1
0
Fork 0
This repository has been archived on 2025-09-12. You can view files and clone it, but cannot push or open issues or pull requests.
honest-jam-2/game/construction/ConstructionUi.gd

21 lines
481 B
GDScript

extends Control
onready var panel: PopupPanel = $PopupPanel
onready var game: Node = find_parent("Game")
func _ready() -> void:
$PanelToggleButton.connect("pressed", self, "toggle_panel")
func _input(event: InputEvent) -> void:
if event.is_action_pressed("build_menu"):
toggle_panel()
func toggle_panel() -> void:
if !panel.visible:
panel.show()
else:
panel.hide()
if game.selected_building:
game.selected_building.queue_free()
game.selected_building = null