diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2025-01-11 12:31:00 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2025-01-11 12:31:00 +0100 |
commit | f448ca4259d7f76fc58bc3b5c12ea8d04ab49a87 (patch) | |
tree | 679e0b6186253a9becd8fbe5ade5bbb679ba06a0 /inventory_bar.gd | |
parent | b1d9bfe7e80b4d95acd26d0ab6a1ce34ad18d91c (diff) |
next commit
Diffstat (limited to 'inventory_bar.gd')
-rw-r--r-- | inventory_bar.gd | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/inventory_bar.gd b/inventory_bar.gd new file mode 100644 index 0000000..0077274 --- /dev/null +++ b/inventory_bar.gd @@ -0,0 +1,25 @@ +extends Control + + +var active_type: Block.Type = Block.Type.GRASS + + +func _input(event: InputEvent) -> void: + if event.is_action_pressed("inventory_bar_slot_1"): + _on_texture_rect_pressed() + if event.is_action_pressed("inventory_bar_slot_2"): + _on_texture_rect_2_pressed() + if event.is_action_pressed("inventory_bar_slot_3"): + _on_texture_rect_3_pressed() + + +func _on_texture_rect_pressed() -> void: + active_type = Block.Type.GRASS + + +func _on_texture_rect_2_pressed() -> void: + active_type = Block.Type.STONE + + +func _on_texture_rect_3_pressed() -> void: + active_type = Block.Type.ICE |