Options controller - part 2 of 4
func open(from_surface: String = "pauseMenu") -> void:
return_surface = from_surface
Runtime.call("show_system_interface", "optionsMenu")
fill(Runtime.call("get_runtime_options"))
was_open = true
await SetVariable({"name":"options_notice",
"value":"Change settings, then choose Apply."})func fill(options: Dictionary) -> void:
for key: String in NUMBERS:
var slider: Range = control(str(NUMBERS[key][0])) as Range
if is_instance_valid(slider):
slider.set_value_no_signal(float(options.get(key, 1.0)))
for key: String in CHECKS:
var check: BaseButton = control(str(CHECKS[key])) as BaseButton
if is_instance_valid(check):
check.set_pressed_no_signal(bool(options.get(key, false)))
select_language("opt_language", str(options.get("language", "en")))
var voice: String = str(options.get("voiceLanguage", ""))
select_language("opt_voice_language", "auto" if voice.is_empty() else voice)
var autosave: BaseButton = control("opt_autosave") as BaseButton
if is_instance_valid(autosave):
autosave.disabled = not bool(Runtime.call("can_player_toggle_game_autosave"))open records the parent menu. fill uses the applied runtime values, sets controls without emitting an artificial user change, and respects the project’s autosave-toggle permission.
Continue with the next part in the same options_tools record. Do not add another extends line.
