git
/
wowui.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b1aa164
)
cd9dfa5 - Move frame.dead to updateText as it sometimes was missed
author
Aleksi Blinnikka <aleksi.blinnikka@gmail.com>
Mon, 26 Mar 2018 08:12:16 +0000
committer
Aleksi Blinnikka <aleksi.blinnikka@gmail.com>
Mon, 26 Mar 2018 08:12:16 +0000
OmaRF/Events.lua
patch
|
blob
|
history
diff --git
a/OmaRF/Events.lua
b/OmaRF/Events.lua
index
957e82d
..
94dd14f
100644
(file)
--- a/
OmaRF/Events.lua
+++ b/
OmaRF/Events.lua
@@
-64,6
+64,7
@@
local registerUnitEvents = M.RegisterUnitEvents;
local function updateText(frame, unit)
if UnitIsDeadOrGhost(unit) then
local function updateText(frame, unit)
if UnitIsDeadOrGhost(unit) then
+ frame.dead = true;
frame.text:SetText("Dead");
frame.text:Show();
elseif not UnitIsConnected(unit) then
frame.text:SetText("Dead");
frame.text:Show();
elseif not UnitIsConnected(unit) then
@@
-92,14
+93,16
@@
local function updateHealth(frame, unit)
-- somehow current health has gone over the maximum (missed maxhealth event possibly)
-- just put health bar full and update max health for next event
frame.health:SetWidth(width);
-- somehow current health has gone over the maximum (missed maxhealth event possibly)
-- just put health bar full and update max health for next event
frame.health:SetWidth(width);
+ frame.health.width = width;
updateMaxHealth(frame, unit);
frame.health:Show();
elseif current <= 0 or UnitIsDeadOrGhost(unit) then
updateMaxHealth(frame, unit);
frame.health:Show();
elseif current <= 0 or UnitIsDeadOrGhost(unit) then
- frame.dead = true;
frame.health:Hide();
updateText(frame, unit); -- update death
else
frame.health:Hide();
updateText(frame, unit); -- update death
else
- frame.health:SetWidth(current/max*width);
+ local w = current/max*width;
+ frame.health:SetWidth(w);
+ frame.health.width = w;
frame.health:Show();
end
frame.health:Show();
end
@@
-129,10
+132,9
@@
M.UpdateName = updateName;
local function updateHealPred(frame, unit)
local incoming = UnitGetIncomingHeals(unit) or 0;
if incoming > 0 then
local function updateHealPred(frame, unit)
local incoming = UnitGetIncomingHeals(unit) or 0;
if incoming > 0 then
- -- always at least 1 pixel space for heal prediction
- local space = width - frame.health:GetWidth() + 1;
incoming = (incoming / frame.health.max) * width;
incoming = (incoming / frame.health.max) * width;
- frame.healpred:SetWidth(min(space, incoming));
+ -- always at least 1 pixel space for heal prediction
+ frame.healpred:SetWidth(min(width - frame.health.width + 1, incoming));
frame.healpred:Show();
else
frame.healpred:Hide();
frame.healpred:Show();
else
frame.healpred:Hide();
@@
-143,7
+145,7
@@
M.UpdateHealPred = updateHealPred;
local function updateShield(frame, unit)
local shield = UnitGetTotalAbsorbs(unit) or 0;
if shield > 0 then
local function updateShield(frame, unit)
local shield = UnitGetTotalAbsorbs(unit) or 0;
if shield > 0 then
- local space = width - frame.health
:GetWidth()
;
+ local space = width - frame.health
.width
;
shield = (shield / frame.health.max) * width;
if space == 0 then
frame.shield:Hide();
shield = (shield / frame.health.max) * width;
if space == 0 then
frame.shield:Hide();
@@
-167,9
+169,8
@@
M.UpdateShield = updateShield;
local function updateHealAbsorb(frame, unit)
local absorb = UnitGetTotalHealAbsorbs(unit) or 0;
if absorb > 0 then
local function updateHealAbsorb(frame, unit)
local absorb = UnitGetTotalHealAbsorbs(unit) or 0;
if absorb > 0 then
- local space = frame.health:GetWidth();
absorb = (absorb / frame.health.max) * width;
absorb = (absorb / frame.health.max) * width;
- frame.healabsorb:SetWidth(min(
space
, absorb));
+ frame.healabsorb:SetWidth(min(
frame.health.width
, absorb));
frame.healabsorb:Show();
else
frame.healabsorb:Hide();
frame.healabsorb:Show();
else
frame.healabsorb:Hide();
@@
-283,10
+284,6
@@
local eventFuncs = {
updateShield(frame, frame.displayed);
updateHealAbsorb(frame, frame.displayed);
-- no heal prediction update, that doesn't overflow too much
updateShield(frame, frame.displayed);
updateHealAbsorb(frame, frame.displayed);
-- no heal prediction update, that doesn't overflow too much
- -- raid marker update here, if needed
- -- because marker is removed when unit dies
- -- without a RAID_TARGET_UPDATE event
- --updateRaidMarker(frame, frame.unit);
end,
["UNIT_AURA"] = function(frame)
updateAuras(frame, frame.displayed);
end,
["UNIT_AURA"] = function(frame)
updateAuras(frame, frame.displayed);