• 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
Use implicit pagename for ship parameter
Line 1: Line 1:  +
local Utils = require('Module:Utils')
 
local format = require('Module:StringInterpolation').format
 
local format = require('Module:StringInterpolation').format
 
local getArgs = require('Module:GetArgs')
 
local getArgs = require('Module:GetArgs')
Line 127: Line 128:     
function Quotes.ShipQuotes(frame, args)
 
function Quotes.ShipQuotes(frame, args)
     args = args or getArgs{frame = frame:getParent()}
+
     args = args or Utils.getTemplateArgs(frame)
 +
    args.explicit.ship = args.implicit.pagename or args.explicit.ship or ""
 
     local result = {}
 
     local result = {}
     table.insert(result, format{templates.header, note_style = args.note_style or ""})
+
     table.insert(result, format{templates.header, note_style = args.explicit.note_style or ""})
 
     for _, line in pairs(lines) do
 
     for _, line in pairs(lines) do
         local added = insertRow(result, nil, args, line, 0)
+
         local added = insertRow(result, nil, args.explicit, line, 0)
         added = added + insertRow(result, "Kai", args, line, added)
+
         added = added + insertRow(result, "Kai", args.explicit, line, added)
         added = added + insertRow(result, "Kai Ni", args, line, added)
+
         added = added + insertRow(result, "Kai Ni", args.explicit, line, added)
 
         if line.note and added > 0 then
 
         if line.note and added > 0 then
 
             table.insert(result, format{templates.note, note = line.note})
 
             table.insert(result, format{templates.note, note = line.note})
Line 145: Line 147:  
end
 
end
   −
-- Quotes.t = Quotes.ShipQuotes(nil, {ship = "Ayanami"})
+
-- Quotes.t = Quotes.ShipQuotes(nil, {explicit = {}, implicit = {pagename = "Ayanami"}})
    
return Quotes
 
return Quotes
cssedit, gkautomate
7,064

edits

Navigation menu