Skip to content

Commit

Permalink
oUF lib updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Jul 11, 2023
1 parent 3edf2c1 commit 14c5374
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions libs/oUF/elements/additionalpower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ local oUF = ns.oUF
local _, playerClass = UnitClass('player')

-- sourced from FrameXML/AlternatePowerBar.lua
local ADDITIONAL_POWER_BAR_NAME = _G.ADDITIONAL_POWER_BAR_NAME or 'MANA'
local ADDITIONAL_POWER_BAR_INDEX = _G.ADDITIONAL_POWER_BAR_INDEX or 0
local ALT_MANA_BAR_PAIR_DISPLAY_INFO = _G.ALT_MANA_BAR_PAIR_DISPLAY_INFO
local ALT_POWER_BAR_PAIR_DISPLAY_INFO = _G.ALT_POWER_BAR_PAIR_DISPLAY_INFO
local ADDITIONAL_POWER_BAR_NAME = 'MANA'
local ADDITIONAL_POWER_BAR_INDEX = 0

local function UpdateColor(self, event, unit, powerType)
if(not (unit and UnitIsUnit(unit, 'player') and powerType == ADDITIONAL_POWER_BAR_NAME)) then return end
Expand Down Expand Up @@ -272,7 +272,7 @@ local function Enable(self, unit)
self:RegisterEvent('UNIT_DISPLAYPOWER', VisibilityPath)

if(not element.displayPairs) then
element.displayPairs = CopyTable(ALT_MANA_BAR_PAIR_DISPLAY_INFO)
element.displayPairs = CopyTable(ALT_POWER_BAR_PAIR_DISPLAY_INFO)
end

if(element:IsObjectType('StatusBar') and not element:GetStatusBarTexture()) then
Expand Down
8 changes: 4 additions & 4 deletions libs/oUF/elements/powerprediction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ local _, ns = ...
local oUF = ns.oUF

-- sourced from FrameXML/AlternatePowerBar.lua
local ADDITIONAL_POWER_BAR_INDEX = _G.ADDITIONAL_POWER_BAR_INDEX or 0
local ALT_MANA_BAR_PAIR_DISPLAY_INFO = _G.ALT_MANA_BAR_PAIR_DISPLAY_INFO
local ALT_POWER_BAR_PAIR_DISPLAY_INFO = _G.ALT_POWER_BAR_PAIR_DISPLAY_INFO
local ADDITIONAL_POWER_BAR_INDEX = 0

local _, playerClass = UnitClass('player')

Expand All @@ -66,8 +66,8 @@ local function Update(self, event, unit)

local _, _, _, startTime, endTime, _, _, _, spellID = UnitCastingInfo(unit)
local mainPowerType = UnitPowerType(unit)
local hasAltManaBar = ALT_MANA_BAR_PAIR_DISPLAY_INFO[playerClass]
and ALT_MANA_BAR_PAIR_DISPLAY_INFO[playerClass][mainPowerType]
local hasAltManaBar = ALT_POWER_BAR_PAIR_DISPLAY_INFO[playerClass]
and ALT_POWER_BAR_PAIR_DISPLAY_INFO[playerClass][mainPowerType]
local mainCost, altCost = 0, 0

if(event == 'UNIT_SPELLCAST_START' and startTime ~= endTime) then
Expand Down
2 changes: 1 addition & 1 deletion libs/oUF/elements/tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ oUF.Tags = {
end,
SetEventUpdateTimer = function(self, timer)
if(not timer) then return end
if(not type(timer) == 'number') then return end
if(type(timer) ~= 'number') then return end

eventTimerThreshold = math.max(0.05, timer)
end,
Expand Down

0 comments on commit 14c5374

Please sign in to comment.