Skip to content

Commit

Permalink
Merge pull request VOREStation#16647 from Cameron653/Janihud-OP
Browse files Browse the repository at this point in the history
Ports Janihud rework from Outpost 21.
  • Loading branch information
Heroman3003 authored Nov 27, 2024
2 parents 6f02034 + da88e49 commit 05b28ba
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 26 deletions.
2 changes: 2 additions & 0 deletions code/game/objects/effects/chem/coating.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@
/obj/effect/decal/cleanable/chemcoating/update_icon()
..()
color = reagents.get_color()
cut_overlays()
add_janitor_hud_overlay()
4 changes: 3 additions & 1 deletion code/game/objects/effects/decals/Cleanable/aliens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -30,4 +32,4 @@
random_icon_states = list("xgibmid1", "xgibmid2", "xgibmid3")

/obj/effect/decal/cleanable/blood/xtracks
basecolor = "#05EE05"
basecolor = "#05EE05"
3 changes: 3 additions & 0 deletions code/game/objects/effects/decals/Cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/effects/decals/Cleanable/robots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -49,4 +51,4 @@

/obj/effect/decal/cleanable/blood/oil/streak
random_icon_states = list("mgibbl1", "mgibbl2", "mgibbl3", "mgibbl4", "mgibbl5")
amount = 2
amount = 2
1 change: 1 addition & 0 deletions code/game/objects/effects/decals/Cleanable/tracks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
34 changes: 22 additions & 12 deletions code/game/objects/effects/decals/cleanable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand All @@ -40,13 +38,25 @@ 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). If you want to disable it, simply comment out the lines between the 'HUD VARIANT' tag!
hud.appearance_flags = RESET_ALPHA
hud.alpha = 255
//HUD VARIANT end
add_overlay(hud)
33 changes: 23 additions & 10 deletions code/game/objects/effects/decals/crayon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

/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)

mainOverlay.Blend(main,ICON_ADD)
shadeOverlay.Blend(shade,ICON_ADD)
if(mainOverlay && shadeOverlay)
mainOverlay.Blend(art_color,ICON_ADD)
shadeOverlay.Blend(art_shade,ICON_ADD)

add_overlay(mainOverlay)
add_overlay(shadeOverlay)
add_overlay(mainOverlay)
add_overlay(shadeOverlay)

add_hiddenprint(usr)
add_janitor_hud_overlay()
return
// CHOMPEdit End
2 changes: 0 additions & 2 deletions code/modules/recycling/conveyor2.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 05b28ba

Please sign in to comment.