Template:Recipe item/doc: Difference between revisions
From Captain of Industry Wiki
Support instant recipe without unit (for Thermal Storage) |
No edit summary |
||
| Line 33: | Line 33: | ||
{{Recipe item | {{Recipe item | ||
| Name = Steam Hi | | Name = Steam Hi | ||
| Icon = SteamHp | |||
| Quantity = 2 | | Quantity = 2 | ||
| Time = 10 | | Time = 10 | ||
| Line 38: | Line 39: | ||
{{Recipe item | {{Recipe item | ||
| Name = Steam Hi | | Name = Steam Hi | ||
| Icon = SteamHp | |||
| Quantity = 2 | | Quantity = 2 | ||
| Time = 10 | | Time = 10 | ||
| Line 48: | Line 50: | ||
{{Recipe item | {{Recipe item | ||
| Name = Steam Hi | | Name = Steam Hi | ||
| Icon = SteamHp | |||
| Quantity = 2 | | Quantity = 2 | ||
| Time = 10 | | Time = 10 | ||
| Line 54: | Line 57: | ||
{{Recipe item | {{Recipe item | ||
| Name = Steam Hi | | Name = Steam Hi | ||
| Icon = SteamHp | |||
| Quantity = 2 | | Quantity = 2 | ||
| Time = 10 | | Time = 10 | ||
Latest revision as of 15:27, 20 May 2025
- Purpose
- This is a template for improving the maintainability of Template: Recipe draw, where the code for drawing the plus sign and item icon is used nearly 20 times. This template is intended to be used ONLY in Template: Recipe draw and does not work alone.
- Usage
- The template accepts the following parameters:
Name: Name of item (example: Iron Ore). If empty string, does not display anything.Quantity: Amount of consumed or produced item per 1 cycle of recipe.Time: Cycle time of recipe.Unit = MW or something(optional): Adds unit to Quantity.Unit = ?(optional, rare): Makes quantity to "?" (For Waste Sorting Plant and so on)
Plus = yes(optional): Displays "+" icon left of item iconPlus = something(optional, rare): Displays specified icon (or text) instead of "+" icon
Pollution = only(optional): Displays icon only if the item is Air Pollution or Water PollutionPollution = hide(optional): Displays icon only if the item is NOT Air Pollution or Water PollutionImageSize = something(optional, rare): Changes size of the item icon
Examples
- For Input1 and Output1
| Markup | Renders as |
|---|---|
{{Recipe item
| Name = Steam Hi
| Icon = SteamHp
| Quantity = 2
| Time = 10
}}
|
|
- For Input2-6 and Output2-6
| Markup | Renders as |
|---|---|
{{Recipe item
| Name = Steam Hi
| Icon = SteamHp
| Quantity = 2
| Time = 10
| Plus = yes
}}
|
|
- For Mechanical Power and Electricity
- For Instant recipe
- For variable quantity
-
- For displaying "?," Unit should be used instead of Quantity since Input1Qty, etc. in Template: Recipe define can receive only integer.
| Markup | Renders as |
|---|---|
{{Recipe item
| Name = Steam Hi
| Unit = ? <!-- NOT Quantity -->
| Time = 10
}}
|
|
- For hiding pollution
| Markup | Renders as |
|---|---|
{{Recipe item
| Name = Steam Hi
| Quantity = 2
| Time = 10
| Pollution = hide
}}
|
|
{{Recipe item
| Name = Air Pollution
| Quantity = 2
| Time = 10
| Pollution = hide
}}
|
|
- For showing only pollution
| Markup | Renders as |
|---|---|
{{Recipe item
| Name = Steam Hi
| Quantity = 2
| Time = 10
| Pollution = only
}}
|
|
{{Recipe item
| Name = Air Pollution
| Quantity = 2
| Time = 10
| Pollution = only
}}
|
|
- When Name is empty
| Markup | Renders as |
|---|---|
{{Recipe item
| Name =
| Quantity = 2
| Time = 10
}}
|
|
- For overwriting plus icon and/or icon size
| Markup | Renders as |
|---|---|
{{Recipe item
| Name = Steam Hi
| Quantity = 2
| Time = 10
| Plus = [[File:Unity.png|32x32px]]
| ImageSize = 24x24px
}}
|
|
Reason this template cannot be used alone
- This template depends on the following codes in Template: Recipe draw to define its style and some parameters.
- <templatestyles src="Template:Recipe draw/styles.css" />
- <div class="recipe-wrapper>
- {{#vardefine: img_plus | [[File:Plus.png|24x24px]] }}
- {{#vardefine: imgsz_reg | 48x48px }}
- {{#vardefine: pollution_1 | air pollution }}
- {{#vardefine: pollution_2 | water pollution }}
- {{#vardefine: pollution_3 | }}
- {{#vardefine: pollution_4 | }}