From 4f903923db6e4ee1d465bc0cbed094d456843387 Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 4 Jul 2017 23:27:13 +0200 Subject: [PATCH] unitframes: add min/max display --- api/unitframes.lua | 8 ++++++++ modules/gui.lua | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 08796864..3fb9ca30 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1293,6 +1293,12 @@ function pfUI.uf:GetStatusValue(unit, pos) else return unit:GetColor("health") .. pfUI.api.Abbreviate(UnitHealth(unitstr)) end + elseif config == "healthminmax" then + local hp, hpmax = UnitHealth(unitstr), UnitHealthMax(unitstr) + if unit.label == "target" and MobHealth3 then + hp, hpmax = MobHealth3:GetUnitHealth(unit.label) + end + return unit:GetColor("health") .. pfUI.api.Abbreviate(hp) .. "/" .. pfUI.api.Abbreviate(hpmax) -- mana/power/focus elseif config == "power" then @@ -1315,6 +1321,8 @@ function pfUI.uf:GetStatusValue(unit, pos) else return unit:GetColor("power") .. pfUI.api.Abbreviate(UnitMana(unitstr)) end + elseif config == "powerminmax" then + return unit:GetColor("power") .. pfUI.api.Abbreviate(UnitMana(unitstr)) .. "/" .. pfUI.api.Abbreviate(UnitManaMax(unitstr)) else return "" end diff --git a/modules/gui.lua b/modules/gui.lua index 04f19d36..f154ab71 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -615,11 +615,13 @@ pfUI:RegisterModule("gui", function () "healthmax:" .. T["Health - Max"], "healthperc:" .. T["Health - Percentage"], "healthmiss:" .. T["Health - Missing"], + "healthminmax:" .. T["Health - Min/Max"], "powerdyn:" .. T["Mana - Auto"], "power:" .. T["Mana - Current"], "powermax:" .. T["Mana - Max"], "powerperc:" .. T["Mana - Percentage"], - "powermiss:" .. T["Mana - Missing"] + "powermiss:" .. T["Mana - Missing"], + "powerminmax:" .. T["Mana - Min/Max"], } local dropdown_panel_values = {