Module br.player.ui
These functions help in retrieving information about or manipulating UI elements.
UI functions are stored in br.player.ui and can be utilized by `local ui = br.player.ui` in your profile.
Functions
| ui.alwaysCdNever (thisOption) | Checks if the passed option is set to "Always, CD, or Never" |
| ui.alwaysCdAoENever (thisOption[, minUnits=3[, enemyCount]]) | Checks if the passed option is set to "Always, AOE/CD, CD, or Never" |
| ui.chatOverlay (text) | Displays the passed text as an overlay on the chat windows |
| ui.checked (thisOption[, optionPage]) | Checks if the passed option is enabled |
| ui.debug (text) | Displays the text as a debug message in chat (if Addon Debug Messages option is enabled) |
| ui.delay (delayName, delayTime) | Returns false unless the specified delay time has passed since it was last true |
| ui.fullBags () | Checks if your bags are full |
| ui.getSpell (spellName) | Returns the spellID for the highest known if table is passed, or the spellID for the single spell name. |
| ui.isMouseDown ([mouseButton]) | Checks if the mouse button specified is down, or any if none are specified |
| ui.pause () | Returns true if special conditions are met to pause |
| ui.print (msg) | Shows the specified message in chat. |
| ui.pullTimer () | Returns the time remaining on the pull timer (DBM/BigWigs) |
| ui.round (num[, numDecimalPlaces=2]) | Rounds a number to the specified number of decimal places (default 2) |
| ui.time () | Returns the time, value of GetTime |
| ui.timer (timerName, interval) | Returns false unless the specified interval has passed since it was last true |
| ui.toggle (thisToggle) | Checks if the specified toggle from the toggle options is pressed |
| ui.useAOE ([range=8[, minCount=3[, useTarget="player"]]]) | Checks if the specified parameters are valid for AOE, based on Rotation toggle setting. |
| ui.useCDs () | Check if Cooldowns should be used or not based on CD toggle setting. |
| ui.useDefensive () | Check if Defensives should be used or not based on Defensive toggle setting. |
| ui.useInterrupt () | Check if Interrupts should be used or not based on Interrupt toggle setting. |
| ui.useST ([range=8[, minCount=3[, useTarget="player"]]]) | Checks if the specified parameters are valid for Single Target, based on Rotation toggle setting. |
| ui.useTrinkets (trinket) | Checks if the option to use trinkets are valid per each Trinket slot. |
| ui.value (thisOption[, optionPage]) | Returns the value of the specified option. |
| ui.fightStyle.patchwerk () | Returns true when not in a 5-man party instance (raid, outdoor, etc.). |
| ui.fightStyle.dungeonRoute () | Returns true when inside an active Mythic+ key run. |
| ui.fightStyle.dungeonSlice () | Returns true when inside a regular (non-Mythic+) 5-man dungeon. |
| ui.setToggle (toggleName, toggleValue) | Sets a toggle to the specified value and updates the UI |
Functions
- ui.alwaysCdNever (thisOption)
-
Checks if the passed option is set to "Always, CD, or Never"
Parameters:
- thisOption string - Name of the option from the defined profile options.
Returns:
-
boolean - Returns true if the option is set to Always or if CD is selected and CDs are enabled
- ui.alwaysCdAoENever (thisOption[, minUnits=3[, enemyCount]])
-
Checks if the passed option is set to "Always, AOE/CD, CD, or Never"
Parameters:
- thisOption string - Name of the option from the defined profile options.
- minUnits number - Minimum number of units required to treat this as AOE. (default 3)
- enemyCount number - A precomputed enemy count (e.g. `#enemies.yards8`) provided by the caller. (optional)
Returns:
-
boolean - Returns true based on selected option and current combat conditions
Usage:
-- Preferred (profile-controlled): compute a count and pass it local use = ui.alwaysCdAoENever("Bladestorm", 3, #enemies.yards8) -- Convenience wrapper (helper computes the count for you): local use2 = ui.alwaysCdAoENeverRange("Bladestorm", 3, 8, "player") -- Both forms return true if the Bladestorm option is set to Always, or set to AOE and there are at least 3 enemies, -- or set to AOE/CD and either CDs are enabled or the count meets the threshold.
- ui.chatOverlay (text)
-
Displays the passed text as an overlay on the chat windows
Parameters:
- text string - The text to display.
Returns:
-
nil
- ui.checked (thisOption[, optionPage])
-
Checks if the passed option is enabled
Parameters:
- thisOption string - Name of the option from the defined profile options.
- optionPage string - The page where the option is located. (optional)
Returns:
-
boolean - Returns true if the option is checked
- ui.debug (text)
-
Displays the text as a debug message in chat (if Addon Debug Messages option is enabled)
Parameters:
- text string - The message to show in chat.
Returns:
-
nil
- ui.delay (delayName, delayTime)
-
Returns false unless the specified delay time has passed since it was last true
Parameters:
- delayName string - The name of the delay check, should be unique.
- delayTime number - The length of time to wait until true, in seconds.
Returns:
-
boolean - Returns true if the delay time has passed
- ui.fullBags ()
-
Checks if your bags are full
Returns:
-
boolean - Returns true if bags are full
- ui.getSpell (spellName)
-
Returns the spellID for the highest known if table is passed, or the spellID for the single spell name.
Parameters:
- spellName string - The name of the spell.
Returns:
-
number - Returns the spell ID
- ui.isMouseDown ([mouseButton])
-
Checks if the mouse button specified is down, or any if none are specified
Parameters:
- mouseButton string - Name of the mouse button. (optional)
Returns:
-
boolean - Returns true if the specified mouse button is down
- ui.pause ()
-
Returns true if special conditions are met to pause
Returns:
-
boolean - Returns true if rotation should be paused
See also:
- ui.print (msg)
-
Shows the specified message in chat.
Parameters:
- msg string - The message to show in chat.
Returns:
-
nil
- ui.pullTimer ()
-
Returns the time remaining on the pull timer (DBM/BigWigs)
Returns:
-
number - Returns seconds remaining on pull timer
- ui.round (num[, numDecimalPlaces=2])
-
Rounds a number to the specified number of decimal places (default 2)
Parameters:
- num number - The number to round.
- numDecimalPlaces number - The number of decimal places to round to. (default 2)
Returns:
-
number - Returns the rounded number
- ui.time ()
-
Returns the time, value of GetTime
Returns:
-
number - Returns the current game time
- ui.timer (timerName, interval)
-
Returns false unless the specified interval has passed since it was last true
Parameters:
- timerName string - The name of the timer check, should be unique.
- interval number - The length of time to wait until true, in seconds.
Returns:
-
boolean - Returns true if the interval has passed
- ui.toggle (thisToggle)
-
Checks if the specified toggle from the toggle options is pressed
Parameters:
- thisToggle string - Name of the toggle to check.
Returns:
-
boolean - Returns true if the toggle is active
- ui.useAOE ([range=8[, minCount=3[, useTarget="player"]]])
-
Checks if the specified parameters are valid for AOE, based on Rotation toggle setting.
Parameters:
- range number - The range of the AOE damage in yards. (default 8)
- minCount number - The minimum number of units to be in range before true (default 3)
- useTarget string - the reference unit to check range and units against. (default "player")
Returns:
-
boolean - Returns true if AOE should be used
- ui.useCDs ()
-
Check if Cooldowns should be used or not based on CD toggle setting.
Returns:
-
boolean - Returns true if cooldowns should be used
- ui.useDefensive ()
-
Check if Defensives should be used or not based on Defensive toggle setting.
Returns:
-
boolean - Returns true if defensive abilities should be used
- ui.useInterrupt ()
-
Check if Interrupts should be used or not based on Interrupt toggle setting.
Returns:
-
boolean - Returns true if interrupts should be used
- ui.useST ([range=8[, minCount=3[, useTarget="player"]]])
-
Checks if the specified parameters are valid for Single Target, based on Rotation toggle setting.
Parameters:
- range number - The range of the AOE damage in yards. (default 8)
- minCount number - The minimum number of units to be in range before true (default 3)
- useTarget string - the reference unit to check range and units against. (default "player")
Returns:
-
boolean - Returns true if single target abilities should be used
- ui.useTrinkets (trinket)
-
Checks if the option to use trinkets are valid per each Trinket slot.
Parameters:
- trinket number - The item id of the trinket to check for.
Returns:
-
boolean - Returns true if the trinket should be used
- ui.value (thisOption[, optionPage])
-
Returns the value of the specified option.
Parameters:
- thisOption string - The name of the option specified in the options section
- optionPage string - The page where the option is located. (optional)
Returns:
-
number - Returns the value of the specified option
- ui.fightStyle.patchwerk ()
-
Returns true when not in a 5-man party instance (raid, outdoor, etc.).
Returns:
-
boolean
- ui.fightStyle.dungeonRoute ()
-
Returns true when inside an active Mythic+ key run.
Returns:
-
boolean
- ui.fightStyle.dungeonSlice ()
-
Returns true when inside a regular (non-Mythic+) 5-man dungeon.
Returns:
-
boolean
- ui.setToggle (toggleName, toggleValue)
-
Sets a toggle to the specified value and updates the UI
Parameters:
- toggleName string - The name of the toggle to set
- toggleValue number - The value to set the toggle to (1, 2, 3, etc.)
Returns:
-
nil