Module:Tier_List
is used to generate tier lists directly within the wiki using HTML, and the existing character labels.
Usage
A tier list requires that arguments be present in order.
- The abbreviation for the game (IE: GGACR, GBVS, DBFZ, etc)
- All of the tiers, ordered from top to bottom
Within a given tier, you must define the label for that tier (the letter that appears inside of the colored square) followed by a semicolon character (';').
Short Names in Labels
The tier list will attempt to find the appropriate icon and link for a given character. If you choose not to use the full name of a character, you must set up a necessary redirect from the short name to the full name. This applies to both the icon file and the character page itself.
For example: We want to show "Sol" on our tier list instead of "Sol Badguy". We must create 2 redirects.
- Redirect from
[[File:GGACR_Sol_Icon.png]]
to[[File:GGACR_Sol_Badguy_Icon.png]]
- Redirect from
[[GGACR/Sol]]
to[[GGACR/Sol_Badguy]]
Example
{{#invoke:Tier List|drawTierList |GGACR |S;Testament,Baiken,Zappa,Dizzy |A;Chipp,Axl,Faust,Millia,Jam |B;A.B.A,Potemkin,Sol,May |C;Kliff,Order-Sol,Justice,Slayer,Anji,Johnny |D;Robo-Ky,Eddie,I-No,Ky,Venom,Bridget }}
local p = {} function p.drawTierList(frame) local wikitext = "<div class=\"tierList\">" -- initialize the wikitext with the container for the list local GAME = frame.args[1]:gsub("%s+", "") local character = "default" local numberOfTiers = table.getn(frame.args) --Inject the special first tier label wikitext = wikitext .. "<div class=\"tierHeader\" style=\"background-color: #b8ff89; border-top-left-radius: 4px;\">S</div>" for index=2,numberOfTiers-1 do -- open a new tier container wikitext = wikitext .. "<div class=\"tierGroup tierUnderline\">" local currentTier = "default" currentTier = frame.args[2]:gsub("%s+", "") -- iterate over tokens in arg, sperrated by ',' character for token in string.gmatch(currentTier, '([^,]+)') do character = token -- inject character label local characterLabel = frame:expandTemplate{ title = 'Character Label', args = { GAME, character, '32px' } } wikitext = wikitext .. "<div>" .. characterLabel .. "</div>" end -- close the current tier container wikitext = wikitext .. "</div>" end -- inject final tier label wikitext = wikitext .. "<div class=\"tierHeader\" style=\"background-color: #fdff89;\">TIER</div>" -- open final tier container and populate it wikitext = wikitext .. "<div class=\"tierGroup\">" currentTier = frame.args[2]:gsub("%s+", "") for token in string.gmatch(currentTier, '([^,]+)') do character = token local characterLabel = frame:expandTemplate{ title = 'Character Label', args = { GAME, character, '32px' } } wikitext = wikitext .. "<div>" .. characterLabel .. "</div>" end -- close the current tier container wikitext = wikitext .. "</div>" -- close the entire tier list wikitext = wikitext .. "</div>" return wikitext end return p