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)
|
||||
Reference in New Issue
Block a user