Skip to content

[Feature] Add multi-select action bar visibility modes#394

Open
MattS8 wants to merge 2 commits into
EllesmereGaming:mainfrom
MattS8:main
Open

[Feature] Add multi-select action bar visibility modes#394
MattS8 wants to merge 2 commits into
EllesmereGaming:mainfrom
MattS8:main

Conversation

@MattS8

@MattS8 MattS8 commented Jun 19, 2026

Copy link
Copy Markdown

New Feature: Action Bar Multi-Select Visibility

Summary

Action bar visibility now supports multi-select: a bar shows when any selected condition is true (e.g. In Combat + Mouseover → visible in combat or on hover). Visibility Options (hide when mounted, hide without target, etc.) are unchanged (they still act as AND-style hide filters evaluated before mode logic).
image


Feature

  • Checkbox dropdown for visibility modes (same options as before, multi-select).
  • OR evaluation: show if any selected mode matches current state.
  • Never and Always are mutually exclusive; clearing all selections defaults to Always.
  • Visibility Options dropdown unchanged and works as before.

Examples

Modes selected Result
In Combat + Mouseover Bar visible in combat or while hovered
Out of Combat + In Raid Bar visible when not in combat or in a raid
Mouseover only Same as before — fade on hover
Never Bar always hidden
Always Bar always visible

Code changes

EllesmereUI/EllesmereUI.lua

  • Shared visibility system (tail of file): VIS_MODE_ITEMS, mode helpers, and runtime evaluators.
  • GetVisibilityModes: reads barVisibilityModes[], falls back to legacy barVisibility.
  • CheckVisibilityModes: OR evaluation; macro/state modes checked before mouseover.
  • BuildMacroVisibilitySuffix: builds OR-chained secure macro condition strings.
  • CheckVisibilityOptions / CheckVisibilityOptionsNonMacro: unchanged AND-style hide filters.
  • _GetFFD / SetElementVisibility: moved early in the file to fix load-order nil errors in child addons.
  • Re-bind guard before the visibility block for Lua 5.1 200-local limit edge cases at end of the main chunk. (Might want to look into refactoring visibility logic out of main file)

EllesmereUIActionBars/EllesmereUIActionBars.lua

  • EAB.VisibilityCompat expanded as the action-bar visibility layer:
    • ApplyModes, Normalize, Copy, GetModes, BuildMacroSuffix
    • ShouldShowBar, IsMacroModeActive, ApplyBarPresentation, RefreshMixedModePresentation
  • barVisibilityModes is the source of truth; legacy fields (barVisibility, mouseoverEnabled, combatShowEnabled, etc.) are derived on apply.
  • Secure bars: macro-expressible modes use RegisterStateDriver with OR-chained suffixes; when mouseover is combined with macro modes, the driver stays "show" and alpha is managed in Lua.
  • Mixed-mode precedence: macro conditions (e.g. in combat) win over mouseover fade; refreshed on combat enter/exit via RefreshMixedModePresentation.
  • Non-secure bars (XP/Rep, Micro, Bags, etc.): use CheckVisibilityModes with hover state in the managed visibility pass.
  • Helpers live on EAB.VisibilityCompat.* rather than chunk locals to avoid the 200-local variable Lua 5.1 warning.

EllesmereUIActionBars/EUI_ActionBars_Options.lua

  • Replaced single-select visibility dropdown with BuildVisOptsCBDropdown multi-select UI.
  • ToggleVisibilityMode: Never/Always exclusivity; empty selection → Always.
  • Sync-to-all-bars compares full mode arrays via VisibilityModesEqual instead of a single string.

EllesmereUI/EllesmereUI_Migration.lua

  • Migration ab_bar_visibility_to_modes_v1: converts existing barVisibility (and legacy boolean flags) → barVisibilityModes = { mode } per bar.

My Tests

Tested the following in-game:

  • /reload : no Lua errors on login
  • Migration: existing profiles get barVisibilityModes populated & behavior matches pre-migration
  • Single modes (Always, Never, Mouseover, In Combat, Out of Combat): unchanged from before
  • Combined modes:
    • In Combat + Mouseover: visible in combat without hover; also visible on hover out of combat
    • Out of Combat + In Raid: correct in each state
    • Mouseover + Solo: hover works, also visible when solo
  • Visibility Options: still hide correctly when combined with multi-select modes (mounted, no target, instances-only, housing)
  • Sync Visibility to all Bars: copies full mode set to all bars
  • Per-bar types: Checked different mode sets on multiple bars
  • Combat transitions: enter/exit combat with mixed mouseover + in_combat modes, no stuck alpha
  • Pet battle / vehicle / override: existing bar-type hide rules still apply
  • Profile copy / import: modes survive round-trip during copy/import process

Additional Info

Other modules still single-mode
CDM, Unit Frames, Resource Bars, etc. use the shared helpers but not barVisibilityModes multi-select. Action bars are the scope of this PR, and unifying other modules would be a separate change.

EllesmereUI_Visibility.lua dispatcher
EvalVisibility still evaluates a single cfg.visibility string. Could be updated to call CheckVisibilityModes for consistency across Minimap, Friends, Quest Tracker, etc. but I wanted to keep the changes as minimal as possible as this is already a rather large single-change.

Legacy barVisibility field
Only stores the first mode in the array for backward compatibility. Anything reading barVisibility alone will not see the full multi-select state; prefer barVisibilityModes or GetVisibilityModes.

Mode array order
OR logic is order-independent for display, but macro suffix clause order follows array order. Functionally equivalent; could normalize sort order for stable diffs/sync comparisons.

200-local limit
Local variable limit for the rather large core EllesmereUI.lua file mitigated via VisibilityCompat table methods. Core EllesmereUI.lua uses a re-bind guard at end of file. A longer-term fix would move the Shared Visibility System block into EllesmereUI_Visibility.lua or some other module.


Disclaimers

LLMS were used to assist in coding up this change and help write up this pull request. However, any code generated from an LLM was looked over and tested by me.

MattS8 added 2 commits June 18, 2026 19:11
*   Allow combining multiple visibility conditions (e.g., "in combat" and "mouseover").
*   Introduce new `barVisibilityModes` array setting for storing selected modes.
*   Include a migration to convert existing single-mode settings to the new array format.
*   Update all runtime evaluation logic, macro generation, and options UI to support multiple modes.
*   Refactor `_FFD` and `SetElementVisibility` definitions for early availability. This addresses a nil access bug.
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