Repository navigation
Mod install - Add a Browse Mods page for NexusMods and itch.io - #127
Merged
Merged
Conversation
Installing a mod used to mean pasting its URL. Now there's a "Browse Mods" button that opens NexusMods' or itch.io's own Foxhole pages in an embedded browser (full page, swapped into MainWindow's bodyStack like Settings) — installing is then just downloading like normal, no URL needed. - Add BrowseModsWidget (src/views/mod_manager/), hosting BrowserWidget with a NexusMods/itch.io tab switch. An nxm:// "Mod Manager Download" link is redeemed the same way the existing download flow does; any other captured download is matched against the page's URL (NexusUrlParser/ItchUrlParser) to fetch real metadata (author, upload date, etc.) before installing, falling back to just the filename if that fails rather than losing the download. - Add ModInstallHelper, factoring AddModModalContent's archive-extraction and multi-pak-selection pattern out for this single-file case. - Add ToastWidget, a small auto-dismissing banner, for install feedback that doesn't interrupt an ongoing multi-download browsing session the way a modal would. - Fix ItchClient::getGameId() reading an author from a "user" object that doesn't exist in itch's data.json response; the real field is "authors" (an array). - Add BrowserWidget::warmUp(), called shortly after the main window shows, so the Chromium engine's one-time startup cost is paid in the background instead of during the user's first browser open. - Give BrowserWidget's download bar a maximum width with elided text (a long/ugly name could otherwise squeeze the progress bar to a sliver) and drive it from external (API-based) downloads too via showExternalDownload()/ updateExternalDownloadProgress(), so the nxm:// redeem path shows the same live progress bar as a browser-captured one instead of a static toast. - Fix ModInstallHelper always reporting an install as successful regardless of whether ModManager::addModAsync() actually succeeded.
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.
What does this PR do?
Installing a mod used to mean pasting its URL into a modal. This adds a "Browse Mods"
button (next to Add Mod) that opens NexusMods' or itch.io's own Foxhole pages in an
embedded browser instead — a full page (swapped into
MainWindow'sbodyStack, the sameway Settings is), not a modal, since browsing is naturally a multi-download session.
Installing a mod is then just downloading it like normal:
nxm://link the same way theexisting download flow already does.
matched against the page's URL to fetch real metadata (author, upload date, etc.) before
installing, so the mod is update-checkable like one added the old way — falling back to
just the filename if that lookup fails, rather than losing the download.
ToastWidgetinstead of a blocking dialog,so the user can keep browsing and grab several mods in one session.
Also along the way:
ItchClient::getGameId()reading an author from a"user"object that doesn'texist in itch's
data.jsonresponse (the real field is"authors", an array) — thisbug predates this PR and affected the existing itch download flow too.
BrowserWidget::warmUp(), called shortly after the main window shows, soChromium's one-time engine-startup cost is paid in the background instead of during the
user's first browser open.
BrowserWidget's download-progress bar being squeezable to a sliver by along/ugly download name (no max-width/eliding before); it's also now driven by
API-based downloads (the
nxm://redeem path) viashowExternalDownload(), not justbrowser-captured ones, so both show the same live progress instead of a static toast.
ModInstallHelper(new in this PR, factored out ofAddModModalContent'sarchive-extraction/multi-pak-selection pattern for installing a single downloaded file)
always reporting an install as successful regardless of whether
ModManager::addModAsync()actually succeeded.How was it tested?
ctestpass on both platforms this was verified against: Windows (MSVC,Release) and Ubuntu 24.04 (WSL, Debug), both via Qt 6.10.1 kits with the WebEngine
module.
ui_smokelaunches the real app successfully on both.several rounds of iteration: the
nxm://redeem path, a direct Nexus download, and anitch.io download all land as correctly-installed mods with author metadata populated
(verified via debug logging against the live API responses, which is how the
ItchClientbug above was actually found and confirmed fixed).account (Linux verification above is build/test-suite only).
Checklist
area - Add|Fix|Improve|Change|Make|Remove {changes}