Skip to content

Commit

Permalink
Pass on constant upvalues
Browse files Browse the repository at this point in the history
And some rogue chages because of code guidelines
  • Loading branch information
Rainrider authored and p3lim committed Apr 29, 2017
1 parent ac0ce54 commit c08b0d7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion elements/additionalpower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ A default texture will be applied if the widget is a StatusBar and doesn't have
local _, ns = ...
local oUF = ns.oUF

local playerClass = select(2, UnitClass('player'))
local _, playerClass = UnitClass('player')

-- sourced from FrameXML/AlternatePowerBar.lua
local ADDITIONAL_POWER_BAR_NAME = ADDITIONAL_POWER_BAR_NAME or 'MANA'
Expand Down
3 changes: 3 additions & 0 deletions elements/power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ The following options are listed by priority. The first check that returns true
local parent, ns = ...
local oUF = ns.oUF

-- sourced from FrameXML/UnitPowerBarAlt.lua
local ALTERNATE_POWER_INDEX = ALTERNATE_POWER_INDEX or 10

local function getDisplayPower(unit)
local _, min, _, _, _, _, showOnRaid = UnitAlternatePowerInfo(unit)
if(showOnRaid) then
Expand Down
4 changes: 4 additions & 0 deletions elements/powerprediction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ A default texture will be applied if the widget is a StatusBar and doesn't have
local _, ns = ...
local oUF = ns.oUF

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

local playerClass = select(2, UnitClass('player'))

local function Update(self, event, unit)
Expand Down
2 changes: 1 addition & 1 deletion elements/range.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ local function Enable(self)
table.insert(_FRAMES, self)

if(not OnRangeFrame) then
OnRangeFrame = CreateFrame'Frame'
OnRangeFrame = CreateFrame('Frame')
OnRangeFrame:SetScript('OnUpdate', OnRangeUpdate)
end

Expand Down
2 changes: 1 addition & 1 deletion elements/runes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A default texture will be applied if the sub-widgets are StatusBars and doesn't
self.Runes = Runes
--]]

if select(2, UnitClass('player')) ~= 'DEATHKNIGHT' then return end
if(select(2, UnitClass('player')) ~= 'DEATHKNIGHT') then return end

local parent, ns = ...
local oUF = ns.oUF
Expand Down
5 changes: 4 additions & 1 deletion elements/stagger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ A default texture will be applied if the widget is a StatusBar and doesn't have
self.Stagger = Stagger
--]]

if select(2, UnitClass('player')) ~= 'MONK' then return end
if(select(2, UnitClass('player')) ~= 'MONK') then return end

local parent, ns = ...
local oUF = ns.oUF

-- sourced from FrameXML/Constants.lua
local SPEC_MONK_BREWMASTER = SPEC_MONK_BREWMASTER or 1

-- sourced from FrameXML/MonkStaggerBar.lua
local BREWMASTER_POWER_BAR_NAME = BREWMASTER_POWER_BAR_NAME or 'STAGGER'

Expand Down
2 changes: 1 addition & 1 deletion elements/totems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OnEnter and OnLeave will be set to display a Tooltip if the `Totem` widget is mo
## Examples
local Totems = {}
for index = 1, MAX_TOTEMS do
for index = 1, 5 do
-- Position and size of the totem indicator
local Totem = CreateFrame('Button', nil, self)
Totem:SetSize(40, 40)
Expand Down

0 comments on commit c08b0d7

Please sign in to comment.