takes_reagent_appearance
"Takes reagent appearance" Component
Bit of a mouthful, but when applied to an item that can hold reagents (primarily reagent containers), said item will take on an appearance based on the majority share reagent inside
This is more than just "changing the color a bit" or "applies an overlay", this is an entire icon / icon state / name change, making it look like a different item entirely
This is done by cross-referencing the glass style datums. See /datum/glass_style for more information about that.
An example usage is bartender mixed drinks - each reagent gets its own fancy drink sprite
Vars | |
base_container_type | The type to compare against the glass_style's required_container_type. The parent's type by default. |
---|---|
icon_pre_change | Icon file when attached to the item |
icon_state_pre_change | Icon state when attached to the item |
on_icon_changed | Optional callback invoked when when the item's appearance is changed |
on_icon_reset | Optional callback invoked when our item has its appearance reverted to default |
Procs | |
get_main_reagent_style | Gets the correspinding style based on the parent's state and reagents within |
on_update_appearance | Signal proc for COMSIG_ATOM_UPDATE_APPEARANCE We hook into the update appearance proc to perform our own update based on our glass style Preventing any further updates down the line on successes |
update_desc | Performs the description update. |
update_icon | Performs the icon update. |
update_name | Performs the name update. |
Var Details
base_container_type
The type to compare against the glass_style's required_container_type. The parent's type by default.
icon_pre_change
Icon file when attached to the item
icon_state_pre_change
Icon state when attached to the item
on_icon_changed
Optional callback invoked when when the item's appearance is changed
on_icon_reset
Optional callback invoked when our item has its appearance reverted to default
Proc Details
get_main_reagent_style
Gets the correspinding style based on the parent's state and reagents within
- Returns null if its reagents are empty
- Returns null if no majority reagent was found
- Otherwise returns a glass style datum
on_update_appearance
Signal proc for COMSIG_ATOM_UPDATE_APPEARANCE We hook into the update appearance proc to perform our own update based on our glass style Preventing any further updates down the line on successes
update_desc
Performs the description update.
- Returns COMSIG_ATOM_NO_UPDATE_DESC if one was complete
- Returns [NONE] if nothing happened
- Returns [NONE] if the description was reset to initial state
update_icon
Performs the icon update.
- Returns COMSIG_ATOM_NO_UPDATE_ICON if an icon or icon state ocurred
- Returns [NONE] if the icon or icon state was reset to base state
update_name
Performs the name update.
- Returns COMSIG_ATOM_NO_UPDATE_NAME if one was complete
- Returns [NONE] if nothing happened
- Returns [NONE] if the name was reset to initial state