Read live slot information after an operation
A separate Read details button in the workshop runs this GDScript record. It reads the widget’s actual selected slot, then checks the current saved file information:
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
var slot_number: int = int(GetGUIElementProperty(
"save_lab", "save_slots", "selected_slot", -1))
if slot_number < 0:
return false
var info: Dictionary = Runtime.call(
"get_save_slot_info", slot_number)
var exists: bool = bool(info.get("exists", false))
await SetVariable({
"name": "selected_save_status",
"value": "saved" if exists else "empty"
})
var caption: String = "This slot is empty."
if exists:
caption = "Saved: " + str(info.get("name", ""))
await SetVariable({
"name": "save_feedback", "value": caption
})
return existsAssign this record to a Button and show $$save_feedback in a Label. This version deliberately distinguishes file existence from the earlier selection status. Add an autosave-specific caption if your menu needs one.
selected_slot is a readable widget property in this build. The fallback -1 means there is no selected slot. A command can still apply its first-slot fallback, so use your own guard when selection must be mandatory.
