Files
Cody Brittain 9983fca311 Update SSOverlays (ported from Baystation) (#19051)
Our SSOverlays system is outdated, and is likely the cause of many of
the issues seen in #18895. It has also been linked to a massive server
performance decrease.

This brings an updated system from Baystation, hopefully with speed
increases.

Should be testmerged, ideally with #18895.

---------

Co-authored-by: Cody Brittain <cbrittain10@live.com>
2024-05-01 07:46:27 +00:00

34 lines
1008 B
Plaintext

/obj/effect/decal/cleanable/crayon
name = "rune"
desc = "A rune drawn in crayon."
icon = 'icons/obj/rune.dmi'
anchored = 1
/obj/effect/decal/cleanable/crayon/Initialize(mapload, main = "#FFFFFF", shade = "#000000", var/type = "rune")
. = ..()
name = type
desc = "A [type] drawn in crayon."
switch(type)
if("rune")
type = "rune[rand(1,6)]"
if("graffiti")
type = pick("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa")
var/icon/mainOverlay = SSicon_cache.crayon_cache[type]
if (!mainOverlay)
mainOverlay = new/icon('icons/effects/crayondecal.dmi',"[type]",2.1)
mainOverlay.Blend(main,ICON_ADD)
SSicon_cache.crayon_cache[type] = mainOverlay
var/icon/shadeOverlay = SSicon_cache.crayon_cache["[type]_s"]
if (!shadeOverlay)
shadeOverlay = new/icon('icons/effects/crayondecal.dmi',"[type]s",2.1)
shadeOverlay.Blend(shade,ICON_ADD)
SSicon_cache.crayon_cache["[type]_s"] = shadeOverlay
AddOverlays(list(mainOverlay, shadeOverlay))
add_hiddenprint(usr)