d093a7f - Remove heal prediction from regular unit frames
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Fri, 23 Feb 2018 15:14:19 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Fri, 23 Feb 2018 15:14:19 +0000
OmaUF/Events.lua
OmaUF/PetFrame.lua
OmaUF/PlayerFrame.lua
OmaUF/TargetFrame.lua

index 862e7df..8121ae6 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
@@ -352,9 +337,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 +417,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
index 4c2efef..a4d8fa5 100644 (file)
@@ -14,7 +14,6 @@ local bgColor = Settings.BgColor;
 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;
index 76d5d6e..f6f8221 100644 (file)
@@ -16,7 +16,6 @@ local bgColor = Settings.BgColor;
 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;
@@ -130,11 +129,6 @@ function OmaUnitFrames.InitializePlayer(parent)
     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");
index d85755c..9192038 100644 (file)
@@ -17,7 +17,6 @@ local bgColor = Settings.BgColor;
 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;
@@ -116,11 +115,6 @@ function OmaUnitFrames.InitializeTarget(parent)
     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");