Prepping for other scenes.
This commit is contained in:
45
ui/debugmenu/DebugMenu.gd
Normal file
45
ui/debugmenu/DebugMenu.gd
Normal 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)
|
||||
1
ui/debugmenu/DebugMenu.gd.uid
Normal file
1
ui/debugmenu/DebugMenu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bekdew700opvq
|
||||
38
ui/debugmenu/DebugMenu.tscn
Normal file
38
ui/debugmenu/DebugMenu.tscn
Normal 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"
|
||||
Reference in New Issue
Block a user