- if color then frame.name:SetVertexColor(color.r, color.g, color.b) end
-end
-addon.Events.UpdateName = updateName;
-
-local function updateHealPred(frame, unit)
- local incoming = UnitGetIncomingHeals(unit) or 0;
- if incoming > 0 then
- incoming = (incoming / frame.health.max) * width;
- -- always at least 1 pixel space for heal prediction
- frame.healpred:SetWidth(min(width - frame.health.width + 1, incoming));
- if not frame.healpred:IsShown() then frame.healpred:Show() end
- else
- if frame.healpred:IsShown() then frame.healpred:Hide() end
- end
-end
-addon.Events.UpdateHealPred = updateHealPred;
-
-local function updateShield(frame, unit)
- local shield = UnitGetTotalAbsorbs(unit) or 0;
- if shield > 0 then
- local space = width - frame.health.width;
- shield = (shield / frame.health.max) * width;
- if space == 0 then
- if frame.shield:IsShown() then frame.shield:Hide() end
- if not frame.shieldhl:IsShown() then frame.shieldhl:Show() end
- elseif space < shield then
- frame.shield:SetWidth(space);
- if not frame.shield:IsShown() then frame.shield:Show() end
- if not frame.shieldhl:IsShown() then frame.shieldhl:Show() end
+ if color then
+ if not frame.raid then
+ if UnitIsEnemy("player", unit) then
+ frame.health:SetVertexColor(1, 0, 0);
+ elseif UnitIsPlayer(unit) then
+ frame.health:SetVertexColor(color.r, color.g, color.b);
+ else
+ frame.health:SetVertexColor(0, 1, 0);
+ end