[Feature] Add multi-select action bar visibility modes#394
Open
MattS8 wants to merge 2 commits into
Open
Conversation
* 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.
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.
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).

Feature
Examples
Code changes
EllesmereUI/EllesmereUI.luaVIS_MODE_ITEMS, mode helpers, and runtime evaluators.GetVisibilityModes: readsbarVisibilityModes[], falls back to legacybarVisibility.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.EllesmereUIActionBars/EllesmereUIActionBars.luaEAB.VisibilityCompatexpanded as the action-bar visibility layer:ApplyModes,Normalize,Copy,GetModes,BuildMacroSuffixShouldShowBar,IsMacroModeActive,ApplyBarPresentation,RefreshMixedModePresentationbarVisibilityModesis the source of truth; legacy fields (barVisibility,mouseoverEnabled,combatShowEnabled, etc.) are derived on apply.RegisterStateDriverwith OR-chained suffixes; when mouseover is combined with macro modes, the driver stays"show"and alpha is managed in Lua.RefreshMixedModePresentation.CheckVisibilityModeswith hover state in the managed visibility pass.EAB.VisibilityCompat.*rather than chunk locals to avoid the 200-local variable Lua 5.1 warning.EllesmereUIActionBars/EUI_ActionBars_Options.luaBuildVisOptsCBDropdownmulti-select UI.ToggleVisibilityMode: Never/Always exclusivity; empty selection → Always.VisibilityModesEqualinstead of a single string.EllesmereUI/EllesmereUI_Migration.luaab_bar_visibility_to_modes_v1: converts existingbarVisibility(and legacy boolean flags) →barVisibilityModes = { mode }per bar.My Tests
Tested the following in-game:
/reload: no Lua errors on loginbarVisibilityModespopulated & behavior matches pre-migrationAdditional Info
Other modules still single-mode
CDM, Unit Frames, Resource Bars, etc. use the shared helpers but not
barVisibilityModesmulti-select. Action bars are the scope of this PR, and unifying other modules would be a separate change.EllesmereUI_Visibility.luadispatcherEvalVisibilitystill evaluates a singlecfg.visibilitystring. Could be updated to callCheckVisibilityModesfor 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
barVisibilityfieldOnly stores the first mode in the array for backward compatibility. Anything reading
barVisibilityalone will not see the full multi-select state; preferbarVisibilityModesorGetVisibilityModes.Mode array order
ORlogic 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.luafile mitigated viaVisibilityCompattable methods. CoreEllesmereUI.luauses a re-bind guard at end of file. A longer-term fix would move the Shared Visibility System block intoEllesmereUI_Visibility.luaor 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.