Menu controller - part 1 of 2
Record ID: menu_tools. Global Script: on. Paste Part 2 after Part 1 in the same record. No event subscriptions are needed for this controller.
extends "res://scripts/runtime/script_base.gd"var return_surface: String = "pauseMenu"
var was_main: bool = falsefunc on_global_ready(_context: Dictionary = {}) -> void:
set_process(true)func _process(_delta: float) -> void:
var manager: Node = Runtime.get("authored_gui_manager")
if not is_instance_valid(manager):
return
var main_open: bool = bool(manager.call("is_gui_visible", "main_custom"))
if main_open and not was_main:
var nodes: Dictionary = manager.get("element_nodes")
var button: BaseButton = nodes.get("main_custom_button_1") as BaseButton
if is_instance_valid(button):
button.disabled = int(Runtime.call("latest_save_slot")) < 0
was_main = main_openThe controller checks Continue when main_custom becomes visible. It scans saved positions once at that opening, rather than repeatedly checking the disk every frame.
main_custom_button_1 is the Continue Button in this layout. If you give it a clearer ID in your project, change that one lookup too.
