frame:RegisterUnitEvent("UNIT_POWER_BAR_SHOW", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_POWER_BAR_HIDE", frame.unit, displayed);
end
- if frame.healpred then
- frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", frame.unit, displayed);
- end
if frame.shield then
frame:RegisterUnitEvent("UNIT_ABSORB_AMOUNT_CHANGED", frame.unit, displayed);
end
frame.name:SetText(ssub(name, 1, frame.name.count));
end
-local function updateHealPred(frame, unit)
- local incoming = UnitGetIncomingHeals(unit) or 0;
- if incoming > 0 then
- local space = frame.width - frame.health:GetWidth() + 1;
- incoming = (incoming / frame.health.max) * frame.width;
- frame.healpred:SetWidth(min(space, incoming));
- frame.healpred:Show();
- else
- frame.healpred:Hide();
- end
-end
-
local function updateShield(frame, unit)
local shield = UnitGetTotalAbsorbs(unit) or 0;
if shield > 0 then
["UNIT_AURA"] = function(frame)
updateAuras(frame, frame.displayed);
end,
- ["UNIT_HEAL_PREDICTION"] = function(frame)
- updateHealPred(frame, frame.displayed);
- end,
["UNIT_ABSORB_AMOUNT_CHANGED"] = function(frame)
updateShield(frame, frame.displayed);
end,
end
if frame.auras then updateAuras(frame, frame.displayed) end
if frame.shield then updateShield(frame, frame.displayed) end
- if frame.healpred then updateHealPred(frame, frame.displayed) end
if frame.healabsorb then updateHealAbsorb(frame, frame.displayed) end
if frame.name then updateName(frame, frame.displayed) end
if frame.level then updateLevelText(frame, frame.unit) end
local healthColor = Settings.HealthColor;
local shieldColor = Settings.ShieldColor;
local shieldhlColor = Settings.ShieldhlColor;
-local healpredColor = Settings.HealpredColor;
local healabsorbColor = Settings.HealabsorbColor;
local width, height = Settings.Pet.Width, Settings.Pet.Height;
local anchorX, anchorY = Settings.Pet.AnchorX, Settings.Pet.AnchorY;
local healthColor = Settings.HealthColor;
local shieldColor = Settings.ShieldColor;
local shieldhlColor = Settings.ShieldhlColor;
-local healpredColor = Settings.HealpredColor;
local healabsorbColor = Settings.HealabsorbColor;
local width, height = Settings.Player.Width, Settings.Player.Height;
local anchorX, anchorY = Settings.Player.AnchorX, Settings.Player.AnchorY;
frame.shieldhl:SetPoint("BOTTOMRIGHT", frame.healthback, "BOTTOMRIGHT", 1, 0);
frame.shieldhl:SetColorTexture(unpack(shieldhlColor));
frame.shieldhl:Hide();
- frame.healpred = frame:CreateTexture(nil, "ARTWORK");
- frame.healpred:SetPoint("TOPLEFT", frame.health, "TOPRIGHT");
- frame.healpred:SetPoint("BOTTOMLEFT", frame.health, "BOTTOMRIGHT");
- frame.healpred:SetColorTexture(unpack(healpredColor));
- frame.healpred:Hide();
frame.healabsorb = frame:CreateTexture(nil, "ARTWORK");
frame.healabsorb:SetPoint("TOPRIGHT", frame.health, "TOPRIGHT");
frame.healabsorb:SetPoint("BOTTOMRIGHT", frame.health, "BOTTOMRIGHT");
local healthColor = Settings.HealthColor;
local shieldColor = Settings.ShieldColor;
local shieldhlColor = Settings.ShieldhlColor;
-local healpredColor = Settings.HealpredColor;
local healabsorbColor = Settings.HealabsorbColor;
local width, height = Settings.Target.Width, Settings.Target.Height;
local anchorX, anchorY = Settings.Target.AnchorX, Settings.Target.AnchorY;
frame.shieldhl:SetPoint("BOTTOMRIGHT", frame.healthback, "BOTTOMRIGHT", 1, 0);
frame.shieldhl:SetColorTexture(unpack(shieldhlColor));
frame.shieldhl:Hide();
- frame.healpred = frame:CreateTexture(nil, "ARTWORK");
- frame.healpred:SetPoint("TOPLEFT", frame.health, "TOPRIGHT");
- frame.healpred:SetPoint("BOTTOMLEFT", frame.health, "BOTTOMRIGHT");
- frame.healpred:SetColorTexture(unpack(healpredColor));
- frame.healpred:Hide();
frame.healabsorb = frame:CreateTexture(nil, "ARTWORK");
frame.healabsorb:SetPoint("TOPRIGHT", frame.health, "TOPRIGHT");
frame.healabsorb:SetPoint("BOTTOMRIGHT", frame.health, "BOTTOMRIGHT");