From 77f360219272a30e5623cfd8cb6c8f17e0ffb96b Mon Sep 17 00:00:00 2001 From: Anonomit Date: Wed, 23 Nov 2022 01:44:38 -0500 Subject: [PATCH] Fix negative stats showing as positive --- Init/Constants.lua | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/Init/Constants.lua b/Init/Constants.lua index f9f4591..c2a29a6 100644 --- a/Init/Constants.lua +++ b/Init/Constants.lua @@ -522,16 +522,13 @@ do end end if expacs[Addon.expansionLevel] then - local normalName = data[5] - -- local function ReorderByLocale() return GetLocaleStatFormat(reorderLocaleMode, normalName) end - -- local normalPattern = GetLocaleStatFormat(normalName) + local normalName = data[5] - local tooltipPattern = data[6] - local tooltipPattern2 = strGsub(strGsub(tooltipPattern, "%%c", "%%s"), "%%d", "%%s") + local tooltipPattern = data[6] + local tooltipPattern2 = Addon:ChainGsub(tooltipPattern, {"%%c", "%%d", "%%s"}) - local tooltipColor = data[7] - - local color = data[8] + local tooltipColor = data[7] + local color = data[8] Addon.statsInfo[stat] = {} local StatInfo = Addon.statsInfo[stat] @@ -543,23 +540,17 @@ do local reorderLocaleMode = isBaseStat and "%s%s" or "+%s" - - - - local normalNameReplacePattern = Addon:CoverSpecialCharacters(normalName) local normalFormPattern = GetLocaleStatFormat(isBaseStat and "%1$s%2$s" or "+%1$s", normalName) local normalFormCapture = strGsub(Addon:ReversePattern(GetLocaleStatFormat(isBaseStat and "%c%s" or "+%s", normalName)), "%$", "%%.?%0") local normalFormPattern2 = GetLocaleStatFormat(isBaseStat and "%s%s" or "+%s", normalName) - -- local aliasPattern = - local function ApplyMod(text, normalForm) local match1, match2 = strMatch(normalForm, normalFormCapture) local origStrNumber = match1 .. (match2 or "") - local strNumber, percent = strMatch(origStrNumber, "(%d+)(%%?)") + local strNumber, percent = strMatch(origStrNumber, "(%-?%d+)(%%?)") if DECIMAL_SEPERATOR ~= "." then strNumber = strGsub(strNumber, "%"..DECIMAL_SEPERATOR, ".") end