SparrohUILib
Shared UI library for Sparroh Mycopunk mods. Provides themed widgets, HUD builders, windows, and resolution-aware layout.
CHANGELOG
Changelog
1.2.3
Fixes
- Input caret — runtime-created
UIInputFieldnow togglesenabledafter wiring so TMP builds caret/selection graphics (focus alone was not enough)
1.2.2
Fixes
- UIDragList — drop targeting uses padded slot bands (
floorinto row+spacing) so reordering needs less precise pointer placement
1.2.1
Fixes
- UIDragList — dragged row now follows the pointer (grab-offset preserved) instead of only jumping on index change
- Drop index accounts for content padding/spacing and live row centers; scrolling disabled while dragging
OnReorderedfires once on drop (from start index → final index)
1.2.0
Added
- HUD reposition helpers — soft-dependency client for ModSettingsMenu's drag-reposition API (no hard reference required)
HudRepositionClient.Register/Unregister/IsAvailableHudAnchors.Bind— bind{Name} X/{Name} Yunder[HUD Positioning]HudAnchors.BindKeys— bind custom key namesHudReposition.Bind/HudHandle.EnableReposition— register, sync anchors onSettingChanged, auto-unregister on destroyHudHandle.DisableReposition/HasReposition
Notes
- Drag mode (F9), overlay, and auto-detect remain in ModSettingsMenu
- Consumer mods can delete their copied
HudRepositionClient.csand use the library API instead UISlider/UIProgressBarwere already present; no changes in this release
1.1.6
Fixes
- Input caret —
UIInputFieldnow enablescustomCaretColor, sets a readable caret width, and uses a standard blink rate so focused fields show a clear blinking insertion line
1.1.5
Fixes
- Dropdown layering — open option lists reparent to the root canvas and use override sorting (
UITheme.DropdownSortingOrder) so they paint above later siblings and are not clipped by scroll masks - Dropdowns flip above the trigger when there is not enough room below
API
- Added
UIDropdown.IsOpenfor consumers that track open state after reparent
1.1.4
Fixes
- Quit-to-menu / lobby reload — HUD handles parented to the player reticle no longer stay "alive" as stale C# wrappers after scene unload.
HudHandle.IsAlive/HudHandle.IsValidlet consumers detect teardown and rebuild HudHandleLifemarks handles dead immediately when Unity destroys the root (player despawn / scene unload)HudVisibilityprunes dead handles every tick and resets hide-state cache on scene unloadGearActionBarhost is invalidated on scene unload and ticked from the library plugin (no longer depends on a single consumer callingTick)UIThemefont cache cleared on scene unload so destroyed in-scene TMP fonts are not reusedUITextaccessors no-op safely when the underlying TMP was destroyed
API
HudHandle.IsAlive— true while the Unity GameObject still existsHudHandle.IsValid(handle)— null-safe validity checkHudVisibility.PruneDead/ResetSessionStateUITheme.ClearFontCache
1.1.3
Added
- HUD elements built via
HudBuilder/HudHandlenow respect the vanilla Hide HUD option (PlayerLook.DisablePlayerHUD) - Added
HudVisibilityhelper;HudHandle.SetActivestores desired visibility and applies it only when the vanilla HUD is shown
Notes
- Menu/overlay UI (windows, gear action bar) is unaffected
1.1.2
Fixes
- Fixed gear action bar buttons requiring clicks slightly above the visible control
GearActionBarnow parents under the gameMenucanvas (camera/blit UI space) instead of a separate overlay canvas- Bar sizing uses menu reference pixels to avoid double-scaling with the menu
CanvasScaler - Bar re-attaches if the menu is destroyed/recreated; stays on top while gear details is open
- Nudged bar down/right so it sits cleanly in the curved menu chrome
- Gear action buttons are centered and grow outward as more mods register slots
1.1.1
Fixes
- Fixed gear-bar / button hover being wiped when
SetInteractableorSetStyleran every frame UIButtonnow tracks hover/press state and reapplies the correct color after style/interactable changesGearActionBar.Register/SetText/SetInteractableonly apply when values actually change- Stronger, style-specific button hover/pressed colors for Default, Primary, Danger, and Active
1.1.0
Added
- Hex color parsing helpers:
UIColors.TryParseHex,UIColors.ParseHex ConfigColorhelper for binding hex color config entries with cachedColorvalues
1.0.0
Added
- Initial release of SparrohUILib
- Theme system with Mycopunk-inspired palette and resolution-aware scaling
- Core UI factory and layout helpers
- HUD builders (single-line and multi-line panels)
- Gear action bar for shared gear-menu buttons
- Widgets: text, button, toggle, input field, panel, scroll view, separator, dropdown, slider, progress bar, tabs, tooltip, drag list
- Overlay windows and confirmation/alert dialogs (per-window canvases)
- Rich text helpers for labeled values and rates