Randoloot/scripts/ui/planet_services_menu.gd
2026-10-10 21:21:58 +02:00

26 lines
742 B
GDScript

extends Control
signal next_level_requested
signal closed
@onready var next_button: Button = $Center/Panel/Contents/NextButton
@onready var close_button: Button = $Center/Panel/Contents/CloseButton
func _ready() -> void:
next_button.pressed.connect(func() -> void: next_level_requested.emit())
close_button.pressed.connect(_close)
func show_services(at_level_cap: bool) -> void:
next_button.disabled = at_level_cap
next_button.text = "OSIĄGNIĘTO OSTATNI UKŁAD" if at_level_cap else "PRZEJDŹ DO NASTĘPNEGO UKŁADU"
show()
func _close() -> void:
hide()
closed.emit()
func _unhandled_key_input(event: InputEvent) -> void:
if visible and event.is_action_pressed("ui_cancel"):
_close()
get_viewport().set_input_as_handled()