feat: edit entries

This commit is contained in:
LunarAkai 2025-06-30 23:50:48 +02:00
commit 3d87fd8fcb
30 changed files with 519 additions and 6 deletions

View file

@ -4,10 +4,11 @@ class_name UIManager extends HBoxContainer
@export var panel_array: Array[MainPanel] = []
@export var container_collection_box: ContainerBox
@export var main_panel_scene: PackedScene
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var text: String = "Container %d" % container_collection_box.container_id
current_active_panel.container_name_label.text = text
current_active_panel.id = 1
panel_array.append(current_active_panel)
SignalBus.on_panel_created.connect(_on_panel_created)
@ -20,11 +21,20 @@ func _process(delta: float) -> void:
func _on_panel_created() -> void:
var new_panel: MainPanel = MainPanel.new()
var new_panel: MainPanel = main_panel_scene.instantiate()
new_panel.id = panel_array.size() + 1
panel_array.append(new_panel)
func _on_panel_requested(index: int) -> void:
if current_active_panel == panel_array[index]:
print("Already active")
return
print("Panel: %d requested" % index)
current_active_panel.hide()
current_active_panel = panel_array[index]
add_child(current_active_panel)
if not current_active_panel.is_inside_tree():
add_child(current_active_panel)
else:
current_active_panel.show()