Module:ItemsByStat: Difference between revisionsGive feedback
Jump to navigation
Jump to search
SerpentofSet (talk | contribs) disabled status is in JSON now |
SerpentofSet (talk | contribs) _get_string instead of _search_string |
||
| Line 31: | Line 31: | ||
local outData = {} | local outData = {} | ||
local i = 1 | local i = 1 | ||
for | for itemKey,itemData in pairs(InGameItemData) do | ||
if itemData[stat] ~= nil and itemData[stat] ~= "0" then -- If Item has non-zero stat in its keys, | if itemData[stat] ~= nil and itemData[stat] ~= "0" then -- If Item has non-zero stat in its keys, | ||
outData[i] = {} -- start a new record of data and | outData[i] = {} -- start a new record of data and | ||
| Line 37: | Line 37: | ||
outData[i][x] = itemData[inKeys[x]] -- grab stat and other values | outData[i][x] = itemData[inKeys[x]] -- grab stat and other values | ||
end | end | ||
outData[i][#inKeys+1] = itemKey -- Throw item key in there for good measure | |||
i = i+1 | i = i+1 | ||
end | end | ||
| Line 60: | Line 61: | ||
outString = outString.. | outString = outString.. | ||
'|-style="background:'..colorBySlot[tableData[i][4]]..'"\n|'.. | '|-style="background:'..colorBySlot[tableData[i][4]]..'"\n|'.. | ||
frame:expandTemplate{title="Item", args={tableData[i][1],Lang. | frame:expandTemplate{title="Item", args={tableData[i][1],Lang._get_string(tableData[i][7])}}.."||".. | ||
frame:expandTemplate{title="Souls", args={tableData[i][3]}}.."||".. | frame:expandTemplate{title="Souls", args={tableData[i][3]}}.."||".. | ||
'style="text-align:center;"|+'..tableData[i][5]..suffix.."\n" | 'style="text-align:center;"|+'..tableData[i][5]..suffix.."\n" | ||