Module:Game Tabs

local p = {}

local Franchise = require("Module:Franchise") local utilsLayout = require("Module:UtilsLayout") local utilsString = require("Module:UtilsString") local utilsTable = require("Module:UtilsTable")

local CATEGORY_INVALID_ARGS = require("Module:Constants/category/invalidArgs")

function p.Main(frame) local args = frame:getParent.args local categories = ""

local remainingGames = utilsTable.clone(args) local tabData = {} for i, game in ipairs(Franchise.enum) do		remainingGames[game] = nil local content = args[game] or "" content = utilsString.trim(content) if content ~= "" then table.insert(tabData, {				label = Franchise.display(game),				content = content,			}) end end for invalidGame in pairs(remainingGames) do		local utilsError = require("Module:UtilsError") utilsError.warn(string.format("Invalid game code %s. See Data:Franchise for supported games.", invalidGame)) categories = categories.."" end local tabs = utilsLayout.tabs(tabData, {		default = #tabData,		tabOptions = {			collapse = true		},	})

return tabs, categories end

p.Templates = { ["Game Tabs"] = { description = "Displays alternate content for different games—usually different versions of the same game.", } }

return p