FANDOM


local p = {}
 
local getArgs = getArgs or require( 'Module:Arguments' ).getArgs
local toLink = require( 'Module:Color' ).toLink
local titles = titles or mw.loadData( 'Module:Game/Titles' ) -- 게임타이틀
local scheme = scheme or mw.loadData( 'Module:Color/Scheme' ) -- 색상표 데이터
local typeScheme = typeScheme or scheme.types -- 타입 색상표
local moveScheme = moveScheme or scheme.moves -- 기술분류 색상표
local altArgs
 
local function processArgs( abbr, color )
    if not titles[abbr] then
        return '<strong class="text-warning">미등록 타이틀: ' .. abbr .. '</strong>'
    end
 
    local dataset = titles[abbr]
    local ret
 
    altArgs = { color, dataset[1], dataset[2] or abbr }
    ret = toLink( altArgs[1], altArgs[2], altArgs[3] )
 
    if dataset[3] and dataset[4] then
        altArgs[2] = dataset[3]
        altArgs[3] = dataset[4] 
        ret = ret .. toLink( altArgs[1], altArgs[2], altArgs[3] )
    end
 
    return ret
end
 
function p.main( frame )
    local args = getArgs( frame )
    local abbr, color = args[1], args[2]
    local ret = processArgs( abbr, color )
 
    return ret
end
 
return p
Community content is available under CC-BY-SA unless otherwise noted.