mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-12 10:42:37 +00:00
No code changes, just a bunch of moved code to reduce the size of the main atoms file. Took it from about 2.2k lines to under 1k. Also a couple of docs changes where it was incorrect.
31 lines
1.2 KiB
Plaintext
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)
|