Module:ModifierTables: Difference between revisions

no edit summary
(Attempting to add Points of Interest to Modifier tables)
No edit summary
(One intermediate revision by the same user not shown)
Line 14: Line 14:
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')
local Cartography = require('Module:Skills/Cartography')
local Cartography = require('Module:Skills/Cartography')
local GameData = require('Module:GameData')


--First up, functions to get all the things in a category that have a given modifier:
--First up, functions to get all the things in a category that have a given modifier:
Line 547: Line 548:
end
end


-- Function to list all available modifiers for the relevant templates.
function p.getAllModifiers()
local tabl = mw.html.create('table')
:addClass('mw-collapsible mw-collapsed')
tabl:tag('caption')
:css('min-width', '200px')
:tag('b')
:wikitext('All Modifiers List')
-- First, sort modifiers
local modifierNames = {}
for k, _ in pairs(GameData.rawData.modifierData) do
table.insert(modifierNames, tostring(k))
end
table.sort(modifierNames)
-- Then add modifiers to output table
for _, v in pairs(modifierNames) do
tabl:tag('tr')
:tag('td')
:tag('code')
:wikitext(tostring(v)):done()
:done()
:done()
end
return tostring(tabl)
end
--Function for console testing of modifier tables
--Function for console testing of modifier tables
function p.getModifierTableTest()
function p.getModifierTableTest()
1,032

edits