X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/7cd9b15270a53b3c833f41e00ed755a30e22b2ef..197ec731fd13eadba22f20d7b01ea440c094cb54:/OmaRF/RaidFrame.lua diff --git a/OmaRF/RaidFrame.lua b/OmaRF/RaidFrame.lua index ad802cb..03d7ef5 100644 --- a/OmaRF/RaidFrame.lua +++ b/OmaRF/RaidFrame.lua @@ -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; @@ -30,20 +29,21 @@ local attributes = {}; local CFrame = CreateFrame("Frame", "OmaRFFrame", UIParent); local inheritedFrames = "SecureUnitButtonTemplate,SecureHandlerStateTemplate"; +local class = nil; local party = {}; 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 @@ -128,7 +128,7 @@ local function setupFrame(frame, secure, unit) frame.overlay = frame:CreateTexture(nil, "ARTWORK", nil, 1); frame.overlay:SetPoint("TOPLEFT", frame.background, "TOPLEFT"); frame.overlay:SetPoint("BOTTOMRIGHT", frame.background, "BOTTOMRIGHT"); - frame.overlay:SetColorTexture(1, 1, 1); + frame.overlay:SetTexture("Interface\\RaidFrame\\Raid-Bar-Hp-Fill"); frame.overlay:Hide(); frame.name = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight"); frame.name:SetPoint("CENTER", frame.background, "CENTER", 0, 11); @@ -146,7 +146,7 @@ local function setupFrame(frame, secure, unit) frame.ready:SetPoint("BOTTOMRIGHT", frame.background, "BOTTOMLEFT", 14, 0); frame.ready:Hide(); -- set up indicators - setupIndicators(frame); + setupIndicators(frame, class); -- set scripts frame:SetScript("OnShow", frameShow); frame:SetScript("OnHide", frameHide); @@ -263,16 +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"]; - loadCharSettings(); + _, class = UnitClass("player"); + 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);