197ec73 - Tidy up OmaRF files
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Thu, 1 Feb 2018 22:08:42 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Thu, 1 Feb 2018 22:08:42 +0000
OmaRF/Indicators.lua
OmaRF/RaidFrame.lua

index 6b4e04a..6fd7b23 100644 (file)
@@ -3,6 +3,7 @@ local pairs, ipairs = pairs, ipairs;
 local floor = math.floor;
 local GetTime = GetTime;
 local UnitAura = UnitAura;
+local CreateFrame = CreateFrame;
 local UnitIsDeadOrGhost, UnitIsConnected = UnitIsDeadOrGhost, UnitIsConnected;
 local CTimerAfter = C_Timer.After;
 
index 6e2c6c9..03d7ef5 100644 (file)
@@ -1,8 +1,7 @@
 -- RaidFrame.lua
 local _;
-local unpack, pairs, rawget = unpack, pairs, rawget;
+local unpack, pairs = unpack, pairs;
 local format = string.format;
-local UnitHealthMax, UnitPowerMax = UnitHealthMax, UnitPowerMax;
 local UnitInRange = UnitInRange;
 local InCombatLockdown = InCombatLockdown;
 local CreateFrame, RegisterStateDriver, RegisterUnitWatch = CreateFrame, RegisterStateDriver, RegisterUnitWatch;
@@ -37,14 +36,14 @@ local raid = {};
 local M = {};
 OmaRaidFrame = M;
 
-local function unitUpdate(self, elapsed)
+local function unitUpdate(frame)
     -- there's no in/out of range event, have to check each frame
     -- from FrameXML/CompactUnitFrame.lua
-    local inRange, checked = UnitInRange(self.displayed);
+    local inRange, checked = UnitInRange(frame.displayed);
     if checked and not inRange then
-        self:SetAlpha(0.55);
+        frame:SetAlpha(0.55);
     else
-        self:SetAlpha(1);
+        frame:SetAlpha(1);
     end
 end
 
@@ -264,17 +263,13 @@ local function initializeFocus(parent)
     secure:SetAttribute("_onstate-vehicleui", vehicletoggle);
 end
 
-local function loadCharSettings()
-    anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY;
-    attributes = Settings.Character.Clickheal;
-end
-
 local function initialize()
     -- let other addons hook these to anchor tooltip elsewhere
     GameTooltip = _G["GameTooltip"];
     GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
     _, class = UnitClass("player");
-    loadCharSettings();
+    anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY;
+    attributes = Settings.Character.Clickheal;
     CFrame:SetPoint("CENTER", nil, "CENTER", anchorX, anchorY);
     CFrame:SetHeight((height+2)*8);
     CFrame:SetWidth((width+2)*5);