X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/79feebea0985e4fc1d0fee41cbeca982c5e389f9..HEAD:/kehys/boss.lua diff --git a/kehys/boss.lua b/kehys/boss.lua index 988b93d..fecf8fd 100644 --- a/kehys/boss.lua +++ b/kehys/boss.lua @@ -6,6 +6,8 @@ local CFrame = CreateFrame("Frame", "kehysBossInit", UIParent); local CTimerAfter = C_Timer.After; local barTexture = "Interface\\AddOns\\kehys\\images\\minimalist"; +local class = nil; +local attributes = {}; local function showTooltip(frame) GameTooltip_SetDefaultAnchor(GameTooltip, frame); @@ -65,7 +67,12 @@ local function initBoss(parent, y, width, height, update, event) end); f:SetScript("OnEnter", showTooltip); f:SetScript("OnLeave", hideTooltip); + -- set attributes f:RegisterForClicks("AnyDown"); + for attr, val in pairs(attributes) do + if attr ~= "type1" and attr ~= "spell1" then f:SetAttribute(attr, val) end + end + -- rest give target and menu f:SetAttribute("*type1", "target"); f:SetAttribute("*type2", "togglemenu"); f:SetAttribute("toggleForVehicle", false); @@ -138,6 +145,8 @@ local function initBoss(parent, y, width, height, update, event) end CFrame:SetScript("OnEvent", function(self) + _, class = UnitClass("player"); + attributes = addon.Clickheal[class]; self:UnregisterAllEvents(); CFrame:SetFrameStrata("LOW"); CFrame:SetPoint("CENTER", nil, "CENTER");