Module:Tier List: Difference between revisions

From Dustloop Wiki
m (Undo revision 261897 by PrivateTarkus (talk))
Tag: Undo
mNo edit summary
Line 8: Line 8:
   local character = "Venom"
   local character = "Venom"


   wikitext = wikitext .. "<div>{{Character Label|" .. GAME .. "|" .. character "|32px}}</div>" -- append character entry to wikitext
   wikitext = wikitext .. "<div>{{Character Label|" .. GAME .. "|" .. character .. "|32px}}</div>" -- append character entry to wikitext
    
    
   -- local index = 2
   -- local index = 2

Revision as of 21:37, 4 March 2022

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.

  1. The abbreviation for the game (IE: GGACR, GBVS, DBFZ, etc)
  2. 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
}}

Lua error at line 10: attempt to concatenate local 'GAME' (a nil value).


local p = {}

local wikitext = "<div class=\"tierList\">"
local args = { ... }

function p.drawTierList(frame)
  local GAME = frame.args['game']
  local character = "Venom"

  wikitext = wikitext .. "<div>{{Character Label|" .. GAME .. "|" .. character .. "|32px}}</div>" -- append character entry to wikitext
  
  -- local index = 2
  -- while tonumber(frame.args['active' .. index]) ~= nil or tonumber(frame.args['inactive' .. index]) ~= nil do
  --   drawFrame(frame.args['active' .. index], "active")
  --   drawFrame(frame.args['inactive' .. index], "inactive")
  --   index = index + 1
  -- end

  wikitext = wikitext .. "</div>"

  return wikitext
end

return p