From 782c7becc25b6e7c9d5294c6a413596c8297332d Mon Sep 17 00:00:00 2001 From: Aleksi Blinnikka Date: Wed, 30 Jun 2021 19:30:37 +0300 Subject: [PATCH] Clickable boss frames for Kael --- kehys/boss.lua | 9 +++++++++ 1 file changed, 9 insertions(+) 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"); -- 2.39.5