Janihud rework

From Outpost21
This commit is contained in:
C.L.
2024-11-25 18:22:51 -05:00
parent b8bb49ba13
commit 65c640cd68
8 changed files with 59 additions and 26 deletions
@@ -34,3 +34,5 @@
/obj/effect/decal/cleanable/chemcoating/update_icon()
..()
color = reagents.get_color()
cut_overlays()
add_janitor_hud_overlay()
@@ -13,6 +13,8 @@
/obj/effect/decal/cleanable/blood/gibs/xeno/update_icon()
color = "#FFFFFF"
cut_overlays()
add_janitor_hud_overlay()
/obj/effect/decal/cleanable/blood/gibs/xeno/up
random_icon_states = list("xgib1", "xgib2", "xgib3", "xgib4", "xgib5", "xgib6","xgibup1","xgibup1","xgibup1")
@@ -30,4 +32,4 @@
random_icon_states = list("xgibmid1", "xgibmid2", "xgibmid3")
/obj/effect/decal/cleanable/blood/xtracks
basecolor = "#05EE05"
basecolor = "#05EE05"
@@ -70,6 +70,8 @@ var/global/list/image/splatter_cache=list()
else
name = initial(name)
desc = initial(desc)
cut_overlays()
add_janitor_hud_overlay()
/obj/effect/decal/cleanable/blood/Crossed(mob/living/carbon/human/perp)
if(perp.is_incorporeal())
@@ -210,6 +212,7 @@ var/global/list/image/splatter_cache=list()
icon = blood
cut_overlays()
add_overlay(giblets)
add_janitor_hud_overlay()
/obj/effect/decal/cleanable/blood/gibs/up
random_icon_states = list("gib1", "gib2", "gib3", "gib5", "gib6","gibup1","gibup1","gibup1")
@@ -10,6 +10,8 @@
/obj/effect/decal/cleanable/blood/gibs/robot/update_icon()
color = "#FFFFFF"
cut_overlays()
add_janitor_hud_overlay()
/obj/effect/decal/cleanable/blood/gibs/robot/dry() //pieces of robots do not dry up like
return
@@ -49,4 +51,4 @@
/obj/effect/decal/cleanable/blood/oil/streak
random_icon_states = list("mgibbl1", "mgibbl2", "mgibbl3", "mgibbl4", "mgibbl5")
amount = 2
amount = 2
@@ -142,6 +142,7 @@ var/global/list/image/fluidtrack_cache=list()
stack[stack_idx]=track
add_overlay(I)
updatedtracks=0 // Clear our memory of updated tracks.
add_janitor_hud_overlay()
/obj/effect/decal/cleanable/blood/tracks/footprints
name = "wet footprints"
+24 -12
View File
@@ -12,7 +12,6 @@ generic_filth = TRUE means when the decal is saved, it will be switched out for
var/generic_filth = FALSE
var/age = 0
var/list/random_icon_states = list()
var/obj/effect/decal/jan_hud/jan_icon = null
/obj/effect/decal/cleanable/Initialize(var/mapload, var/_age)
if(!isnull(_age))
@@ -21,12 +20,11 @@ generic_filth = TRUE means when the decal is saved, it will be switched out for
src.icon_state = pick(src.random_icon_states)
if(!mapload || !CONFIG_GET(flag/persistence_ignore_mapload))
SSpersistence.track_value(src, /datum/persistent/filth)
jan_icon = new/obj/effect/decal/jan_hud(src.loc)
. = ..()
update_icon()
/obj/effect/decal/cleanable/Destroy()
SSpersistence.forget_value(src, /datum/persistent/filth)
QDEL_NULL(jan_icon)
. = ..()
/obj/effect/decal/cleanable/clean_blood(var/ignore = 0)
@@ -40,13 +38,27 @@ generic_filth = TRUE means when the decal is saved, it will be switched out for
src.icon_state = pick(src.random_icon_states)
..()
/obj/effect/decal/jan_hud
plane = PLANE_JANHUD
layer = BELOW_MOB_LAYER
vis_flags = VIS_HIDE
persist_storable = FALSE
icon = 'icons/mob/hud.dmi'
mouse_opacity = 0
/obj/effect/decal/jan_hud/Initialize()
src.icon_state = "janhud[rand(1,9)]"
/obj/effect/decal/cleanable/update_icon()
// Overrides should not inheret from this, and instead replace it entirely to match this in some form.
// add_janitor_hud_overlay() does not pre-cut overlays, so cut_overlays() must be called first.
// This is so it may be used with update_icon() overrides that use overlays, while adding the janitor overlay at the end.
cut_overlays()
add_janitor_hud_overlay()
/obj/effect/decal/cleanable/proc/add_janitor_hud_overlay()
// This was original a seperate object that followed the grime, it got stuck in everything you can imagine!
// It also likely doubled the memory use of every cleanable decal on station...
var/image/hud = image('icons/mob/hud.dmi', src, "janhud[rand(1,9)]")
hud.appearance_flags = (RESET_COLOR|PIXEL_SCALE|KEEP_APART)
hud.plane = PLANE_JANHUD
hud.layer = BELOW_MOB_LAYER
hud.mouse_opacity = 0
//HUD VARIANT: Allows the hud to show up with it's normal alpha, even if the 'dirty thing' it's attached to has a low alpha (ex: dirt)
/*
hud.appearance_flags = RESET_ALPHA
hud.alpha = 255
*/
//HUD VARIANT end
add_overlay(hud)
+23 -10
View File
@@ -6,26 +6,39 @@
layer = DIRTY_LAYER
anchored = TRUE
/obj/effect/decal/cleanable/crayon/New(location,main = "#FFFFFF",shade = "#000000",var/type = "rune")
..()
loc = location
var/art_type
var/art_color
var/art_shade
/obj/effect/decal/cleanable/crayon/Initialize(var/ml, main = "#FFFFFF",shade = "#000000",var/type = "rune", new_age = 0)
name = type
desc = "A [type] drawn in crayon."
// Persistence vars. Unused here but used downstream. If someone updates the persistance code, it's here.
art_type = type
art_color = main
art_shade = shade
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 = new/icon('icons/effects/crayondecal.dmi',"[type]",2.1)
var/icon/shadeOverlay = new/icon('icons/effects/crayondecal.dmi',"[type]s",2.1)
. = ..(ml, new_age) // mapload, age
mainOverlay.Blend(main,ICON_ADD)
shadeOverlay.Blend(shade,ICON_ADD)
/obj/effect/decal/cleanable/crayon/update_icon()
cut_overlays()
var/icon/mainOverlay = new/icon('icons/effects/crayondecal.dmi',"[art_type]",2.1)
var/icon/shadeOverlay = new/icon('icons/effects/crayondecal.dmi',"[art_type]s",2.1)
add_overlay(mainOverlay)
add_overlay(shadeOverlay)
if(mainOverlay && shadeOverlay)
mainOverlay.Blend(art_color,ICON_ADD)
shadeOverlay.Blend(art_shade,ICON_ADD)
add_hiddenprint(usr)
add_overlay(mainOverlay)
add_overlay(shadeOverlay)
add_janitor_hud_overlay()
return
// CHOMPEdit End
-2
View File
@@ -113,8 +113,6 @@
for(var/atom/movable/A in affecting)
if(istype(A,/obj/effect/abstract)) // Flashlight's lights are not physical objects
continue
if(istype(A,/obj/effect/decal/jan_hud)) // Ignore these too
continue
if(!A.anchored)
if(A.loc == src.loc) // prevents the object from being affected if it's not currently here.
step(A,movedir)