Bit more cleanup
This commit is contained in:
@@ -1,25 +1,5 @@
|
||||
class_name UISystem extends Control
|
||||
|
||||
enum Layer {
|
||||
Game,
|
||||
VN,
|
||||
Test,
|
||||
Debug
|
||||
}
|
||||
|
||||
func addSubscene(subscene:Control, layer:Layer) -> void:
|
||||
subscene.originalParent.remove_child.call_deferred(subscene)
|
||||
|
||||
match layer:
|
||||
Layer.Game:
|
||||
$LayerGame.add_child.call_deferred(subscene)
|
||||
Layer.Debug:
|
||||
$LayerDebug.add_child.call_deferred(subscene)
|
||||
Layer.VN:
|
||||
$LayerVN.add_child.call_deferred(subscene)
|
||||
_:
|
||||
push_error("Invalid layer: " + str(layer))
|
||||
return
|
||||
|
||||
func removeSubscene(subscene:Control) -> void:
|
||||
subscene.get_parent().remove_child(subscene)
|
||||
func _process(delta: float) -> void:
|
||||
# This needs to always be at the end of the parent node's tree
|
||||
get_parent().move_child(self, get_parent().get_child_count() - 1)
|
||||
|
Reference in New Issue
Block a user