WIP: feat(mods): the Mods page and its store, a Home that plays with a Versions tab, profiles that carry the game's settings #268
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!268
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:mods/launcher-pr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Longshot's mod API needs a launcher that can install, switch and trust mods per profile, and players asked for a launcher
that plays first and manages second. This pull request adds the mods side on top of #259's profiles (**Profile > Version
profile.json, the Mods page with its store and repositories, trust per profile,a simpler Home front page with a Save picker, and a cleaner look with a few MagicBean brand accents.
Stacked on #259 (
feat/longshot-build, here atyrosrqpp). Review from the commit after it: 129 commits. The profile basics (the profile folders, the Profiles,Versions and Saves pages, Who's playing? and the migration) moved to #259; this pull request keeps the mods layer over
them. The game side is Longshot #2434 (mods, trust) on
#2286 (
--profile,LONGSHOT_PROFILE).What changed for players
Profiles and mods
profiles/<id>/withprofile.json,mods/,settings.ini,saves/), and Play on a builder's version isLongshot.exe --profile <folder>.profile.json'smods, every per-modkey (
granted,version, unknown ones) kept on rewrite; trust per profile intrust.jsonbeside it (an olderprofile-trust.jsonis renamed once); copying a slot or backing up a save carries its mods data (modstore/).Home and Versions
dropdown, a Save dropdown and the buttons: Build (no version), Build vX again (its game is missing),
Play and Update side by side and the same size (an update exists), or Play. One status line appears only
when needed (the shared-saves warning, a refused save folder, a failed start).
there are none (Play opens the title screen); hidden on a version without
start_slot, with one quiet line instead.Update / Build it again / Set as default / Open folder / Delete; Add a build folder, Check for updates and Build another
version.
Mods
index.jsonand its Ed25519 signature, checkedagainst the key given when adding it; packages are checked by SHA-256 and go through the same install and trust flow.
Ours is the default, listed always and can be turned off. Mods from another repo carry its name and the same warnings.
(pnpm-like), the dependency resolver at Play, Safe start,
launch.jsonforlongshot mod run, the modding docs offlineand a game data reference made from the player's own game.
Look
states, gold for focus, green for Play; Noto Sans Black (OFL, bundled) for each page's one big title. Flat cards, no
glows.
middle with the full path in a tooltip; dropdowns in the launcher's colours; "versions", not "instances".
The builder's mods list
IBuilder.ModsList: make_game.py gets--mods;longshot-buildergets a list the launcher writes(
.longshot-builder-mods/,--user) beside #259's flags, so only the code patches the Mods page shows on are built in.Translations
(mostly the Mods page's) still show in English. Unused texts are dropped.
Testing
python3 -I tests/test_launcher_core.py --strict --longshot <Longshot main>, as CI runs it, on9674064b:dotnet build LongshotLauncher.slnxand the screenshots tool: 0 errors, 0 warnings.check). Upscale ONNX: 25 passed.
translations.pyreports no faults.recipes.
and the TV view) were checked each round.
Checklist
Sans Black (SIL OFL 1.1), with its licence. Lock files updated; a
--locked-moderestore passes.Path, UTF-8 catalogs.docs/mods.md,docs/saves.md,docs/controller.md.yrosrqpp).Why WIP
The three contract checks need the mod API on Longshot main, and the mods and save-slot paths have not yet been played
against a game built from Longshot #2286 and #2434.
🤖 Generated with Claude Code
Twelve catalogs (de, es, fr, it, ja, ko, nl, pl, pt-BR, ru, zh-Hans, zh-Hant) still held four texts the launcher no longer shows ("Details" and three about the old folder layout), which scripts/translations.py refuses. Only those entries are taken out; every other line is as it was. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8oThe game's manifest rules gained "exports" (JavaScript names, not "default", at most 256, a script's only) and "net" ("*" or wss:// and https:// origins, at most 64, a script's only), each origin a net:<origin> permission unless optionalPermissions lists it; and a net: permission over ws:// or http:// is refused. Ported from host/mod_manifest.c, with Longshot's updated manifest and resolver vectors copied from mods/together (475d4d2e). The install confirmation, a version's page and the update offer name the servers a mod will talk to. Co-Authored-By: Claude Opus 5.5 <[email protected]>The game's manifest rules gained an optional "author" and declared "settings" (toggle, choice, slider, number, text, keybind and color, with help, restart, scope global, profile or save, secret, and a keybind's {key, pad} default): ported from host/mod_manifest.c with their value rules and the JSON text the game keeps, and Longshot's manifest and resolver vectors copied from mods/settings (2e3d147b). The Mods page shows a mod's author, and its settings of scope global and profile can be changed there, each in the store the game keeps it in (host/modapi/storage.c: the "<owner>/<name>+settings" store under the user folder's modstore, global/ or profile/<list>/, <list> keyed by the list's path), written as the game writes it, with Default to put one back. A secret's value is never shown, a setting of scope save is the game's to change, a file a newer mod wrote is left alone, and nothing is changed while that instance's game runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>Jobs are read as Longshot's host/texture_packs.c writes them (modcache/upscale/<owner>__<name>/<key>/job.json), each mod's newest; done.json is written last as upscale_done reads it. The model comes from its https link only (a redirect away from https refused, HttpFetcher.RedirectRefusal), hashed as it comes and kept by its SHA-256, hashed again before each run; the player is asked once per model, with its size. The job runs in the launcher's own process again (--upscale-worker) at below-normal priority, one at a time, with progress and Cancel on the Mods page; tiles overlap so no seam is drawn, alpha separate, model or keep. ONNX only (safetensors refused, said). Microsoft.ML.OnnxRuntime 1.31.1 is pinned for App and tests/upscale_onnx (CPU build). A job needs each texture's decoded picture ("in"), which the game does not write yet: such a job is shown and refused, said. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEtLongshot's mods/discord adds the system-only permission presence and system/discord, "enabled": "with-presence" (the stamp's system_mods= flag 8, MODRT_SYSTEM_PRESENCE); mods/settingsreg adds the system-only settings.engine and system/settings ("off", flags 0). Both branches, from mods/final-r3, also have gfx.world in api.toml. - ModPermissions: gfx.world, presence and settings.engine in the game's words and risk, the last two system-only; ModResolver's reader knows presence and settings.engine. check_permissions takes a checkout that has not yet the system-only ones another branch adds (each is last in its branch), and nothing else differing. - ModsSystem: SystemModEnabled.WithPresence from "with-presence" (listed with presence, never required, as modapi/generate.py takes it) and from flag 8 alone (9 to 15 refused, as test_mods_api_stamp.py's rule). The Discord status's mod is shown with no mod of the player's too, off whatever mods.json says (put_systems), with no switch and the game's row note "Runs while Discord runs on this PC and the Insert menu's Gameplay > Discord status is on." (host/modapi/loader.c); SetSystemEnabled refuses it. The row's note moves to SystemModShown.Note so the checks reach it. - The shared vectors in mods/discord's and mods/settingsreg's tests/mod_vectors are the ones here, unchanged. - Checks: both permissions refused for a mod the player installs (listed or optional), flag 8's parse, "with-presence" defaults, and the Discord row's text and its lack of a switch, stamped or not. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEtLongshot's mods/ipc (cdce343a) makes system mods libraries: any mod names one in its dependencies ("? system/discord >= 0.3.0"), a required one keeps the mod off while the player has it off (dependency-disabled), an optional one runs either way with its calls refused (not-running), a range is against the system mod's own version, and a system/ dependency is never fetched. The launcher now decides what the game's next start will, with the game's resolver (ModResolver, which passes mods/ipc's resolve.json, its system cases among them): - ModsDeps: the resolver's input as host/modapi/loader.c modrt_resolve and host/mods.c put_systems make it (the folder's manifest mods, the first folder of an id by name; the trusted system mods first in the list with their switches; then the player's mods that are on, a mod whose code waits for its warning off, pins as the list says), each dependency's state, what switching a mod on with what it needs would do (Fix: installed mods and system mods, dependencies first; what is missing, not shipped, waiting for its warning, locked or at a version that does not fit), and which mods need a system mod that is off. - The Mods page: the load order, a box of the mods that are on and will not load (the game starts without them), and on each such row why in the resolver's words, "Switch on what it needs" (ModsState.SetManyEnabled, one write) and "Get what it needs…" (the portal's install with the mod kept at its version); a built-in mod that is off says which mods need it; an optional dependency on one says what runs without it. - Play says first which mods that are on will not load. The game never refuses a start over a dependency, so neither does the launcher. - Installs (ModsInstall.Plan): a required system/ dependency is switched on when it is off and the player may switch it, and said when this version does not ship it or not at a version that fits; an optional one is left; the last check resolves with the system mods as the game will. A system mod's step writes only its switch. - System mods' legacySwitch (mods/ipc): system/discord's old discord_status line of longshot_options.ini is its switch while mods.json has no entry for it, as put_systems takes it (the first line that is 0, false, 1 or true); the page says when it is, and the "system" object takes the key as modapi/generate.py does. ModsPlace carries the settings file the game reads (LauncherService.OptionsFileOf). - A folder mod in an owner's folder that is not where its id goes is no mod (host/modapi/loader.c folder_matches), so a dependency on its id is missing, as in the game. - The shared vectors: resolve.json is mods/ipc's with mods/oxc's entries (the two branches touch different cases; merged line by line), and system_discord.json is mods/ipc's at cdce343a (version 0.3.0, its exports, the switch's legacySwitch in place of the "enabled" setting, modsMaySet). Not decided here, and said where it matters: a .lsmod left in the mods folder (the game reads it; the launcher always unpacks), a hook-site mod held for another game build, and the features this game's build has (the game checks at its start). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEtlongshot mod runstarts the game as the launcher does 8dd561c3e6Longshot mod-api a334ed6190d9 moved what a release ships: modapi/native to host/modapi/native, game/ to host/game/sites, modapi/{system,examples,packages,templates} and docs/modding to assets/modding. Toolchains.ShippedFallback is that commit's scripts/builder_package.py list (gpu, host, nx2, scripts, third_party, assets/profiles, assets/longshot.png, assets/modding), and docs/ is no longer taken whole: a release ships none of it. The fixtures in PullRequestChecks use the new paths and that commit's list; the comments and docs naming Longshot's docs/modding name assets/modding/docs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEthost/mods_trust.c now has exefs among the unsafe tier's grants, and the broker keeps for a confined game only what narrows the file (a grant taken back): its yes to code or to the unsafe tier lasts its run. The launcher's writes are unchanged in kind ("accepted", and "granted": [] to take grants back), so its Accept is what keeps a code mod's acceptance. ModsTrust.UnsafeNames takes exefs; trust.json is made again by make_trust.py over that commit, with the exefs grant's cases (taken now, refused before); docs/mods.md says who writes the file. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEtThe home with versions was mostly empty space around a small Play, and it did not say what a profile or a save was to a version. Both homes are now one family: the logo beside the title, then one card. With a version, the card puts the version (track and version), its profile (its own list of which mods are on and their settings, picked here, named to the game at Play) and the saves every version and profile shares side by side, then Play and what it starts in words ("v3.1.0 · Default profile · 3 save slots"). The save is not picked here: the game asks for a slot on its title screen, and the card says so. With no version yet, the card says what a build makes, what it needs and how long, over Build. A version's state is said plainly: Ready, Not built yet, Game missing (its folder has lost its game: Build it again, not "Built today, not built"), Deleting. The versions list keeps every action on a version (set the default, its mods, its folder, delete; build another, add a folder, check for updates); Play is the card's. The home opens on the version Play started last. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueAt 960x560 Home's Version picker cut a nightly's name ("Nightl…"). The field now shows its short name (Nightly 187, PR #1548; a release as it is), wrapping rather than cutting, with the full name in its tooltip and in the list, which wraps too. Storage's read-only folder boxes cut a long path at its end. They are now a TextBlock cut in its middle by path segment ("…"), the whole path in its tooltip. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puePossibly related, for context:
New head
6460b9f4(was77512e83): the launcher rebuilt around Profile > Version + Save (profiles own mods, settings and saves; Who's playing?; matching Profiles/Versions/Saves pages), the save slot picker (HOS_START_SLOT), per-profile saves (HOS_SAVE_DIR, never the shared saves silently), mod repositories (Edit repos…), the Mods page changes, and a cleaner look with brand accents. Launcher core 4356 checks pass; build clean. Home is being simplified further next, then a rebase onto #259's newest head.Head
6c39f057: Home is now the band, a Version and a Save dropdown and one button (Build / Build again / Update with Play beside it / Play), with the profile in the title bar; everything else left Home. Launcher core 4357 checks pass; build clean.New head
5f00b3f4: the launcher moves to versions → profiles → saves. A profile is a folder (profiles/<id>/:profile.jsonv1 with its mods' order and on/off, game copy and upscalers;mods/,settings.ini,saves/), versions are builder folders (versions/<v>/Longshot.exeandbuilds/<stamp>/), and Play isLongshot.exe --profile <folder>; older make_game.py versions play as before. A one-time migration copies every profile's saves, mods list and settings into its folder and keeps the originals. Home: the Save picker lists the profile's slots (no "Choose in game"; "New game" with no saves; hidden on versions without start_slot), and Update is a button as big as Play. Launcher core 4382 checks pass (25 new for the profile model); build clean.b691ce5a0c9674064b65Rebased onto #259's yrosrqpp (
9674064b, 129 commits). The profile basics moved to #259; this keeps the mods layer over them (profile.json's mods with per-mod keys kept, trust.json, modstore carried with saves), the Mods page (a Mods tab in #259's title bar), repos, Home's front page and Save picker, and the look. Launcher core 4497 checks pass, ONNX 25, build clean, translations clean.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.