Skip to content

Commit b1bd235

Browse files
committed
more power tags
1 parent 16eaab3 commit b1bd235

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Core/Config/TagsDatabase.lua

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,30 @@ oUF.Tags.Methods["curpp:abbr"] = function(unit)
275275
end
276276
end
277277

278+
oUF.Tags.Methods["curpp:manapercent"] = function(unit)
279+
if not unit or not UnitExists(unit) then return "" end
280+
local unitPower = UnitPower(unit)
281+
local unitPowerType = UnitPowerType(unit)
282+
if unitPowerType == Enum.PowerType.Mana and unitPower then
283+
local powerPercent = UnitPowerPercent(unit, Enum.PowerType.Mana, true, CurveConstants.ScaleTo100)
284+
return string.format("%.f", powerPercent)
285+
else
286+
return string.format("%s", unitPower)
287+
end
288+
end
289+
290+
oUF.Tags.Methods["curpp:manapercent:abbr"] = function(unit)
291+
if not unit or not UnitExists(unit) then return "" end
292+
local unitPower = UnitPower(unit)
293+
local unitPowerType = UnitPowerType(unit)
294+
if unitPowerType == Enum.PowerType.Mana and unitPower then
295+
local powerPercent = UnitPowerPercent(unit, Enum.PowerType.Mana, true, CurveConstants.ScaleTo100)
296+
return string.format("%.f", powerPercent)
297+
else
298+
return string.format("%s", AbbreviateValue(unitPower))
299+
end
300+
end
301+
278302
oUF.Tags.Methods["maxpp:abbr"] = function(unit)
279303
if not unit or not UnitExists(unit) then return "" end
280304
local unitPowerMax = UnitPowerMax(unit)
@@ -386,13 +410,17 @@ local PowerTags = {
386410
["maxpp:colour"] = "Maximum Power with Colour",
387411
["maxpp:abbr:colour"] = "Maximum Power with Abbreviation and Colour",
388412
["missingpp"] = "Missing Power",
413+
["curpp:manapercent"] = "Current Power but Mana as Percentage",
414+
["curpp:manapercent:abbr"] = "Current Power but Mana as Percentage with Abbreviation",
389415
},
390416
{
391417
"perpp",
392418
"curpp",
393419
"curpp:colour",
394420
"curpp:abbr",
395421
"curpp:abbr:colour",
422+
"curpp:manapercent",
423+
"curpp:manapercent:abbr",
396424
"maxpp",
397425
"maxpp:abbr",
398426
"maxpp:colour",

0 commit comments

Comments
 (0)