TowerDefense/game_menu.gd

31 lines
626 B
GDScript3
Raw Normal View History

2025-08-25 23:23:03 +02:00
extends Control
var selected_tower
func _ready() -> void:
EventBus.tower_selected.connect(_on_EventBus_tower_selected)
EventBus.open_shop.connect(open_shop)
EventBus.close_shop.connect(close_shop)
2025-08-25 23:23:03 +02:00
func open_shop():
if visible:
close_shop()
return
2025-08-25 23:23:03 +02:00
visible = true
func close_shop():
visible = false
2025-08-25 23:42:09 +02:00
func _on_EventBus_tower_selected(tower : PackedScene):
selected_tower = tower
2025-08-25 23:42:09 +02:00
func _on_button_return_desktop_pressed() -> void:
get_tree().quit()
func _on_button_back_to_start_screen_pressed() -> void:
Transition.goto("res://UI/start_menu.tscn")
func _on_button_continue_pressed() -> void:
visible = false