mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-22 20:10:50 +00:00
unitframes: add MobInfo2 support
This commit is contained in:
@@ -1427,12 +1427,18 @@ function pfUI.uf:GetStatusValue(unit, pos)
|
|||||||
if unit.label == "target" and MobHealth3 then
|
if unit.label == "target" and MobHealth3 then
|
||||||
local hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
local hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
||||||
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp)
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp)
|
||||||
|
elseif unit.label == "target" and MobHealthFrame and MobHealth_GetTargetCurHP() then
|
||||||
|
local hp = MobHealth_GetTargetCurHP()
|
||||||
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp)
|
||||||
end
|
end
|
||||||
return unit:GetColor("health") .. pfUI.api.Abbreviate(UnitHealth(unitstr))
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(UnitHealth(unitstr))
|
||||||
elseif config == "healthmax" then
|
elseif config == "healthmax" then
|
||||||
if unit.label == "target" and MobHealth3 then
|
if unit.label == "target" and MobHealth3 then
|
||||||
local hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
local hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
||||||
return unit:GetColor("health") .. pfUI.api.Abbreviate(hpmax)
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(hpmax)
|
||||||
|
elseif unit.label == "target" and MobHealthFrame and MobHealth_GetTargetMaxHP() then
|
||||||
|
local hpmax = MobHealth_GetTargetMaxHP()
|
||||||
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(hpmax)
|
||||||
end
|
end
|
||||||
return unit:GetColor("health") .. pfUI.api.Abbreviate(UnitHealthMax(unitstr))
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(UnitHealthMax(unitstr))
|
||||||
elseif config == "healthperc" then
|
elseif config == "healthperc" then
|
||||||
@@ -1449,12 +1455,18 @@ function pfUI.uf:GetStatusValue(unit, pos)
|
|||||||
if unit.label == "target" and MobHealth3 then
|
if unit.label == "target" and MobHealth3 then
|
||||||
local hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
local hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
||||||
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp) .. " - " .. ceil(hp / hpmax * 100) .. "%"
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp) .. " - " .. ceil(hp / hpmax * 100) .. "%"
|
||||||
|
elseif unit.label == "target" and MobHealthFrame and MobHealth_GetTargetCurHP() then
|
||||||
|
local hp, hpmax = MobHealth_GetTargetCurHP(),MobHealth_GetTargetMaxHP()
|
||||||
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp) .. " - " .. ceil(hp / hpmax * 100) .. "%"
|
||||||
end
|
end
|
||||||
return unit:GetColor("health") .. pfUI.api.Abbreviate(UnitHealth(unitstr)) .. " - " .. ceil(UnitHealth(unitstr) / UnitHealthMax(unitstr) * 100) .. "%"
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(UnitHealth(unitstr)) .. " - " .. ceil(UnitHealth(unitstr) / UnitHealthMax(unitstr) * 100) .. "%"
|
||||||
else
|
else
|
||||||
if unit.label == "target" and MobHealth3 then
|
if unit.label == "target" and MobHealth3 then
|
||||||
local hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
local hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
||||||
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp)
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp)
|
||||||
|
elseif unit.label == "target" and MobHealthFrame and MobHealth_GetTargetCurHP() then
|
||||||
|
local hp = MobHealth_GetTargetCurHP()
|
||||||
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp)
|
||||||
end
|
end
|
||||||
return unit:GetColor("health") .. pfUI.api.Abbreviate(UnitHealth(unitstr))
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(UnitHealth(unitstr))
|
||||||
end
|
end
|
||||||
@@ -1462,6 +1474,8 @@ function pfUI.uf:GetStatusValue(unit, pos)
|
|||||||
local hp, hpmax = UnitHealth(unitstr), UnitHealthMax(unitstr)
|
local hp, hpmax = UnitHealth(unitstr), UnitHealthMax(unitstr)
|
||||||
if unit.label == "target" and MobHealth3 then
|
if unit.label == "target" and MobHealth3 then
|
||||||
hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
hp, hpmax = MobHealth3:GetUnitHealth(unit.label)
|
||||||
|
elseif unit.label == "target" and MobHealthFrame and MobHealth_GetTargetCurHP() then
|
||||||
|
local hp, hpmax = MobHealth_GetTargetCurHP(), MobHealth_GetTargetMaxHP()
|
||||||
end
|
end
|
||||||
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp) .. "/" .. pfUI.api.Abbreviate(hpmax)
|
return unit:GetColor("health") .. pfUI.api.Abbreviate(hp) .. "/" .. pfUI.api.Abbreviate(hpmax)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user