git
/
wowui.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
12d76ae - TOC updates to 8.2
[wowui.git]
/
kehys
/
frame.lua
diff --git
a/kehys/frame.lua
b/kehys/frame.lua
index
2409d26
..
4301178
100644
(file)
--- a/
kehys/frame.lua
+++ b/
kehys/frame.lua
@@
-6,6
+6,7
@@
local format = string.format;
local CreateFrame = CreateFrame;
local CTimerAfter = C_Timer.After;
local CreateFrame = CreateFrame;
local CTimerAfter = C_Timer.After;
+local guids = addon.FrameGuids;
local updaters = {};
local function showTooltip(frame)
GameTooltip_SetDefaultAnchor(GameTooltip, frame);
local updaters = {};
local function showTooltip(frame)
GameTooltip_SetDefaultAnchor(GameTooltip, frame);
@@
-23,14
+24,15
@@
function addon.NewRaidFrame(parent, width, height, unit, attributes,
assert(type(width) == "number", "Frame creation missing width!");
assert(type(height) == "number", "Frame creation missing height!");
assert(type(unit) == "string", "Frame creation missing unit!");
assert(type(width) == "number", "Frame creation missing width!");
assert(type(height) == "number", "Frame creation missing height!");
assert(type(unit) == "string", "Frame creation missing unit!");
- assert(type(attributes) == "table",
- "Frame creation missing attributes table!");
assert(type(update) == "function",
"Frame creation missing update function!");
assert(type(event) == "function",
"Frame creation missing event function!");
assert(type(onshow) == "function",
"Frame creation missing onshow function!");
assert(type(update) == "function",
"Frame creation missing update function!");
assert(type(event) == "function",
"Frame creation missing event function!");
assert(type(onshow) == "function",
"Frame creation missing onshow function!");
+ if type(attributes) ~= "table" then
+ attributes = {};
+ end
local f = CreateFrame(
"Button",
local f = CreateFrame(
"Button",
@@
-42,15
+44,20
@@
function addon.NewRaidFrame(parent, width, height, unit, attributes,
f:Hide(); -- hide frame to have an initial frame:OnShow call
f:SetWidth(width);
f:SetHeight(height);
f:Hide(); -- hide frame to have an initial frame:OnShow call
f:SetWidth(width);
f:SetHeight(height);
+ f.barwidth = width - 2; -- 1px padding on both sides
f:SetAttribute("unit", unit);
f.unit = unit;
f.displayed = unit;
f.vehicle = unit == "player" and "vehicle" or format("%spet", unit);
f.prev = {} -- values stored from previous update
f:SetAttribute("unit", unit);
f.unit = unit;
f.displayed = unit;
f.vehicle = unit == "player" and "vehicle" or format("%spet", unit);
f.prev = {} -- values stored from previous update
+ f.alert = {}; -- alerting auras
+ f.heal = {}; -- high healing auras
+ f.tankcd = {}; -- tank CD auras
+ f.stacks = {}; -- stacking aura tracking
-- set up periodic updates
updaters[f] = function()
if f.updating then
-- set up periodic updates
updaters[f] = function()
if f.updating then
- CTimerAfter(0.
25
, updaters[f]);
+ CTimerAfter(0.
1
, updaters[f]);
return update(f)
end
end
return update(f)
end
end
@@
-63,6
+70,10
@@
function addon.NewRaidFrame(parent, width, height, unit, attributes,
f:SetScript("OnHide", function()
f:UnregisterAllEvents();
f.updating = false;
f:SetScript("OnHide", function()
f:UnregisterAllEvents();
f.updating = false;
+ if f.guid then
+ guids[f.guid] = nil;
+ f.guid = nil;
+ end
end);
f:SetScript("OnEvent", event);
f:SetScript("OnEnter", showTooltip);
end);
f:SetScript("OnEvent", event);
f:SetScript("OnEnter", showTooltip);
@@
-128,10
+139,19
@@
function addon.NewRaidFrame(parent, width, height, unit, attributes,
f.text:SetPoint("CENTER", f, "CENTER", 0, -1);
f.text:SetFont(STANDARD_TEXT_FONT, 13);
f.text:Hide();
f.text:SetPoint("CENTER", f, "CENTER", 0, -1);
f.text:SetFont(STANDARD_TEXT_FONT, 13);
f.text:Hide();
+ f.stack = f:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall");
+ f.stack:SetPoint("BOTTOMLEFT", f.background, "BOTTOMLEFT");
+ f.stack:Hide();
f.ready = f:CreateTexture(nil, "OVERLAY");
f.ready:SetPoint("TOPLEFT", f, "BOTTOMLEFT", 1, 15);
f.ready:SetPoint("BOTTOMRIGHT", f, "BOTTOMLEFT", 15, 1);
f.ready:Hide();
f.ready = f:CreateTexture(nil, "OVERLAY");
f.ready:SetPoint("TOPLEFT", f, "BOTTOMLEFT", 1, 15);
f.ready:SetPoint("BOTTOMRIGHT", f, "BOTTOMLEFT", 15, 1);
f.ready:Hide();
+ f.defensive = f:CreateTexture(nil, "OVERLAY");
+ f.defensive:SetPoint("TOPLEFT", f.background, "TOPLEFT", 1, -1);
+ f.defensive:SetWidth(6);
+ f.defensive:SetHeight(6);
+ f.defensive:SetColorTexture(1, 0.3, 0);
+ f.defensive:Hide();
f.targeticon = f:CreateTexture(nil, "OVERLAY");
f.targeticon:SetPoint("CENTER", f, "TOP", 0, -1);
f.targeticon:SetWidth(12);
f.targeticon = f:CreateTexture(nil, "OVERLAY");
f.targeticon:SetPoint("CENTER", f, "TOP", 0, -1);
f.targeticon:SetWidth(12);