local p = {}
local function wikitext(text1)
return mw.getCurrentFrame():preprocess(text1)
end
-- 核心映射表:key=俱乐部主标识,value={aliases=别名列表, type=图片类型(local/external), path=路径/链接}
local ClubIconMap = {
-- 【此处为使用萌娘共享站文件的图标】
["MTG"] = {
aliases = {"马来西亚MTG"},
type = "local",
path = "Mtg.png"
},
["无锡JXG"] = {
aliases = {"JXG"},
type = "local",
path = "JXG22.png"
},
["HI"] = {
aliases = {},
type = "local",
path = "HI22.png"
},
["火豹"] = {
aliases = {},
type = "local",
path = "火豹22.png"
},
["镇江VTG"] = {
aliases = {"VTG"},
type = "local",
path = "镇江VTG22.png"
},
["XYG"] = {
aliases = {},
type = "local",
path = "Xyg.png"
},
["重庆狼队"] = {
aliases = {"狼队(KPL)"},
type = "local",
path = "QG狼队.png"
},
["苏州KSG"] = {
aliases = {"KSG"},
type = "local",
path = "苏州KSG.png"
},
["广州TTG"] = {
aliases = {"TTG"},
type = "local",
path = "Ttg.png"
},
["长沙TES.A"] = {
aliases = {"TES.A", "TESA"},
type = "local",
path = "Tesa.png"
},
["济南RW侠"] = {
aliases = {"RW(KPL)"},
type = "local",
path = "Rw.png"
},
["LK(KPL)"] = {
aliases = {},
type = "local",
path = "LKG.png"
},
["Sviper"] = {
aliases = {"Sviper(KPL)", "SV(KPL)"},
type = "local",
path = "Sviper.png"
},
["WF.D"] = {
aliases = {"WeFun.D", "WFD", "WFD(KPL)"},
type = "local",
path = "WFD.png"
},
["AS仙阁2016"] = {
aliases = {"AS仙阁16", "AS2016", "AS16"},
type = "local",
path = "AS仙阁2016.png"
},
["龙珠超玩会"] = {
aliases = {"超玩会龙珠", "超玩会丶龙珠", "AG超玩会16", "AG超玩会2016", "AG2016", "AG16", "龙珠(KPL)", "超玩会2016", "超玩会16"},
type = "local",
path = "超玩会龙珠.png"
},
["EMC2022"] = {
aliases = {},
type = "local",
path = "澳门EMC2022挑战者杯.png"
},
["TCG2022"] = {
aliases = {},
type = "local",
path = "TCG2022.png"
},
["YYG2022"] = {
aliases = {},
type = "local",
path = "YuYeGaming挑战者杯2022.png"
},
["GOG2022"] = {
aliases = {},
type = "local",
path = "GOG挑战者杯2022.png"
},
["TY2022"] = {
aliases = {},
type = "local",
path = "TY挑战者杯2022.png"
},
["BOA2022"] = {
aliases = {},
type = "local",
path = "BOA挑战者杯2022.png"
},
["MD(KPL)"] = {
aliases = {"Mad Dog Gaming", "Mad Dog"},
type = "local",
path = "Shenzhen_Penguin_Mad_Dog.png"
},
["TLG"] = {
aliases = {"拖米队", "托米队", "TLGaming", "TLG(KPL)"},
type = "local",
path = "TLGaming.png"
},
["HaHa"] = {
aliases = {"哈队", "哈哈", "HH", "Haha Gaming"},
type = "local",
path = "Shanghai_HaHa_lightmode.png"
},
["仙阁天津"] = {
aliases = {"天津仙阁"},
type = "local",
path = "天津仙阁.png"
},
["仙阁辉耀"] = {
aliases = {"老仙阁2016"},
type = "local",
path = "仙阁辉耀.png"
},
["唐宋元明清"] = {
aliases = {"唐宋元明清2016"},
type = "local",
path = "唐宋元明清.png"
},
["MU冠军杯"] = {
aliases = {"MU王者冠军杯"},
type = "local",
path = "MU冠军杯.png"
},
["掌游宝-DL"] = {
aliases = {"掌游宝DL"},
type = "local",
path = "掌游宝-DL.png"
},
["DL冠军杯"] = {
aliases = {"DL(KPL)"},
type = "local",
path = "DL冠军杯.png"
},
["南京Hero2020"] = {
aliases = {"南京Hero20", "Hero2020", "Hero20", "Hero久竞2020", "Hero久竞20", "南京Hero久竞2020", "南京Hero久竞20"},
type = "local",
path = "Hero20.png"
},
-- 【此处为使用网络图片的图标】
["东莞WZ"] = {
aliases = {"东莞Wz"},
type = "external",
path = "https://res.edata.qq.com/sgame/static/images/team/10034.png"
},
["DYG2020"] = {
aliases = {"DYG20"},
type = "external",
path = "http://mms0.baidu.com/it/u=541885879,2203505168&fm=253&app=138&f=PNG&fmt=auto&q=75?w=491&h=500"
},
["DYG.JC"] = {
aliases = {"DYG2019", "DYG19", "JC2019", "JC19"},
type = "external",
path = "http://mms0.baidu.com/it/u=359005721,1446082684&fm=253&app=138&f=PNG&fmt=auto&q=75?w=459&h=459"
},
["JC2017"] = {
aliases = {"JC17"},
type = "external",
path = "http://mms2.baidu.com/it/u=3734608322,272510434&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["JC2018"] = {
aliases = {"JC18", "JC", "JC(KPL)"},
type = "external",
path = "http://mms0.baidu.com/it/u=1847650616,1684419770&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["武汉EstarPro"] = {
aliases = {"EstarPro", "Estar", "Estarpro", "武汉eStarPro", "eStarPro"}, -- 原模板所有别名
type = "external",
path = "http://mms2.baidu.com/it/u=438891418,2933695204&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=486"
},
["成都AG超玩会"] = {
aliases = {"AG", "AG(KPL)", "超玩会", "AG超玩会", "成都AG"},
type = "external",
path = "http://mms2.baidu.com/it/u=3839158487,1334467378&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["北京WB"] = {
aliases = {"WB.TS", "WB(KPL)"},
type = "external",
path = "http://mms1.baidu.com/it/u=2969353167,3867308132&fm=253&app=138&f=PNG&fmt=auto&q=75?w=270&h=270"
},
["上海RNG.M"] = {
aliases = {"RNG.M", "RNGM", "RNG", "RNG(KPL)"},
type = "external",
path = "http://mms1.baidu.com/it/u=3433478009,4141623223&fm=253&app=138&f=PNG&fmt=auto&q=75?w=400&h=401"
},
["上海EDG.M"] = {
aliases = {"EDG.M", "EDGM", "EDG(KPL)"},
type = "external",
path = "http://mms0.baidu.com/it/u=2131022686,395837031&fm=253&app=138&f=PNG&fmt=auto&q=75?w=150&h=150"
},
["深圳DYG"] = {
aliases = {"DYG"},
type = "external",
path = "http://mms2.baidu.com/it/u=611985080,1738653860&fm=253&app=120&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["南京Hero久竞"] = {
aliases = {"南京Hero", "南京HERO", "南京hero"},
type = "external",
path = "http://mms1.baidu.com/it/u=4194965358,3225597518&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=522"
},
["杭州LGD大鹅"] = {
aliases = {"LGD(KPL)", "LGD大鹅"},
type = "external",
path = "http://mms0.baidu.com/it/u=1563144561,1778270044&fm=253&app=138&f=PNG&fmt=auto&q=75?w=180&h=180"
},
["西安WE"] = {
aliases = {"WE(KPL)", "WE"},
type = "external",
path = "http://mms1.baidu.com/it/u=453908901,3618475192&fm=253&app=138&f=PNG&fmt=auto&q=75?w=450&h=450"
},
["厦门VG"] = {
aliases = {"VG(KPL)", "VG"},
type = "external",
path = "http://mms2.baidu.com/it/u=3293453885,40299052&fm=253&app=120&f=PNG&fmt=auto&q=75?w=270&h=270"
},
["RW"] = {
aliases = {},
type = "external",
path = "http://mms1.baidu.com/it/u=987053869,2685554794&fm=253&app=138&f=PNG&fmt=auto&q=75?w=450&h=450"
},
["佛山GK"] = {
aliases = {"佛山DRG.GK", "佛山DRG", "GK"},
type = "external",
path = "http://mms2.baidu.com/it/u=1693549133,3646980061&fm=253&app=138&f=PNG&fmt=auto&q=75?w=468&h=453"
},
["TTG.XQ"] = {
aliases = {"XQ2020", "XQ20", "TTG2020", "TTG20"},
type = "external",
path = "http://mms1.baidu.com/it/u=1427395543,2123560106&fm=253&app=138&f=PNG&fmt=auto&q=75?w=278&h=361"
},
["XQ"] = {
aliases = {"XQ(KPL)"},
type = "external",
path = "http://mms0.baidu.com/it/u=4200889807,759769186&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["TS"] = {
aliases = {"TS(KPL)"},
type = "external",
path = "http://mms1.baidu.com/it/u=3694663570,2906324283&fm=253&app=138&f=PNG&fmt=auto&q=75?w=501&h=500"
},
["BA黑凤梨"] = {
aliases = {"BA", "BA(KPL)", "AG.BA"},
type = "external",
path = "http://mms2.baidu.com/it/u=3557823789,1540329504&fm=253&app=138&f=PNG&fmt=auto&q=75?w=477&h=477"
},
["BWS(KPL)"] = {
aliases = {},
type = "external",
path = "http://mms2.baidu.com/it/u=2767321158,3400082901&fm=253&app=138&f=PNG&fmt=auto&q=75?w=437&h=413"
},
["SC(KPL)"] = {
aliases = {},
type = "external",
path = "http://mms1.baidu.com/it/u=1208604995,3621592162&fm=253&app=138&f=PNG&fmt=auto&q=75?w=300&h=300"
},
["MU(KPL)"] = {
aliases = {},
type = "external",
path = "http://mms0.baidu.com/it/u=1288885659,3301864157&fm=253&app=138&f=PNG&fmt=auto&q=75?w=200&h=200"
},
["DL火箭"] = {
aliases = {"DL(KPL)"},
type = "external",
path = "http://mms0.baidu.com/it/u=2293287644,381212010&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["WeFun"] = {
aliases = {"WF(KPL)"},
type = "external",
path = "http://mms0.baidu.com/it/u=2509278447,3752189097&fm=253&app=120&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["VGHow"] = {
aliases = {"VGH(KPL)", "VG2016", "VG16"},
type = "external",
path = "http://mms2.baidu.com/it/u=1794535054,3481137161&fm=253&app=138&f=PNG&fmt=auto&q=75?w=200&h=200"
},
["AS仙阁"] = {
aliases = {"AS(KPL)", "AS仙阁(KPL)"},
type = "external",
path = "http://mms1.baidu.com/it/u=3498646308,3532477971&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["Estar2016"] = {
aliases = {"Estar2017", "Estar16", "Estar17"},
type = "external",
path = "http://mms1.baidu.com/it/u=190535950,3011403801&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["YTG(KPL)"] = {
aliases = {"YTG"},
type = "external",
path = "http://mms2.baidu.com/it/u=3176658919,1311027423&fm=253&app=138&f=PNG&fmt=auto&q=75?w=270&h=270"
},
["YTG2020"] = {
aliases = {"YTG20", "KS.YTG", "KSG2020", "KSG20"},
type = "external",
path = "http://mms0.baidu.com/it/u=4069796870,2575233554&fm=253&app=138&f=PNG&fmt=auto&q=75?w=749&h=500"
},
["QGHappy"] = {
aliases = {"QGH(KPL)", "QG(KPL)", "重庆QG", "重庆QGHappy", "重庆QGhappy"},
type = "external",
path = "http://mms2.baidu.com/it/u=3693945699,2987302016&fm=253&app=138&f=PNG&fmt=auto&q=75?w=280&h=280"
},
["EDG"] = {
aliases = {"Edward Gaming", "EDG(LPL)"},
type = "external",
path = "http://mms0.baidu.com/it/u=1219370783,2722919525&fm=253&app=138&f=PNG&fmt=auto&q=75?w=450&h=450"
},
["南京Hero2018"] = {
aliases = {"南京Hero18", "Hero2018", "Hero18", "Hero久竞2018", "Hero久竞18", "南京Hero久竞2018", "南京Hero久竞18"},
type = "external",
path = "http://mms2.baidu.com/it/u=1591057966,3275929793&fm=253&app=138&f=PNG&fmt=auto&q=75?w=495&h=490"
},
["南京Hero2019"] = {
aliases = {"南京Hero19", "Hero2019", "Hero19", "Hero久竞2019", "Hero久竞19", "南京Hero久竞2019", "南京Hero久竞19"},
type = "external",
path = "http://mms2.baidu.com/it/u=3547722548,1045821602&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["TOP.M"] = {
aliases = {"TOPM"},
type = "external",
path = "http://mms2.baidu.com/it/u=2526168367,865417198&fm=253&app=138&f=PNG&fmt=auto&q=75?w=200&h=200"
},
["TES"] = {
aliases = {"TES(LPL)", "TES(KPL)", "Top Esports"},
type = "external",
path = "http://mms2.baidu.com/it/u=4018151056,3432339879&fm=253&app=138&f=PNG&fmt=auto&q=75?w=450&h=450"
},
["IG"] = {
aliases = {"Invictus Gaming", "IG(LPL)"},
type = "external",
path = "http://mms0.baidu.com/it/u=1877254485,715233761&fm=253&app=138&f=PNG&fmt=auto&q=75?w=140&h=140"
},
["T1"] = {
aliases = {"SKT T12022", "SKT T12021", "SKI2021", "SKT21"},
type = "external",
path = "http://mms1.baidu.com/it/u=3838813288,611735649&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["SKT"] = {
aliases = {"SKT T1", "SKTT1", "SKT1"},
type = "external",
path = "http://mms0.baidu.com/it/u=3179005957,323441157&fm=253&app=138&f=PNG&fmt=auto&q=75?w=268&h=268"
},
["FPX"] = {
aliases = {"FPX(LPL)", "FPX2022", "FPX22", "FPX2021", "FPX21"},
type = "external",
path = "http://mms1.baidu.com/it/u=2297456195,2393029026&fm=253&app=120&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["FPX2020"] = {
aliases = {"FPX20"},
type = "external",
path = "http://mms1.baidu.com/it/u=2739592400,1678909144&fm=253&app=138&f=PNG&fmt=auto&q=75?w=450&h=450"
},
["FPX2019"] = {
aliases = {"FPX19", "FPX19-", "FPX2019-", "FPXS9", "FPX(S9)"},
type = "external",
path = "http://mms1.baidu.com/it/u=2837913315,963327455&fm=253&app=138&f=PNG&fmt=auto&q=75?w=400&h=400"
},
["DWG"] = {
aliases = {"DWG(S10)", "DWGS10"},
type = "external",
path = "http://mms1.baidu.com/it/u=1886027816,3909907303&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["JDG2020"] = {
aliases = {"JDG20", "JDG(S10)", "JDGS10"},
type = "external",
path = "http://mms1.baidu.com/it/u=1207342122,432260150&fm=253&app=138&f=PNG&fmt=auto&q=75?w=450&h=450"
},
["JMI"] = {
aliases = {},
type = "external",
path = "https://s2.loli.net/2022/07/23/kvEr7FW5LDJSfU9.png"
},
["JDI"] = {
aliases = {},
type = "external",
path = "https://s2.loli.net/2022/07/23/vHto3LZDfVbEcg9.png"
},
["JDG"] = {
aliases = {"JDG2021", "JDG21", "JDG2022", "JDG22"},
type = "external",
path = "http://mms2.baidu.com/it/u=370756727,3581536237&fm=253&app=120&f=PNG&fmt=auto&q=75?w=387&h=387"
},
["TSM"] = {
aliases = {"Team Solomid"},
type = "external",
path = "http://mms1.baidu.com/it/u=382933029,2180970180&fm=253&app=138&f=PNG&fmt=auto&q=75?w=300&h=300"
},
["G2"] = {
aliases = {"G2 Esports"},
type = "external",
path = "http://mms2.baidu.com/it/u=2228201867,2657228487&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["GEN.G"] = {
aliases = {"GEN", "Generation Gaming"},
type = "external",
path = "http://mms0.baidu.com/it/u=3205216944,138119712&fm=253&app=138&f=PNG&fmt=auto&q=75?w=450&h=450"
},
["SK战队"] = {
aliases = {"SK", "SK Gaming"},
type = "external",
path = "http://mms0.baidu.com/it/u=4145208958,1737441262&fm=253&app=138&f=PNG&fmt=auto&q=75?w=300&h=299"
},
["DFM"] = {
aliases = {"DetonatioN FocusMe"},
type = "external",
path = "http://mms1.baidu.com/it/u=3705245741,161846979&fm=253&app=138&f=PNG&fmt=auto&q=75?w=500&h=500"
},
["JT"] = {
aliases = {"J Team", "Jay Team"},
type = "external",
path = "http://mms1.baidu.com/it/u=2004394111,1847532715&fm=253&app=138&f=PNG&fmt=auto&q=75?w=400&h=400"
},
["100T"] = {
aliases = {"100 Thieves"},
type = "external",
path = "http://mms1.baidu.com/it/u=3264128767,619855483&fm=253&app=138&f=PNG&fmt=auto&q=75?w=344&h=344"
}
}
-- 辅助函数:根据输入的俱乐部名称匹配映射表,返回图片信息
local function matchClub(clubName)
-- 默认值:武汉EstarPro(原模板默认)
local default = ClubIconMap["武汉EstarPro"]
if not clubName or clubName == "" then
return default
end
-- 遍历映射表,匹配主标识或别名
for mainName, info in pairs(ClubIconMap) do
if mainName == clubName then
return info
end
for _, alias in ipairs(info.aliases) do
if alias == clubName then
return info
end
end
end
-- 未匹配时返回默认
return default
end
-- 主函数:外部调用入口,根据output参数返回指定信息(type/path/style)
function p.getIcon(frame)
local clubName = frame.args.club or "武汉EstarPro" -- 接收俱乐部名称,默认武汉EstarPro
local outputType = frame.args.output or "path" -- 接收输出类型,默认返回路径/链接
local clubInfo = matchClub(clubName)
-- 根据outputType返回对应值
if outputType == "type" then
return clubInfo.type -- 返回:local/external
elseif outputType == "style" then
-- 对应原模板的style值:local→1,external→0
return clubInfo.type == "local" and "1" or "0"
elseif outputType == "path" then
return clubInfo.path -- 返回路径/链接
else
return "" -- 无效outputType返回空
end
end
function p.check()
local t = wikitext([=[
{|class = "wikitable mw-collapsible mw-collapsed"
|-
! 主识别 !! 别名 !! 结果
]=])
-- 提取所有主识别名称到一个数组
local mainNames = {}
for k, _ in pairs(ClubIconMap) do
table.insert(mainNames, k)
end
-- 对主识别名称进行升序排序
table.sort(mainNames)
-- 按排序后的顺序遍历
for _, k in ipairs(mainNames) do
local v = ClubIconMap[k]
-- 处理别名列表,转为字符串
local aliasesStr = table.concat(v.aliases, "、")
t = t .. wikitext(string.format([=[
|-
| %s || %s || {{ClubIcon|%s}}
]=], k, aliasesStr, k))
end
t = t .. wikitext('|}')
return t
end
return p