online multiplayer chess game (note server currently down)
Diffstat (limited to 'ui/Status.gd')
-rw-r--r--ui/Status.gd6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/Status.gd b/ui/Status.gd
index 1cf2eb7..dd3debf 100644
--- a/ui/Status.gd
+++ b/ui/Status.gd
@@ -4,11 +4,15 @@ class_name StatusLabel
func set_text(newtext: String, time := 7) -> void:
__set_text(newtext)
- if time != 0:
+ if time != 0 && newtext != "":
yield(get_tree().create_timer(time), "timeout")
__set_text("")
+func clear_text():
+ __set_text("")
+
+
func __set_text(_text: String = ""):
text = _text
visible = text != ""