Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add left menu badges #1452

Merged
merged 5 commits into from
May 28, 2024
Merged

Conversation

erri120
Copy link
Member

@erri120 erri120 commented May 27, 2024

Resolves #1424.

Also adds badges for diagnostics instead of using (count) as before. Since the left menu doesn't know if the mod library page is currently open and visible, the badge will only be removed if the user actually clicks on the item.

@erri120 erri120 requested a review from Al12rs May 27, 2024 13:41
@erri120 erri120 self-assigned this May 27, 2024

public static bool FilterDownloadAnalysisModel(DownloadAnalysis.Model model, GameDomain currentGameDomain)
{
if (!model.TryGet(DownloaderState.GameDomain, out var domain)) return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not return false
If we don't have a GameDomain on the DownloadState it is likely because it was installed from archive on disk, but we want to show those, not filter them out.

You can move the StreamBasedFileOrigin check first, then return true if has no game, then false if game doesn't match

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do archives from disk not have a game domain? The button to do so is in the Loadout Grid, so we have access to the game domain.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with that is that you are assuming that the user will add a mod for this game, which isn't necessarily true.
So someone on SSE could add a mod for Legendary edition and we would auto label it as SSE mod. Leaving it unknown is preferrable in that case.
I guess we will have to figure something out when we add support for another game.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the code to add GameDomain to the manually added archive.

Copy link
Member Author

@erri120 erri120 May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support SSE or LE yet. For Stardew Valley, modders would expect their Stardew Valley archives to appear for Stardew Valley and not as "unknown".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file would show up even if installation failed because it wasn't actually a StardewMod. We might want to ask @captainsandypants

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mod installation isn't relevant to this, tho. Adding a mod manually is an escape hatch in the first place. Again, this shouldn't be complex.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that if the user adds a mod manually to Stardew we should register is as Stardew, although where would the game domain show up in the UI? And do we need to consider multiple game store version of Stardew being managed for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although where would the game domain show up in the UI?

We don't have a column that shows the game domain, but the code above filters by game domain because that's the only way to check if the download is for the current game.

And do we need to consider multiple game store version of Stardew being managed for this?

No. The "game domain" is the identifier used by Nexus Mods stardewvalley and applies to all versions of the game. It's our way of uniquely identifying a game across installations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds fine for now then

@erri120 erri120 requested a review from Al12rs May 27, 2024 14:57
Copy link
Contributor

@Al12rs Al12rs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erri120 erri120 requested a review from Al12rs May 28, 2024 08:42
@erri120 erri120 merged commit 607fbb7 into Nexus-Mods:main May 28, 2024
7 checks passed
@erri120 erri120 deleted the feat/1424-left-menu-badges branch May 28, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants