diff --git a/code/datums/mutable_appearance.dm b/code/datums/mutable_appearance.dm index 1b095c555d5..4abaa9e640e 100644 --- a/code/datums/mutable_appearance.dm +++ b/code/datums/mutable_appearance.dm @@ -9,11 +9,13 @@ plane = FLOAT_PLANE // No clue why this is 0 by default yet images are on FLOAT_PLANE // And yes this does have to be in the constructor, BYOND ignores it if you set it as a normal var -// Helper similar to image() -/proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER, 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 diff --git a/code/game/machinery/accounting.dm b/code/game/machinery/accounting.dm index 509837b3b67..0cf85a07a80 100644 --- a/code/game/machinery/accounting.dm +++ b/code/game/machinery/accounting.dm @@ -58,15 +58,15 @@ if(machine_stat & (NOPOWER|BROKEN) || !anchored) return if(panel_open) - SSvis_overlays.add_vis_overlay(src, icon, "recharger-open", layer, plane, dir, alpha) + . += mutable_appearance(icon, "recharger-open", layer, plane, alpha) return if(inserted_id) - SSvis_overlays.add_vis_overlay(src, icon, "recharger-full", layer, plane, dir, alpha) - SSvis_overlays.add_vis_overlay(src, icon, "recharger-full", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "recharger-full", layer, plane, alpha) + . += mutable_appearance(icon, "recharger-full", 0, EMISSIVE_PLANE, alpha) return - SSvis_overlays.add_vis_overlay(src, icon, "recharger-empty", layer, plane, dir, alpha) - SSvis_overlays.add_vis_overlay(src, icon, "recharger-empty", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "recharger-empty", layer, plane, alpha) + . += mutable_appearance(icon, "recharger-empty", 0, EMISSIVE_PLANE, alpha) /obj/machinery/accounting/update_appearance(updates) . = ..() diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm index 64d0ebd730f..b3ab40208d4 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -39,8 +39,8 @@ var/overlay_state = icon_screen if(machine_stat & BROKEN) overlay_state = "[icon_state]_broken" - SSvis_overlays.add_vis_overlay(src, icon, overlay_state, layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, overlay_state, layer, EMISSIVE_PLANE, dir) + . += mutable_appearance(icon, overlay_state, layer, plane) + . += mutable_appearance(icon, overlay_state, layer, EMISSIVE_PLANE) /obj/machinery/computer/power_change() . = ..() diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 8be543b7bb5..b25462787c5 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -79,32 +79,32 @@ . += "fire_overlay" if(is_station_level(z)) . += "fire_[GLOB.security_level]" - SSvis_overlays.add_vis_overlay(src, icon, "fire_[GLOB.security_level]", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "fire_[GLOB.security_level]", layer, EMISSIVE_PLANE, dir) + . += mutable_appearance(icon, "fire_[GLOB.security_level]", layer, plane) + . += mutable_appearance(icon, "fire_[GLOB.security_level]", layer, EMISSIVE_PLANE) else . += "fire_[SEC_LEVEL_GREEN]" - SSvis_overlays.add_vis_overlay(src, icon, "fire_[SEC_LEVEL_GREEN]", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "fire_[SEC_LEVEL_GREEN]", layer, EMISSIVE_PLANE, dir) + . += mutable_appearance(icon, "fire_[SEC_LEVEL_GREEN]", layer, plane) + . += mutable_appearance(icon, "fire_[SEC_LEVEL_GREEN]", layer, EMISSIVE_PLANE) var/area/A = get_area(src) if(!detecting || !A.fire) . += "fire_off" - SSvis_overlays.add_vis_overlay(src, icon, "fire_off", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "fire_off", layer, EMISSIVE_PLANE, dir) + . += mutable_appearance(icon, "fire_off", layer, plane) + . += mutable_appearance(icon, "fire_off", layer, EMISSIVE_PLANE) else if(obj_flags & EMAGGED) . += "fire_emagged" - SSvis_overlays.add_vis_overlay(src, icon, "fire_emagged", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "fire_emagged", layer, EMISSIVE_PLANE, dir) + . += mutable_appearance(icon, "fire_emagged", layer, plane) + . += mutable_appearance(icon, "fire_emagged", layer, EMISSIVE_PLANE) else . += "fire_on" - SSvis_overlays.add_vis_overlay(src, icon, "fire_on", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "fire_on", layer, EMISSIVE_PLANE, dir) + . += mutable_appearance(icon, "fire_on", layer, plane) + . += mutable_appearance(icon, "fire_on", layer, EMISSIVE_PLANE) if(!panel_open && detecting && triggered) //It just looks horrible with the panel open . += "fire_detected" - SSvis_overlays.add_vis_overlay(src, icon, "fire_detected", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "fire_detected", layer, EMISSIVE_PLANE, dir) //Pain + . += mutable_appearance(icon, "fire_detected", layer, plane) + . += mutable_appearance(icon, "fire_detected", layer, EMISSIVE_PLANE) //Pain /obj/machinery/firealarm/emp_act(severity) . = ..() diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index c9d4ea9900d..e70a2a62ee3 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -38,7 +38,7 @@ /obj/machinery/light_switch/update_overlays() . = ..() if(!(machine_stat & NOPOWER)) - SSvis_overlays.add_vis_overlay(src, icon, "[base_icon_state]-glow", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "[base_icon_state]-glow", 0, EMISSIVE_PLANE, alpha) /obj/machinery/light_switch/examine(mob/user) . = ..() diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 790e69f41ab..e634d2392cb 100755 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -176,17 +176,17 @@ if(machine_stat & (NOPOWER|BROKEN) || !anchored) return if(panel_open) - SSvis_overlays.add_vis_overlay(src, icon, "[base_icon_state]-open", layer, plane, dir, alpha) + . += mutable_appearance(icon, "[base_icon_state]-open", layer, plane, alpha) return if(!charging) - SSvis_overlays.add_vis_overlay(src, icon, "[base_icon_state]-empty", layer, plane, dir, alpha) - SSvis_overlays.add_vis_overlay(src, icon, "[base_icon_state]-empty", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "[base_icon_state]-empty", layer, plane, alpha) + . += mutable_appearance(icon, "[base_icon_state]-empty", 0, EMISSIVE_PLANE, alpha) return if(using_power) - SSvis_overlays.add_vis_overlay(src, icon, "[base_icon_state]-charging", layer, plane, dir, alpha) - SSvis_overlays.add_vis_overlay(src, icon, "[base_icon_state]-charging", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "[base_icon_state]-charging", layer, plane, alpha) + . += mutable_appearance(icon, "[base_icon_state]-charging", 0, EMISSIVE_PLANE, alpha) return - SSvis_overlays.add_vis_overlay(src, icon, "[base_icon_state]-full", layer, plane, dir, alpha) - SSvis_overlays.add_vis_overlay(src, icon, "[base_icon_state]-full", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "[base_icon_state]-full", layer, plane, alpha) + . += mutable_appearance(icon, "[base_icon_state]-full", 0, EMISSIVE_PLANE, alpha) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index fddc64134e5..7311eb275c9 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -88,7 +88,7 @@ if(broken || !secure) return //Overlay is similar enough for both that we can use the same mask for both - SSvis_overlays.add_vis_overlay(src, icon, "locked", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "locked", 0, EMISSIVE_PLANE, alpha) . += locked ? "locked" : "unlocked" /obj/structure/closet/examine(mob/user) diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index c1131a72e5b..3be8dbb5453 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -63,7 +63,7 @@ /obj/machinery/smartfridge/update_overlays() . = ..() if(!machine_stat) - SSvis_overlays.add_vis_overlay(src, icon, "smartfridge-light-mask", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "smartfridge-light-mask", 0, EMISSIVE_PLANE, alpha) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 4735b814396..a8ddbc1631a 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -401,19 +401,19 @@ if((machine_stat & (BROKEN|MAINT)) || update_state) return - SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", layer, EMISSIVE_PLANE, dir) - SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", layer, EMISSIVE_PLANE, dir) + . += mutable_appearance(icon, "apcox-[locked]", layer, plane) + . += mutable_appearance(icon, "apcox-[locked]", layer, EMISSIVE_PLANE) + . += mutable_appearance(icon, "apco3-[charging]", layer, plane) + . += mutable_appearance(icon, "apco3-[charging]", layer, EMISSIVE_PLANE) if(!operating) return - SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", layer, EMISSIVE_PLANE, dir) - SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", layer, EMISSIVE_PLANE, dir) - SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", layer, plane, dir) - SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", layer, EMISSIVE_PLANE, dir) + . += mutable_appearance(icon, "apco0-[equipment]", layer, plane) + . += mutable_appearance(icon, "apco0-[equipment]", layer, EMISSIVE_PLANE) + . += mutable_appearance(icon, "apco1-[lighting]", layer, plane) + . += mutable_appearance(icon, "apco1-[lighting]", layer, EMISSIVE_PLANE) + . += mutable_appearance(icon, "apco2-[environ]", layer, plane) + . += mutable_appearance(icon, "apco2-[environ]", layer, EMISSIVE_PLANE) /// Checks for what icon updates we will need to handle /obj/machinery/power/apc/proc/check_updates() diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 8fd9e24e4d6..cfebe2d4a85 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -407,12 +407,12 @@ var/area/A = get_area(src) if(emergency_mode || (A?.fire)) - SSvis_overlays.add_vis_overlay(src, overlayicon, "[base_state]_emergency", layer, plane, dir) + . += mutable_appearance(overlayicon, "[base_state]_emergency", layer, plane) return if(nightshift_enabled) - SSvis_overlays.add_vis_overlay(src, overlayicon, "[base_state]_nightshift", layer, plane, dir) + . += mutable_appearance(overlayicon, "[base_state]_nightshift", layer, plane) return - SSvis_overlays.add_vis_overlay(src, overlayicon, base_state, layer, plane, dir) + . += mutable_appearance(overlayicon, base_state, layer, plane) // update the icon_state and luminosity of the light depending on its state /obj/machinery/light/proc/update(trigger = TRUE) diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index d705e64e2b9..bd41af070bd 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -387,15 +387,15 @@ //check for items in disposal - occupied light if(contents.len > 0) . += "dispover-full" - SSvis_overlays.add_vis_overlay(src, icon, "dispover-full", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "dispover-full", 0, EMISSIVE_PLANE, alpha) //charging and ready light if(pressure_charging) . += "dispover-charge" - SSvis_overlays.add_vis_overlay(src, icon, "dispover-charge-glow", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "dispover-charge-glow", 0, EMISSIVE_PLANE, alpha) else if(full_pressure) . += "dispover-ready" - SSvis_overlays.add_vis_overlay(src, icon, "dispover-ready-glow", 0, EMISSIVE_PLANE, dir, alpha) + . += mutable_appearance(icon, "dispover-ready-glow", 0, EMISSIVE_PLANE, alpha) /obj/machinery/disposal/bin/proc/do_flush() set waitfor = FALSE diff --git a/code/modules/research/nanites/nanite_program_hub.dm b/code/modules/research/nanites/nanite_program_hub.dm index 2557099e4af..f8ad95c498f 100644 --- a/code/modules/research/nanites/nanite_program_hub.dm +++ b/code/modules/research/nanites/nanite_program_hub.dm @@ -30,8 +30,8 @@ . = ..() if((machine_stat & (NOPOWER|MAINT|BROKEN)) || panel_open) return - SSvis_overlays.add_vis_overlay(src, icon, "nanite_program_hub_on", layer, plane) - SSvis_overlays.add_vis_overlay(src, icon, "nanite_program_hub_on", 0, EMISSIVE_PLANE) + . += mutable_appearance(icon, "nanite_program_hub_on", layer, plane) + . += mutable_appearance(icon, "nanite_program_hub_on", 0, EMISSIVE_PLANE) /obj/machinery/nanite_program_hub/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/disk/nanite_program)) diff --git a/code/modules/research/nanites/nanite_programmer.dm b/code/modules/research/nanites/nanite_programmer.dm index 28af9d0bd36..cbc572d5fcd 100644 --- a/code/modules/research/nanites/nanite_programmer.dm +++ b/code/modules/research/nanites/nanite_programmer.dm @@ -15,8 +15,8 @@ . = ..() if((machine_stat & (NOPOWER|MAINT|BROKEN)) || panel_open) return - SSvis_overlays.add_vis_overlay(src, icon, "nanite_programmer_on", layer, plane) - SSvis_overlays.add_vis_overlay(src, icon, "nanite_programmer_on", 0, EMISSIVE_PLANE) + . += mutable_appearance(icon, "nanite_programmer_on", layer, plane) + . += mutable_appearance(icon, "nanite_programmer_on", 0, EMISSIVE_PLANE) /obj/machinery/nanite_programmer/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/disk/nanite_program)) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 3a5f6af7e26..c022aaa8018 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -263,7 +263,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C if(!light_mask) return if(!(machine_stat & BROKEN) && powered()) - SSvis_overlays.add_vis_overlay(src, icon, light_mask, 0, EMISSIVE_PLANE) + . += mutable_appearance(icon, light_mask, 0, EMISSIVE_PLANE) /obj/machinery/vending/obj_break(damage_flag) . = ..()