Editing Module:Infobox Item

From Eco - English Wiki

Your changes will be displayed to readers once an authorized user accepts them. (help)

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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. [[Category:MissingItem]]'
         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.checkImage(itemTable.type)
     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.footprint ~= nil then
     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: darkkhaki; text-align: right; padding: 3px;\" | ' .. L.t('Fat') .. ': ' .. itemTable.fat .. '\n'
         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/100
         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
Please note that all contributions to Eco - English Wiki are considered to be released under the CC BY-NC-SA 4.0 (see Eco:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)

Template used on this page: