Module:Shared VA: Difference between revisions

No edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 25: Line 25:
     ["hg2"] = "[[w:c:houkai2nd:%s|%s]]",
     ["hg2"] = "[[w:c:houkai2nd:%s|%s]]",
     ["hna"] = "[https://hna.wiki/%s %s]",
     ["hna"] = "[https://hna.wiki/%s %s]",
     ["gi"]  = "[[w:c:genshin-impact:%s|%s]]",
     ["gi"]  = "[https://genshin-impact.fandom.com/%s %s]",
     ["zzz"] = "[[w:c:zenless-zone-zero:%s|%s]]",
     ["zzz"] = "[[w:c:zenless-zone-zero:%s|%s]]",
     ["tot"] = "[https://tot.wiki/wiki/%s %s]",
     ["tot"] = "[https://tot.wiki/wiki/%s %s]",
}
}
local game_order = {'hsr', 'hi3', 'hg2', 'hna', 'gi', 'zzz', 'pp', 'tot'}
local game_order = {'pp', 'hg2', 'hi3', 'tot', 'gi', 'hsr', 'zzz', 'hna'}
local lang_order = {'EN', 'CN', 'JP', 'KR'}
local lang_order = {'EN', 'CN', 'JP', 'KR'}


Line 44: Line 44:
function p._main(args, frame)
function p._main(args, frame)
local VAs = {character = args['char']}
local VAs = {character = args['char']}
local data = Parse(args['char'], {only='Character Infobox'}) or {}
local data = Parse(args['char'], {only='Neighbor Infobox'}) or {}
local out = mw.html.create('ul')
local out = mw.html.create('ul')
Line 54: Line 54:
or (lib.isNotEmpty(va) and
or (lib.isNotEmpty(va) and
frame:preprocess(lib.trim(
frame:preprocess(lib.trim(
VAs.character=='Trailblazer'  
VAs.character=='Trailblazer' --if we ever do have a voice actor for MC
and (va:gsub('^.-F: (.-)<r?b?.-M: (.+)$', '%1 or %2'):gsub('%s*<ref.+$', ''))
and (va:gsub('^.-F: (.-)<r?b?.-M: (.+)$', '%1 or %2'):gsub('%s*<ref.+$', ''))
or (va:gsub('%s*<ref.+$', ''))
or (va:gsub('%s*<ref.+$', ''))