Fixed UI system

This commit is contained in:
2025-05-06 16:08:46 -05:00
parent b0d9106772
commit 85a7ed99bf
44 changed files with 158 additions and 87 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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
View 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)

View File

@@ -0,0 +1 @@
uid://dahhuhiu8u88b

View File

@@ -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