2024-07-09 22:33:38 +02:00
|
|
|
extends Control
|
|
|
|
|
2024-07-20 11:20:18 +02:00
|
|
|
@onready var tool_slots = %ToolSlots
|
|
|
|
@onready var game_menu_ui = %GameMenuUI
|
|
|
|
|
2024-07-09 22:33:38 +02:00
|
|
|
|
|
|
|
func _on_message_timer_timeout():
|
|
|
|
%MessagesContainer.visible = false
|
|
|
|
|
|
|
|
|
|
|
|
func _on_player_trigger_message(message):
|
|
|
|
%MessagesContainer/MessageTextEdit.text = message
|
|
|
|
%MessagesContainer/MessageTimer.start(1)
|
|
|
|
%MessagesContainer.visible = true
|
|
|
|
|
2024-07-20 11:20:18 +02:00
|
|
|
|
|
|
|
func _unhandled_key_input(event:InputEvent):
|
|
|
|
var key_event:InputEventKey = event as InputEventKey
|
|
|
|
|
|
|
|
if key_event and key_event.pressed and key_event.get_keycode_with_modifiers() == KEY_ESCAPE:
|
|
|
|
if %GameMenuUI.visible:
|
|
|
|
%GameMenuUI.hide()
|
|
|
|
else:
|
|
|
|
%GameMenuUI.show()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_game_menu_ui_visibility_changed():
|
|
|
|
# Function gets triggered when scene is still in construction. In that
|
|
|
|
# case just return.
|
|
|
|
if tool_slots == null:
|
|
|
|
return
|
|
|
|
|
|
|
|
if %GameMenuUI.visible:
|
|
|
|
tool_slots.hide()
|
2024-08-02 00:06:50 +02:00
|
|
|
%GameScene.process_mode = Node.PROCESS_MODE_DISABLED
|
2024-07-20 11:20:18 +02:00
|
|
|
else:
|
|
|
|
tool_slots.show()
|
2024-08-02 00:06:50 +02:00
|
|
|
%GameScene.process_mode = Node.PROCESS_MODE_INHERIT
|
2024-07-20 11:20:18 +02:00
|
|
|
|