Module:Entry/metatable: Difference between revisions

Jump to navigation Jump to search
Adjust to Module:Entry/titles changes
(oops)
(Adjust to Module:Entry/titles changes)
Line 1: Line 1:
local titles = require("Module:Entry/titles")
local titles = require("Module:Entry/titles").lookup
local megamixLabels
local megamixLabels
local entryMT = {}
local entryMT = {}
Line 23: Line 23:


function entryMT.text(entry)
function entryMT.text(entry)
return titles[entry][3] or entry.title
local t = titles[entry]
return t[3] or t[2] or t[1]
end
end


Line 84: Line 85:
}
}
local ext = animateStages[entry.console][entry.stage] and "gif" or "png"
local ext = animateStages[entry.console][entry.stage] and "gif" or "png"
    local console = entry.console
local console = entry.console
    if console == "Arcade" then console = "GBA" end
if console == "Arcade" then console = "GBA" end
   
local entryCode = titles[entry].icon or (entry.stage .. "-" .. entry.number)
local entryCode
if console == "Wii" and entry.stage == "E" then
local endlessCodes = {"E-4", "E-1", "E-2", "E-3", "E-4 JP", "E-5"}
entryCode = endlessCodes[tonumber(entry.number)]
elseif console == "3DS" then
megamixLabels = megamixLabels or require("Module:Entry/3ds_labels")
entryCode = megamixLabels[entry.stage][entry.number]
else
entryCode = entry.stage .. "-" .. entry.number
end
return mw.ustring.format("Game %s %s.%s", console, entryCode, ext)
return mw.ustring.format("Game %s %s.%s", console, entryCode, ext)
end
end
Line 111: Line 102:


local function _iconAndLink(entry, iconSize, tempoUpSize)
local function _iconAndLink(entry, iconSize, tempoUpSize)
    return tostring(mw.html.create("span")
return tostring(mw.html.create("span")
        :css("white-space", "nowrap")
:css("white-space", "nowrap")
        :wikitext(entry:icon(iconSize), " ", entry:link(tempoUpSize))
:wikitext(entry:icon(iconSize), " ", entry:link(tempoUpSize))
    )
)
end
end


420

edits

Navigation menu