4,683
edits
(Correct various issues) |
(Updated for changes in Constants, getModifierDetails) |
||
Line 85: | Line 85: | ||
local modList = {} | local modList = {} | ||
for i, modDet in ipairs(GameData.rawData.golbinRaid.possibleModifiers) do | for i, modDet in ipairs(GameData.rawData.golbinRaid.possibleModifiers) do | ||
local baseName, modText | local baseName, modText, isNeg, modifyValue = Constants.getModifierDetails(modDet.key) | ||
--TODO: Is this necessary? getModifierDetails has the same code and this function doesn't have params | |||
local prefix = '' | local prefix = '' | ||
if Shared.startsWith(baseName, 'increased') or Shared.startsWith(baseName, 'decreased') then | if Shared.startsWith(baseName, 'increased') or Shared.startsWith(baseName, 'decreased') then | ||
Line 97: | Line 98: | ||
end | end | ||
modText = Constants._getModifierText(modDet.key, modVal, false) | modText = Constants._getModifierText(modDet.key, modVal, false) | ||
modList[baseName] = {modText, ["ord"] = i, [" | modList[baseName] = {modText, ["ord"] = i, ["mods"] = 1} | ||
else | else | ||
modList[baseName]["mods"] = modList[baseName]["mods"] + 1 | |||
end | end | ||
end | end | ||
Line 113: | Line 114: | ||
for baseName, modDet in Shared.spairs(modList, sortFunc) do | for baseName, modDet in Shared.spairs(modList, sortFunc) do | ||
local modText = modDet[1] | local modText = modDet[1] | ||
if | if modDet['mods'] > 1 then | ||
local replPat = | local replPat = '[+-]' | ||
modText = string.gsub(modDet[1], replPat, '+/-', 2) | |||
modText = string.gsub(modDet[1], replPat, | |||
end | end | ||
resultTable:tag('tr') | resultTable:tag('tr') | ||
:tag('td'):wikitext(modText):done() | :tag('td'):wikitext(modText):done() | ||
end | end | ||
return tostring(resultTable) | return tostring(resultTable) | ||
end | end | ||
return p | return p |