local GetRaidTargetIndex, SetRaidTargetIconTexture = GetRaidTargetIndex, SetRaidTargetIconTexture;
local RAID_CLASS_COLORS = RAID_CLASS_COLORS;
local GetRaidTargetIndex, SetRaidTargetIconTexture = GetRaidTargetIndex, SetRaidTargetIconTexture;
local RAID_CLASS_COLORS = RAID_CLASS_COLORS;
frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_MAXHEALTH", frame.unit, displayed);
if frame.mana then
frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_MAXHEALTH", frame.unit, displayed);
if frame.mana then
frame:RegisterUnitEvent("UNIT_MAXPOWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_MAXPOWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", frame.unit, displayed);
local function updateMaxHealth(frame, unit)
frame.health.max = UnitHealthMax(unit);
end
local function updateMaxHealth(frame, unit)
frame.health.max = UnitHealthMax(unit);
end
local function updateHealth(frame, unit)
local current, max = UnitHealth(unit), frame.health.max;
local function updateHealth(frame, unit)
local current, max = UnitHealth(unit), frame.health.max;
local function updateHealthText(frame, unit)
if UnitIsDeadOrGhost(unit) then
local function updateHealthText(frame, unit)
if UnitIsDeadOrGhost(unit) then
local function updateMaxPower(frame, unit)
frame.mana.max = UnitPowerMax(unit);
end
local function updateMaxPower(frame, unit)
frame.mana.max = UnitPowerMax(unit);
end
local function updatePower(frame, unit)
local current, max = UnitPower(unit), frame.mana.max;
local function updatePower(frame, unit)
local current, max = UnitPower(unit), frame.mana.max;
local function updatePowerText(frame, unit)
local current, max = UnitPower(unit), frame.mana.max;
local function updatePowerText(frame, unit)
local current, max = UnitPower(unit), frame.mana.max;
local function updatePowerColor(frame, unit)
frame.mana:SetVertexColor(unpack(powerColors[UnitPowerType(unit)]));
end
local function updatePowerColor(frame, unit)
frame.mana:SetVertexColor(unpack(powerColors[UnitPowerType(unit)]));
end
local function updateName(frame, unit)
local name = UnitName(unit);
if not name then return end
frame.name:SetText(ssub(name, 1, frame.name.count));
end
local function updateName(frame, unit)
local name = UnitName(unit);
if not name then return end
frame.name:SetText(ssub(name, 1, frame.name.count));
end
local function updateShield(frame, unit)
local shield = UnitGetTotalAbsorbs(unit) or 0;
local function updateShield(frame, unit)
local shield = UnitGetTotalAbsorbs(unit) or 0;
local function updateAggro(frame, unit)
local status = UnitThreatSituation(unit);
local function updateAggro(frame, unit)
local status = UnitThreatSituation(unit);
local function updateStatus(frame, unit)
-- coords from FrameXML/PlayerFrame.lua
local function updateStatus(frame, unit)
-- coords from FrameXML/PlayerFrame.lua
local function updateLeaderIcon(frame, unit)
if UnitIsGroupLeader(frame.unit) then
local function updateLeaderIcon(frame, unit)
if UnitIsGroupLeader(frame.unit) then
local function updateHealthColor(frame, unit)
if not UnitPlayerControlled(unit) and UnitIsTapDenied(unit) then
local function updateHealthColor(frame, unit)
if not UnitPlayerControlled(unit) and UnitIsTapDenied(unit) then
local function updateRaidMarker(frame, unit)
local index = GetRaidTargetIndex(unit);
local function updateRaidMarker(frame, unit)
local index = GetRaidTargetIndex(unit);
updateHealthText(frame, frame.displayed);
if frame.shield then updateShield(frame, frame.displayed) end
end,
updateHealthText(frame, frame.displayed);
if frame.shield then updateShield(frame, frame.displayed) end
end,
updatePower(frame, frame.displayed);
updatePowerText(frame, frame.displayed);
end,
updatePower(frame, frame.displayed);
updatePowerText(frame, frame.displayed);
end,
eventFuncs["UNIT_TARGETABLE_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
function M.UnitEvent(self, event, arg1)
eventFuncs["UNIT_TARGETABLE_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
function M.UnitEvent(self, event, arg1)