MemR/game/Main.gd

42 lines
1.2 KiB
GDScript3
Raw Normal View History

2022-12-10 11:49:21 +01:00
extends Control
var _menu : Control
var _settings : Control
var _sort : Control
2022-12-10 13:20:14 +01:00
var _folder_setup_error_popup : AcceptDialog
2022-12-10 11:49:21 +01:00
func hide_all() -> void:
_menu.hide()
_settings.hide()
_sort.hide()
2022-12-11 11:46:31 +01:00
func apply_shink() -> void:
if !ProjectSettings.get("display/window/stretch/shrink_override"):
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_DISABLED, SceneTree.STRETCH_ASPECT_IGNORE, Vector2(900, 1000), clamp(OS.get_screen_dpi() / 72.0, 1, 3))
else:
var shrink_override_value : float = ProjectSettings.get("display/window/stretch/shrink_override_value")
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_DISABLED, SceneTree.STRETCH_ASPECT_IGNORE, Vector2(900, 1000), shrink_override_value)
2022-12-10 11:49:21 +01:00
func _on_Sort_pressed() -> void:
2022-12-10 13:20:14 +01:00
if !_sort.validate_folders():
_folder_setup_error_popup.popup_centered()
return
2022-12-10 11:49:21 +01:00
hide_all()
_sort.show()
func _on_Settings_pressed() -> void:
hide_all()
_settings.show()
func _notification(what: int) -> void:
if what == NOTIFICATION_READY:
_menu = get_node("Menu")
_settings = get_node("Settings")
_sort = get_node("Sort")
2022-12-10 13:20:14 +01:00
_folder_setup_error_popup = get_node("Control/FolderSetupError")
2022-12-10 11:49:21 +01:00
func _on_Settings_back() -> void:
hide_all()
_menu.show()