Repository navigation
Add PolyGlass themes - #1289
Add PolyGlass themes#1289
Conversation
Wyvest
left a comment
There was a problem hiding this comment.
call (old) polyglass "polyfrosted", call new theme "polyglass"
…1.21.11 and newer
fe8cf17 to
4568fd4
Compare
| updateAccent() | ||
| try { | ||
| val theme = registry.find { it.name == ThemeConfig.activeTheme } | ||
| val saved = if (ThemeConfig.polyfrostedRenameApplied) ThemeConfig.activeTheme else renamedThemes[ThemeConfig.activeTheme] ?: ThemeConfig.activeTheme |
There was a problem hiding this comment.
🟡 [P2] Reset the migration marker when opening an old profile
When an old profile is opened after another profile has been migrated, its themes.json has no polyfrostedRenameApplied field, so profile rebinding retains the previous profile’s true value. This skips the rename and loads the new PolyGlass theme instead of the saved old appearance; the next save also records the marker. Reset or derive the marker from the incoming profile before resolving its theme.
| fun Color.scaleOpacity(percent: Float, defaultPercent: Float): Color = | ||
| copy(alpha = (alpha * percent / defaultPercent).coerceIn(0f, 1f)) | ||
|
|
||
| fun UITheme.surfaceOpacity(color: Color, percent: Float, defaultPercent: Float): Color = | ||
| if (liquidGlass) color.scaleOpacity(percent, defaultPercent) else color.withOpacityPercent(percent) |
There was a problem hiding this comment.
🟡 [P2] Make 100% opacity opaque for PolyGlass
With either PolyGlass theme active, setting Page Opacity or Sidebar Opacity to 100 still leaves the panel translucent: for example, the dark page reaches only about 62% alpha. The settings explicitly promise that 100 is fully opaque, so users cannot hide the game background as requested. Map the maximum to full opacity while retaining the desired default appearance.
| val GLASS_DARK: OneConfigUITheme by lazy { componentsBridge().glassDark() } | ||
|
|
||
| @JvmStatic | ||
| val GLASS_LIGHT: OneConfigUITheme by lazy { componentsBridge().glassLight() } |
There was a problem hiding this comment.
🔵 [P3] Update the PolyPlus toggle for the new glass variants (non-blocking)
When PolyGlass Light is active, PolyPlus’s main-menu theme toggle recognizes only the legacy light theme and Minecraft Light, so it treats PolyGlass Light as dark. Clicking the toggle then selects Polyfrosted Light rather than a dark theme; toggling from PolyGlass Dark also leaves the glass family. Coordinate an update to the PolyPlus toggle and its applyTheme function so they recognize and preserve the new variants.
| fun endFrame() { | ||
| if (GuiTargetRedirect.target != null) return | ||
| submitted = false | ||
| drawBounds.clear() | ||
| glassDraws.clear() |
There was a problem hiding this comment.
🟡 [P2] Release the backdrop texture after glass is no longer used
After a PolyGlass panel is opened on Minecraft 1.21.11 or newer, the full-window backdrop texture and view remain allocated even after the menu closes or the theme changes. At 4K this retains roughly 32 MiB of GPU memory for the rest of the session. Release the snapshot after an idle period or when it is no longer needed, and recreate it on demand.


New PolyGlass dark and light themes with real frosted glass behind the menus. The old PolyGlass is now called Polyfrosted. Tested in game on everything from 1.8.9 to 26.3.