Template:Manual Chem Box: Difference between revisions

From Space Station 14 Wiki
Aliser (talk | contribs)
added text outline of inverse color to headers to improve legibility
Aliser (talk | contribs)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--><templatestyles src="Template:Manual Chem Box/styles.css" /><!--
--><templatestyles src="Template:Manual Chem Box/styles.css" /><!--
-->{{#vardefine: textcolor
|{{#switch: {{lc:{{{textcolor|light}}}}}
|light = var(--quickbox-header-text-theme-light)
|dark = var(--quickbox-header-text-theme-dark)
|{{{textcolor|}}}
}}
}}<!--
-->{{#vardefine: textcolor_outline
|{{#if: {{{textcolor_outline|}}}
|{{#switch: {{lc:{{{textcolor_outline}}}}}
|light = var(--quickbox-header-text-outline-dark)
|dark = var(--quickbox-header-text-outline-light)
|{{{textcolor_outline}}}
}}
|{{#switch: {{#var:textcolor}}
|light = var(--quickbox-header-text-outline-dark)
|dark = var(--quickbox-header-text-outline-light)
|transparent
}}
}}
}}<!--
# glowy watah
-->{{#ifeq: {{lc:{{{id|}}}}}|water|{{#vardefine:textcolor_outline|var(--quickbox-header-text-outline-light)}}<!---->}}<!--


--><div id="chem_{{{id|Default}}}" class="quickbox"><!--
--><div id="chem_{{{id|Default}}}" class="quickbox"><!--
     --><div class="quickboxhead" style="
     --><div class="quickboxhead" style="
             background-color: {{{color}}};  
             background-color: {{{color}}};  
             color: {{{textcolor}}};
             color: {{#var:textcolor}};
             text-shadow: 0 0 2px {{{textcolor_outline}}};">'''{{{name|No name}}}'''</div><!--
             --sh-c: {{#var:textcolor_outline}};">'''{{{name|No name}}}'''</div><!--
     --><div class="quickbox-section mw-collapsible mw-collapsed"><!--
     --><div class="quickbox-section mw-collapsible mw-collapsed"><!--
         --><div class="quickboxbody-section-header">Recipes</div><!--
         --><div class="quickboxbody-section-header">Recipes</div><!--
Line 13: Line 39:
     --><div class="quickbox-section mw-collapsible mw-collapsed"><!--
     --><div class="quickbox-section mw-collapsible mw-collapsed"><!--
         --><div class="quickboxbody-section-header">Effects</div><!--
         --><div class="quickboxbody-section-header">Effects</div><!--
         --><div class="quickboxbody-section-body mw-collapsible-content">{{{metabolisms|No info}}}</div><!--
         --><div class="quickboxbody-section-body mw-collapsible-content">{{{metabolisms|{{{effects|No info}}}}}}</div><!--
     --></div><!--
     --></div><!--
     --><div class="quickboxbody-section-bare"><!--
     --><div class="quickboxbody-section-bare"><!--
Line 23: Line 49:
}}
}}


{{Manual Chem Box}}
<templatedata>
 
{
TODO documentation
"params": {
 
"id": {
</noinclude>
"label": "Product ID",
"description": "In-game ID of the product. Used to create navigation links to this card.",
"example": "BuzzochloricBees",
"type": "line",
"suggested": true
},
"color": {
"label": "Header background color",
"description": "Color used for the card header background.",
"example": "#215263",
"type": "line",
"suggested": true
},
"textcolor": {
"label": "Header text color",
"description": "Color used for the card header label. Use one of the predefined values whenever possible.",
"type": "line",
"suggestedvalues": [
"Light",
"Dark"
],
"suggested": true
},
"textcolor_outline": {
"label": "Header text outline color",
"description": "Color used for the card header label outline. By default, uses the opposite of the text color (whenever possible). Use one of the predefined values if possible.",
"type": "line",
"suggestedvalues": [
"Light",
"Dark"
],
"suggested": true
},
"name": {
"label": " Product name",
"example": "Ultravasculine",
"type": "line",
"required": true
},
"recipes": {
"label": "Recipes",
"description": "Product recipes. Use {{Recipe Box}} and {{Recipe Component}} to define these.",
"type": "string",
"suggested": true
},
"desc": {
"label": "Description",
"description": "Product description",
"type": "string",
"suggested": true
},
"physicalDesc": {
"label": "Physical description",
"type": "string",
"suggested": true,
"description": "The X in \"seems to be X\" part of the description."
},
"effects": {
"aliases": [
"metabolisms"
],
"label": "Effects",
"description": "What effects does a product cause when consumed (metabolized)?",
"type": "string",
"suggested": true
}
},
"description": "Generates a card describing a reagent/food item/element/etc., their recipe and effects when consumed.",
"paramOrder": [
"id",
"color",
"textcolor",
"textcolor_outline",
"name",
"recipes",
"effects",
"desc",
"physicalDesc"
]
}
</templatedata></noinclude>

Latest revision as of 05:53, 21 May 2025

Template documentation
view or edit this documentation about template documentation
Uses template styles
This template uses template styles found in:

This page will contain a basic overview of how manual chem boxes work, and also how auto chem boxes should work.

Data fields

  • {{id}}
    This is the ID used for the chembox div ID. The current standard according to the JSON is PascalCase. The ID is almost always the same text as the name, except for when it isn't (looking at you, copper blood)
  • {{name}}
    This is the name used in the display. It should be in Title Case. However, the data itself comes in lower case, as that's how the localisation files display it.
  • {{color}}
    This is the colour used in the header. It should be the colour taken from the game's files. It can be any CSS accepted color name, but hex must be proceeded by a hash.
  • {{textcolor}}
    This should be either black or white, depending on which contrasts more. The chem data does not contain this tag, so must be created on demand by any Modules.
  • {{recipes}}
    This should contain a joined list of all the relevant recipes used to make the chemical. Each recipe should be inputted as a Template:Recipe Box, where in each item follows Template:Recipe Component. For standard chemicals, the
    {{transformer}}
    component should take Template:Beaker. If the chemical requires a certain temperature, it can be passed into the Beaker component as
    |temperature=999k
    (replacing 999k with whatever temperature is required)
  • {{metabolisms}}
    is the effects list component. It should be listed in this format:
'''Subheading'''
* Effect Description
* Effect Description
In the data, there are three alternative forms of the effects data, but only effectLine should be needed.
  • {{desc}}
    This should be ended by a full stop.
  • {{physicalDesc}}
    This is a short descriptor. Use lower case and no full stop

Auto Chem Boxes (How they should work)

  1. An ID should be passed to a Module
  2. The Module should read User:UpAndLeaves/chemData.json
  3. The Module should return the following items, either with one function returning the entire template, or the individual functions returning seperate components:
    1. The name
    2. The color and text color
    3. The recipes (as stated above, should be parsed as a Template:Recipe Box with various components
    4. The effects (which can just be taken from effectLine)
    5. The description
    6. The physical description

Implementation Questions

  • Do we want to replace Template:Chembox or make a new one?
  • Do we want to have the template be a single function that returns a template or multiple functions inserted into a template?
  • Can we make the chemData expand outside of just medicines?
  • Can we actually just make anyone create new chemData using a program? (for User:UpAndLeaves to answer

Generates a card describing a reagent/food item/element/etc., their recipe and effects when consumed.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Product IDid

In-game ID of the product. Used to create navigation links to this card.

Example
BuzzochloricBees
Linesuggested
Header background colorcolor

Color used for the card header background.

Example
#215263
Linesuggested
Header text colortextcolor

Color used for the card header label. Use one of the predefined values whenever possible.

Suggested values
Light Dark
Linesuggested
Header text outline colortextcolor_outline

Color used for the card header label outline. By default, uses the opposite of the text color (whenever possible). Use one of the predefined values if possible.

Suggested values
Light Dark
Linesuggested
Product namename

no description

Example
Ultravasculine
Linerequired
Recipesrecipes

Product recipes. Use {{Recipe Box}} and {{Recipe Component}} to define these.

Stringsuggested
Effectseffects metabolisms

What effects does a product cause when consumed (metabolized)?

Stringsuggested
Descriptiondesc

Product description

Stringsuggested
Physical descriptionphysicalDesc

The X in "seems to be X" part of the description.

Stringsuggested