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".
|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|
|apply_condi_style||Applies style to condiment bottle.|
|get_condi_styles||Defines and provides list of available condiment bottle styles|
|guess_condi_style||Provides condiment bottle style based on reagents.|
|replace_beaker||Handles process of moving input reagents containers in/from machine|
|strip_condi_styles_to_icons||Translates styles data into UI compatible format|
Info to display on 'analyze' screen
Input reagents container
Pill bottle for newly created pills
Currently selected condiment bottle style
Currently selected pill style
Decides what UI to show. If TRUE shows UI of CondiMaster, if FALSE - ChemMaster
List of available condibottle styles for UI
Whether separated reagents should be moved back to container or destroyed. 1 - move, 0 - destroy
List of available pill styles for UI
Current UI screen. On the moment of writing this comment there were two: 'home' - main screen, and 'analyze' - info about specific reagent
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.
- container - condiment bottle that gets style applied to it
- style - assoc list, must probably one from /obj/machinery/chem_master/proc/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
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
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.
boolean. TRUE if user provided (ignoring whether threre was any beaker change) and FALSE if not.
- user - Mob that initialized replacement, gets previously inserted beaker if there's any
- new_beaker - New beaker to insert. Optional
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" =
- styles - List of styles for condiment bottles in internal format: /obj/machinery/chem_master/proc/get_condi_styles