wip(0.S2): migrate - a var nothing writes becomes a let; a state is keyed by its module, directory or program, so every program's plan agrees; paths normalized; program states named SceneDemoState / scene_demo_st; the LSP reads state, mut and entry/handler parameters

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 15:31:34 +03:00
parent 3eda72e8c2
commit 5ffe50ed02
463 changed files with 72045 additions and 67421 deletions

View file

@ -1,35 +1,35 @@
# ludic.settings/rules.ludic - the whole store at once: every setting to its default, every one
# held to its range, and the rescue set. None of these is news: whoever calls them applies it all
export function settings_reset_all(settings_st: mut SettingsState) -> void {
sg_init(settings_st)
for i in 0 .. len(settings_st.sg_defs) {
settings_st.sg_num[i] = settings_st.sg_defs[i].num
settings_st.sg_text[i] = settings_st.sg_defs[i].text
export function settings_reset_all() -> void {
sg_init()
for i in 0 .. len(sg_defs) {
sg_num[i] = sg_defs[i].num
sg_text[i] = sg_defs[i].text
}
}
# a hand-edited file, or one from a build with more choices, never hands the game a value it has
# no case for
export function settings_clamp_all(settings_st: mut SettingsState) -> void {
sg_init(settings_st)
for i in 0 .. len(settings_st.sg_defs) { settings_st.sg_num[i] = settings_held(settings_st, i, settings_st.sg_num[i]) }
export function settings_clamp_all() -> void {
sg_init()
for i in 0 .. len(sg_defs) { sg_num[i] = settings_held(i, sg_num[i]) }
}
# the values every machine can run: each setting marked `rescue` back to its default, and the
# rest (keys, language, volume) left the player's
export function settings_rescue(settings_st: mut SettingsState) -> void {
sg_init(settings_st)
for i in 0 .. len(settings_st.sg_defs) {
if settings_st.sg_defs[i].rescue {
settings_st.sg_num[i] = settings_st.sg_defs[i].num
settings_st.sg_text[i] = settings_st.sg_defs[i].text
export function settings_rescue() -> void {
sg_init()
for i in 0 .. len(sg_defs) {
if sg_defs[i].rescue {
sg_num[i] = sg_defs[i].num
sg_text[i] = sg_defs[i].text
}
}
}
# whether a setting is on the rescue list at its safe value
export function settings_is_safe(settings_st: SettingsState, id: int) -> bool {
let d = settings_st.sg_defs[id]
export function settings_is_safe(id: int) -> bool {
let d = sg_defs[id]
if not d.rescue { return true }
return settings_st.sg_num[id] == d.num and settings_st.sg_text[id] == d.text
return sg_num[id] == d.num and sg_text[id] == d.text
}