Line 62: |
Line 62: |
| if type(v) == "table" and recurse then | | if type(v) == "table" and recurse then |
| size = size+getRowSize(v) | | size = size+getRowSize(v) |
− | elseif v ~= "" then | + | elseif v ~= "" and k ~= "label" then |
| size = size+1 | | size = size+1 |
| end | | end |
Line 106: |
Line 106: |
| end | | end |
| body:node(headerRow) | | body:node(headerRow) |
− | for nodeLetter,values in pairs(info) do | + | local letterOrder = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"} |
| + | for _,nodeLetter in pairs(letterOrder) do |
| + | local values = info[nodeLetter] |
| if values ~= nil then | | if values ~= nil then |
| local firstRow = mw.html.create("tr") | | local firstRow = mw.html.create("tr") |
Line 162: |
Line 164: |
| end | | end |
| firstRow:node(td) | | firstRow:node(td) |
− | else
| |
− | firstRow:node(mw.html.create("td"))
| |
| end | | end |
| end | | end |
Line 183: |
Line 183: |
| if headers[param] then | | if headers[param] then |
| local col = mw.html.create("td") | | local col = mw.html.create("td") |
− | local temp = values[i]
| + | if values[1][param] ~= nil then |
− | temp = temp[param]
| + | local text = values[1][param] |
− | if values[i][param] ~= nil then | + | col:wikitext(p.replaceWordWithWikicode(text .. " ")) |
− | local text = values[i][param] | + | if param == "Node Info" and nil ~= string.find(string.lower(text),"class") then |
− | col | + | col:css("text-align","left") |
− | :wikitext(p.replaceWordWithWikicode(text))
| + | else |
− | :css("text-align","center") | + | col:css("text-align","center") |
| + | end |
| end | | end |
| row:node(col) | | row:node(col) |
Line 212: |
Line 213: |
| end | | end |
| row:node(td) | | row:node(td) |
− | else
| |
− | row:node(mw.html.create("td"))
| |
| end | | end |
| | | |
Line 306: |
Line 305: |
| | | |
| return html | | return html |
− |
| |
| end | | end |
| | | |
Line 312: |
Line 310: |
| local nodeInfoImageTable = { | | local nodeInfoImageTable = { |
| ["fuel"] = '[[File:Fuel.png|Fuel|25px]]', | | ["fuel"] = '[[File:Fuel.png|Fuel|25px]]', |
− | ["ammo"] = '[[File:Ammunition.png|Ammo|25px]]', | + | ["ammo"] = '[[File:Amm.png|Ammo|25px]]', |
| ["steel"] = '[[File:Steel.png|Steel|25px]]', | | ["steel"] = '[[File:Steel.png|Steel|25px]]', |
| ["bauxite"] = '[[File:Bauxite.png|Bauxite|25px]]' | | ["bauxite"] = '[[File:Bauxite.png|Bauxite|25px]]' |