918
edits
Falterfire (talk | contribs) (Attempting to add Points of Interest to Modifier tables) |
(Add function to display a list of all modifier names.) |
||
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') | |||
tabl:tag('caption'):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() |
edits