Fixed UI system
This commit is contained in:
@@ -3,7 +3,7 @@ extends Node
|
||||
var debugMenu:DebugMenu
|
||||
|
||||
func _ready() -> void:
|
||||
debugMenu = $UI/DebugMenu;
|
||||
debugMenu = $SubsceneUI/DebugMenu;
|
||||
debugMenu.hide()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
@@ -16,8 +16,7 @@ func _process(delta: float) -> void:
|
||||
|
||||
func showMenu() -> void:
|
||||
debugMenu.show()
|
||||
self.get_parent().move_child(self, self.get_parent().get_child_count() - 1)
|
||||
print("Debug menu shown")
|
||||
|
||||
func hideMenu() -> void:
|
||||
debugMenu.hide()
|
||||
self.get_parent().move_child(self, 0)
|
||||
|
@@ -1,7 +1 @@
|
||||
class_name QuestSystem extends Node
|
||||
|
||||
static var QUEST_EXAMPLE = preload("res://scripts/Quest/QuestExample.gd").new();
|
||||
|
||||
static var ALL_QUESTS = [
|
||||
QUEST_EXAMPLE
|
||||
]
|
||||
class_name QuestSystem extends Node
|
@@ -1,4 +1,4 @@
|
||||
extends Node
|
||||
class_name SceneManager extends Node
|
||||
|
||||
const MainMenu = preload("res://scenes/MainMenu.tscn");
|
||||
const OverworldScene = preload("res://scenes/Overworld.tscn");
|
||||
|
25
scripts/Singletons/UI.gd
Normal file
25
scripts/Singletons/UI.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
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)
|
1
scripts/Singletons/UI.gd.uid
Normal file
1
scripts/Singletons/UI.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dahhuhiu8u88b
|
@@ -1,5 +1,10 @@
|
||||
class_name VNSystem extends Node
|
||||
const VNTextbox = preload("res://scripts/UI/VNTextbox.gd")
|
||||
|
||||
var vnTextbox:VNTextbox = null
|
||||
|
||||
func _ready() -> void:
|
||||
vnTextbox = $SubsceneUI/VNTextbox
|
||||
|
||||
func getTextbox() -> VNTextbox:
|
||||
return $UI/VNTextbox;
|
||||
return vnTextbox
|
||||
|
Reference in New Issue
Block a user