git
/
wowui.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e8fd612
)
782c7be - Clickable boss frames for Kael
author
Aleksi Blinnikka <aleksi.blinnikka@iki.fi>
Wed, 30 Jun 2021 16:30:37 +0000
committer
Aleksi Blinnikka <aleksi.blinnikka@iki.fi>
Wed, 30 Jun 2021 16:30:37 +0000
kehys/boss.lua
patch
|
blob
|
history
diff --git
a/kehys/boss.lua
b/kehys/boss.lua
index
988b93d
..
fecf8fd
100644
(file)
--- 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 CTimerAfter = C_Timer.After;
local barTexture = "Interface\\AddOns\\kehys\\images\\minimalist";
+local class = nil;
+local attributes = {};
local function showTooltip(frame)
GameTooltip_SetDefaultAnchor(GameTooltip, frame);
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);
end);
f:SetScript("OnEnter", showTooltip);
f:SetScript("OnLeave", hideTooltip);
+ -- set attributes
f:RegisterForClicks("AnyDown");
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);
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)
end
CFrame:SetScript("OnEvent", function(self)
+ _, class = UnitClass("player");
+ attributes = addon.Clickheal[class];
self:UnregisterAllEvents();
CFrame:SetFrameStrata("LOW");
CFrame:SetPoint("CENTER", nil, "CENTER");
self:UnregisterAllEvents();
CFrame:SetFrameStrata("LOW");
CFrame:SetPoint("CENTER", nil, "CENTER");