• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
Line 29: Line 29:  
==Epeditions Table==
 
==Epeditions Table==
   −
{{Expedition
+
my goal is to call :
|world = 1
+
{{#invoke:ExpeditionTable|returnExpeditionTable|all}}
   −
|world = 2
  −
}}
      +
==code testing==
 +
*'''(modified from Module:ShipDropTable)'''
      −
<includeonly>{{{{{subst|safesubst:}}}#invoke:View/Expedition|render}}</includeonly><noinclude>
  −
{{Expedition
  −
|world = 1
  −
}}
         +
local U = require("Module:Core")
 +
local Formatting = require("Module:Formatting")
 +
local Exp = require("Data/Expedition")
    +
local worlds = {
 +
  {world = 1, exp = 14},
 +
  {world = 2, exp = 14},
 +
  {world = 3, exp = 8},
 +
  {world = 7, exp = 6},
 +
  {world = 4, exp = 11},
 +
  {world = 5, exp = 10},
 +
  {world = 6, exp = 0},
 +
}
      −
{{#invoke:ExpeditionTable|returnExpeditionTable|all}}
+
local function render(frame)
 +
  local args = frame.args
 +
  local result = {[[<div style="overflow-x:auto"><table class="wikitable sortable" style="text-align:center;width:100%">]]}
 +
  table.insert(result, "<tr>")
 +
  for _, cell in ipairs({"Ship", "Rarity", "Type", "No."}) do
 +
    table.insert(result, string.format([[<th rowspan="2">%s</th>]], cell))
 +
  end
 +
  for _, e in ipairs(worlds) do
 +
    table.insert(result, string.format([=[<th colspan="%s">[[World %s]]</th>]=], e.maps, e.world))
 +
  end
 +
  table.insert(result, [[<th rowspan="2">Remarks</th></tr><tr>]])
 +
  for _, e in ipairs(worlds) do
 +
    for map = 1, e.maps do
 +
      table.insert(result, string.format([=[<th>[[%s-%s|%s]]</th>]=], e.world, map, map))
 +
    end
 +
  end
 +
  table.insert(result, "</tr>")
 +
  for _, shipName in ipairs(args[1] == "all" and U.sort(U.keys(dropData)) or args) do
 +
    table.insert(result, formatShip(shipName))
 +
  end
 +
  table.insert(result, [[</table></div>]])
 +
  return table.concat(result)
 +
end
 +
 
 +
return { returnExpeditionTable = render }
35,460

edits

Navigation menu