Conversation
Save the currently selected variant for each (ref prim, ref vert) mod group to Local %APPDATA%\ModelMod\<gamename>.prefs.yaml so selections survive game restarts. The YAML format is versioned and extensible for future prefs. Loading is best-effort: out-of-range indices are reset to zero, missing entries stay at the default (0). Save happens after each cycle via Ctrl+Numpad8/9; load happens inline in setup_mod_data. serde's proc macros add noticeable overhead to incremental rebuilds, so keep them out of mod_load (a central crate touched often during development). The serde-dependent types and IO now live in the new mod_prefs crate; mod_load and hook_core call into it. Also add mod_prefs to the VS Code workspace. New tests cover: - `ModPrefs::new`/`Default` produce current version and empty variants - YAML round-trip preserves all `VariantPref` fields - Missing `version`/`variants` deserialize to defaults (forward-compat) - `apply_variants` applies in-range indices, skips out-of-range and unknown ref-geometry entries, and reports the correct applied/total counts for mixed inputs - `build_prefs` omits zero (default) indices, records ref counts from the first entry in each mod vector, sorts deterministically, and skips selections whose ref geometry has no loaded mods - End-to-end build -> YAML -> apply round-trip lands on the same state
71de632 to
e847133
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.