[checked revision] | [checked revision] |
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
+ | local util_vars = require("Module:VarsUtil") |
||
⚫ | |||
− | game = function(frame) |
||
⚫ | |||
− | if frame == mw.getCurrentFrame() then |
||
− | args = require( 'Module:ProcessArgs' ).merge( true ) |
||
− | else |
||
− | frame = mw.getCurrentFrame() |
||
⚫ | |||
− | local Gamenames = mw.loadData('Module:Gamenames') |
||
− | |||
− | local gameInput = mw.ustring.lower(args[1] or '') |
||
− | local namevars = Gamenames[gameInput] |
||
⚫ | |||
− | if not namevars then |
||
− | namevars = {long = args[1], image = "ERROR"} |
||
− | elseif type(namevars) == 'string' then |
||
− | namevars = Gamenames[namevars] |
||
− | end |
||
− | |||
− | local text = '' |
||
− | if args['text'] then |
||
− | text = namevars.long |
||
− | end |
||
− | local size = '' |
||
− | if args['size'] then |
||
− | size = args['size'] |
||
− | end |
||
− | |||
− | return '[[File:'..namevars.image..'|link=|'..size..']]'..text |
||
+ | local p = require('Module:EntityAbstract'):extends() |
||
⚫ | |||
+ | |||
+ | p.objectType = 'Game' |
||
+ | p.imageDisplayLength = 'long' |
||
+ | p.imagelength = 'unique' |
||
+ | p.defaultlength = 'long' -- this is what we store in cargo !! |
||
+ | -- p.cssClass = 'league-object' |
||
+ | p.imagesizes = {} |
||
+ | p.nosize = true |
||
+ | |||
+ | function p:init(str) |
||
+ | self:super('init', str, 'Item') |
||
+ | if self.unknown then |
||
+ | self.vars = { |
||
+ | long = str, |
||
+ | image = 'Unknown Infobox Image - Tournament.png' |
||
⚫ | |||
end |
end |
||
⚫ | |||
− | } |
||
+ | |||
⚫ |
Revision as of 22:10, 21 October 2020
Documentation for this module may be created at Module:Game/doc
local util_vars = require("Module:VarsUtil")
local p = require('Module:EntityAbstract'):extends()
local h = {}
p.objectType = 'Game'
p.imageDisplayLength = 'long'
p.imagelength = 'unique'
p.defaultlength = 'long' -- this is what we store in cargo !!
-- p.cssClass = 'league-object'
p.imagesizes = {}
p.nosize = true
function p:init(str)
self:super('init', str, 'Item')
if self.unknown then
self.vars = {
long = str,
image = 'Unknown Infobox Image - Tournament.png'
}
end
end
return p