git
/
wowui.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
60bc5ec - Add basic player and target frames in separate addon
[wowui.git]
/
OmaRF
/
RaidFrame.lua
diff --git
a/OmaRF/RaidFrame.lua
b/OmaRF/RaidFrame.lua
index
078280d
..
461d4dc
100644
(file)
--- a/
OmaRF/RaidFrame.lua
+++ b/
OmaRF/RaidFrame.lua
@@
-6,6
+6,8
@@
local UnitHealthMax, UnitPowerMax = UnitHealthMax, UnitPowerMax;
local UnitInRange = UnitInRange;
local CreateFrame, RegisterStateDriver, RegisterUnitWatch = CreateFrame, RegisterStateDriver, RegisterUnitWatch;
local STANDARD_TEXT_FONT = STANDARD_TEXT_FONT;
local UnitInRange = UnitInRange;
local CreateFrame, RegisterStateDriver, RegisterUnitWatch = CreateFrame, RegisterStateDriver, RegisterUnitWatch;
local STANDARD_TEXT_FONT = STANDARD_TEXT_FONT;
+local GameTooltip = nil;
+local GameTooltip_SetDefaultAnchor = nil;
local registerEvents = OmaRFEvents.RegisterEvents;
local unitEvent = OmaRFEvents.UnitEvent;
local registerEvents = OmaRFEvents.RegisterEvents;
local unitEvent = OmaRFEvents.UnitEvent;
@@
-57,7
+59,7
@@
local function setupIndicators(frame)
if i == 1 then
frame.major[i]:SetPoint("TOPLEFT", frame.major, "TOPLEFT");
else
if i == 1 then
frame.major[i]:SetPoint("TOPLEFT", frame.major, "TOPLEFT");
else
- frame.major[i]:SetPoint("TOPLEFT", frame.major[i-1], "TOP
LEF
T");
+ frame.major[i]:SetPoint("TOPLEFT", frame.major[i-1], "TOP
RIGH
T");
end
frame.major[i]:SetWidth(indSize*2);
frame.major[i]:SetHeight(indSize*2);
end
frame.major[i]:SetWidth(indSize*2);
frame.major[i]:SetHeight(indSize*2);
@@
-90,6
+92,10
@@
local function frameShow(frame)
frame:RegisterEvent("UNIT_PET");
frame:RegisterEvent("PLAYER_ROLES_ASSIGNED");
frame:RegisterEvent("GROUP_ROSTER_UPDATE");
frame:RegisterEvent("UNIT_PET");
frame:RegisterEvent("PLAYER_ROLES_ASSIGNED");
frame:RegisterEvent("GROUP_ROSTER_UPDATE");
+ frame:RegisterEvent("PLAYER_ENTERING_WORLD");
+ frame:RegisterEvent("READY_CHECK");
+ frame:RegisterEvent("READY_CHECK_CONFIRM");
+ frame:RegisterEvent("READY_CHECK_FINISHED");
registerEvents(frame);
frame:SetScript("OnUpdate", unitUpdate);
unitEvent(frame, "UPDATE_ALL_BARS", frame.displayed);
registerEvents(frame);
frame:SetScript("OnUpdate", unitUpdate);
unitEvent(frame, "UPDATE_ALL_BARS", frame.displayed);
@@
-100,6
+106,15
@@
local function frameHide(frame)
frame:SetScript("OnUpdate", nil);
end
frame:SetScript("OnUpdate", nil);
end
+local function showTooltip(frame)
+ GameTooltip_SetDefaultAnchor(GameTooltip, PlayerFrame);
+ GameTooltip:SetUnit(frame:GetAttribute("unit"));
+end
+
+local function hideTooltip(frame)
+ GameTooltip:FadeOut();
+end
+
local function setupFrame(frame, secure, unit)
secure:SetAttribute("unit", unit);
frame:SetAttribute("unit", unit);
local function setupFrame(frame, secure, unit)
secure:SetAttribute("unit", unit);
frame:SetAttribute("unit", unit);
@@
-180,12
+195,21
@@
local function setupFrame(frame, secure, unit)
frame.rez:SetPoint("BOTTOMRIGHT", frame.background, "CENTER", 12, -12);
frame.rez:SetTexture("Interface\\RaidFrame\\Raid-Icon-Rez");
frame.rez:Hide();
frame.rez:SetPoint("BOTTOMRIGHT", frame.background, "CENTER", 12, -12);
frame.rez:SetTexture("Interface\\RaidFrame\\Raid-Icon-Rez");
frame.rez:Hide();
+ frame.ready = frame:CreateTexture(nil, "OVERLAY");
+ frame.ready:SetPoint("TOPLEFT", frame.background, "BOTTOMLEFT", 0, 12);
+ frame.ready:SetPoint("BOTTOMRIGHT", frame.background, "BOTTOMLEFT", 12, 0);
+ frame.ready:Hide();
-- set up indicators
setupIndicators(frame);
-- set scripts
frame:SetScript("OnShow", frameShow);
frame:SetScript("OnHide", frameHide);
frame:SetScript("OnEvent", unitEvent);
-- set up indicators
setupIndicators(frame);
-- set scripts
frame:SetScript("OnShow", frameShow);
frame:SetScript("OnHide", frameHide);
frame:SetScript("OnEvent", unitEvent);
+ -- let other addons hook these to anchor tooltip elsewhere
+ GameTooltip = _G["GameTooltip"];
+ GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
+ secure:SetScript("OnEnter", showTooltip);
+ secure:SetScript("OnLeave", hideTooltip);
-- set attributes
secure:RegisterForClicks("AnyDown");
for attr, val in pairs(attributes) do
-- set attributes
secure:RegisterForClicks("AnyDown");
for attr, val in pairs(attributes) do