Changes

no edit summary
Line 7: Line 7:  
for param, list in pairs(frame.args) do
 
for param, list in pairs(frame.args) do
 
local label = string.upper(mw.text.split(param, "_")[1]) -- Should be single letter in uppercase
 
local label = string.upper(mw.text.split(param, "_")[1]) -- Should be single letter in uppercase
local shipCode = mw.text.split(param, "_")[2] -- One of DD, CL, CA, BB, CV, CVL, AV, SS, AUX
+
local shipCode = mw.text.split(param, "_")[2] -- One of DE, DD, CL, CA, BB, CV, CVL, AV, SS, AUX
 
if drops[label] == nil then
 
if drops[label] == nil then
 
drops[label] = {}
 
drops[label] = {}
Line 15: Line 15:     
local numTypes = {}
 
local numTypes = {}
local validLabels = {"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"}
+
local validLabels = {"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","Z1", "Z2", "Z3", "Z4", "Z5", "Z6", "Z7", "Z8", "Z9", "ZZ1", "ZZ2", "ZZ3"}
local shipTypes = {"DD", "CL", "CA", "BB", "CV", "CVL", "AV", "SS", "AUX"}
+
local shipTypes = {"DE", "DD", "CL", "CA", "BB", "CV", "CVL", "AV", "SS", "AUX"}
    
for i, letter in pairs(validLabels) do
 
for i, letter in pairs(validLabels) do
Line 35: Line 35:     
local classLink = {}
 
local classLink = {}
 +
classLink["DE"] = '[[Destroyer Escorts]]'
 
classLink["DD"] = '[[EliteDD|Destroyers]]'
 
classLink["DD"] = '[[EliteDD|Destroyers]]'
 
classLink["CL"] = '[[EliteCL|Light Cruisers]]'
 
classLink["CL"] = '[[EliteCL|Light Cruisers]]'
Line 49: Line 50:  
tablehtml = tablehtml .. '<tr><td style="text-align:center; font-size:18px; font-weight:bold;" '
 
tablehtml = tablehtml .. '<tr><td style="text-align:center; font-size:18px; font-weight:bold;" '
 
tablehtml = tablehtml .. 'rowspan="' .. numTypes[node] .. '">' .. node .. '</td>'
 
tablehtml = tablehtml .. 'rowspan="' .. numTypes[node] .. '">' .. node .. '</td>'
 
+
remTypes = numTypes[node] - 1
+
remTypes = numTypes[node]
 
for y, ship in pairs(shipTypes) do
 
for y, ship in pairs(shipTypes) do
 
if drops[node][ship] ~= nil then
 
if drops[node][ship] ~= nil then
 
tablehtml = tablehtml .. '<td style="text-align:center; width:70px;">' .. classLink[ship] .. '</td>'
 
tablehtml = tablehtml .. '<td style="text-align:center; width:70px;">' .. classLink[ship] .. '</td>'
 
tablehtml = tablehtml .. '<td>' .. drops[node][ship] .. '</td>'
 
tablehtml = tablehtml .. '<td>' .. drops[node][ship] .. '</td>'
end
  −
if remTypes > 0 then
  −
tablehtml = tablehtml .. '</tr><tr>'
   
remTypes = remTypes - 1
 
remTypes = remTypes - 1
else
+
if remTypes > 0 then
tablehtml = tablehtml .. '</tr>'
+
tablehtml = tablehtml .. '</tr><tr>'
break
+
else
 +
tablehtml = tablehtml .. '</tr>'
 +
break
 +
end
 
end
 
end
 
end
 
end
5,421

edits