local UnitDebuff, UnitIsCharmed = UnitDebuff, UnitIsCharmed;
local UnitPower, UnitPowerMax, UnitPowerType = UnitPower, UnitPowerMax, UnitPowerType;
local UnitHealth, UnitHealthMax = UnitHealth, UnitHealthMax;
+local UnitIsAFK, UnitIsDND = UnitIsAFK, UnitIsDND;
local UnitGetIncomingHeals, UnitGetTotalAbsorbs = UnitGetIncomingHeals, UnitGetTotalAbsorbs;
local UnitThreatSituation, GetThreatStatusColor = UnitThreatSituation, GetThreatStatusColor;
local UnitIsDeadOrGhost, UnitIsConnected = UnitIsDeadOrGhost, UnitIsConnected;
OmaRFEvents = M;
function M.RegisterEvents(frame)
-- events are taken from FrameXML/CompactUnitFrame.lua
- -- TODO raid marker support,
- -- player flags support (/afk, /dnd)
+ -- TODO raid marker support
local displayed = frame.unit ~= frame.displayed and frame.displayed or nil;
frame:RegisterUnitEvent("UNIT_HEALTH", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_CONNECTION", frame.unit, displayed);
frame:RegisterUnitEvent("INCOMING_RESURRECT_CHANGED", frame.unit, displayed);
+ frame:RegisterUnitEvent("PLAYER_FLAGS_CHANGED", frame.unit, displayed);
end
local registerEvents = M.RegisterEvents;
elseif not UnitIsConnected(unit) then
frame.text:SetText("DC");
frame.text:Show();
+ elseif UnitIsAFK(unit) then
+ frame.text:SetText("afk");
+ frame.text:Show();
+ elseif UnitIsDND(unit) and healthLost == 0 then
+ frame.text:SetText("dnd");
+ frame.text:Show();
elseif healthLost > 0 then
if healthLost > 1200000000 then -- 1.2B
frame.text:SetFormattedText("-%.1fB", healthLost / 1000000000);
};
eventFuncs["UNIT_HEALTH_FREQUENT"] = eventFuncs["UNIT_HEALTH"];
eventFuncs["PARTY_MEMBER_DISABLE"] = eventFuncs["PARTY_MEMBER_ENABLE"];
+eventFuncs["PLAYER_FLAGS_CHANGED"] = eventFuncs["UNIT_CONNECTION"];
eventFuncs["READY_CHECK_CONFIRM"] = eventFuncs["READY_CHECK"];
eventFuncs["READY_CHECK_FINISHED"] = eventFuncs["READY_CHECK"];
eventFuncs["UNIT_ENTERED_VEHICLE"] = eventFuncs["UPDATE_ALL_BARS"];
CompactRaidFrameContainer:HookScript("OnShow", hide);
hooksecurefunc("CompactRaidFrameManager_UpdateOptionsFlowContainer", hideBlizzardRaidButton);
hideBlizzardRaidButton();
+
+ -- hide focus frame
+ for _, frame in pairs({FocusFrame, FocusFrameToT}) do
+ frame:UnregisterAllEvents();
+ frame.healthbar:UnregisterAllEvents();
+ frame.manabar:UnregisterAllEvents();
+ if frame.spellbar then frame.spellbar:UnregisterAllEvents() end
+ if frame.powerBarAlt then frame.powerBarAlt:UnregisterAllEvents() end
+ frame:Hide();
+ end
end
CFrame:RegisterEvent("ADDON_LOADED");