No edit summary |
No edit summary |
||
(127 intermediate revisions by 2 users not shown) | |||
Line 21: | Line 21: | ||
["Specialist"] = "Specialist", |
["Specialist"] = "Specialist", |
||
+ | ["Unspecified"] = "Unspecified", |
||
+ | } |
||
+ | local classicon = { |
||
+ | ["Enforcer"] = "Tank icon.png", |
||
+ | ["Juggernaut"] = "Fighter icon.png", |
||
+ | ["Skirmisher"] = "Emptylord Skirmisher icon.png", |
||
+ | |||
+ | ["Artillery"] = "Emptylord Artillery icon.png", |
||
+ | ["Mage"] = "Mage icon.png", |
||
+ | ["Ranger"] = "Marksman icon.png", |
||
+ | ["Rogue"] = "Slayer icon.png", |
||
+ | |||
+ | ["Disruptor"] = "Emptylord Disruptor icon.png", |
||
+ | ["Enchanter"] = "Controller icon.png", |
||
+ | ["Warden"] = "Emptylord Warden icon.png", |
||
+ | |||
+ | ["Specialist"] = "Emptylord Specialist icon.png", |
||
+ | ["Ranged"] = "Ranged role.png", |
||
+ | ["Melee"] = "Melee role.png", |
||
["Unspecified"] = "Unspecified", |
["Unspecified"] = "Unspecified", |
||
} |
} |
||
local fulltype = { |
local fulltype = { |
||
− | ["Quality"] = " |
+ | ["Quality"] = "Balance changes", |
− | ["Rework"] = " |
+ | ["Rework"] = "Gameplay update", |
["Relaunch"] = "Champion relaunch", |
["Relaunch"] = "Champion relaunch", |
||
− | ["Original"] = " |
+ | ["Original"] = "New addition", |
− | [" |
+ | ["Novel"] = "New champion", |
− | [" |
+ | ["Unspecified"] = "", |
+ | } |
||
− | ["Unspecified"] = "Unspecified", |
||
+ | |||
+ | local fulltheme = { |
||
+ | ["Current"] = "Current theme", |
||
+ | ["Revisited"] = "Revisited theme", |
||
+ | ["Blended"] = "Blended theme", |
||
+ | ["Novel"] = "Novel theme", |
||
+ | ["Imported"] = "Imported theme", |
||
+ | ["Unspecified"] = "", |
||
} |
} |
||
Line 43: | Line 70: | ||
} |
} |
||
− | function p. |
+ | function p.getPatch(frame) |
local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end |
local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end |
||
− | local get = require ('Module:Sandbox/Emptylord/ |
+ | local get = require ('Module:Sandbox/Emptylord/Navigation/getter') |
local champname = args['champname'] or args[1] |
local champname = args['champname'] or args[1] |
||
local set = tonumber(args['set']) or tonumber(args[2]) |
local set = tonumber(args['set']) or tonumber(args[2]) |
||
Line 62: | Line 89: | ||
end |
end |
||
− | function p. |
+ | function p.getPatchRoster(frame) |
local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end |
local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end |
||
− | local champData = require('Module:Sandbox/Emptylord/ |
+ | local champData = require('Module:Sandbox/Emptylord/Navigation/patch') |
local champTable = {} |
local champTable = {} |
||
local filter = args['filter'] or "None" |
local filter = args['filter'] or "None" |
||
− | local |
+ | local filter2 = args['filter2'] or "None" |
+ | local links = args['links'] or "true" |
||
local gridonly = args['gridonly'] or "false" |
local gridonly = args['gridonly'] or "false" |
||
− | local s = "" |
||
for champname in pairs(champData) do |
for champname in pairs(champData) do |
||
Line 85: | Line 112: | ||
for _, champion in pairs(champTable) do |
for _, champion in pairs(champTable) do |
||
− | if filter == "None" or champData[champion]["projtype"] == filter then |
+ | if champData[champion]["indexed"] ~= "false" and (filter == "None" or champData[champion]["projtype"] == filter or champData[champion]["projtype"] == filter2) then |
local gridnode = mw.html.create('div') |
local gridnode = mw.html.create('div') |
||
local _title = champData[champion]["title"] or "" |
local _title = champData[champion]["title"] or "" |
||
local _disp = champData[champion]["disp_name"] or champion |
local _disp = champData[champion]["disp_name"] or champion |
||
local _icon = champData[champion]["icon"] or "ChampionSquare.png" |
local _icon = champData[champion]["icon"] or "ChampionSquare.png" |
||
+ | local _link = champData[champion]["link"] or "User:Emptylord/Patch/" .. champion |
||
local _image = champData[champion]["image"] or "ChampionBanner.png" |
local _image = champData[champion]["image"] or "ChampionBanner.png" |
||
local _range = champData[champion]["range"] or "Unspecified" |
local _range = champData[champion]["range"] or "Unspecified" |
||
local _class = champData[champion]["class"] or "Unspecified" |
local _class = champData[champion]["class"] or "Unspecified" |
||
+ | local _classlist = "" |
||
local _type = champData[champion]["projtype"] or "Unspecified" |
local _type = champData[champion]["projtype"] or "Unspecified" |
||
local _status = champData[champion]["projstatus"] or "Unspecified" |
local _status = champData[champion]["projstatus"] or "Unspecified" |
||
+ | local _theme = champData[champion]["projtheme"] or "Unspecified" |
||
local _cont = champData[champion]["contributors"] or "" |
local _cont = champData[champion]["contributors"] or "" |
||
+ | local _desc = champData[champion]["description"] or "" |
||
+ | |||
+ | local alttext = _disp .. " - " .. _title |
||
local opacity = 1 |
local opacity = 1 |
||
− | local link = "" |
||
local cursor = "default" |
local cursor = "default" |
||
+ | |||
− | local s = "" |
||
+ | local s = "" |
||
− | |||
+ | s = s .. "<div style='padding:0.5em 0 0.5em 0.5em; float:right; width:350px;'>" |
||
− | if _type == "Unspecified" then opacity = 0.15 end |
||
+ | s = s .. "<table style='width:350px; text-align: center; background: #010A13; padding: 0.5em 1em;'>" |
||
− | if _type ~= "Unspecified" then cursor = "pointer" end |
||
+ | s = s .. "<tr>" |
||
− | if links ~= "false" then link = "User:Emptylord/Patch/" .. champion end |
||
+ | s = s .. "<td colspan='2' style='font-size: 1.5em; font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _disp .. " </td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td colspan='2' style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _title .. " </td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td colspan='2' style='padding: 0 2em 0.5em 2em;'><div class='justified-grid''>" |
||
+ | if _range ~= "Unspecified" then |
||
+ | s = s .. "<div class='centered-grid-icon'>[[File:" .. classicon[_range] .. "|48px]]</div>" |
||
+ | end |
||
+ | for i in string.gmatch(_class, "([^,]+)") do |
||
+ | if i ~= "Unspecified" then |
||
+ | _classlist = _classlist .. superclass[i] .. "," .. i .. "," |
||
+ | s = s .. "<div class='centered-grid-icon'>[[File:" .. classicon[i] .. "|48px]]</div>" |
||
+ | end |
||
+ | end |
||
+ | s = s .. "</div></td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td colspan='2' style='font-family: BeaufortLoL; color: #c9aa71; border-top: solid 1px #f1e6d0; padding:0.5em 0;'> " .. _desc .. " </td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Type</td><td> {{flag|" .. _type .. "}}</td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Theme</td><td>{{flag|" .. _theme .. "}}</td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Status</td><td>{{flag|" .. _status .. "}}</td>" |
||
+ | s = s .. "</tr>" |
||
+ | s = s .. "</table>" |
||
+ | s = s .. "</div>" |
||
+ | |||
+ | if _type == "Unspecified" then |
||
+ | s = "" |
||
+ | opacity = 0.15 |
||
+ | _link = "" |
||
+ | else |
||
+ | alttext = alttext .. " /\n/ " .. (fulltype[_type] or _type) .. " - " .. (fulltheme[_theme] or theme) .." /\n/ " .. _desc |
||
+ | if links == "false" then |
||
+ | _link = "" |
||
+ | cursor = "pointer" |
||
+ | end |
||
+ | end |
||
local _classlist = "" |
local _classlist = "" |
||
− | for i in |
+ | for i in (_class .. ","):gmatch("([^,]*),") do |
− | _classlist = superclass[i] .. "," .. i .. "," |
+ | _classlist = _classlist .. superclass[i] .. "," .. i .. "," |
end |
end |
||
gridnode |
gridnode |
||
− | :addClass('grid-icon emptylord-icon roster-icon') |
+ | :addClass('grid-icon emptylord-icon roster-icon centered-grid-icon advanced-tooltip') |
:attr('data-range', _range) |
:attr('data-range', _range) |
||
:attr('data-class', _classlist) |
:attr('data-class', _classlist) |
||
+ | :attr('data-theme', _theme) |
||
:attr('data-status', _status) |
:attr('data-status', _status) |
||
:attr('data-type', _type) |
:attr('data-type', _type) |
||
− | :attr('data-search', _title) |
+ | :attr('data-search', _title .. "," .. _cont) |
+ | :attr('title', alttext) |
||
:css('opacity', opacity) |
:css('opacity', opacity) |
||
:css('cursor', cursor) |
:css('cursor', cursor) |
||
− | :wikitext("[[File:" .. _icon .. "| |
+ | :wikitext("[[File:" .. _icon .. "|32px|link=" .. _link .. "|" .. alttext .."]]") |
+ | :tag('div') |
||
+ | :attr('class','tooltip-contents') |
||
+ | :css('display','none') |
||
+ | :wikitext(frame:preprocess(s)) |
||
+ | :done() |
||
:done() |
:done() |
||
+ | grid |
||
− | if _type == "Unspecified" or gridonly == "true" then |
||
− | + | :node(gridnode) |
|
− | + | :newline() |
|
− | + | ||
− | else |
||
− | local _classlist = "" |
||
− | for i in string.gmatch(_class, "([^,]+)") do |
||
− | if i ~= "Unspecified" then |
||
− | _classlist = _classlist .. "{{tip|Emptylord" .. i .. "|" .. i .. "}} " |
||
− | else |
||
− | _classlist = _classlist .. "{{tip|" .. i .. "}} " |
||
− | end |
||
− | end |
||
− | |||
− | s = s .. "<infobox>" |
||
− | s = s .. "<header><div style='width:100%; text-align:center;'>".. (fulltype[_type] or "Unhandled type") .. " " .. (statusflag[_status] or "Unhandled status") .. "</div></header>" |
||
− | s = s .. "<title><default>" .. _disp .. "</default></title>" |
||
− | s = s .. "<data><default>[[File:" .. _image .. "|250px]]</default></data>" |
||
− | s = s .. "<data><default>" .. _title .. "</default></data>" |
||
− | s = s .. "<data><label>Range</label><default>{{tip|" .. _range .. "}}</default></data>" |
||
− | s = s .. "<data><label>Classes</label><default>" .. _classlist .. "</default></data>" |
||
− | s = s .. "<data><label>Contributors</label><default>" .. _cont .. "</default></data>" |
||
− | s = s .. "</infobox>" |
||
− | |||
− | s = s .. "{{:User:Emptylord/Patch/" .. champion .. "}}" |
||
− | |||
− | grid |
||
− | :node(gridnode) |
||
− | :newline() |
||
− | :wikitext(frame:preprocess("<div class='roster-info'>" .. s .. "</div>")) |
||
− | end |
||
else |
else |
||
--skip champion |
--skip champion |
||
Line 159: | Line 209: | ||
return grid |
return grid |
||
+ | end |
||
+ | |||
+ | function p.getCustomRoster(frame) |
||
+ | local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end |
||
+ | |||
+ | local champData = require('Module:Sandbox/Emptylord/Navigation/custom') |
||
+ | local champTable = {} |
||
+ | local filter = args['filter'] or "None" |
||
+ | local filter2 = args['filter2'] or "None" |
||
+ | local links = args['links'] or "true" |
||
+ | local gridonly = args['gridonly'] or "false" |
||
+ | |||
+ | for champname in pairs(champData) do |
||
+ | table.insert(champTable, champname) |
||
+ | end |
||
+ | table.sort(champTable) |
||
+ | |||
+ | local grid = mw.html.create('div') |
||
+ | |||
+ | grid |
||
+ | :attr('id', 'emptylord-grid') |
||
+ | :addClass('centered-grid') |
||
+ | :css('clear', 'both') |
||
+ | :css('padding', '4px') |
||
+ | |||
+ | for _, champion in pairs(champTable) do |
||
+ | if champData[champion]["indexed"] ~= "false" and (filter == "None" or champData[champion]["projtype"] == filter or champData[champion]["projtype"] == filter2) then |
||
+ | local gridnode = mw.html.create('div') |
||
+ | local _title = champData[champion]["title"] or "" |
||
+ | local _disp = champData[champion]["disp_name"] or champion |
||
+ | local _icon = champData[champion]["icon"] or "ChampionBanner.png" |
||
+ | local _link = champData[champion]["link"] or "User:Emptylord/Patch/" .. champion |
||
+ | local _image = champData[champion]["image"] or _icon |
||
+ | local _range = champData[champion]["range"] or "Unspecified" |
||
+ | local _class = champData[champion]["class"] or "Unspecified" |
||
+ | local _classlist = "" |
||
+ | local _type = champData[champion]["projtype"] or "Unspecified" |
||
+ | local _status = champData[champion]["projstatus"] or "Unspecified" |
||
+ | local _theme = champData[champion]["projtheme"] or "Unspecified" |
||
+ | local _cont = champData[champion]["contributors"] or "" |
||
+ | local _desc = champData[champion]["description"] or "" |
||
+ | |||
+ | local alttext = _disp .. " - " .. _title |
||
+ | local opacity = 1 |
||
+ | local cursor = "default" |
||
+ | |||
+ | local s = "" |
||
+ | s = s .. "<div style='padding:0.5em 0 0.5em 0.5em; float:right;'>[[File:" .. _image .. "|350px]]" |
||
+ | s = s .. "<table style='width:350px; text-align: center; background: #010A13; padding: 0.5em 1em;'>" |
||
+ | s = s .. "<tr>" |
||
+ | s = s .. "<td colspan='2' style='font-size: 1.5em; font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _disp .. " </td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td colspan='2' style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _title .. " </td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td colspan='2' style='padding: 0 2em 0.5em 2em;'><div class='justified-grid''>" |
||
+ | if _range ~= "Unspecified" then |
||
+ | s = s .. "<div class='centered-grid-icon'>[[File:" .. classicon[_range] .. "|48px]]</div>" |
||
+ | end |
||
+ | for i in string.gmatch(_class, "([^,]+)") do |
||
+ | if i ~= "Unspecified" then |
||
+ | _classlist = _classlist .. superclass[i] .. "," .. i .. "," |
||
+ | s = s .. "<div class='centered-grid-icon'>[[File:" .. classicon[i] .. "|48px]]</div>" |
||
+ | end |
||
+ | end |
||
+ | s = s .. "</div></td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td colspan='2' style='font-family: BeaufortLoL; color: #c9aa71; border-top: solid 1px #f1e6d0; padding:0.5em 0;'> " .. _desc .. " </td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Type</td><td>{{flag|" .. _type .. "}}</td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Theme</td><td>{{flag|" .. _theme .. "}}</td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Status</td><td>{{flag|" .. _status .. "}}</td>" |
||
+ | s = s .. "</tr>" |
||
+ | s = s .. "</table>" |
||
+ | s = s .. "</div>" |
||
+ | |||
+ | if _type == "Unspecified" then |
||
+ | opacity = 0.15 |
||
+ | _link = "" |
||
+ | else |
||
+ | alttext = alttext .. " /\n/ " .. (fulltype[_type] or _type) .. " - " .. (fulltheme[_theme] or theme) .." /\n/ " .. _desc |
||
+ | if links == "false" then |
||
+ | _link = "" |
||
+ | cursor = "pointer" |
||
+ | end |
||
+ | end |
||
+ | |||
+ | gridnode |
||
+ | :addClass('grid-icon emptylord-icon roster-icon centered-grid-icon advanced-tooltip') |
||
+ | :attr('data-range', _range) |
||
+ | :attr('data-class', _classlist) |
||
+ | :attr('data-theme', _theme) |
||
+ | :attr('data-status', _status) |
||
+ | :attr('data-type', _type) |
||
+ | :attr('data-search', _title .. "," .. _cont) |
||
+ | :attr('title', alttext) |
||
+ | :css('opacity', opacity) |
||
+ | :css('cursor', cursor) |
||
+ | :css('width', '86px') |
||
+ | :css('overflow', ' hidden') |
||
+ | :css('margin', '2px') |
||
+ | :wikitext("[[File:" .. _icon .. "|x48px|link=" .. _link .. "|" .. alttext .."]]") |
||
+ | :tag('div') |
||
+ | :attr('class','tooltip-contents') |
||
+ | :css('display','none') |
||
+ | :wikitext(frame:preprocess(s)) |
||
+ | :done() |
||
+ | :done() |
||
+ | |||
+ | grid |
||
+ | :node(gridnode) |
||
+ | :newline() |
||
+ | |||
+ | else |
||
+ | --skip champion |
||
+ | end |
||
+ | end |
||
+ | |||
+ | return grid |
||
+ | end |
||
+ | |||
+ | function p.getInfobox(frame) |
||
+ | local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end |
||
+ | |||
+ | local dataset = args['dataset'] or "patch" |
||
+ | local champData = require('Module:Sandbox/Emptylord/Navigation/' .. dataset) |
||
+ | local champion = args['1'] or args['id'] or "Glitch" |
||
+ | local champTable = {} |
||
+ | |||
+ | for champname in pairs(champData) do |
||
+ | table.insert(champTable, champname) |
||
+ | end |
||
+ | table.sort(champTable) |
||
+ | |||
+ | local _title = champData[champion]["title"] or "N/A" |
||
+ | local _disp = champData[champion]["disp_name"] or champion |
||
+ | local _icon = champData[champion]["icon"] or "ChampionBanner.png" |
||
+ | local _link = champData[champion]["link"] or "User:Emptylord/Patch/" .. champion |
||
+ | local _image = champData[champion]["image"] or _icon |
||
+ | local _range = champData[champion]["range"] or "Unspecified" |
||
+ | local _class = champData[champion]["class"] or "Unspecified" |
||
+ | local _classlist = "" |
||
+ | local _type = champData[champion]["projtype"] or "Unspecified" |
||
+ | local _status = champData[champion]["projstatus"] or "Unspecified" |
||
+ | local _theme = champData[champion]["projtheme"] or "Unspecified" |
||
+ | local _cont = champData[champion]["contributors"] or "" |
||
+ | local _desc = champData[champion]["description"] or "" |
||
+ | |||
+ | local alttext = _disp .. " - " .. _title |
||
+ | local opacity = 1 |
||
+ | local cursor = "default" |
||
+ | |||
+ | local s = "" |
||
+ | s = s .. "<div style='padding:0.5em 0 0.5em 0.5em; float:right;'>[[File:" .. _image .. "|350px]]" |
||
+ | s = s .. "<table style='width:350px; text-align: center; background: #010A13; padding: 0.5em 1em;'>" |
||
+ | s = s .. "<tr>" |
||
+ | s = s .. "<td colspan='2' style='font-size: 1.5em; font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _disp .. " </td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td colspan='2' style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _title .. " </td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td colspan='2' style='padding: 0 2em 0.5em 2em; border-bottom: solid 1px #f1e6d0;'><div class='justified-grid''>" |
||
+ | if _range ~= "Unspecified" then |
||
+ | s = s .. "<div class='centered-grid-icon glossary' data-tip='" .. _range .. "'>[[File:" .. classicon[_range] .. "|48px]]</div>" |
||
+ | end |
||
+ | for i in string.gmatch(_class, "([^,]+)") do |
||
+ | if i ~= "Unspecified" then |
||
+ | _classlist = _classlist .. superclass[i] .. "," .. i .. "," |
||
+ | s = s .. "<div class='centered-grid-icon glossary' data-tip='Emptylord" .. i:lower() .. "'>[[File:" .. classicon[i] .. "|48px]]</div>" |
||
+ | end |
||
+ | end |
||
+ | s = s .. "</div></td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Type</td><td>" .. _type .. "</td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Theme</td><td>" .. _theme .. "</td>" |
||
+ | s = s .. "</tr><tr>" |
||
+ | s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Status</td><td>" .. _status .. "</td>" |
||
+ | s = s .. "</tr>" |
||
+ | s = s .. "</table>" |
||
+ | s = s .. "</div>" |
||
+ | |||
+ | if _desc ~= "" then |
||
+ | s = s .. "{{quote|" .. _desc .. "|Project description}}" |
||
+ | end |
||
+ | |||
+ | return frame:preprocess(s) |
||
end |
end |
||
Latest revision as of 23:36, 29 December 2021
- Quick Links
- MediaWiki:Common.js/rosterFilter.js
- Module:Sandbox/Emptylord/Navigation /doc (functions)
- Module:Sandbox/Emptylord/Navigation/patch /doc
- Module:Sandbox/Emptylord/Navigation/custom /doc
- Module:Sandbox/Emptylord/Navigation/getter
- User:Emptylord/Re-Workshop
- User:Emptylord/Template:Re-Workshop
- User:Emptylord/Template:Rework infobox
-- <pre>
local p = {}
local lib = require('Module:Feature')
local json = require('Module:JSON')
local userError = require('Dev:User error')
local FN = require('Module:Filename')
local superclass = {
["Enforcer"] = "Fighter",
["Juggernaut"] = "Fighter",
["Skirmisher"] = "Fighter",
["Artillery"] = "Slayer",
["Mage"] = "Slayer",
["Ranger"] = "Slayer",
["Rogue"] = "Slayer",
["Disruptor"] = "Support",
["Enchanter"] = "Support",
["Warden"] = "Support",
["Specialist"] = "Specialist",
["Unspecified"] = "Unspecified",
}
local classicon = {
["Enforcer"] = "Tank icon.png",
["Juggernaut"] = "Fighter icon.png",
["Skirmisher"] = "Emptylord Skirmisher icon.png",
["Artillery"] = "Emptylord Artillery icon.png",
["Mage"] = "Mage icon.png",
["Ranger"] = "Marksman icon.png",
["Rogue"] = "Slayer icon.png",
["Disruptor"] = "Emptylord Disruptor icon.png",
["Enchanter"] = "Controller icon.png",
["Warden"] = "Emptylord Warden icon.png",
["Specialist"] = "Emptylord Specialist icon.png",
["Ranged"] = "Ranged role.png",
["Melee"] = "Melee role.png",
["Unspecified"] = "Unspecified",
}
local fulltype = {
["Quality"] = "Balance changes",
["Rework"] = "Gameplay update",
["Relaunch"] = "Champion relaunch",
["Original"] = "New addition",
["Novel"] = "New champion",
["Unspecified"] = "",
}
local fulltheme = {
["Current"] = "Current theme",
["Revisited"] = "Revisited theme",
["Blended"] = "Blended theme",
["Novel"] = "Novel theme",
["Imported"] = "Imported theme",
["Unspecified"] = "",
}
local statusflag = {
["Concept"] = "<span style='font-size: 75%; background-color: darkcyan; padding: 4px; border-radius: 4px; margin-left:1em; line-height: 18px;'>EARLY CONCEPT</span>",
["Draft"] = "<span style='font-size: 75%; background-color: darkblue; padding: 4px; border-radius: 4px; margin-left:1em; line-height: 18px;'>WORK IN PROGRESS</span>",
["Published"] = "<span style='font-size: 75%; background-color: darkgreen; padding: 4px; border-radius: 4px; margin-left:1em; line-height: 18px;'>COMPLETED</span>",
["Outdated"] = "<span style='font-size: 75%; background-color: darkred; padding: 4px; border-radius: 4px; margin-left:1em; line-height: 18px;'>OUTDATED</span>",
["Retired"] = "<span style='font-size: 75%; background-color: black; padding: 4px; border-radius: 4px; margin-left:1em; line-height: 18px;'>RETIRED</span>",
["Unspecified"] = "Unspecified",
}
function p.getPatch(frame)
local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end
local get = require ('Module:Sandbox/Emptylord/Navigation/getter')
local champname = args['champname'] or args[1]
local set = tonumber(args['set']) or tonumber(args[2])
local datatype = args['datatype'] or args[3]
local result = get[datatype](champname, set)
if (datatype == "active" or dataype == "passive ") and result ~= nil then
return frame:preprocess(result)
elseif result == nil then
return ""
else
return result
end
end
function p.getPatchRoster(frame)
local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end
local champData = require('Module:Sandbox/Emptylord/Navigation/patch')
local champTable = {}
local filter = args['filter'] or "None"
local filter2 = args['filter2'] or "None"
local links = args['links'] or "true"
local gridonly = args['gridonly'] or "false"
for champname in pairs(champData) do
table.insert(champTable, champname)
end
table.sort(champTable)
local grid = mw.html.create('div')
grid
:attr('id', 'emptylord-grid')
:addClass('centered-grid')
:css('clear', 'both')
for _, champion in pairs(champTable) do
if champData[champion]["indexed"] ~= "false" and (filter == "None" or champData[champion]["projtype"] == filter or champData[champion]["projtype"] == filter2) then
local gridnode = mw.html.create('div')
local _title = champData[champion]["title"] or ""
local _disp = champData[champion]["disp_name"] or champion
local _icon = champData[champion]["icon"] or "ChampionSquare.png"
local _link = champData[champion]["link"] or "User:Emptylord/Patch/" .. champion
local _image = champData[champion]["image"] or "ChampionBanner.png"
local _range = champData[champion]["range"] or "Unspecified"
local _class = champData[champion]["class"] or "Unspecified"
local _classlist = ""
local _type = champData[champion]["projtype"] or "Unspecified"
local _status = champData[champion]["projstatus"] or "Unspecified"
local _theme = champData[champion]["projtheme"] or "Unspecified"
local _cont = champData[champion]["contributors"] or ""
local _desc = champData[champion]["description"] or ""
local alttext = _disp .. " - " .. _title
local opacity = 1
local cursor = "default"
local s = ""
s = s .. "<div style='padding:0.5em 0 0.5em 0.5em; float:right; width:350px;'>"
s = s .. "<table style='width:350px; text-align: center; background: #010A13; padding: 0.5em 1em;'>"
s = s .. "<tr>"
s = s .. "<td colspan='2' style='font-size: 1.5em; font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _disp .. " </td>"
s = s .. "</tr><tr>"
s = s .. "<td colspan='2' style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _title .. " </td>"
s = s .. "</tr><tr>"
s = s .. "<td colspan='2' style='padding: 0 2em 0.5em 2em;'><div class='justified-grid''>"
if _range ~= "Unspecified" then
s = s .. "<div class='centered-grid-icon'>[[File:" .. classicon[_range] .. "|48px]]</div>"
end
for i in string.gmatch(_class, "([^,]+)") do
if i ~= "Unspecified" then
_classlist = _classlist .. superclass[i] .. "," .. i .. ","
s = s .. "<div class='centered-grid-icon'>[[File:" .. classicon[i] .. "|48px]]</div>"
end
end
s = s .. "</div></td>"
s = s .. "</tr><tr>"
s = s .. "<td colspan='2' style='font-family: BeaufortLoL; color: #c9aa71; border-top: solid 1px #f1e6d0; padding:0.5em 0;'> " .. _desc .. " </td>"
s = s .. "</tr><tr>"
s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Type</td><td> {{flag|" .. _type .. "}}</td>"
s = s .. "</tr><tr>"
s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Theme</td><td>{{flag|" .. _theme .. "}}</td>"
s = s .. "</tr><tr>"
s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Status</td><td>{{flag|" .. _status .. "}}</td>"
s = s .. "</tr>"
s = s .. "</table>"
s = s .. "</div>"
if _type == "Unspecified" then
s = ""
opacity = 0.15
_link = ""
else
alttext = alttext .. " /\n/ " .. (fulltype[_type] or _type) .. " - " .. (fulltheme[_theme] or theme) .." /\n/ " .. _desc
if links == "false" then
_link = ""
cursor = "pointer"
end
end
local _classlist = ""
for i in (_class .. ","):gmatch("([^,]*),") do
_classlist = _classlist .. superclass[i] .. "," .. i .. ","
end
gridnode
:addClass('grid-icon emptylord-icon roster-icon centered-grid-icon advanced-tooltip')
:attr('data-range', _range)
:attr('data-class', _classlist)
:attr('data-theme', _theme)
:attr('data-status', _status)
:attr('data-type', _type)
:attr('data-search', _title .. "," .. _cont)
:attr('title', alttext)
:css('opacity', opacity)
:css('cursor', cursor)
:wikitext("[[File:" .. _icon .. "|32px|link=" .. _link .. "|" .. alttext .."]]")
:tag('div')
:attr('class','tooltip-contents')
:css('display','none')
:wikitext(frame:preprocess(s))
:done()
:done()
grid
:node(gridnode)
:newline()
else
--skip champion
end
end
return grid
end
function p.getCustomRoster(frame)
local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end
local champData = require('Module:Sandbox/Emptylord/Navigation/custom')
local champTable = {}
local filter = args['filter'] or "None"
local filter2 = args['filter2'] or "None"
local links = args['links'] or "true"
local gridonly = args['gridonly'] or "false"
for champname in pairs(champData) do
table.insert(champTable, champname)
end
table.sort(champTable)
local grid = mw.html.create('div')
grid
:attr('id', 'emptylord-grid')
:addClass('centered-grid')
:css('clear', 'both')
:css('padding', '4px')
for _, champion in pairs(champTable) do
if champData[champion]["indexed"] ~= "false" and (filter == "None" or champData[champion]["projtype"] == filter or champData[champion]["projtype"] == filter2) then
local gridnode = mw.html.create('div')
local _title = champData[champion]["title"] or ""
local _disp = champData[champion]["disp_name"] or champion
local _icon = champData[champion]["icon"] or "ChampionBanner.png"
local _link = champData[champion]["link"] or "User:Emptylord/Patch/" .. champion
local _image = champData[champion]["image"] or _icon
local _range = champData[champion]["range"] or "Unspecified"
local _class = champData[champion]["class"] or "Unspecified"
local _classlist = ""
local _type = champData[champion]["projtype"] or "Unspecified"
local _status = champData[champion]["projstatus"] or "Unspecified"
local _theme = champData[champion]["projtheme"] or "Unspecified"
local _cont = champData[champion]["contributors"] or ""
local _desc = champData[champion]["description"] or ""
local alttext = _disp .. " - " .. _title
local opacity = 1
local cursor = "default"
local s = ""
s = s .. "<div style='padding:0.5em 0 0.5em 0.5em; float:right;'>[[File:" .. _image .. "|350px]]"
s = s .. "<table style='width:350px; text-align: center; background: #010A13; padding: 0.5em 1em;'>"
s = s .. "<tr>"
s = s .. "<td colspan='2' style='font-size: 1.5em; font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _disp .. " </td>"
s = s .. "</tr><tr>"
s = s .. "<td colspan='2' style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _title .. " </td>"
s = s .. "</tr><tr>"
s = s .. "<td colspan='2' style='padding: 0 2em 0.5em 2em;'><div class='justified-grid''>"
if _range ~= "Unspecified" then
s = s .. "<div class='centered-grid-icon'>[[File:" .. classicon[_range] .. "|48px]]</div>"
end
for i in string.gmatch(_class, "([^,]+)") do
if i ~= "Unspecified" then
_classlist = _classlist .. superclass[i] .. "," .. i .. ","
s = s .. "<div class='centered-grid-icon'>[[File:" .. classicon[i] .. "|48px]]</div>"
end
end
s = s .. "</div></td>"
s = s .. "</tr><tr>"
s = s .. "<td colspan='2' style='font-family: BeaufortLoL; color: #c9aa71; border-top: solid 1px #f1e6d0; padding:0.5em 0;'> " .. _desc .. " </td>"
s = s .. "</tr><tr>"
s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Type</td><td>{{flag|" .. _type .. "}}</td>"
s = s .. "</tr><tr>"
s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Theme</td><td>{{flag|" .. _theme .. "}}</td>"
s = s .. "</tr><tr>"
s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Status</td><td>{{flag|" .. _status .. "}}</td>"
s = s .. "</tr>"
s = s .. "</table>"
s = s .. "</div>"
if _type == "Unspecified" then
opacity = 0.15
_link = ""
else
alttext = alttext .. " /\n/ " .. (fulltype[_type] or _type) .. " - " .. (fulltheme[_theme] or theme) .." /\n/ " .. _desc
if links == "false" then
_link = ""
cursor = "pointer"
end
end
gridnode
:addClass('grid-icon emptylord-icon roster-icon centered-grid-icon advanced-tooltip')
:attr('data-range', _range)
:attr('data-class', _classlist)
:attr('data-theme', _theme)
:attr('data-status', _status)
:attr('data-type', _type)
:attr('data-search', _title .. "," .. _cont)
:attr('title', alttext)
:css('opacity', opacity)
:css('cursor', cursor)
:css('width', '86px')
:css('overflow', ' hidden')
:css('margin', '2px')
:wikitext("[[File:" .. _icon .. "|x48px|link=" .. _link .. "|" .. alttext .."]]")
:tag('div')
:attr('class','tooltip-contents')
:css('display','none')
:wikitext(frame:preprocess(s))
:done()
:done()
grid
:node(gridnode)
:newline()
else
--skip champion
end
end
return grid
end
function p.getInfobox(frame)
local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end
local dataset = args['dataset'] or "patch"
local champData = require('Module:Sandbox/Emptylord/Navigation/' .. dataset)
local champion = args['1'] or args['id'] or "Glitch"
local champTable = {}
for champname in pairs(champData) do
table.insert(champTable, champname)
end
table.sort(champTable)
local _title = champData[champion]["title"] or "N/A"
local _disp = champData[champion]["disp_name"] or champion
local _icon = champData[champion]["icon"] or "ChampionBanner.png"
local _link = champData[champion]["link"] or "User:Emptylord/Patch/" .. champion
local _image = champData[champion]["image"] or _icon
local _range = champData[champion]["range"] or "Unspecified"
local _class = champData[champion]["class"] or "Unspecified"
local _classlist = ""
local _type = champData[champion]["projtype"] or "Unspecified"
local _status = champData[champion]["projstatus"] or "Unspecified"
local _theme = champData[champion]["projtheme"] or "Unspecified"
local _cont = champData[champion]["contributors"] or ""
local _desc = champData[champion]["description"] or ""
local alttext = _disp .. " - " .. _title
local opacity = 1
local cursor = "default"
local s = ""
s = s .. "<div style='padding:0.5em 0 0.5em 0.5em; float:right;'>[[File:" .. _image .. "|350px]]"
s = s .. "<table style='width:350px; text-align: center; background: #010A13; padding: 0.5em 1em;'>"
s = s .. "<tr>"
s = s .. "<td colspan='2' style='font-size: 1.5em; font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _disp .. " </td>"
s = s .. "</tr><tr>"
s = s .. "<td colspan='2' style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'> " .. _title .. " </td>"
s = s .. "</tr><tr>"
s = s .. "<td colspan='2' style='padding: 0 2em 0.5em 2em; border-bottom: solid 1px #f1e6d0;'><div class='justified-grid''>"
if _range ~= "Unspecified" then
s = s .. "<div class='centered-grid-icon glossary' data-tip='" .. _range .. "'>[[File:" .. classicon[_range] .. "|48px]]</div>"
end
for i in string.gmatch(_class, "([^,]+)") do
if i ~= "Unspecified" then
_classlist = _classlist .. superclass[i] .. "," .. i .. ","
s = s .. "<div class='centered-grid-icon glossary' data-tip='Emptylord" .. i:lower() .. "'>[[File:" .. classicon[i] .. "|48px]]</div>"
end
end
s = s .. "</div></td>"
s = s .. "</tr><tr>"
s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Type</td><td>" .. _type .. "</td>"
s = s .. "</tr><tr>"
s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Theme</td><td>" .. _theme .. "</td>"
s = s .. "</tr><tr>"
s = s .. "<td style='font-family: BeaufortLoL; text-transform: uppercase; color: #f1e6d0;'>Project Status</td><td>" .. _status .. "</td>"
s = s .. "</tr>"
s = s .. "</table>"
s = s .. "</div>"
if _desc ~= "" then
s = s .. "{{quote|" .. _desc .. "|Project description}}"
end
return frame:preprocess(s)
end
return p
-- </pre>
-- [[Category:Lua]]