Module:DunItem

local getArgs = require('Module:Arguments').getArgs local p = {}

function p.main(frame) local args = getArgs(frame) return p._main(args) end

function p._main(args) local IS = require("Module:IS").main local TableColor = require('Module:TableColor').main local item = IS({args[1]}) or "nil" local name = args[1] or '??' local loc = args[2] or '??' local tile = args[3] or '??' local visibility = args[4] or '??' local sprite = args["sprite"] or nil local color = args["color"] or nil local row = mw.html.create local cells = mw.html.create if name == "Shards" then item = IS({"Yellow Shard", "Items/Tutor Items"}) elseif name == "Gummis" then item = IS({"Blue Gummi", "Items/Gummis"}) end

if sprite then item = IS({sprite}) end cells :tag('td'):wikitext(item) :done :tag('td'):wikitext(name) :done :tag('td'):wikitext(loc) :done :tag('td'):wikitext(tile) :done :tag('td'):wikitext(visibility) :done

if color then row :tag('tr'):css( 'background-color', "#"..TableColor({"row", color}) ) :node(cells) else row :tag('tr'):css( 'background-color', "#"..TableColor({"row"}) ) :node(cells) end

return tostring(row) end

return p

-- print(p.main)