Skip to content

Up axis preference survives a restart - #327

Open
DonnieAlex wants to merge 1 commit into
srlegrand:mainfrom
DonnieAlex:fix/up-axis-preference
Open

DonnieAlex wants to merge 1 commit into
srlegrand:mainfrom
DonnieAlex:fix/up-axis-preference

Conversation

@DonnieAlex

@DonnieAlex DonnieAlex commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

No linked issue: the up axis chosen in Preferences > Settings did not survive a restart.

What was wrong and what happens now

The interface kept a second copy of the optionVars in memory. optionVar and the Preferences window wrote the
session's copy, while the autosave settings wrote the interface copy, whose upAxisDirection was still the value the
session started with. Saving Preferences runs the autosave settings after the up-axis saver, so the stale copy was
written over optionVars.json and the next start read the old axis back.

There is now one optionVars store, the session's. The optionVar command, the Preferences window and the autosave
settings all read and write it, and the core saves it after each command. The redundant interface-side optionVar
command was removed: the scene layer's full one is the command that already runs.

What I checked (steps in the app, tests run, and what I could not check)

  • Reproduced the failure on the installed 2.714 with copies of the real prefs: Preferences > Settings > Y > Save
    reported Y in the session, but optionVars.json was written back to Z during the same Save.
  • After the fix, the same Preferences > Save > close flow leaves optionVars.json at y; a restart reports
    upAxis and optionVar upAxisDirection both y.
  • Added autosave_settings_do_not_put_the_old_up_axis_back to tests/world_settings.rs: it reads the autosave
    settings first, changes the up axis, then saves autosave settings, and checks the file.
  • cargo test -p aztek_host --test autosave --test cmds_u17 --test cmds_u20 --test world_settings passes.
  • The autosave test now calls use_prefs() before creating its second session, as the application's startup does;
    the previous path relied on the removed interface copy.
  • Built on Linux with ./build.sh and ran the flow above on the built AppRun.
  • Not checked on macOS or Windows.

How it was made (by hand, or with an LLM; built and run, or not)

Made with an LLM, built and run on Linux.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant