/tg/ Station 13 - Modules - TypesVar Details - Proc Details

chem_master

Machine that allows to identify and separate reagents in fitting container as well as to create new containers with separated reagents in it.

Contains logic for both ChemMaster and CondiMaster, switched by "condi".

Vars

analyze_varsInfo to display on 'analyze' screen
beakerInput reagents container
bottlePill bottle for newly created pills
chosen_condi_styleCurrently selected condiment bottle style
chosen_pill_styleCurrently selected pill style
condiDecides what UI to show. If TRUE shows UI of CondiMaster, if FALSE - ChemMaster
condi_stylesList of available condibottle styles for UI
modeWhether separated reagents should be moved back to container or destroyed. 1 - move, 0 - destroy
pill_stylesList of available pill styles for UI
screenCurrent UI screen. On the moment of writing this comment there were two: 'home' - main screen, and 'analyze' - info about specific reagent

Procs

apply_condi_styleApplies style to condiment bottle.
get_condi_stylesDefines and provides list of available condiment bottle styles
guess_condi_styleProvides condiment bottle style based on reagents.
replace_beakerHandles process of moving input reagents containers in/from machine
strip_condi_styles_to_iconsTranslates styles data into UI compatible format

Var Details

analyze_vars

Info to display on 'analyze' screen

beaker

Input reagents container

bottle

Pill bottle for newly created pills

chosen_condi_style

Currently selected condiment bottle style

chosen_pill_style

Currently selected pill style

condi

Decides what UI to show. If TRUE shows UI of CondiMaster, if FALSE - ChemMaster

condi_styles

List of available condibottle styles for UI

mode

Whether separated reagents should be moved back to container or destroyed. 1 - move, 0 - destroy

pill_styles

List of available pill styles for UI

screen

Current UI screen. On the moment of writing this comment there were two: 'home' - main screen, and 'analyze' - info about specific reagent

Proc Details

apply_condi_style

Applies style to condiment bottle.

Applies props provided in "style" assuming that "container" is freshly created with no styles applied before. User specified name for bottle applied after this method during bottle creation, so container.name overwritten here for consistency rather than with some purpose in mind.

Arguments:

get_condi_styles

Defines and provides list of available condiment bottle styles

Uses typelist() for styles storage after initialization. For fallback style must provide style with key (const) CONDIMASTER_STYLE_FALLBACK Returns list( = list( "icon_state" = , "name" = , "desc" = , ?"generate_name" = <if truthy, autogenerates default name from reagents instead of using "name">, ?"icon_empty" = <icon_state when empty>, ?"fill_icon_thresholds" = <list of thresholds for reagentfillings, no tresholds if not provided or falsy>, ?"inhand_icon_state" = <inhand icon_state, falsy - no icon, not provided - whatever is initial (currently "beer")>, ?"lefthand_file" = <file for inhand icon for left hand, ignored if "inhand_icon_state" not provided>, ?"righthand_file" = <same as "lefthand_file" but for right hand>, ), .. )

guess_condi_style

Provides condiment bottle style based on reagents.

Gets style from available by key, using last part of main reagent type (eg. "rice" for /datum/reagent/consumable/rice) as key. If not available returns fallback style, or null if no such thing. Returns list that is one of condibottle styles from /obj/machinery/chem_master/proc/get_condi_styles

replace_beaker

Handles process of moving input reagents containers in/from machine

When called checks for previously inserted beaker and gives it to user. Then, if new_beaker provided, places it into src.beaker. Returns boolean. TRUE if user provided (ignoring whether threre was any beaker change) and FALSE if not.

Arguments:

strip_condi_styles_to_icons

Translates styles data into UI compatible format

Expects to receive list of availables condiment styles in its complete format, and transforms them in simplified form with enough data to get UI going. Returns list(list("id" = , "className" = , "title" = ),..).

Arguments: