Repository navigation
Add WindowSkin: let a separate plugin theme the settings window - #126
Merged
Merged
Conversation
…ok of the game WindowSkin (null by default) is used to draw the window, its controls and tooltips; its window style draws the window background instead of the built-in grey one. Plugin and category headers use the skin's custom styles named ConfigurationManager.PluginHeader / ConfigurationManager.CategoryHeader if present. The default look is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ManlyMarco
approved these changes
Oct 11, 2026
Member
|
Let me know when you're done working on this plugins and I'll make a release. |
Contributor
Author
|
Thank you so much for the quick and thoughtful reviews, and for merging both PRs! I was really glad to help. I'm done working on this plugin, so feel free to make the release whenever it suits you. |
Contributor
Author
|
Sorry, one tiny last fix after all: #127 (the slider value box was a fixed 50px and clipped numbers with a bigger font). After that, that's really everything from me. Huge thanks again! We'll be happy to download the release with these changes. |
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
A small extension point so that a separate plugin can give the settings window the look of the game it is used in. The plugin itself ships no themes and its default look does not change.
ConfigurationManager.WindowSkin(GUISkin, null by default). When set, the window, its controls and tooltips are drawn with it, and itswindowstyle draws the window background instead of the built-in grey one. The dimmed backdrop behind a window that has not been moved yet keeps the default skin.ConfigurationManager.PluginHeaderandConfigurationManager.CategoryHeader(constantsPluginHeaderStyleName/CategoryHeaderStyleName) if the skin has them. Otherwise they are built from the skin's label as before. The private fields_pluginHeaderSkin/_categoryHeaderSkinkeep their names, so plugins that already reach into them keep working.Usage from a theme plugin:
Why
Mods that want the window to match their game currently have to patch it with Harmony: replace
GUI.skinin a prefix toOnGUI, force_windowWasMovedso that the grey background is not drawn under a themed window, and restyle the header styles through reflection. That breaks whenever the internals change. WithWindowSkinthe theme stays in its own plugin and needs no patches. Separate from #125 (translation): this PR touches only the skin handling.Testing
Unity 2020.3 Mono game, BepInEx 5.4.23.5. The theme plugin is the game's own UI mod: dark paper and old gold. It uses
WindowSkinwhen the property exists and falls back to its old Harmony path otherwise.Default look, unchanged (
WindowSkinnull):WindowSkinset by the theme plugin, headers from its named custom styles:The same in the game:
Turning the theme off at runtime (setting
WindowSkinback to null) returns the default look immediately.19.0 with the same theme plugin, through its old Harmony path, looks the same as before.
Builds:
ConfigurationManager(BepInEx 5, net35) andConfigurationManager.IL2CPP, 0 errors. Not run in an IL2CPP game.(The window in the screenshots is in Russian because of #125's translation file; this PR does not depend on it.)
🤖 Generated with Claude Code