Repository navigation
Conversation
Wyvest
left a comment
There was a problem hiding this comment.
can you move the button to above the hud icons (so where the old global hidden button was) with a settings icon
| when (val looks = t.getProp(PROVIDER_LOOKS)?.get()) { | ||
| is Array<*> -> looks.forEach { if (it != null) noteProviderLook(it.toString()) } | ||
| is Iterable<*> -> looks.forEach { if (it != null) noteProviderLook(it.toString()) } | ||
| } | ||
| hudProviders.values.forEach { applyProviderLook(it) } |
There was a problem hiding this comment.
[P2] Reset provider looks when switching profiles
After baking overrides in profile A, switching to a blank profile B retains A's provider styles. teardownForProfile() clears knownProviders but not providerLooks, so this load reapplies stale entries and subsequent registry saves persist them into B. This reproduces with an unplaced, multi-instance HUD. Clear the cache and restore provider defaults before loading the destination profile's looks.
| AnimatedVisibility( | ||
| visible = globalPanelOpen && libraryChromeVisible, |
There was a problem hiding this comment.
[P2] Keep global controls accessible when the library is empty
When all registered HUDs are single-instance and already placed, addable and consequently modIds are empty, making libraryChromeVisible false. Both the new settings button and this panel therefore disappear despite existing HUDs needing configuration. Decouple global-control visibility from available library entries so users can still access global settings and “Apply to all HUDs” in this state.
| // providers have no tree, so their look is remembered in the registry instead | ||
| if (hud !in HudManager.activeInstances) HudManager.storeProviderLook(hud) |
There was a problem hiding this comment.
[P2] Persist applied looks for active single-instance providers
A single-instance HUD is also its own provider, so this condition skips saving its provider look while placed. After applying overrides, disabling them, deleting that HUD and restarting, adding it again restores the original appearance rather than the applied look; re-adding before restarting retains it. Persist the look for every registered provider, including providers also present in activeInstances, so the promised defaults for future placements survive deletion and restart.
# Conflicts: # modules/hud/api/hud.api # modules/hud/src/main/kotlin/org/polyfrost/oneconfig/api/hud/v1/HudBackgroundMerge.kt # modules/internal/src/main/java/org/polyfrost/oneconfig/internal/OneConfigConfig.java # modules/internal/src/main/kotlin/org/polyfrost/oneconfig/internal/ui/hud/screens/HudDesignStudio.kt # modules/internal/src/main/kotlin/org/polyfrost/oneconfig/internal/ui/hud/screens/sections/Designer.kt # modules/internal/src/main/kotlin/org/polyfrost/oneconfig/internal/ui/hud/screens/sections/Settings.kt
| for (hud in HudManager.activeInstances) { | ||
| if (hud !is LegacyHud) continue | ||
| if (!HudManager.isEditing) { | ||
| if (!GlobalHudSettings.enabled) continue |
There was a problem hiding this comment.
🟡 [P2] Apply the master visibility switch to compatibility HUDs
With compatibility-wrapped HUDs such as Skyblocker widgets, disabling the HUD overlay still leaves those elements visible after exiting the editor. They implement
LegacyHudMarker, notLegacyHud, so this loop skips them;HudManageralso excludes them, while their original rendering hooks only checkCompatOverlayRenderer.oneConfigScreenOpen(). Gate the compatibility rendering paths on the master switch too, without overwriting individual HUD visibility preferences.
| // providers have no tree, so their look is remembered in the registry instead | ||
| if (providers.any { it === hud }) HudManager.storeProviderLook(hud) |
There was a problem hiding this comment.
🟡 [P2] Include provider appearance changes in undo history
After applying a global font and then undoing,
HudHistoryrestores placed HUDs but leaves provider values and their persisted registry entries unchanged. Disabling the override and adding another HUD therefore uses the supposedly undone font, including after restarting. A targeted test reproduces this partial undo. Provider appearance changes need to participate in the same history operation as the placed HUD changes.
| key = key * 31 + (hud.effectiveBackgroundRadius * hud.effectiveScale * 4f).roundToInt() | ||
| key = key * 31 + (if (hud.effectiveShowBackground) 1 else 0) |
There was a problem hiding this comment.
🟡 [P2] Invalidate the merge fast path when global backgrounds change
When the new public API changes background overrides outside the editor, no HUD
geometryStampchanges.HudManager.updateBackgroundGroups()consequently returns through itsstablefast path before evaluating this updated key. Merged backgrounds retain stale visibility or radius, and newly matching backgrounds do not merge until another geometry change occurs. Include the global background settings in the fast-path invalidation; a targeted radius-override test reproduces the stale groups.
| @SuppressWarnings("unchecked") | ||
| public static void setGlobalHudOption(String option, Object value) { | ||
| OneConfigConfig inst = INSTANCE; | ||
| if (inst == null || inst.tree == null) { | ||
| return; | ||
| } | ||
| ((Property<Object>) inst.getProperty(option)).set(value); |
There was a problem hiding this comment.
🔵 [P3] Use the existing type-erased property setter
Property.setAs(value)already supports writing values without this unchecked cast, so the new suppression is unnecessary. Use that setter, or document why the cast is required and safe if retained.
Description
Adds
GlobalHudSettings, holding preferences that apply to every HUD from every mod. Appearance settings pair an override switch with a value: off leaves each HUD on its own look, on routes the global value through the new effective* accessors on Hud without touching stored values.Enabled gates drawing entirely, while the HUD editor keeps rendering so the user can get back. Values are editable under Preferences > Global HUD and from a panel in the design studio, both writing through
GlobalHudSettingsBridge.Related Issue(s)
none
Checklist