Module:Param Parse: Difference between revisions
Sort episodes by episode number instead of name
m (support variant_type = bounty) |
(Sort episodes by episode number instead of name) |
||
Line 213:
-- Episode
local valid_episodes = {
['none'] = { 0, 'None' },
['hopeport'] = { 1, 'Hopeport' },
['hopeforest'] = { 2, 'Hopeforest' },
['mine of mantuban'] = { 3, 'Mine of Mantuban' },
['crenopolis'] = { 4, 'Crenopolis' },
['stonemaw hill'] = { 5, 'Stonemaw Hill' },
['bleakholm crags'] = { 6, 'Bleakholm Crags' },
}
function parse.episode_func(episode)
local valid_episode = valid_episodes[string.lower(episode or '')]
if valid_episode then
local sort = valid_episode[1]
if valid_episode == 'None' then▼
local name = valid_episode[2]
local link = name
local label = '[[' .. name .. ']]'
name = 'Unknown'
link = ''
label = 'None'
end
return ('<span data-sort-value="%s">[[File:%s episode icon.png|18px|link=%s]] %s</span>'):format(sort, name, link, label)
end
return nil
Line 235 ⟶ 240:
local valid_episode = valid_episodes[string.lower(episode or '')]
if valid_episode then
return valid_episode[2]
end
return nil
|