mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-09 07:49:09 +00:00
* Micros the lighting subsystem (Saves a second of init) * Update stat_tracking.dm Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
24 lines
1.0 KiB
Plaintext
24 lines
1.0 KiB
Plaintext
// Mutable appearances are an inbuilt byond datastructure. Read the documentation on them by hitting F1 in DM.
|
|
// Basically use them instead of images for overlays/underlays and when changing an object's appearance if you're doing so with any regularity.
|
|
// Unless you need the overlay/underlay to have a different direction than the base object. Then you have to use an image due to a bug.
|
|
|
|
// Mutable appearances are children of images, just so you know.
|
|
|
|
// Mutable appearances erase template vars on new, because they accept an appearance to copy as an arg
|
|
// If we have nothin to copy, we set the float plane
|
|
/mutable_appearance/New(mutable_appearance/to_copy)
|
|
..()
|
|
if(!to_copy)
|
|
plane = FLOAT_PLANE
|
|
|
|
/// Helper similar to image()
|
|
/proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER, plane = FLOAT_PLANE, alpha = 255, appearance_flags = NONE)
|
|
var/mutable_appearance/MA = new()
|
|
MA.icon = icon
|
|
MA.icon_state = icon_state
|
|
MA.layer = layer
|
|
MA.plane = plane
|
|
MA.alpha = alpha
|
|
MA.appearance_flags |= appearance_flags
|
|
return MA
|