MemR/game/Main.gd

37 lines
865 B
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()
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:
2022-12-11 11:32:40 +01:00
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))
2022-12-10 11:49:21 +01:00
_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()