Changes

no edit summary
Line 1: Line 1:  
local Utils = require('Module:Utils')
 
local Utils = require('Module:Utils')
 +
local format = require('Module:StringInterpolation').format
 
local getArgs = require('Module:GetArgs')
 
local getArgs = require('Module:GetArgs')
   Line 339: Line 340:  
!
 
!
 
]===], args.art and "Glossary#List_of_Vessels_by_Artist|Artist" or "Glossary#List_of_Vessels_by_Seiyuu|Seiyuu", i) .. r .. "|}" end)
 
]===], args.art and "Glossary#List_of_Vessels_by_Artist|Artist" or "Glossary#List_of_Vessels_by_Seiyuu|Seiyuu", i) .. r .. "|}" end)
 +
 +
end
 +
 +
function Seasonal.include(frame)
 +
 +
    local quote_template = [=[|- id="${ship}"
 +
|align="center"|[[${ship}]]
 +
|align="center"|<span class="audio-button click-parent">[[File:${ship} ${season}.ogg|Play]]</span>
 +
|lang="ja"|${ja}
 +
|${en}
 +
|${note}]=]
 +
 +
    local args = getArgs{frame = frame:getParent()}
 +
    local season, type = args[1], args[2]
 +
    local result = {
 +
        "|-",
 +
        string.format([=[!colspan="4"|From [[Seasonal/%s|%s]]]=], season, season)
 +
    }
 +
    local seasonal_data = require(string.format("Module:Seasonal/%s", season))
 +
    for _, ship in ipairs(seasonal_data.index[type]) do
 +
        local ship_data = seasonal_data.ships[ship]
 +
        for _, quote in ipairs(ship_data) do
 +
            table.insert(result, format{
 +
                quote_template,
 +
                ship = ship,
 +
                season = season,
 +
                ja = quote.ja,
 +
                en = quote.en,
 +
                note = quote.note,
 +
            })
 +
        end
 +
    end
 +
    return table.concat(result, "\n")
    
end
 
end
    
return Seasonal
 
return Seasonal
cssedit, gkautomate
7,060

edits