X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/d180f82975c6b13a3380bd8df5ab47df70112c49..674e0c047004a7f514ee4c991e09603bcee96432:/OmaRF/RaidFrame.lua?ds=sidebyside diff --git a/OmaRF/RaidFrame.lua b/OmaRF/RaidFrame.lua index 31ef192..078280d 100644 --- a/OmaRF/RaidFrame.lua +++ b/OmaRF/RaidFrame.lua @@ -11,9 +11,6 @@ local registerEvents = OmaRFEvents.RegisterEvents; local unitEvent = OmaRFEvents.UnitEvent; local Settings = OmaRFSettings; -local positions = Settings.Positions; -local width, height = Settings.Character.Width, Settings.Character.Height; -local anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY; local indSize = Settings.IndSize; local baseColor = Settings.BaseColor; local bgColor = Settings.BgColor; @@ -22,7 +19,11 @@ local shieldColor = Settings.ShieldColor; local shieldhlColor = Settings.ShieldhlColor; local healpredColor = Settings.HealpredColor; local healabsorbColor = Settings.HealabsorbColor; -local attributes = Settings.Character.Clickheal; +-- placeholders with visible values when error happens +local positions = {}; +local width, height = 10, 10; +local anchorX, anchorY = 10, 10; +local attributes = {}; local CFrame = CreateFrame("Frame", "OmaRFFrame", UIParent); local inheritedFrames = "SecureUnitButtonTemplate,SecureHandlerStateTemplate"; @@ -289,9 +290,22 @@ local function initialize() initializeRaid(CFrame); end +local function loadCharSettings() + width, height = Settings.Character.Width, Settings.Character.Height; + anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY; + attributes = Settings.Character.Clickheal; + positions = Settings.Character.Positions; +end + +CFrame:RegisterEvent("ADDON_LOADED"); CFrame:RegisterEvent("PLAYER_LOGIN"); CFrame:SetScript("OnEvent", function(self, event) if event == "PLAYER_LOGIN" then initialize(); + elseif event == "ADDON_LOADED" then + OmaRFLoadChar(); + loadCharSettings(); + OmaRFEvents.LoadChar(); + OmaRFIndicators.LoadChar(); end end);