Files
Bubberstation/code/game/atom/atom_greyscale.dm
SkyratBot e5e5130696 [MIRROR] Splits up most of atoms.dm [MDB IGNORE] (#25055)
* Splits up most of atoms.dm

* Fix diffs

* Update tgstation.dme

---------

Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-11-16 18:50:40 -05:00

31 lines
1.2 KiB
Plaintext

/atom
///The config type to use for greyscaled sprites. Both this and greyscale_colors must be assigned to work.
var/greyscale_config
///A string of hex format colors to be used by greyscale sprites, ex: "#0054aa#badcff"
var/greyscale_colors
/// Handles updates to greyscale value updates.
/// The colors argument can be either a list or the full color string.
/// Child procs should call parent last so the update happens after all changes.
/atom/proc/set_greyscale(list/colors, new_config)
SHOULD_CALL_PARENT(TRUE)
if(istype(colors))
colors = colors.Join("")
if(!isnull(colors) && greyscale_colors != colors) // If you want to disable greyscale stuff then give a blank string
greyscale_colors = colors
if(!isnull(new_config) && greyscale_config != new_config)
greyscale_config = new_config
update_greyscale()
/// Checks if this atom uses the GAGS system and if so updates the icon
/atom/proc/update_greyscale()
SHOULD_CALL_PARENT(TRUE)
if(greyscale_colors && greyscale_config)
icon = SSgreyscale.GetColoredIconByType(greyscale_config, greyscale_colors)
if(!smoothing_flags) // This is a bitfield but we're just checking that some sort of smoothing is happening
return
update_atom_colour()
QUEUE_SMOOTH(src)