summaryrefslogtreecommitdiffstats
path: root/Main.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-10 14:46:13 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-10 14:46:13 +0200
commite0a6d318be7570152eef053ad0dbc67608a981de (patch)
treef9818a3777ad6e513750eba33365a859e004a6eb /Main.gd
parented517bbfd0e10abd9bc571131188061a7221d103 (diff)
downloadgodot-hexgrid-e0a6d318be7570152eef053ad0dbc67608a981de.zip
godot-hexgrid-e0a6d318be7570152eef053ad0dbc67608a981de.tar.gz
add check boxes
Diffstat (limited to 'Main.gd')
-rw-r--r--Main.gd7
1 files changed, 7 insertions, 0 deletions
diff --git a/Main.gd b/Main.gd
index 36affaa..88af749 100644
--- a/Main.gd
+++ b/Main.gd
@@ -9,11 +9,18 @@ onready var Camera : Camera2D = $ViewportContainer/Viewport/Camera
func _ready():
UI.get_node("rotate").connect("pressed", Map, "on_rotate")
+ UI.get_node("LOS").connect("pressed", self, "on_toggle")
+ UI.get_node("Move").connect("pressed", self, "on_toggle")
Map.connect("configure", Camera, "on_configure")
Map.connect("hex_touched", self, "on_hex_touched")
Camera.window = $ViewportContainer/Viewport.size
+ on_toggle()
Map.on_rotate()
+func on_toggle() -> void:
+ Map.config(UI.get_node("LOS").pressed, UI.get_node("Move").pressed)
+ Map.update()
+
func on_hex_touched(pos : Vector2, hex : Hex, key : int) -> void:
UI.get_node("Info").set_text("\n(%d;%d)\n -> %s\n -> %d" % [int(pos.x), int(pos.y), hex.inspect(), key])