Repository navigation
No Man's Sky: built-in handler that manages GCMODSETTINGS.MXML - #619
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhVuRBjYHgoPvYK63yz1N7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhVuRBjYHgoPvYK63yz1N7
Mirrors the Baldur's Gate 3 modsettings.lsx backup/state/restore helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhVuRBjYHgoPvYK63yz1N7
Replaces the Resources-branch custom handler definition (same name and game_id, so profiles carry over) and writes the game's mod registry on deploy in modlist order, restoring the user's original on restore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhVuRBjYHgoPvYK63yz1N7
…ot_Folder - VFS deploys now write the file into the private view via _vfs_post_view_build (as Cyberpunk does for its archive modlist); the real game folder is no longer modified and the game sees the result. - A GCMODSETTINGS.MXML shipped in Root_Folder wins and raises a deploy warning instead of silently replacing the generated file. - The built-in handler no longer reports is_custom, so the custom-game edit / force-update actions don't target the shadowed JSON. - Self-tests for the deploy/restore wiring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhVuRBjYHgoPvYK63yz1N7
- icons/games/No_Man_s_Sky.png: the definition's image_url banner, resized to the bundled 256x256 convention. - An unreadable original GCMODSETTINGS.MXML now raises a deploy warning (same message as the log line) since hand-installed entries are lost. - Add the game folder's __init__.py like every other handler folder. - Note that the backup/restore helpers mirror the BG3 handler's. - unmanaged_folders is annotated Iterable[str]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhVuRBjYHgoPvYK63yz1N7
NMS has no in-game switch for GCMODSETTINGS' DisableAllMods, so expose it as a handler LaunchToggle (play bar > Launch settings), like Morrowind's skip-launcher toggle. The generated file - physical or VFS view - follows the toggle; restore still puts the user's original back exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhVuRBjYHgoPvYK63yz1N7
Amethyst's Priority column rises toward the winner (higher wins, as in MO2) while NMS gives ModPriority 0 precedence. The handler maps winner to winner, so the numbers read mirrored; say so in the code and make the deploy log line state which end wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhVuRBjYHgoPvYK63yz1N7
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.
Summary
Adds a built-in No Man's Sky handler that manages the game's own mod registry,
Binaries/SETTINGS/GCMODSETTINGS.MXML. NMS decides each mod's priority and on/off state from that file. The current Resources-branch custom handler links the mod folders but never touches the file, so NMS priority doesn't follow the mod list.The handler keeps the same
nameandgame_id(No_Man_s_Sky) as that custom handler. Discovery gives built-in handlers priority, so existing profiles carry over unchanged. It subclassesStandardCustomGamewith the old definition built in, so deployment is identical and only the MXML handling is new.What it does
ModPriorityprecedence, so Amethyst's highest-priority mod (the one its conflict view shows winning) getsModPriority 0.[Overwrite]outranks everything.GAMEDATA/MODSthat Amethyst didn't deploy keep their entries after Amethyst's, in their original order and on/off state.modsettings.lsxhandling: SHA-256 integrity checks, and a recovery copy if the game changed the file at runtime._vfs_post_view_build, as Cyberpunk does for its archivemodlist.txt. The real game folder is not modified.GCMODSETTINGS.MXMLin Root_Folder (for example, one captured as a runtime file under the old handler) wins, and raises a deploy warning.DisableAllMods, which NMS has no in-game switch for. It's applied on the next deploy.</Data>.icons/games/No_Man_s_Sky.png, from the definition'simage_url); the handler reportsis_custom = False, so the "Edit custom game" and "Force update handler" actions don't target the shadowed JSON; and translation markers for the toggle.Files
src/Utils/nms/gcmodsettings.py: parse, build, order and write, with no dependency on Qt or game objects.src/Games/No Man's Sky/no_mans_sky.py: the handler.src/Utils/nms/_selftest.py: a runnable self-test, following theUtils/vfs/_selftest.pyconvention.Testing
python3 src/Utils/nms/_selftest.pypasses (39 checks). It covers:MODS/, preserved entries, escaping;discover_games()loadsNoMansSkywith no load failures.main:Notes / follow-ups
Custom Handlers/No_Man_s_Sky.jsonon the Resources branch can be removed. Until then the built-in handler shadows it.modsettings.lsxhelpers, and a comment in the handler says so. If a third handler needs the same exact-restore behaviour, they could move into a shared helper. I kept BG3 untouched in this PR.🤖 Generated with Claude Code