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

[ModUpdateMenu] Use ThemeManager for loading UI Assets #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

KhloeLeclair
Copy link

This is an optional PR that improves mod compatibility with user interface theme mods. Please don't feel compelled to accept it, but please consider it. If you do accept it, you should merge my other PR about fixing link clicking first as this PR builds upon that one.

This PR introduces my ThemeManager class to ModUpdateMenu and uses it to load texture assets. You're probably wondering why this is a good thing. To summarize, ThemeManager:

  • Automatically discovers compatible assets in other mods / content packs.
  • Selects the best asset based on which mods are loaded by the user.
  • Requires no effort on the part of the user.
  • Introduces no external dependencies, living entirely in a single C# file that can be updated when necessary by replacing it with a fresh copy from https://github.com/KhloeLeclair/Stardew-ThemeManager
  • Uses the MIT No Attribution license to avoid any licensing concerns.

To expand on "no effort on the part of the user", traditionally installing a user interface theme for Stardew Valley requires the user to copy files from the theme into other mods' folders. While not particularly taxing, it's still a point of frustration for users. Content Patcher does not support modifying mod assets, so it cannot be used.

ThemeManager is designed to correct that problem. No file copying is required, and everything will just work seamlessly once both mod and theme are updated to support each other.

Thank you for your time reading and considering this,

~ Khloe

Regarding Stardew Valley 1.6 and SMAPI 4.0

As you may know, the upcoming Stardew Valley 1.6 release and companion SMAPI 4.0 release introduce a replacement for IAssetLoader, the AssetRequested event. This is already supported by ThemeManager, but requires an update.

All you would have to do, as a mod author, to update ThemeManager is download the latest version from the main-4 branch on GitHub and replace your copy of ThemeManager.cs

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.

1 participant