blob: 014eb40caa428c1980b282408782a0f420637e29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
class_name StateDefault
extends State
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
if not event.is_double_click() and not Input.is_action_pressed("select_multiple"):
for tower: Tower in Client.selection.get_nodes().duplicate():
tower.is_selected = false
|