Template:Infobox food: Difference between revisions

From PZwiki
(New food infobox --WIP)
 
(added more variables +bkg)
Line 1: Line 1:
<noinclude>{{Notice|Underconstruction}}</noinclude>
<includeonly><table border=0 cellspacing=10 style="float:right; valign=top;"> <tr> <td style="background: #f7f7f7; border: 1px solid #ccc; vertical-align: top; width:240px;">   
<includeonly><table border=0 cellspacing=10 style="float:right; valign=top;"> <tr> <td style="background: #f7f7f7; border: 1px solid #ccc; vertical-align: top; width:240px;">   
<div style="margin: 5px; background: #3E3E3E; padding: 5px; font-weight: bold; text-align: center; font-size: 120%; color:#ffffff;"><div style="float: right;"></div>{{#if: {{{display_name|}}} |
<div style="margin: 5px; background: #3E3E3E; padding: 5px; font-weight: bold; text-align: center; font-size: 120%; color:#ffffff;"><div style="float: right;"></div>{{#if: {{{display_name|}}} |
Line 6: Line 5:
{{!}}- style="height:130px;"
{{!}}- style="height:130px;"
{{#if: {{{image|}}} |{{!}}colspan="2" {{!}} [[Image:{{{image}}}|120px|center]] |{{!}}colspan="2" {{!}} [[Image:image.png|120px|center]]}}
{{#if: {{{image|}}} |{{!}}colspan="2" {{!}} [[Image:{{{image}}}|120px|center]] |{{!}}colspan="2" {{!}} [[Image:image.png|120px|center]]}}
{{!}}- style="height:47px; vertical-align:top;" align="center"  
{{!}}- style="height:47px; vertical-align:top;" align="center"  
{{#if: {{{alternate_image|}}} |{{!}}colspan="2" {{!}}  
{{#if: {{{alternate_image|}}} |{{!}}colspan="2" {{!}}  
{{{!}}  
{{{!}}  
{{!}} style="background-color:white; border-style:solid; border-width:1px;" {{!}}[[Image:{{{alternate_image}}}|32px|center|link=|{{{alternate_name}}}]]
{{!}} style="background-color:white; border-style:solid; border-width:1px;" {{!}}[[Image:{{{alternate_image}}}|32px|center|link={{{alternate_link}}}|{{{alternate_name}}}]]
{{!}}}}}
{{!}}} }}
{{!}}- style="height:30px; background-color:#F2F2F2;"
{{!}}- style="height:30px; {{#if: {{{weight_bkg|}}}| background-color:#F2F2F2;}}"  
{{#if: {{{weight|}}} |{{!}} '''Weight:''' {{!}}{{!}} {{{weight}}}}}
{{#if: {{{weight|}}} |{{!}} '''Weight''' {{!}}{{!}} {{{weight}}} }}
{{!}}- style="height:30px;"
{{!}}- style="height:30px; {{#if: {{{hunger_change_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{hunger_change|}}} |{{!}} '''Hunger Change:''' {{!}}{{!}} {{{hunger_change}}}}}
{{#if: {{{hunger_change|}}} |{{!}} '''Hunger change''' {{!}}{{!}} {{{hunger_change}}} }}
{{!}}- style="height:30px; background-color:#F2F2F2;"
{{!}}- style="height:30px; {{#if: {{{thirst_change_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{thirst_change|}}} |{{!}} '''Thirst Change:''' {{!}}{{!}} {{{thirst_change}}}}}
{{#if: {{{thirst_change|}}} |{{!}} '''Thirst change''' {{!}}{{!}} {{{thirst_change}}} }}
{{!}}- style="height:30px;"
{{!}}- style="height:30px; {{#if: {{{unhappy_change_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{unhappy_change|}}} |{{!}} '''Unhappy Change:''' {{!}}{{!}} {{{unhappy_change}}}}}
{{#if: {{{unhappy_change|}}} |{{!}} '''Unhappy change''' {{!}}{{!}} {{{unhappy_change}}} }}
{{!}}- style="height:30px; background-color:#F2F2F2;"
{{!}}- style="height:30px; {{#if: {{{boredom_change_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{boredom_change|}}} |{{!}} '''Boredom Change:''' {{!}}{{!}} {{{boredom_change}}}}}
{{#if: {{{boredom_change|}}} |{{!}} '''Boredom change''' {{!}}{{!}} {{{boredom_change}}} }}
{{!}}- style="height:30px;"
{{!}}- style="height:30px; {{#if: {{{stress_change_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{stress_change|}}} |{{!}} '''Stress Change:''' {{!}}{{!}} {{{stress_change}}}}}
{{#if: {{{stress_change|}}} |{{!}} '''Stress change''' {{!}}{{!}} {{{stress_change}}} }}
{{!}}- style="height:30px; background-color:#F2F2F2;"
{{!}}- style="height:30px; {{#if: {{{fatigue_change_bkg|}}}| background-color:#F2F2F2;}}"  
{{#if: {{{fatigue_change|}}} |{{!}} '''Fatigue Change:''' {{!}}{{!}} {{{fatigue_change}}}}}
{{#if: {{{fatigue_change|}}} |{{!}} '''Fatigue change''' {{!}}{{!}} {{{fatigue_change}}} }}
{{!}}- style="height:30px;"
{{!}}- style="height:30px; {{#if: {{{cook_minutes_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{cook_minutes|}}} |{{!}} '''Time To Cook:''' {{!}}{{!}} {{{cook_minutes}}} minutes}}
{{#if: {{{cook_minutes|}}} |{{!}} '''Time to cook''' {{!}}{{!}} {{{cook_minutes}}} minutes}}
{{!}}- style="height:30px; background-color:#F2F2F2;"
{{!}}- style="height:30px; {{#if: {{{burn_minutes_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{burn_minutes|}}} |{{!}} '''Time To Burn:''' {{!}}{{!}} {{{burn_minutes}}} minutes}}
{{#if: {{{burn_minutes|}}} |{{!}} '''Time to burn''' {{!}}{{!}} {{{burn_minutes}}} minutes}}
{{!}}- style="height:30px;"
{{!}}- style="height:30px; {{#if: {{{dangerous_uncooked_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{bad_uncooked|}}} |{{!}} '''Bad Uncooked:''' {{!}}{{!}} {{{bad_uncooked}}}}}
{{#if: {{{dangerous_uncooked|}}} |{{!}} '''Dangerous uncooked''' {{!}}{{!}} {{{dangerous_uncooked}}} }}
{{!}}- style="height:30px; background-color:#F2F2F2;"
{{!}}- style="height:30px; {{#if: {{{bad_microwaved_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{class_name|}}} |{{!}} '''Name:''' {{!}}{{!}} {{{class_name}}}}}
{{#if: {{{bad_microwaved|}}} |{{!}} '''Bad microwaved''' {{!}}{{!}} {{{bad_microwaved}}} }}
{{!}}- style="height:30px; {{#if: {{{good_hot_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{good_hot|}}} |{{!}} '''Good hot''' {{!}}{{!}} {{{good_hot}}} }}
{{!}}- style="height:30px; {{#if: {{{bad_cold_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{bad_cold|}}} |{{!}} '''Bad cold''' {{!}}{{!}} {{{bad_cold}}} }}
{{!}}- style="height:30px; {{#if: {{{days_fresh_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{days_fresh|}}} |{{!}} '''Days fresh''' {{!}}{{!}} {{{days_fresh}}} days}}
{{!}}- style="height:30px; {{#if: {{{days_rotten_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{days_rotten|}}} |{{!}} '''Days until rotten''' {{!}}{{!}} {{{days_rotten}}} days}}
{{!}}- style="height:30px; {{#if: {{{poison_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{poison|}}} |{{!}} '''Poison''' {{!}}{{!}} {{{poison}}}}}
{{!}}- style="height:30px; {{#if: {{{poison_power_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{poison_power|}}} |{{!}} '''Poison power''' {{!}}{{!}} {{{poison_power}}}}}
{{!}}- style="height:30px; {{#if: {{{spice_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{spice|}}} |{{!}} '''Spice''' {{!}}{{!}} {{{spice}}}}}
{{!}}- style="height:30px; {{#if: {{{cant_be_frozen_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{cant_be_frozen|}}} |{{!}} '''Can't be frozen''' {{!}}{{!}} {{{cant_be_frozen}}}}}
{{!}}- style="height:30px; {{#if: {{{alcohol_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{alcohol|}}} |{{!}} '''Alcoholic''' {{!}}{{!}} {{{alcohol}}}}}
{{!}}- style="height:30px; {{#if: {{{alcohol_power_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{alcohol_power|}}} |{{!}} '''Alcohol power''' {{!}}{{!}} {{{alcohol_power}}}}}
{{!}}- style="height:30px; {{#if: {{{packaged_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{packaged|}}} |{{!}} '''Packaged''' {{!}}{{!}} {{{packaged}}}}}
{{!}}- style="height:30px; {{#if: {{{class_name_bkg|}}}| background-color:#F2F2F2;}}"
{{#if: {{{class_name|}}} |{{!}} '''Name:''' {{!}}{{!}} {{{class_name}}} }}
{{!}}}
{{!}}}
</small></center></td></tr></table>
</small></center></td></tr></table>
</includeonly><noinclude>
</includeonly><noinclude>
{{Infobox food
|display_name=Testing Food
|image=image.png
|alternate_image=EggCarton.png
|alternate_name=Eggs :)
|weight=1
|hunger_change=2
|thirst_change=3
|unhappy_change=4
|boredom_change=5
|stress_change=6
|fatigue_change=7
|cook_minutes=8
|burn_minutes=9
|bad_uncooked=False
|bad_microwaved=True
|good_hot=True
|class_name=Base.TestingFood101
}}
{{documentation}}
{{documentation}}
[[category:infobox]]
[[category:infobox]]
</noinclude>
</noinclude>

Revision as of 15:46, 10 June 2018

[view] [edit] [history] [purge] Template documentation
Imbox deletion.png
This page is a candidate for deletion.
Reason: Unused
This page (and any subpages) will be deleted after being reviewed by an admin, and no one has objected to its deletion. Users may discuss this request for deletion on the page's talk page. Once added, this should only be removed by an admin, or the user that added it.

This template is used to create an infobox in an article about food items.

Usage

To use this template in an article, copy the template below, then paste the template into an article.

All parameters are optional – those you do not populate with data will not show up in the infobox when the article is saved.

It is strongly advised to only include variables that are relevant to the specific item in question, i.e. parameters that do not display as false or 0 (excluding nutrition values).

Infobox food
Image.png
alternate_name
Weight weight
Hunger change hunger_change
Thirst change thirst_change
Unhappy change unhappy_change
Boredom change boredom_change
Stress change stress_change
Fatigue change fatigue_change
Time to cook cook_minutes minutes
Time to burn burn_minutes minutes
Dangerous uncooked dangerous_uncooked
Bad microwaved bad_microwaved
Good hot good_hot
Bad cold bad_cold
Days fresh days_fresh days
Days until rotten days_rotten days
Poison power poison_power
Spice spice
Can't be frozen cant_be_frozen
Alcohol power alcohol_power
Packaged packaged
{{Infobox food
|name =
|image=
|image_width=
|alternate_image=
|alternate_name=
|alternate_link=
|alternate_image2=
|alternate_name2=
|alternate_link2=
|alternate_image3=
|alternate_name3=
|alternate_link3=
|alternate_image4=
|alternate_name4=
|alternate_link4=
|alternate_image5=
|alternate_name5=
|alternate_link5=
|alternate_image6=
|alternate_name6=
|alternate_link6=
|alternate_image7=
|alternate_name7=
|alternate_link7=
|alternate_image8=
|alternate_name8=
|alternate_link8=
|alternate_image9=
|alternate_name9=
|alternate_link9=
|alternate_image10=
|alternate_name10=
|alternate_link10=
|alternate_image11=
|alternate_name11=
|alternate_link11=
|alternate_image12=
|alternate_name12=
|alternate_link12=
|alternate_image13=
|alternate_name13=
|alternate_link13=
|alternate_image14=
|alternate_name14=
|alternate_link14=
|alternate_image15=
|alternate_name15=
|alternate_link15=
|alternate_image16=
|alternate_name16=
|alternate_link16=
<!--GENERAL-->
|category=
|weight=
|function=
|max_units=
|days_fresh=
|days_rotten=
|cant_be_frozen=
|packaged=
<!--NUTRITION-->
|hunger_change=
|thirst_change=
|calories=
|lipids=
|proteins=
|carbohydrates=
<!--EFFECT-->
|unhappy_change=
|boredom_change=
|stress_change=
|fatigue_change=
|endurance_change=
|flu_change=
|pain_change=
|sick_change=
|reduce_infection_power=
|alcohol_power=
|poison_power=
<!--COOKING-->
|cook_minutes=
|burn_minutes=
|dangerous_uncooked=
|bad_microwaved=
|good_hot=
|bad_cold=
|spice=
<!--TECHNICAL DETAILS-->
|item_id =
}}

Parameters

Heading/Image

display_name
The display name of the item as it appears in-game. Leaving blank will display the pagename.
name_colour
The background colour for the display name. Codes can be found at Template:Infobox nc.
name_text_colour
The text colour for the display name. Codes can be found at Template:Infobox nc.
image
An image of the icon displayed at 128px by default. An image of the static model should be used if available.
image_width
Customise the width of the image.
alternate_image
An alternate image displayed at 32px. Can be an empty, packaged, open or any other variant.
alternate_name
The name of the alternate item image. Leaving blank will display no name when the image is hovered over.
alternate_link
An optional link to the alternate image page. Leaving blank will have no link.

General

weight
The base weight of the item.
category
The in-game category the item is displayed in in the inventory.
function
What the item is used for. Can usually be removed if the item isn't considered a tool by the wiki. (remove if value is empty)
max_units
The maximum units in a full item. Calculated using the "UseDelta" value: 1 / UseDelta.
packaged
Whether this item is considered to be "packaged", displaying the item's nutritional values. (remove if value is false)
cant_be_frozen
Whether this item can be frozen, delaying time before the food rots. (remove if value is false)
days_fresh
The amount of days this item is recognised as "fresh". The unit "days" is appended after the value. This value can be taken from DaysFresh in the scripts file. (remove if value is empty)
days_rotten
The amount of days before this item is recognised as "rotten". The unit "days" is appended after the value. This value can be taken from DaysTotallyRotten in the scripts file. (remove if value is empty)

Nutritional values

hunger_change
The value of hunger that is changed from using/consuming this item. (remove if value is empty)
thirst_change
The value of thirst that is changed from using/consuming this item. (remove if value is empty)
calories
The value of calories.
lipids
The value of lipids.
proteins
The value of proteins.
carbohydrates
The value of carbohydrates.

Effect

unhappy_change
The value of unhappiness that is changed from using/consuming this item. (remove if value is empty)
boredom_change
The value of boredom that is changed from using/consuming this item. (remove if value is empty)
stress_change
The value of stress that is changed from using/consuming this item. (remove if value is empty)
fatigue_change
The value of fatigue that is changed from using/consuming this item. (remove if value is empty)
endurance_change
The value of endurance that is changed from using/consuming this item. (remove if value is empty)
flu_change
The value of flu/cold that is changed from using/consuming this item. (remove if value is empty)
pain_change
The value of pain that is changed from using/consuming this item. (remove if value is empty)
sick_change
The value of sickness that is changed from using/consuming this item. (remove if value is empty)
reduce_infection_power
How much the item reduces wound infection. (remove if value is empty)
alcohol_power
The alcohol power of this item when used on wounds. (remove if value is empty)
poison_power
The value of poison power attached to this item. (remove if value is empty)

Cooking

cook_minutes
How long it takes before this item is "cooked". The unit "minutes" is appended after the value. (remove if value is empty)
burn_minutes
How long it takes before this item is "burnt". The unit "minutes" is appended after the value. (remove if value is empty)
dangerous_uncooked
Whether this item is dangerous if it is consumed before cooking it. (remove if value is false)
bad_microwaved
Whether this item is of a poorer quality if it is cooked in a microwave. (remove if value is false)
good_hot
Whether this item is of a superior quality if it is consumed hot. (remove if value is false)
bad_cold
Whether this item is of a poorer quality if it is consumed cold. (remove if value is false)
spice
Whether this item is considered a "spice" in cooking recipes. (remove if value is false)

Technical details

class_name
The item's 'Item ID'.


Examples

Hot Cuppa infobox

Infobox food
MugBlue Model.png
Hot Drink
Weight 0.5
Hunger change -5
Thirst change -50
Unhappy change -5
Stress change -10
Fatigue change -5
Can't be frozen True
{{Infobox food
|name =Hot Cuppa
|image=MugBlue_Model.png
|image_width=220px
|alternate_image=MugFulll.png
|alternate_name=Hot Drink
|alternate_link=
|weight=0.5
|category=Food
|hunger_change=-5
|thirst_change=-50
|calories=4
|lipids=0
|proteins=0.12
|carbohydrates=0.75
|unhappy_change=-5
|stress_change=-10
|fatigue_change=-5
|cant_be_frozen=True
|item_id =Base.Mugfull
}}

Pot of Soup infobox

Infobox food
CookingPot Model.png
Pot of Soup
Weight 4
Hunger change -30
Thirst change -30
Unhappy change -20
Time to cook 50 minutes
Time to burn 100 minutes
Days fresh 3 days
Days until rotten 5 days
{{Infobox food
|name =Pot of Soup
|image=CookingPot_Model.png
|image_width=160px
|alternate_image=PotFull.png
|alternate_name=Pot of Soup
|alternate_link=Pot of Soup
|weight=4
|category=Food
|hunger_change=-30
|thirst_change=-30
|calories=202
|carbohydrates = 25
|proteins = 14
|lipids = 4.5
|unhappy_change=-20
|cook_minutes=50
|burn_minutes=100
|days_fresh=3
|days_rotten=5
|item_id =Base.PotOfSoup
}}

Lollipop infobox

Infobox food
Lollipop Model.png
Lollipop
Weight 0.1
Hunger change -5
Unhappy change -10
{{Infobox food
|name =Lollipop
|image=Lollipop_Model.png
|image_width=150px
|alternate_image=Lollipop.png
|alternate_name=Lollipop
|alternate_link=Lollipop
|alternate_image2=CandyPackagei.png
|alternate_name2=Candy Package
|alternate_link2=Candy Package
|weight=0.1
|category=Food
|hunger_change=-5
|unhappy_change=-10
|calories=40
|carbohydrates = 10
|proteins = 0
|lipids = 0.5
|item_id =Base.Lollipop
}}

Meat Patty infobox

Infobox food
MeatPatty Model.png
Meat Patty
Weight 0.3
Hunger change -40
Time to cook 50 minutes
Time to burn 70 minutes
Bad microwaved True
Good hot True
Bad cold True
Days fresh 2 days
Days until rotten 4 days
{{Infobox food
|name =Meat Patty
|image=MeatPatty__Model.png
|image_width=150px
|alternate_image=MeatPatty.png
|alternate_name=Meat Patty
|alternate_link=
|alternate_image2=MeatPattyRotten.png
|alternate_name2=Meat Patty (Rotten)
|alternate_link2=
|alternate_image3=Cookedmeatpatty.png
|alternate_name3=Meat Patty (Cooked)
|alternate_link3=
|alternate_image4=Burnedmeatpatty.png
|alternate_name4=Meat Patty (Burnt)
|alternate_link4=
|weight=0.3
|category=Food
|hunger_change=-40
|calories=380
|carbohydrates = 0
|proteins = 26
|lipids = 30
|cook_minutes=50
|burn_minutes=70
|bad_microwaved=True
|good_hot=True
|bad_cold=True
|days_fresh=2
|days_rotten=4
|item_id =Base.MeatPatty
}}

Bourbon infobox

Infobox food
WhiskeyBottle Model.png
Bourbon
Weight 0.7
Hunger change -20
Thirst change -20
Unhappy change -10
Can't be frozen True
Alcohol power 2
{{Infobox food
|name =Bourbon
|image=WhiskeyBottle_Model.png
|image_width=200px
|alternate_image=WhiskeyFull.png
|alternate_link=Bourbon
|alternate_name=Bourbon
|alternate_image2=WhiskeyEmpty.png
|alternate_link2=Water Bottle (Bourbon)
|alternate_name2=Empty Bottle
|weight=0.7
|category=Food
|packaged_True
|cant_be_frozen=True
|hunger_change=-20
|thirst_change=-20
|calories=1500
|carbohydrates = 0
|proteins = 0
|lipids = 0
|unhappy_change=-10
|alcohol_power=2
|item_id =Base.WhiskeyFull
}}

Bleach infobox

Infobox food
Bleach Model.png
Bleach
Weight 0.3
Empty: 0.1
Thirst change -60
Unhappy change 99
Poison power 120
{{Infobox food
|name =Bleach
|image=Bleach_Model.png
|image_width=200px
|alternate_image=Bleach.png
|alternate_name=Bleach
|alternate_link=
|alternate_image2=Bleach.png
|alternate_name2=Empty Bleach Bottle
|alternate_link2=
|weight=0.3<br>Empty: 0.1
|category=Household
|thirst_change=-60
|unhappy_change=99
|poison_power=120
|use_for_poison=38
|item_id =Base.Bleach
}}
Documentation transcluded from Template:Infobox food/doc.
Editors can experiment in this template's sandbox (create)