updateHealPred(frame, unit);
updateHealAbsorb(frame, unit);
updatePowerColor(frame, unit);
+ updateAggro(frame, unit);
updateName(frame, unit);
end,
};
-- events are taken from FrameXML/CompactUnitFrame.lua
-- TODO vehicle support, ready check support, raid marker support,
-- player flags support (/afk, /dnd)
+ -- TODO only update for vehicle events here
frame:RegisterEvent("PARTY_MEMBER_ENABLE");
frame:RegisterEvent("PARTY_MEMBER_DISABLE");
frame:RegisterUnitEvent("UNIT_HEALTH", unit);
if vis then
frame:Show();
frame:SetScript("OnUpdate", unitUpdate);
- frame:UnregisterAllEvents();
- registerEvents(frame, frame.unit);
+ --frame:UnregisterAllEvents();
+ --registerEvents(frame, frame.unit);
-- wait one frame to update data
-- create function if needed to pass arguments to unitEvent
local func = updaters[frame];
else
frame:Hide();
frame:SetScript("OnUpdate", nil);
- frame:UnregisterAllEvents();
+ --frame:UnregisterAllEvents();
end;
end
Frames.InitializeRaid(CFrame, raid, unitEvent);
end
+CFrame:RegisterEvent("ADDON_LOADED");
CFrame:RegisterEvent("PLAYER_LOGIN");
CFrame:RegisterEvent("PLAYER_ENTERING_WORLD");
CFrame:RegisterEvent("GROUP_ROSTER_UPDATE");
updateGroup();
elseif event == "PLAYER_LOGIN" then
initialize();
+ elseif event == "ADDON_LOADED" then
+ -- loaded
end
end);
local unpack, pairs, rawget = unpack, pairs, rawget;
local UnitHealthMax, UnitPowerMax = UnitHealthMax, UnitPowerMax;
local CreateFrame, RegisterStateDriver, RegisterUnitWatch = CreateFrame, RegisterStateDriver, RegisterUnitWatch;
-local SPELL_POWER_MANA = SPELL_POWER_MANA;
+local PowerTypeMana = Enum.PowerType.Mana;
+local PowerTypeRage = Enum.PowerType.Rage;
+local PowerTypeFocus = Enum.PowerType.Focus;
+local PowerTypeEnergy = Enum.PowerType.Energy;
+local PowerTypeRunic = Enum.PowerType.RunicPower;
local M = {};
OmaFrames = M;
M.OverlayColorCharm = {0.8, 0, 1, 0.5};
M.OverlayColorAlert = {1, 0, 0, 0.5};
M.PowerColors = {
- [SPELL_POWER_MANA] = {0, 0.5, 1},
- [SPELL_POWER_RAGE] = {1, 0, 0},
- [SPELL_POWER_FOCUS] = {1, 0.5, 0},
- [SPELL_POWER_ENERGY] = {1, 0.8, 0},
- [SPELL_POWER_RUNIC_POWER] = {0.9, 0, 0.1},
+ [PowerTypeMana] = {0, 0.5, 1},
+ [PowerTypeRage] = {1, 0, 0},
+ [PowerTypeFocus] = {1, 0.5, 0},
+ [PowerTypeEnergy] = {1, 0.8, 0},
+ [PowerTypeRunic] = {0.9, 0, 0.1},
};
-- watch to not remove mana entry
-setmetatable(M.PowerColors, {__index = function(t) return rawget(t, SPELL_POWER_MANA) end});
+setmetatable(M.PowerColors, {__index = function(t) return rawget(t, PowerTypeMana) end});
local positions = M.Positions;
local width, height = M.Width, M.Height;
frame.text:SetPoint("CENTER", frame.background, "CENTER", 0, -1);
frame.text:Hide();
setupIndicators(frame);
+ -- setup events
+ frame:RegisterEvent("PARTY_MEMBER_ENABLE");
+ frame:RegisterEvent("PARTY_MEMBER_DISABLE");
+ frame:RegisterUnitEvent("UNIT_HEALTH", unit);
+ frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", unit);
+ frame:RegisterUnitEvent("UNIT_MAXHEALTH", unit);
+ frame:RegisterUnitEvent("UNIT_POWER", unit);
+ frame:RegisterUnitEvent("UNIT_MAXPOWER", unit);
+ frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", unit);
+ frame:RegisterUnitEvent("UNIT_NAME_UPDATE", unit);
+ frame:RegisterUnitEvent("UNIT_AURA", unit);
+ frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", unit);
+ frame:RegisterUnitEvent("UNIT_ABSORB_AMOUNT_CHANGED", unit);
+ frame:RegisterUnitEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", unit);
+ frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", unit);
+ frame:RegisterUnitEvent("UNIT_CONNECTION", unit);
+ frame:RegisterUnitEvent("INCOMING_RESURRECT_CHANGED", unit);
-- set attributes
secure:RegisterForClicks("AnyDown");
secure:SetAttribute("type1", "spell"); -- left click