aboutsummaryrefslogtreecommitdiff
path: root/scripts/gui.gd
diff options
context:
space:
mode:
authorjacopograndi <jacopo.grandi@outlook.it>2021-12-24 21:10:33 +0100
committerjacopograndi <jacopo.grandi@outlook.it>2021-12-24 21:10:33 +0100
commite9598b88841374301646a7115253ab38ac904e4c (patch)
tree0ddc46c3ebd34762408cb108a3dbfb98d669af85 /scripts/gui.gd
parent156420f2a4635a84390e8ff488d12b8f84fea94f (diff)
working
Diffstat (limited to 'scripts/gui.gd')
-rw-r--r--scripts/gui.gd27
1 files changed, 19 insertions, 8 deletions
diff --git a/scripts/gui.gd b/scripts/gui.gd
index bae4ffc..03a2e04 100644
--- a/scripts/gui.gd
+++ b/scripts/gui.gd
@@ -1,12 +1,23 @@
-extends Panel
+extends Control
-var _player
-var _label
+var player : Node
+var _in_editor : bool
-func _ready():
- _player = self.get_parent().get_parent().find_node("player")
- _label = self.find_node("Label")
+var bottom_bar : Control
+var top_bar : Control
+
+func _fetch ():
+ var root = get_tree().root.get_child(0)
+ player = root.get_node("player")
+
+ if bottom_bar == null: bottom_bar = get_node("bottom_bar")
+ if top_bar == null: top_bar = get_node("top_bar")
-func _process(delta):
- _label.text = str(_player.sel_map[_player.sel])
+func _ready():
+ _fetch()
+ bottom_bar.build()
+func refresh (in_editor : bool):
+ _fetch()
+ bottom_bar.refresh(in_editor)
+ top_bar.refresh(in_editor)