2,875
edits
(Add items table) |
(Fix item icons and item tables) |
||
Line 24: | Line 24: | ||
-- @return (string) Formatted string, or the input if it's not a string. | -- @return (string) Formatted string, or the input if it's not a string. | ||
local function formatName(name) | local function formatName(name) | ||
-- Special case to correctly format GP name. | |||
if shared.compareString(name, 'Gold Pieces', true) or shared.compareString(name, 'GP', true) then | |||
return 'Gold Pieces' | |||
end | |||
if type(name) == 'string' then | if type(name) == 'string' then | ||
return shared.titleCase(name) | return shared.titleCase(name) | ||
Line 39: | Line 44: | ||
local function getItemIcon(iconName) | local function getItemIcon(iconName) | ||
return icons.Icon({iconName | return icons.Icon({iconName, notext=true}) | ||
end | end | ||
Line 302: | Line 307: | ||
local inputsTable = buildItemTable(pInputs) | local inputsTable = buildItemTable(pInputs) | ||
if inputsTable ~= nil then | if inputsTable ~= nil then | ||
html:node(inputsTable) | html:css('padding', '0') | ||
:css('vertical-align', 'top') | |||
:node(inputsTable) | |||
else | else | ||
html:wikitext("None") | html:wikitext("None") | ||
Line 310: | Line 317: | ||
local outputsTable = buildItemTable(pOutputs) | local outputsTable = buildItemTable(pOutputs) | ||
if outputsTable ~= nil then | if outputsTable ~= nil then | ||
html:node(outputsTable) | html:css('padding', '0') | ||
:css('vertical-align', 'top') | |||
:node(outputsTable) | |||
else | else | ||
html:wikitext("None") | html:wikitext("None") |
edits