d76a52e - Change width/height to global setting
[wowui.git] / OmaUF / UnitFrames.lua
index d2e5fcc..815fa17 100644 (file)
@@ -21,8 +21,8 @@ local shieldColor = Settings.ShieldColor;
 local shieldhlColor = Settings.ShieldhlColor;
 local healpredColor = Settings.HealpredColor;
 local healabsorbColor = Settings.HealabsorbColor;
 local shieldhlColor = Settings.ShieldhlColor;
 local healpredColor = Settings.HealpredColor;
 local healabsorbColor = Settings.HealabsorbColor;
+local width, height = Settings.Width, Settings.Height;
 -- placeholders with visible values when error happens
 -- placeholders with visible values when error happens
-local width, height = 10, 10;
 local anchorX, anchorY = 10, 10;
 local attributes = {};
 
 local anchorX, anchorY = 10, 10;
 local attributes = {};
 
@@ -69,7 +69,7 @@ local function frameHide(frame)
 end
 
 local function showTooltip(frame)
 end
 
 local function showTooltip(frame)
-    GameTooltip_SetDefaultAnchor(GameTooltip, PlayerFrame);
+    GameTooltip_SetDefaultAnchor(GameTooltip, frame);
     GameTooltip:SetUnit(frame:GetAttribute("unit"));
 end
 
     GameTooltip:SetUnit(frame:GetAttribute("unit"));
 end
 
@@ -176,9 +176,6 @@ local function setupFrame(frame, secure, unit)
     frame:SetScript("OnShow", frameShow);
     frame:SetScript("OnHide", frameHide);
     frame:SetScript("OnEvent", unitEvent);
     frame:SetScript("OnShow", frameShow);
     frame:SetScript("OnHide", frameHide);
     frame:SetScript("OnEvent", unitEvent);
-    -- let other addons hook these to anchor tooltip elsewhere
-    GameTooltip = _G["GameTooltip"];
-    GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
     secure:SetScript("OnEnter", showTooltip);
     secure:SetScript("OnLeave", hideTooltip);
     -- set attributes
     secure:SetScript("OnEnter", showTooltip);
     secure:SetScript("OnLeave", hideTooltip);
     -- set attributes
@@ -237,13 +234,15 @@ local function initializeTarget(parent)
 end
 
 local function loadCharSettings()
 end
 
 local function loadCharSettings()
-    width, height = Settings.Character.Width, Settings.Character.Height;
     anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY;
     attributes = Settings.Character.Clickheal;
 end
 
 local function initialize()
     loadCharSettings();
     anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY;
     attributes = Settings.Character.Clickheal;
 end
 
 local function initialize()
     loadCharSettings();
+    -- let other addons hook these to anchor tooltip elsewhere
+    GameTooltip = _G["GameTooltip"];
+    GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
     initializePlayer(UIParent);
     initializeTarget(UIParent);
     -- TODO boss frames, pet frame, (arena frames)
     initializePlayer(UIParent);
     initializeTarget(UIParent);
     -- TODO boss frames, pet frame, (arena frames)
@@ -286,7 +285,6 @@ UnitFrames:RegisterEvent("PLAYER_LOGIN");
 UnitFrames:SetScript("OnEvent", function(self, event)
     if event == "PLAYER_LOGIN" then
         OmaUFLoadChar();
 UnitFrames:SetScript("OnEvent", function(self, event)
     if event == "PLAYER_LOGIN" then
         OmaUFLoadChar();
-        OmaUFEvents.LoadChar();
         hideBlizzardFrames();
         initialize();
     end
         hideBlizzardFrames();
         initialize();
     end