2023-09-23 16:24:55 +00:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
func _ready():
|
2023-12-31 07:58:20 +00:00
|
|
|
var children = findElements(self, "Control")
|
2024-01-11 07:20:52 +00:00
|
|
|
for n: Control in children: #iterate the children to grab focus on mouse hov
|
2024-01-11 07:34:38 +00:00
|
|
|
if (n.focus_mode == FOCUS_ALL):
|
2024-01-11 07:20:52 +00:00
|
|
|
n.mouse_entered.connect(_on_control_mouse_entered.bind(n))
|
2024-02-13 12:45:30 +00:00
|
|
|
combine_tkeys()
|
|
|
|
|
2024-02-11 08:12:01 +00:00
|
|
|
|
2023-12-21 10:29:46 +00:00
|
|
|
func _input(event):
|
|
|
|
if event.is_action_pressed("quit"):
|
2024-01-12 07:37:05 +00:00
|
|
|
_exit()
|
2023-12-31 07:58:20 +00:00
|
|
|
|
|
|
|
func findElements(node: Node, className: String, result: Array = []) -> Array:
|
|
|
|
if node.is_class(className):
|
|
|
|
result.push_back(node)
|
|
|
|
for child in node.get_children():
|
|
|
|
result = findElements(child, className, result)
|
|
|
|
return result
|
|
|
|
|
|
|
|
func _on_control_mouse_entered(control: Node):
|
|
|
|
control.grab_focus()
|
2024-01-11 18:19:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_quickresume_advanced_pressed():
|
|
|
|
var popup = load("res://components/popup.tscn").instantiate() as Control
|
|
|
|
popup.set_content("res://popup_content_test.tscn")
|
|
|
|
$Background.add_child(popup)
|
2024-01-12 07:37:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_exit_button_pressed():
|
|
|
|
_exit()
|
|
|
|
|
|
|
|
func _exit():
|
|
|
|
get_tree().root.propagate_notification(NOTIFICATION_WM_CLOSE_REQUEST)
|
|
|
|
get_tree().quit()
|
2024-01-24 17:00:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_locale_selected(index):
|
|
|
|
match index:
|
|
|
|
0:
|
|
|
|
TranslationServer.set_locale("en")
|
|
|
|
1:
|
|
|
|
TranslationServer.set_locale("it")
|
2024-02-11 08:12:01 +00:00
|
|
|
2:
|
|
|
|
TranslationServer.set_locale("de")
|
2024-02-13 12:45:30 +00:00
|
|
|
3:
|
2024-02-16 07:17:39 +00:00
|
|
|
TranslationServer.set_locale("sv")
|
2024-02-18 08:32:34 +00:00
|
|
|
4:
|
|
|
|
TranslationServer.set_locale("ua")
|
|
|
|
5:
|
|
|
|
TranslationServer.set_locale("ja")
|
|
|
|
6:
|
|
|
|
TranslationServer.set_locale("zh")
|
2024-02-13 12:45:30 +00:00
|
|
|
combine_tkeys()
|
2024-01-24 17:00:26 +00:00
|
|
|
|
2024-02-13 12:45:30 +00:00
|
|
|
func combine_tkeys(): #More as a test
|
|
|
|
$Background/MarginContainer/TabContainer/TK_SYSTEM/ScrollContainer/VBoxContainer/game_control_container/GridContainer/cheats.text = tr("TK_CHEATS") + " " + tr("TK_SOON")
|
|
|
|
$Background/MarginContainer/TabContainer/TK_GRAPHICS/ScrollContainer/VBoxContainer/decorations_container/GridContainer/shaders.text = tr("TK_SHADERS") + " " + tr("TK_SOON")
|
|
|
|
$Background/MarginContainer/TabContainer/TK_GRAPHICS/ScrollContainer/VBoxContainer/extra_container/GridContainer/tate_mode.text = tr("TK_TATE") + " " + tr("TK_SOON")
|
|
|
|
$Background/MarginContainer/TabContainer/TK_CONTROLS/ScrollContainer/VBoxContainer/controls_container/hotkey_sound.text = tr("TK_HOTKEYSOUND") + " " + tr("TK_SOON")
|
|
|
|
$Background/MarginContainer/TabContainer/TK_NETWORK/ScrollContainer/VBoxContainer/cheevos_container/cheevos_advanced_container/cheevos_hardcore.text = tr("TK_CHEEVOSHARDCORE") + " " + tr("TK_SOON")
|
|
|
|
$Background/MarginContainer/TabContainer/TK_NETWORK/ScrollContainer/VBoxContainer/data_mng_container/saves_sync.text = tr("TK_SAVESSYNC") + " " + tr("TK_SOON")
|
|
|
|
$Background/MarginContainer/TabContainer/TK_CONFIGURATOR/ScrollContainer/VBoxContainer/system_container/easter_eggs.text = tr("TK_EASTEREGGS") + " " + tr("TK_SOON")
|