2d85b26 - Hide cast bar explicitly
[wowui.git] / OmaUF / Events.lua
index 862e7df..59b8592 100644 (file)
@@ -47,9 +47,6 @@ function M.RegisterUnitEvents(frame)
         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
@@ -146,18 +143,6 @@ local function updateName(frame, unit)
     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
@@ -266,6 +251,10 @@ local function updateStatus(frame, unit)
     end
 end
 
+local pvpIcons = {
+    Alliance = "Interface\\TARGETINGFRAME\\UI-PVP-Alliance",
+    Horde = "Interface\\TARGETINGFRAME\\UI-PVP-Horde"
+};
 local function updatePVP(frame, unit)
     if UnitIsPVPFreeForAll(unit) then
         frame.pvp:SetTexture("Interface\\TARGETINGFRAME\\UI-PVP-FFA");
@@ -281,7 +270,7 @@ local function updatePVP(frame, unit)
                     faction = "Horde";
                 end
             end
-            frame.pvp:SetTexture("Interface\\TARGETINGFRAME\\UI-PVP-"..faction);
+            frame.pvp:SetTexture(pvpIcons[faction]);
             frame.pvp:Show();
         else
             frame.pvp:Hide();
@@ -352,9 +341,6 @@ local eventFuncs = {
     ["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,
@@ -435,7 +421,6 @@ local eventFuncs = {
         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