From c08b0d7a954b20ea55883ebafdefe7ecc6c1ea8d Mon Sep 17 00:00:00 2001 From: Rainrider Date: Tue, 25 Apr 2017 21:17:25 +0200 Subject: [PATCH] Pass on constant upvalues And some rogue chages because of code guidelines --- elements/additionalpower.lua | 2 +- elements/power.lua | 3 +++ elements/powerprediction.lua | 4 ++++ elements/range.lua | 2 +- elements/runes.lua | 2 +- elements/stagger.lua | 5 ++++- elements/totems.lua | 2 +- 7 files changed, 15 insertions(+), 5 deletions(-) diff --git a/elements/additionalpower.lua b/elements/additionalpower.lua index d6dafc503..372ed1d3c 100644 --- a/elements/additionalpower.lua +++ b/elements/additionalpower.lua @@ -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' diff --git a/elements/power.lua b/elements/power.lua index 2a6c22744..35effff88 100644 --- a/elements/power.lua +++ b/elements/power.lua @@ -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 diff --git a/elements/powerprediction.lua b/elements/powerprediction.lua index 22896026a..68879fec8 100644 --- a/elements/powerprediction.lua +++ b/elements/powerprediction.lua @@ -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) diff --git a/elements/range.lua b/elements/range.lua index 0462d23d5..4cb01717d 100644 --- a/elements/range.lua +++ b/elements/range.lua @@ -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 diff --git a/elements/runes.lua b/elements/runes.lua index a330f3e74..dc00885c6 100644 --- a/elements/runes.lua +++ b/elements/runes.lua @@ -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 diff --git a/elements/stagger.lua b/elements/stagger.lua index 730e2ddfe..c130a9e68 100644 --- a/elements/stagger.lua +++ b/elements/stagger.lua @@ -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' diff --git a/elements/totems.lua b/elements/totems.lua index 43f0891a4..6a528c029 100644 --- a/elements/totems.lua +++ b/elements/totems.lua @@ -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)