diff options
author | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-16 17:14:36 +0100 |
---|---|---|
committer | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-16 17:14:36 +0100 |
commit | 5781b7dad68c3e01d83365f73b0d35d9e5252f97 (patch) | |
tree | dada65ab375ed8287b33e6ffe023f5df5e666d24 /scripts/gui_top_bar.gd | |
parent | 8e5358aaefa1df729ffc02047e53b62705d6b3b1 (diff) |
control system
Diffstat (limited to 'scripts/gui_top_bar.gd')
-rw-r--r-- | scripts/gui_top_bar.gd | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scripts/gui_top_bar.gd b/scripts/gui_top_bar.gd index a002e87..6c086ce 100644 --- a/scripts/gui_top_bar.gd +++ b/scripts/gui_top_bar.gd @@ -1,6 +1,5 @@ extends Control -var _in_editor : bool var _editor_button : Button var _hbox : HBoxContainer @@ -8,16 +7,14 @@ var _resources : Node var _gui : Control func refresh (in_editor : bool): - _in_editor = in_editor - - var root = get_tree().root.get_child(0) + var root = get_tree().root.get_node("world") _resources = root.get_node("player").get_node("resources") if _gui == null: _gui = get_parent() if _hbox == null: _hbox = $panel/resources/HBoxContainer if _editor_button == null: _editor_button = $panel/editor_button - if _in_editor: _editor_button.text = "Editor" + if in_editor: _editor_button.text = "Editor" else: _editor_button.text = "Playmode" func _process (_delta): @@ -25,7 +22,7 @@ func _process (_delta): _hbox.get_node(r).text = str(_resources[r]) + r func _on_editor_button_down(): - _gui.player.gui_editor_toggle_event() + _gui.control.gui_editor_toggle_event() func _on_wave_button_pressed(): - _gui.player.gui_start_wave_event() + _gui.control.gui_start_wave_event() |