Anonymous

Module:Township/Sandbox: Difference between revisions

From Melvor Idle
no edit summary
(Created page with "local Shared = require('Module:Shared') local Icons = require('Module:Icons') local Items = require('Module:Items') local Monsters = require('Module:Monsters') local Shop = require('Module:Shop') local GameData = require('Module:GameData') local Constants = require('Module:Constants') local Num = require('Module:Number') local p = {} local Township = GameData.getSkillData('melvorD:Township') p.Township = Township -- Gets a Township building by ID, e.g. melvorF:Hunters...")
 
No edit summary
Line 334: Line 334:
-- Skips upgraded buildings
-- Skips upgraded buildings
function p.getBuildingBiomeTable(frame)
function p.getBuildingBiomeTable(frame)
-- Setup the table
local ret = {}
local tbl = mw.html.create('table')
local tbl = mw.html.create('table')
:addClass('wikitable sortable stickyHeader')
:addClass('wikitable sortable stickyHeader')
Line 343: Line 341:
:addClass('headerRow-0')
:addClass('headerRow-0')
:wikitext('Building')
:wikitext('Building')
local level = mw.html.create('tr')
local level = mw.html.create('tr')
:addClass('sorttop')
:addClass('sorttop')
:wikitext(Icons.Icon({'Township', 'Level', type='skill', nolink=true}))
:wikitext(Icons.Icon({'Township', 'Level', type='skill', nolink=true}))
local pop = mw.html.create('tr')
local pop = mw.html.create('tr')
:addClass('sorttop')
:addClass('sorttop')
Line 378: Line 374:
end
end


tbl :tag('tr')
tbl:tag('tr'):tag('td')
:tag('td')
:css('text-align', 'left')
:css('text-align', 'left')
:attr('data-sort-value', building.name)
:attr('data-sort-value', building.name)
:wikitext(Icons.Icon({building.name, type='building'}))
:wikitext(Icons.Icon({building.name, type='building'}))


for _, biome in ipairs(Township.biomes) do
for _, biome in ipairs(Township.biomes) do
if buildingBiomes[biome.id] then
if buildingBiomes[biome.id] then
tbl :tag('td')
tbl :tag('td')
:class('table-positive')
:addClass('table-positive')
:wikitext('✓')
:wikitext('✓')
else
else
2,875

edits