Template:Manual Chem Box: Difference between revisions

From Space Station 14 Wiki
Aliser (talk | contribs)
added docs and some logic changes to make them work
Aliser (talk | contribs)
typo in vardefine
Line 3: Line 3:


-->{{#vardefine: textcolor
-->{{#vardefine: textcolor
{{#switch: {{lc:{{{textcolor|light}}}}}
|{{#switch: {{lc:{{{textcolor|light}}}}}
|light = var(--quickbox-header-text-theme-light)
|light = var(--quickbox-header-text-theme-light)
|dark = var(--quickbox-header-text-theme-dark)
|dark = var(--quickbox-header-text-theme-dark)

Revision as of 04:24, 21 May 2025

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

Warning
This template is obsolete, use {{Reagent card}} instead.

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