Prepping for other scenes.

This commit is contained in:
2026-01-08 23:12:02 -06:00
parent cd2dd3fe0e
commit ba61ab90a5
25 changed files with 159 additions and 10 deletions

45
ui/debugmenu/DebugMenu.gd Normal file
View File

@@ -0,0 +1,45 @@
class_name DebugMenu extends Control
@export var btnInitial: Button = null
@export var btnOverworld: Button = null
@export var btnBattle: Button = null
@export var btnCooking: Button = null
var isClosed:bool = false:
get():
return !self.visible;
set(value):
self.visible = !value;
func _enter_tree() -> void:
if btnInitial:
btnInitial.pressed.connect(onInitialPressed)
if btnOverworld:
btnOverworld.pressed.connect(onOverworldPressed)
if btnBattle:
btnBattle.pressed.connect(onBattlePressed)
if btnCooking:
btnCooking.pressed.connect(onCookingPressed)
isClosed = false
func _exit_tree() -> void:
if btnInitial:
btnInitial.pressed.disconnect(onInitialPressed)
if btnOverworld:
btnOverworld.pressed.disconnect(onOverworldPressed)
if btnBattle:
btnBattle.pressed.disconnect(onBattlePressed)
if btnCooking:
btnCooking.pressed.disconnect(onCookingPressed)
func onInitialPressed() -> void:
SCENE.setScene(SCENE.SceneType.INITIAL)
func onOverworldPressed() -> void:
SCENE.setScene(SCENE.SceneType.OVERWORLD)
func onBattlePressed() -> void:
SCENE.setScene(SCENE.SceneType.BATTLE)
func onCookingPressed() -> void:
SCENE.setScene(SCENE.SceneType.COOKING)

View File

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

View File

@@ -0,0 +1,38 @@
[gd_scene load_steps=2 format=3 uid="uid://b38dr0wkix76t"]
[ext_resource type="Script" uid="uid://bekdew700opvq" path="res://ui/debugmenu/DebugMenu.gd" id="1_c1p3i"]
[node name="DebugMenu" type="Control" node_paths=PackedStringArray("btnInitial", "btnOverworld", "btnBattle", "btnCooking")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_c1p3i")
btnInitial = NodePath("HBoxContainer/InitialScene")
btnOverworld = NodePath("HBoxContainer/OverworldScene")
btnBattle = NodePath("HBoxContainer/BattleScene")
btnCooking = NodePath("HBoxContainer/CookingScene")
metadata/_custom_type_script = "uid://bekdew700opvq"
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="OverworldScene" type="Button" parent="HBoxContainer"]
layout_mode = 2
text = "Overworld scene"
[node name="BattleScene" type="Button" parent="HBoxContainer"]
layout_mode = 2
text = "Battle scene"
[node name="CookingScene" type="Button" parent="HBoxContainer"]
layout_mode = 2
text = "Cooking Scene"
[node name="InitialScene" type="Button" parent="HBoxContainer"]
layout_mode = 2
text = "Initial scene"