Editing Module:Infobox Item
From Eco - English Wiki
Your changes will be displayed to readers once an authorized user accepts them. (help)
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 16: | Line 16: | ||
if itemTable == nil then | if itemTable == nil then | ||
return item .. ' could not be found in Module:ItemData. | return item .. ' could not be found in Module:ItemData.' | ||
end | end | ||
Line 44: | Line 44: | ||
infobox = infobox .. text_colour .. ';\"\n| colspan=\"2\" | \'\'\'' .. itemTable.group .. '\'\'\'\n' | infobox = infobox .. text_colour .. ';\"\n| colspan=\"2\" | \'\'\'' .. itemTable.group .. '\'\'\'\n' | ||
local icon = Utils. | local icon = Utils.build_icon(name) | ||
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | '..icon .. '\n' | infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | '..icon .. '\n' | ||
Line 69: | Line 69: | ||
-- 'Item' World Object header (if itemTable.group = Placeable or Blocks) | -- 'Item' World Object header (if itemTable.group = Placeable or Blocks) | ||
if itemTable. | if itemTable.group == L.t('Block Items') or itemTable.group == L.t('World Object Items') then | ||
infobox = infobox .. placementSection(itemTable, itemimagename) | infobox = infobox .. placementSection(itemTable, itemimagename) | ||
Line 195: | Line 195: | ||
section = section .. '| style=\"color: red; text-align: right; padding: 3px;\" | ' .. L.t('Carbs') .. ': ' .. itemTable.carbs .. '\n' | section = section .. '| style=\"color: red; text-align: right; padding: 3px;\" | ' .. L.t('Carbs') .. ': ' .. itemTable.carbs .. '\n' | ||
section = section .. '|- valign=\"center\"\n| style=\"color: orange; text-align: right; padding: 3px;\" | ' .. L.t('Protein') .. ': ' .. itemTable.protein .. '\n' | section = section .. '|- valign=\"center\"\n| style=\"color: orange; text-align: right; padding: 3px;\" | ' .. L.t('Protein') .. ': ' .. itemTable.protein .. '\n' | ||
section = section .. '|- valign=\"center\"\n| style=\"color: | section = section .. '|- valign=\"center\"\n| style=\"color: yellow; text-align: right; padding: 3px;\" | ' .. L.t('Fat') .. ': ' .. itemTable.fat .. '\n' | ||
section = section .. '|- valign=\"center\"\n| style=\"color: limegreen; text-align: right; padding: 3px;\" | ' .. L.t('Vitamins') .. ': ' .. itemTable.vitamins .. '\n' | section = section .. '|- valign=\"center\"\n| style=\"color: limegreen; text-align: right; padding: 3px;\" | ' .. L.t('Vitamins') .. ': ' .. itemTable.vitamins .. '\n' | ||
section = section .. sectionRow('Nutrition Density', L.t('%s per 100 cals'):format(itemTable.density)) | section = section .. sectionRow('Nutrition Density', L.t('%s per 100 cals'):format(itemTable.density)) | ||
Line 212: | Line 212: | ||
local weight | local weight | ||
if itemTable.weight ~= nil then | if itemTable.weight ~= nil then | ||
weight = itemTable.weight | weight = itemTable.weight | ||
else | else | ||
weight = '0.0' | weight = '0.0' | ||
Line 246: | Line 246: | ||
-- item id (type) | -- item id (type) | ||
section = section .. sectionRow('Item ID', itemTable.type) | section = section .. sectionRow('Item ID', itemTable.type) | ||
-- id number (type id) | |||
section = section .. sectionRow('ID Number', itemTable.typeID) | |||
return section | return section |