Difference between revisions of "Template:Ingredient List"

From RimWorld Wiki
Jump to navigation Jump to search
 
(48 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>
+
<includeonly><!--
{{Documentation}}
+
 
</noinclude><includeonly>
+
VARIABLES
<div><li style="display: inline-table;">
+
-->{{#vardefine:ingredient | {{{ 1 | {{PAGENAME}} }}} }}<!--
{{#vardefine:name | {{{ 1 | {{PAGENAME}}}}} }}{| {{STDT|sortable c_03 text-center}}
+
-->{{#vardefine:noCollapse | {{{noCollapse|}}} }}<!--
! Name !! Amount
+
-->{{#vardefine:mainCollapse | class="mw-collapsible {{#if: {{{noCollapse|}}}||mw-collapsed}}" id="mw-customcollapsible-ingredient-list-{{#replace:{{#var:ingredient}}|<nowiki> </nowiki>}}"}}<!--
|-
+
-->{{#vardefine:stuffableCollapse | class="mw-collapsible {{#if: {{{noCollapse|}}}||mw-collapsed}}" id="mw-customcollapsible-ingredient-list-stuffable-{{#replace:{{#var:ingredient}}|<nowiki> </nowiki>}}"}}<!--
{{#ask:[[Resource 1::{{lc:{{#var:name}}}}]]
+
 
  | named args=yes
+
CONTROL PANEL
  | ?Name=?Name
+
-- {{#if: {{Q|{{#var:ingredient}}|Stuff Category}} |<table {{STDT|any}}>
  | ?Resource 1 Amount=?Amount
+
<tr><th> Feature </th><th> Toggle </th></tr>
  | format=template
+
{{Control Panel|-ingredient-list-stuff|label = [[Stuff]]}}
  | template=Ingredient List Row
+
</table>}}<!--
 +
 
 +
MAIN TABLE HEADERS
 +
--><div><li style="display: inline-table;">
 +
{| {{STDT|sortable c_03 text-left}}
 +
! Product !! Ingredients !! Type [<span style="color:#0645ad;" class="mw-collapsible {{#if: {{{noCollapse|}}}|mw-collapsed}} mw-customtoggle-ingredient-list-{{#replace:{{#var:ingredient}}|<nowiki> </nowiki>}}" id="mw-customcollapsible-ingredient-list-{{#replace:{{#var:ingredient}}|<nowiki> </nowiki>}}">Expand</span><span style="color:#0645ad;" class="mw-collapsible {{#if: {{{noCollapse|}}}||mw-collapsed}} mw-customtoggle-ingredient-list-{{#replace:{{#var:ingredient}}|<nowiki> </nowiki>}}" id="mw-customcollapsible-ingredient-list-{{#replace:{{#var:ingredient}}|<nowiki> </nowiki>}}">Collapse</span>]
 +
{{#ask: [[Resource 1::Stuff]]<!-- Filters out buildings that have Stufftags but can't be created by the player --> [[Stuff Tags::~*{{Q|{{#var:ingredient}}|Stuff Category|noStuff}}*]] OR [[Resource 1::{{#var:ingredient}}]] OR [[Resource 2::{{#var:ingredient}}]] OR [[Resource 3::{{#var:ingredient}}]] OR [[Resource 4::{{#var:ingredient}}]] OR [[Resource 5::{{#var:ingredient}}]] OR [[Resource 6::{{#var:ingredient}}]]
 +
  | named args = yes
 +
| ? = ?Product
 +
  | ?Name = ?Name
 +
| ?Type = ?Type
 +
| ?Type2 = ?Type2
 +
| ?Resource 1 = ?R1
 +
| ?Resource 2 = ?R2
 +
| ?Resource 3 = ?R3
 +
| ?Resource 4 = ?R4
 +
| ?Resource 5 = ?R5
 +
| ?Resource 6 = ?R6
 +
  | ?Resource 1 Amount = ?R1a
 +
| ?Resource 2 Amount = ?R2a
 +
| ?Resource 3 Amount = ?R3a
 +
| ?Resource 4 Amount = ?R4a
 +
| ?Resource 5 Amount = ?R5a
 +
| ?Resource 6 Amount = ?R6a
 +
  | format = template
 +
  | template = Ingredient List Row
 +
| limit = 500
 +
| link = none
 +
| sort = From DLC, Type, Type2, Name
 
}}
 
}}
|-
 
{{#ask:[[Resource 2::{{lc:{{#var:name}}}}]]
 
| named args=yes
 
| ?Name=?Name
 
| ?Resource 2 Amount=?Amount
 
| format=template
 
| template=Ingredient List Row
 
}}
 
|-
 
{{#ask:[[Resource 3::{{lc:{{#var:name}}}}]]
 
| named args=yes
 
| ?Name=?Name
 
| ?Resource 3 Amount=?Amount
 
| format=template
 
| template=Ingredient List Row
 
}}
 
|-
 
{{#ask:[[Resource 4::{{lc:{{#var:name}}}}]]
 
| named args=yes
 
| ?Name=?Name
 
| ?Resource 4 Amount=?Amount
 
| format=template
 
| template=Ingredient List Row
 
}}
 
|-
 
{{#ask:[[Resource 5::{{lc:{{#var:name}}}}]]
 
| named args=yes
 
| ?Name=?Name
 
| ?Resource 5 Amount=?Amount
 
| format=template
 
| template=Ingredient List Row
 
}}
 
|-
 
 
|}
 
|}
</li><div> </includeonly>
+
</li></div></includeonly><noinclude>{{Recode|reason= 1) only works for one stuff category, bioferrite has two 2) Given we now have a control panel standard, it might be best to add a toggle for the stuffable options to limit table bloat - ideally needs to be autodisabled if the material ONLY has stuffables, and otherwise should be toggled off by default to increase initialusability }}
 +
{{Documentation}}</noinclude><!-- Add categories and interwikis to the /doc subpage, not here! -->

Latest revision as of 12:12, 5 April 2025

Documentation icon Template documentation[view] [edit] [history] [purge]

Description[edit]

This template automatically creates a table of all items that use given material in their creation recipes, as well as how much of the material is required.

This template is dependent on Template: Ingredient List Row.

Parameters[edit]

The first parameter (if present) will specify which material to generate the template for. If absent, {{PAGENAME}} will be used.

noCollapse=1 will suppress the collapsible nature of table.

Example usage[edit]

{{Ingredient List}}

on the Steel page would produce:

  • Product Ingredients Type [Expand]
  • {{Ingredient List| Neutroamine}}
    

    on any page would produce:

  • Product Ingredients Type [Expand]
  • {{Ingredient List| Chemfuel|noCollapse=1}}
    

    on any page would produce:

  • Product Ingredients Type [Collapse]
    Foam turret Foam turret Stuff 30 (Metallic, 300 for SVMs) + Steel 70 + Component 3 + Chemfuel 140 Building - Security
    Rocketswarm launcher Rocketswarm launcher Plasteel 20 + Steel 200 + Component 2 + Chemfuel 180 Building - Security
    High-explosive shell High-explosive shell Steel 15 + Chemfuel 15 Crafted resources - Mortar shell
    Incendiary shell Incendiary shell Steel 10 + Chemfuel 20 Crafted resources - Mortar shell
    Frag grenades Frag grenades Steel 20 + Chemfuel 80 Equipment - Weapons
    Molotov cocktails Molotov cocktails Cloth 25 + Chemfuel 80 Equipment - Weapons
    Firefoam pop pack Firefoam pop pack Steel 20 + Component 1 + Chemfuel 30 Gear - Utility
    Smokepop pack Smokepop pack Steel 20 + Component 1 + Chemfuel 40 Gear - Utility
    Tox shell Tox shell Content added by the Biotech DLC Steel 10 + Chemfuel 10 Crafted resources - Mortar shell
    Gas mask Gas mask Content added by the Biotech DLC Steel 20 + Chemfuel 20 Gear - Clothing
    Tox pack Tox pack Content added by the Biotech DLC Steel 10 + Component 1 + Chemfuel 35 Gear - Utility
    Locust armor Locust armor Content added by the Royalty DLC Plasteel 120 + Uranium 10 + Advanced component 3 + Component 3 + Chemfuel 100 Gear - Armor
    Phoenix armor Phoenix armor Content added by the Royalty DLC Plasteel 150 + Uranium 50 + Advanced component 6 + Steel 75 + Component 4 + Chemfuel 40 Gear - Armor
    Jump pack Jump pack Content added by the Royalty DLC Plasteel 30 + Component 3 + Chemfuel 100 Gear - Utility