Skip to content

Conversation

@ZackWilde27
Copy link
Contributor

@ZackWilde27 ZackWilde27 commented Nov 16, 2025

I've finished the theme downloader, but unfortunately there's still one final issue you'll have to take a look at, the API call to fetch the mods still doesn't return

The call is in ThemeDownloader.cs located in Launcher/Utility, line 100

I've added a definition at the top of ThemeDownloader to enable test mode, which recreates the API call's results so the downloader can at least be tested out.

themedownloader.mp4

ZackWilde27 and others added 7 commits October 24, 2025 21:05
There's now Violet, Teal, and Monochrome to go along with the colours added previously, but I also got more creative and made some totally new designs

There's now 2 metallic themes, Metallic_Silver and Metallic_Default

I also added a recreation of Windows XP's Luna theme as a bonus
Added a "Fetch Themes..." option to the theme selector, which if selected will fetch all GUIs mods from GameBanana and add them to the list. clicking on any of the new entries will automatically download and install it

The catch? I haven't tested it in a real scenario yet because GetByNameAsync does not return

Also I removed the luna theme, I really liked that one but Microsoft might have something to say about it so it's gone now
I manually recreated the results the API call should be returning, so I was able to test it for real, and I immediately noticed a few flaws

- Fixed installing the heroes mod loader theme

- Fixed duplicates being added to the theme selector

- Fixed bullet lists not being recognized

- Added an admittedly hacky method to update the download window as it goes along

- Attempted to make it switch to the theme you selected after it installs, but it's not working, I'll have to work on that a bit more

As it is right now, you have to either restart reloaded after installing the theme, or switch to a different theme and switch back to get it to properly update

I also removed all of my other themes I added previously, that was the plan anyways and I wanted to test downloading them
Finished all the polishing to tie everything together

- Moved ThemeDownloader.cs from Launcher/Lib/Utility to Launcher/Utility, so I can do the window stuff from there

- Created a new download window for themes which *should* update along with the download, it doesn't for some reason but it should

- The theme doesn't switch back to default anymore when 'Fetch Themes...' is selected

- The new themes are inserted into the drop down alphabetically to keep the sorting

- Implemented the most bodgeyest of bodges to get it to switch to the theme after downloading
I added a retry policy to both downloading themes, and fetching them

Also cleaned up a couple things while I was doing that
- Removed the unnecessary binding to ThemeDownloadDialog's progress bar value

- Removed the documentation for a parameter on DownloadThemeByName that isn't there anymore
- Added a cancel button and associated logic when downloading themes

- Made the text colour be the opposite of the progress bar below it

- Added a try catch around extracting a theme, just in case

- Moved the dialog handling to a task, which I was hoping would allow the progress bar to update but sadly still no

- The download dialog is only created once and then reused, so it doesn't pop up twice when downloading the heroes mod loader theme
@Sewer56
Copy link
Member

Sewer56 commented Nov 16, 2025

https://github.com/ZackWilde27/Reloaded-II/blob/f010fc4974a4b2f4ab5ed84bde6c6f5ed4a1f8e6/source/Reloaded.Mod.Launcher/Utility/XamlThemeSelector.cs#L17-L20

    private void PopulateAndFetch(string selectedTheme, bool fetch=true)
    {
        PopulateXamlFiles();
        ThemeDownloader.RefreshAvailableThemes(fetch).Wait();

This is the cause of the deadlock.

Needs to be private async void PopulateAndFetchAsync(string selectedTheme, bool fetch=true)
with await ThemeDownloader.RefreshAvailableThemes(fetch);

@Sewer56
Copy link
Member

Sewer56 commented Nov 16, 2025

Use the default top level category 'Mod' in here.

AvailableThemes = await GameBananaMod.GetByNameAsync("", 7486, 0, 5);

In the older days, GameBanana had multiple top level categories; Skin, Mod, GameFile, etc.
These got merged into just Mod, Sound, Wip.

@dreamsyntax
Copy link
Contributor

Needs rebase; Has extra commits

@Sewer56
Copy link
Member

Sewer56 commented Nov 16, 2025

Eh, it's fine, I don't mind.

A standard for uploading themes has been decided, and some fixes on top of that

- Changed theme fetching to match the standard (with some exceptions for existing themes)

- Implemented the deadlock fix that Sewer suggested

- Themes now fetch from the default category, and have a take of 50

Once the other themes have been changed to match the standard, I'll be back to remove the exceptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants