online multiplayer chess game (note server currently down)
Diffstat (limited to 'ui/checkboxbutton/CheckBoxButton.gd')
-rw-r--r--ui/checkboxbutton/CheckBoxButton.gd16
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/checkboxbutton/CheckBoxButton.gd b/ui/checkboxbutton/CheckBoxButton.gd
new file mode 100644
index 0000000..178fcca
--- /dev/null
+++ b/ui/checkboxbutton/CheckBoxButton.gd
@@ -0,0 +1,16 @@
+extends Button
+class_name CheckBoxButton
+
+onready var tx := text
+
+export(String) var off_icon = ""
+export(String) var on_icon = ""
+
+
+func _toggled(p: bool):
+ text = (on_icon if p else off_icon) + tx
+
+
+func _ready():
+ assert(toggle_mode)
+ _toggled(pressed)