Skip to reading
Replace the Built-in Screens

Create the selected-slot command wrappers

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Record ID: save_selected. Global Script: off. Put it on save_custom’s Save selected Button.

Code example
extends "res://scripts/runtime/script_base.gd"
Code example
func run(_context: Dictionary = {}) -> Variant:
    await CallScript("menu_tools", "slot_command", ["save_custom", "save_custom_slots", "save-slot"])
    return true

Record ID: load_selected. Global Script: off. Put it on load_custom’s Load selected Button.

Code example
extends "res://scripts/runtime/script_base.gd"
Code example
func run(_context: Dictionary = {}) -> Variant:
    await CallScript("menu_tools", "slot_command", ["load_custom", "load_custom_slots", "load-slot"])
    return true

The guard reads the widget’s live selected_slot, not a guessed row number and not a label caption. Give the player a visible selected border before allowing Save or Load.

The project must contain both named GUIs and both named widgets. Validate can catch some broken references; a Play test still has to confirm the correct selected position is used.

Page 77 of 88Permalink
Go to page