summaryrefslogtreecommitdiff
path: root/Game/States/Default
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-10-09 17:20:55 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-10-09 17:20:55 +0200
commit1aac583cee47d232ef22d8c5df97b888f689ab96 (patch)
tree7ef0796e4f01272fc68d199e1b0dc1812aaad1e0 /Game/States/Default
parentb96e384d8299473b14edcbf885fa914a9308d18f (diff)
intermediate commit
Diffstat (limited to 'Game/States/Default')
-rw-r--r--Game/States/Default/StateDefault.gd10
1 files changed, 6 insertions, 4 deletions
diff --git a/Game/States/Default/StateDefault.gd b/Game/States/Default/StateDefault.gd
index 1d2dd9f..b7b630c 100644
--- a/Game/States/Default/StateDefault.gd
+++ b/Game/States/Default/StateDefault.gd
@@ -6,6 +6,12 @@ func _state_input(event: InputEvent) -> void:
if event.is_action_pressed("build_mode_start"):
set_state("StateBuild")
+ if event.is_action_pressed("select"):
+ if Unit.selected_unit:
+ Unit.selected_unit.is_selected = false
+
+
+func _state_unhandled_input(event: InputEvent) -> void:
# deselect
if event.is_action_pressed("select"):
# if not multi selecting
@@ -13,7 +19,3 @@ func _state_input(event: InputEvent) -> void:
if Tower.selected_towers:
for tower in Tower.selected_towers.duplicate():
tower.is_selected = false
-
- if event.is_action_pressed("select"):
- if Unit.selected_unit:
- Unit.selected_unit.is_selected = false