mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 14:00:48 +00:00
unitframes: disable animation on unit switch
This commit is contained in:
+8
-7
@@ -194,18 +194,19 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
|
|||||||
local hpReal = this.cache.hp
|
local hpReal = this.cache.hp
|
||||||
local hpDiff = abs(hpReal - hpDisplay)
|
local hpDiff = abs(hpReal - hpDisplay)
|
||||||
|
|
||||||
local powerDisplay = this.power.bar:GetValue()
|
|
||||||
local powerReal = this.cache.power
|
|
||||||
local powerDiff = abs(powerReal - powerDisplay)
|
|
||||||
|
|
||||||
if this.config.invert_healthbar == "1" then
|
if this.config.invert_healthbar == "1" then
|
||||||
hpDisplay = this.hp.bar:GetValue()
|
hpDisplay = this.hp.bar:GetValue()
|
||||||
hpReal = this.cache.hpmax - this.cache.hp
|
hpReal = this.cache.hpmax - this.cache.hp
|
||||||
hpDiff = abs(hpReal - hpDisplay)
|
hpDiff = abs(hpReal - hpDisplay)
|
||||||
end
|
end
|
||||||
|
|
||||||
if this.label == "target" or this.label == "targettarget" then
|
local powerDisplay = this.power.bar:GetValue()
|
||||||
-- Instant
|
local powerReal = this.cache.power
|
||||||
|
local powerDiff = abs(powerReal - powerDisplay)
|
||||||
|
|
||||||
|
if UnitName(this.label .. this.id) ~= this.lastUnit then
|
||||||
|
-- No Animations for new Units
|
||||||
|
this.lastUnit = UnitName(this.label .. this.id)
|
||||||
this.hp.bar:SetValue(hpReal)
|
this.hp.bar:SetValue(hpReal)
|
||||||
this.power.bar:SetValue(powerReal)
|
this.power.bar:SetValue(powerReal)
|
||||||
else
|
else
|
||||||
@@ -223,7 +224,7 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
|
|||||||
elseif powerDisplay > powerReal then
|
elseif powerDisplay > powerReal then
|
||||||
this.power.bar:SetValue(powerDisplay - ceil(powerDiff / pfUI_config.unitframes.animation_speed))
|
this.power.bar:SetValue(powerDisplay - ceil(powerDiff / pfUI_config.unitframes.animation_speed))
|
||||||
else
|
else
|
||||||
this.power.bar:SetValue(powerReal)
|
this.power.bar:SetValue(this.cache.power)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user