From f75ee64e21f67b4f27404147aedaa63750058d5a Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Mon, 17 Jan 2022 19:41:46 +0100 Subject: wave --- scripts/gui.gd | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'scripts/gui.gd') diff --git a/scripts/gui.gd b/scripts/gui.gd index 71eaf76..3ad47aa 100644 --- a/scripts/gui.gd +++ b/scripts/gui.gd @@ -2,22 +2,30 @@ extends Control var player : Node var control : Node +var wave : Node var bottom_bar : Control var top_bar : Control +var _wave_ongoing : Panel func _fetch (): var root = get_tree().root.get_node("world") player = root.get_node("player") control = player.get_node("control") + wave = root.get_node("wave") if bottom_bar == null: bottom_bar = get_node("bottom_bar") if top_bar == null: top_bar = get_node("top_bar") + if _wave_ongoing == null: _wave_ongoing = $wave_ongoing_indicator func _ready(): _fetch() -func refresh (in_editor : bool): +func refresh (): _fetch() - bottom_bar.refresh(in_editor) - top_bar.refresh(in_editor) + + bottom_bar.refresh(control.ineditor) + top_bar.refresh(control.ineditor) + + if wave.ongoing: _wave_ongoing.visible = true + else: _wave_ongoing.visible = false -- cgit v1.2.3-54-g00ecf