diff --git a/code/__HELPERS/misc/sonar.dm b/code/__HELPERS/misc/sonar.dm index 71e5cd4f7f2..dc7778fb954 100644 --- a/code/__HELPERS/misc/sonar.dm +++ b/code/__HELPERS/misc/sonar.dm @@ -89,16 +89,16 @@ if(SONAR_RESOLUTION_VISIBLE) MA = vfx_clone_as_outline(127) MA.pixel_x = MA.pixel_y = VFX_SEE_ANYWHERE_PIXEL_SHIFT - holder.overlays += MA + holder.add_overlay(MA) if(SONAR_RESOLUTION_WALLHACK) MA = vfx_clone_as_greyscale() MA.pixel_x = MA.pixel_y = VFX_SEE_ANYWHERE_PIXEL_SHIFT - holder.overlays += MA + holder.add_overlay(MA) if(SONAR_RESOLUTION_BLOCKY) MA = make_sonar_shape() MA.pixel_x = MA.pixel_y = VFX_SEE_ANYWHERE_PIXEL_SHIFT if(MA) - holder.overlays += MA + holder.add_overlay(MA) /atom/proc/make_sonar_shape() return diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index df12da216d9..215870f78f3 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -850,7 +850,7 @@ var/old_icon_state1 = T.icon_state var/old_icon1 = T.icon var/old_decals = T.decals?.Copy() - var/old_overlays = T.overlays.Copy() + var/old_overlays = copy_overlays(T) var/old_underlays = T.underlays.Copy() if(platingRequired) diff --git a/code/_onclick/hud/_screen_object.dm b/code/_onclick/hud/_screen_object.dm index 78c80cd123e..6b5ec91c645 100644 --- a/code/_onclick/hud/_screen_object.dm +++ b/code/_onclick/hud/_screen_object.dm @@ -165,8 +165,8 @@ update_icon() /atom/movable/screen/zone_sel/update_icon() - overlays.Cut() - overlays += image('icons/mob/zone_sel.dmi', "[selecting]") + cut_overlays() + add_overlay(image('icons/mob/zone_sel.dmi', "[selecting]")) /// The UI Button to open the TGUI Crafting Menu /atom/movable/screen/craft diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm index aef68a6f5a3..e78a6dcf08f 100644 --- a/code/_onclick/hud/ability_screen_objects.dm +++ b/code/_onclick/hud/ability_screen_objects.dm @@ -54,14 +54,14 @@ my_mob.client.screen -= O // O.handle_icon_updates = 0 showing = 0 - overlays.len = 0 - overlays.Add(closed_state) + cut_overlays() + add_overlay(closed_state) else if(forced_state != 1) // We're opening it, show the icons. open_ability_master() update_abilities(1) showing = 1 - overlays.len = 0 - overlays.Add(open_state) + cut_overlays() + add_overlay(open_state) update_icon() /atom/movable/screen/movable/ability_master/proc/open_ability_master() @@ -242,10 +242,10 @@ // overlays -= last_charged_icon // else // icon_state = "[spell_base]_spell_ready" - overlays.Cut() + cut_overlays() icon_state = "[background_base_state]_spell_base" - overlays += ability_icon_state + add_overlay(ability_icon_state) // last_charge = spell.charge_counter diff --git a/code/_onclick/hud/actions/_action.dm b/code/_onclick/hud/actions/_action.dm index 129ea938ffc..7b215af22dd 100644 --- a/code/_onclick/hud/actions/_action.dm +++ b/code/_onclick/hud/actions/_action.dm @@ -137,7 +137,7 @@ icon = owner.button_icon icon_state = owner.background_icon_state - overlays.Cut() + cut_overlays() var/image/img if(owner.action_type == AB_ITEM && owner.target) var/obj/item/I = owner.target @@ -146,7 +146,7 @@ img = image(owner.button_icon,src,owner.button_icon_state) img.pixel_x = 0 img.pixel_y = 0 - overlays += img + add_overlay(img) if(!owner.IsAvailable()) color = rgb(128,0,0,128) @@ -181,9 +181,9 @@ return /atom/movable/screen/movable/action_button/hide_toggle/UpdateIcon() - overlays.Cut() - var/image/img = image(icon,src,hidden?"show":"hide") - overlays += img + cut_overlays() + var/image/img = image(icon, src, (hidden ? "show" : "hide")) + add_overlay(img) return //This is the proc used to update all the action buttons. Properly defined in /mob/living/ diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index a8cda96feeb..0feaa0008de 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -336,8 +336,8 @@ mymob.zone_sel.icon = ui_style mymob.zone_sel.color = ui_color mymob.zone_sel.alpha = ui_alpha - mymob.zone_sel.overlays.Cut() - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") + mymob.zone_sel.cut_overlays() + mymob.zone_sel.add_overlay(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")) hud_elements |= mymob.zone_sel /* diff --git a/code/_onclick/hud/inventory/inventory.dm b/code/_onclick/hud/inventory/inventory.dm index f56b3a565ba..dc37314cb57 100644 --- a/code/_onclick/hud/inventory/inventory.dm +++ b/code/_onclick/hud/inventory/inventory.dm @@ -39,11 +39,11 @@ "icon" = 'icons/mob/screen_gen.dmi', "icon_state" = "[is_left_hand? "l_hand" : "r_hand"]_hud_handcuffs" ) - overlays.Cut() + cut_overlays() if(iscarbon(hud?.mymob)) var/mob/living/carbon/C = hud.mymob if(C.handcuffed) - overlays += handcuff_overlay + add_overlay(handcuff_overlay) /atom/movable/screen/inventory/hand/left name = "l_hand" diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm index e1a3f09f1e7..27440f6af24 100644 --- a/code/_onclick/hud/other_mobs.dm +++ b/code/_onclick/hud/other_mobs.dm @@ -126,8 +126,8 @@ mymob.zone_sel.icon = 'icons/mob/screen1_construct.dmi' - mymob.zone_sel.overlays.len = 0 - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") + mymob.zone_sel.cut_overlays() + mymob.zone_sel.add_overlay(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")) mymob.purged.icon = 'icons/mob/screen1_construct.dmi' diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 81207482203..c6cb33cd98a 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -177,8 +177,8 @@ var/atom/movable/screen/robot_inventory mymob.zone_sel = new /atom/movable/screen/zone_sel() mymob.zone_sel.icon = ui_style mymob.zone_sel.alpha = ui_alpha - mymob.zone_sel.overlays.Cut() - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") + mymob.zone_sel.cut_overlays() + mymob.zone_sel.add_overlay(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")) //Handle the gun settings buttons mymob.gun_setting_icon = new /atom/movable/screen/gun/mode(null) diff --git a/code/_onclick/hud/spell_screen_objects.dm b/code/_onclick/hud/spell_screen_objects.dm index a6f47edc52c..c08ae707a0c 100644 --- a/code/_onclick/hud/spell_screen_objects.dm +++ b/code/_onclick/hud/spell_screen_objects.dm @@ -36,21 +36,20 @@ toggle_open() -/atom/movable/screen/movable/spell_master/proc/toggle_open(var/forced_state = 0) +/atom/movable/screen/movable/spell_master/proc/toggle_open(forced_state = 0) + cut_overlays() if(showing && (forced_state != 2)) for(var/atom/movable/screen/spell/O in spell_objects) if(spell_holder && spell_holder.client) spell_holder.client.screen -= O O.handle_icon_updates = 0 showing = 0 - overlays.len = 0 - overlays.Add(closed_state) + add_overlay(closed_state) else if(forced_state != 1) open_spellmaster() update_spells(1) showing = 1 - overlays.len = 0 - overlays.Add(open_state) + add_overlay(open_state) /atom/movable/screen/movable/spell_master/proc/open_spellmaster() var/list/screen_loc_xy = splittext(screen_loc,",") @@ -181,7 +180,7 @@ if((last_charge == spell.charge_counter || !handle_icon_updates) && !forced_update) return //nothing to see here - overlays -= spell.hud_state + cut_overlay(spell.hud_state) if(spell.charge_type == Sp_RECHARGE || spell.charge_type == Sp_CHARGES) if(spell.charge_counter < spell.charge_max) @@ -189,27 +188,27 @@ if(spell.charge_counter > 0) var/icon/partial_charge = icon(src.icon, "[spell_base]_spell_ready") partial_charge.Crop(1, 1, partial_charge.Width(), round(partial_charge.Height() * spell.charge_counter / spell.charge_max)) - overlays += partial_charge + add_overlay(partial_charge) if(last_charged_icon) - overlays -= last_charged_icon + cut_overlay(last_charged_icon) last_charged_icon = partial_charge else if(last_charged_icon) - overlays -= last_charged_icon + cut_overlay(last_charged_icon) last_charged_icon = null else icon_state = "[spell_base]_spell_ready" if(last_charged_icon) - overlays -= last_charged_icon + cut_overlay(last_charged_icon) else icon_state = "[spell_base]_spell_ready" - overlays += spell.hud_state + add_overlay(spell.hud_state) last_charge = spell.charge_counter - overlays -= "silence" + cut_overlay("silence") if(spell.silenced) - overlays += "silence" + add_overlay("silence") /atom/movable/screen/spell/Click() if(!usr || !spell) diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 18bba230f6d..95068962c3c 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -153,7 +153,7 @@ var/const/tk_maxrange = 15 return /obj/item/tk_grab/update_icon() - overlays.Cut() + cut_overlays() if(focus && focus.icon && focus.icon_state) - overlays += icon(focus.icon,focus.icon_state) + add_overlay(icon(focus.icon,focus.icon_state)) return diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index 2609242e860..18d394865bb 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -136,7 +136,7 @@ SUBSYSTEM_DEF(air) T.update_air_properties() T.post_update_air_properties() #ifdef ZAS_DEBUG_GRAPHICS - T.overlays -= mark + T.cut_overlay(mark) #endif if(MC_TICK_CHECK) return @@ -153,7 +153,7 @@ SUBSYSTEM_DEF(air) T.update_air_properties() T.post_update_air_properties() #ifdef ZAS_DEBUG_GRAPHICS - T.overlays -= mark + T.cut_overlay(mark) #endif if(MC_TICK_CHECK) return diff --git a/code/game/gamemodes/changeling/powers/lesser_form.dm b/code/game/gamemodes/changeling/powers/lesser_form.dm index c106fb7a10a..949e8b42711 100644 --- a/code/game/gamemodes/changeling/powers/lesser_form.dm +++ b/code/game/gamemodes/changeling/powers/lesser_form.dm @@ -67,7 +67,7 @@ C.transforming = 1 C.canmove = 0 C.icon = null - C.overlays.Cut() + C.cut_overlays() C.invisibility = 101 var/atom/movable/overlay/animation = new /atom/movable/overlay( C.loc ) animation.icon_state = "blank" diff --git a/code/game/gamemodes/cult/cultify/mob.dm b/code/game/gamemodes/cult/cultify/mob.dm index 488a32e615e..ea550a7d7cc 100644 --- a/code/game/gamemodes/cult/cultify/mob.dm +++ b/code/game/gamemodes/cult/cultify/mob.dm @@ -10,7 +10,7 @@ if(icon_state != "ghost-narsie") icon = 'icons/mob/mob.dmi' icon_state = "ghost-narsie" - overlays = 0 + cut_overlays() invisibility = 0 to_chat(src, "Even as a non-corporal being, you can feel Nar-Sie's presence altering you. You are now visible to everyone.") @@ -24,7 +24,7 @@ var/mob/observer/dead/G = (ghostize()) G.icon = 'icons/mob/mob.dmi' G.icon_state = "ghost-narsie" - G.overlays = 0 + G.cut_overlays() G.invisibility = 0 to_chat(G, "You feel relieved as what's left of your soul finally escapes its prison of flesh.") diff --git a/code/game/gamemodes/cult/soulstone.dm b/code/game/gamemodes/cult/soulstone.dm index 466dfed6956..759a5043f5d 100644 --- a/code/game/gamemodes/cult/soulstone.dm +++ b/code/game/gamemodes/cult/soulstone.dm @@ -139,7 +139,7 @@ S.real_name = "Shade of [T.real_name]" S.icon = T.icon S.icon_state = T.icon_state - S.overlays = T.overlays + S.overlays = copy_overlays(T) S.color = rgb(254,0,0) S.alpha = 127 if (T.client) diff --git a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm index f50f25c5994..cad7a3f239f 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm @@ -19,7 +19,7 @@ START_PROCESSING(SSobj, src) /obj/singularity/narsie/large/exit/update_icon() - overlays = 0 + cut_overlays() /obj/singularity/narsie/large/exit/process(delta_time) for(var/mob/M in GLOB.player_list) diff --git a/code/game/gamemodes/technomancer/assistance/golem.dm b/code/game/gamemodes/technomancer/assistance/golem.dm index 748a31f4591..85da1a94331 100644 --- a/code/game/gamemodes/technomancer/assistance/golem.dm +++ b/code/game/gamemodes/technomancer/assistance/golem.dm @@ -110,24 +110,26 @@ qdel(src) /mob/living/simple_animal/technomancer_golem/update_icon() - overlays.Cut() - overlays += sword_image - overlays += spell_image + cut_overlays() + var/list/overlays_to_add = list() + overlays_to_add += sword_image + overlays_to_add += spell_image + add_overlay(overlays_to_add) update_modifier_visuals() -// Unfortunately, BYOND does not let you flick() images or other overlays, so we need to do this in a terrible way. -/atom/proc/manual_flick(var/list/frames, var/image/I, var/reset_to = null) +/// Unfortunately, BYOND does not let you flick() images or other overlays, so we need to do this in a terrible way. +/atom/proc/manual_flick(list/frames, image/I, reset_to = null) // Swap in and out each frame manually. for(var/frame in frames) - overlays -= I + cut_overlay(I) I.icon_state = frame - overlays += I + add_overlay(I) sleep(frames[frame]) if(reset_to) // One more time to reset it to what it was before. - overlays -= I + cut_overlay(I) I.icon_state = reset_to - overlays += I + add_overlay(I) /mob/living/simple_animal/technomancer_golem/proc/spellcast_pre_animation() setClickCooldown(5) diff --git a/code/game/gamemodes/technomancer/instability.dm b/code/game/gamemodes/technomancer/instability.dm index 7c2361f7f7b..218336da666 100644 --- a/code/game/gamemodes/technomancer/instability.dm +++ b/code/game/gamemodes/technomancer/instability.dm @@ -90,9 +90,9 @@ last_instability_event = world.time spawn(1) var/image/instability_flash = image('icons/obj/spells.dmi',"instability") - overlays |= instability_flash + add_overlay(instability_flash) sleep(4) - overlays.Remove(instability_flash) + cut_overlay(instability_flash) qdel(instability_flash) /mob/living/silicon/instability_effects() diff --git a/code/game/gamemodes/technomancer/spell_objs.dm b/code/game/gamemodes/technomancer/spell_objs.dm index 780782caf2f..98eca6c04b9 100644 --- a/code/game/gamemodes/technomancer/spell_objs.dm +++ b/code/game/gamemodes/technomancer/spell_objs.dm @@ -147,9 +147,9 @@ /obj/item/spell/update_icon() if(toggled) var/image/new_overlay = image('icons/obj/spells.dmi',"toggled") - overlays |= new_overlay + add_overlay(new_overlay) else - overlays.Cut() + cut_overlays() ..() // Proc: run_checks() diff --git a/code/game/gamemodes/technomancer/spells/illusion.dm b/code/game/gamemodes/technomancer/spells/illusion.dm index 2d75c56428f..0cc0e1e3bde 100644 --- a/code/game/gamemodes/technomancer/spells/illusion.dm +++ b/code/game/gamemodes/technomancer/spells/illusion.dm @@ -64,11 +64,11 @@ // Makes a tiny overlay of the thing the player has copied, so they can easily tell what they currently have. /obj/item/spell/illusion/update_icon() - overlays.Cut() + cut_overlays() if(copied) var/image/temp_image = image(copied) var/matrix/M = matrix() M.Scale(0.5, 0.5) temp_image.transform = M // temp_image.pixel_y = 8 - src.overlays.Add(temp_image) + add_overlay(temp_image) diff --git a/code/game/machinery/atm_ret_field.dm b/code/game/machinery/atm_ret_field.dm index 27f890b3bdf..6f4f3756a10 100644 --- a/code/game/machinery/atm_ret_field.dm +++ b/code/game/machinery/atm_ret_field.dm @@ -192,7 +192,7 @@ //light_on = TRUE /obj/structure/atmospheric_retention_field/update_icon() - overlays.Cut() + cut_overlays() var/list/dirs = list() for(var/obj/structure/atmospheric_retention_field/F in orange(src,1)) dirs += get_dir(src, F) @@ -202,7 +202,7 @@ icon_state = "" for(var/i = 1 to 4) var/image/I = image(icon, "[basestate][connections[i]]", dir = 1<<(i-1)) - overlays += I + add_overlay(I) return diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 84621058138..ed6049be301 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -191,9 +191,9 @@ update_flag 32 = tank_pressure go boom. */ - if (src.destroyed) - src.overlays = 0 - src.icon_state = text("[]-1", src.canister_color) + if (destroyed) + cut_overlays() + icon_state = text("[]-1", src.canister_color) return if(icon_state != "[canister_color]") @@ -202,20 +202,24 @@ update_flag if(check_change()) //Returns 1 if no change needed to icons. return - src.overlays = 0 + cut_overlays() + var/list/overlays_to_add = list() if(update_flag & 1) - overlays += "can-open" + overlays_to_add += "can-open" if(update_flag & 2) - overlays += "can-connector" + overlays_to_add += "can-connector" if(update_flag & 4) - overlays += "can-o0" + overlays_to_add += "can-o0" if(update_flag & 8) - overlays += "can-o1" + overlays_to_add += "can-o1" else if(update_flag & 16) - overlays += "can-o2" + overlays_to_add += "can-o2" else if(update_flag & 32) - overlays += "can-o3" + overlays_to_add += "can-o3" + + add_overlay(overlays_to_add) + return /obj/machinery/portable_atmospherics/canister/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index b51a2e5ffe6..80112ea75ea 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -29,7 +29,8 @@ src.air_contents.adjust_multi(/datum/gas/oxygen, air_mix[/datum/gas/oxygen], /datum/gas/nitrogen, air_mix[/datum/gas/nitrogen]) /obj/machinery/portable_atmospherics/powered/pump/update_icon() - src.overlays = 0 + cut_overlays() + var/list/overlays_to_add = list() if(on && cell && cell.charge) icon_state = "psiphon:1" @@ -37,11 +38,11 @@ icon_state = "psiphon:0" if(holding) - overlays += "siphon-open" + overlays_to_add += "siphon-open" if(connected_port) - overlays += "siphon-connector" - + overlays_to_add += "siphon-connector" + add_overlay(overlays_to_add) return /obj/machinery/portable_atmospherics/powered/pump/emp_act(severity) @@ -219,7 +220,7 @@ to_chat(user, "You can't directly interact with this machine. Use the pump control console.") /obj/machinery/portable_atmospherics/powered/pump/huge/update_icon() - overlays.Cut() + cut_overlays() if(on && !(machine_stat & (NOPOWER|BROKEN))) icon_state = "siphon:1" diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 28a61cba07f..d0fcb34881f 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -185,7 +185,7 @@ to_chat(user, "You can't directly interact with this machine. Use the scrubber control console.") /obj/machinery/portable_atmospherics/powered/scrubber/huge/update_icon() - src.overlays = 0 + cut_overlays() if(on && !(machine_stat & (NOPOWER|BROKEN))) icon_state = "scrubber:1" diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 506904b7c0c..30b1ac97427 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -283,7 +283,7 @@ return FALSE /obj/machinery/autolathe/update_icon() - overlays.Cut() + cut_overlays() icon_state = initial(icon_state) diff --git a/code/game/machinery/bomb_tester.dm b/code/game/machinery/bomb_tester.dm index 44656f8f1f9..ca25bbaa56b 100644 --- a/code/game/machinery/bomb_tester.dm +++ b/code/game/machinery/bomb_tester.dm @@ -64,15 +64,17 @@ simulation_finish() /obj/machinery/bomb_tester/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(tank1) - overlays += image(icon, "[icon_name]-tank1") + overlays_to_add += image(icon, "[icon_name]-tank1") if(tank2) - overlays += image(icon, "[icon_name]-tank2") + overlays_to_add += image(icon, "[icon_name]-tank2") if(machine_stat & NOPOWER) icon_state = "[icon_name]-p" else icon_state = "[icon_name][simulating]" + add_overlay(overlays_to_add) /obj/machinery/bomb_tester/power_change() ..() diff --git a/code/game/machinery/computer/RCON_Console.dm b/code/game/machinery/computer/RCON_Console.dm index 325e44c8683..d8f3941f372 100644 --- a/code/game/machinery/computer/RCON_Console.dm +++ b/code/game/machinery/computer/RCON_Console.dm @@ -39,4 +39,4 @@ /obj/machinery/computer/rcon/update_icon() ..() if(!(machine_stat & (NOPOWER|BROKEN))) - overlays += image(icon, "ai-fixer-empty", overlay_layer) + add_overlay(image(icon, "ai-fixer-empty", overlay_layer)) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 598de3f4e66..a4026a664ae 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -715,12 +715,12 @@ G.update_icon() /obj/machinery/cryopod/robot/door/gateway/update_icon() - overlays.Cut() + cut_overlays() if(occupant) var/image/I = image(icon, src, "[base_icon_state]_active_overlay") I.plane = ABOVE_LIGHTING_PLANE I.layer = ABOVE_LIGHTING_LAYER - overlays += I + add_overlay(I) set_light(0.4, 1.2, 4, 10) else set_light(0) @@ -728,7 +728,7 @@ var/image/I = image(icon, src, "[base_icon_state]_idle_overlay") I.plane = ABOVE_LIGHTING_PLANE I.layer = ABOVE_LIGHTING_LAYER - overlays += I + add_overlay(I) /obj/machinery/computer/cryopod/gateway name = "teleport oversight console" diff --git a/code/game/machinery/doorbell_vr.dm b/code/game/machinery/doorbell_vr.dm index 7867d3292b6..a1ffe2c4e98 100644 --- a/code/game/machinery/doorbell_vr.dm +++ b/code/game/machinery/doorbell_vr.dm @@ -33,9 +33,9 @@ update_icon() /obj/machinery/doorbell_chime/update_icon() - overlays.Cut() + cut_overlays() if(panel_open) - overlays += "dbchime-open" + add_overlay("dbchime-open") if(inoperable()) icon_state = "dbchime-off" if(!id_tag) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index be0b0eb0dba..f233919c5e0 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -799,35 +799,42 @@ About the new airlock wires panel: /obj/machinery/door/airlock/update_icon() - if(overlays) overlays.Cut() + if(overlays) + cut_overlays() + + var/list/overlays_to_add = list() + if(density) if(locked && lights && src.arePowerSystemsOn()) icon_state = "door_locked" else icon_state = "door_closed" if(p_open || welded) - overlays = list() if(p_open) - overlays += image(icon, "panel_open") + overlays_to_add += image(icon, "panel_open") if (!(machine_stat & NOPOWER)) if(machine_stat & BROKEN) - overlays += image(icon, "sparks_broken") + overlays_to_add += image(icon, "sparks_broken") else if (health < maxhealth * 3/4) - overlays += image(icon, "sparks_damaged") + overlays_to_add += image(icon, "sparks_damaged") if(welded) - overlays += image(icon, "welded") + overlays_to_add += image(icon, "welded") else if (health < maxhealth * 3/4 && !(machine_stat & NOPOWER)) - overlays += image(icon, "sparks_damaged") + overlays_to_add += image(icon, "sparks_damaged") else icon_state = "door_open" if((machine_stat & BROKEN) && !(machine_stat & NOPOWER)) - overlays += image(icon, "sparks_open") + overlays_to_add += image(icon, "sparks_open") + + add_overlay(overlays_to_add) + return /obj/machinery/door/airlock/do_animate(animation) switch(animation) if("opening") - if(overlays) overlays.Cut() + if(overlays) + cut_overlays() if(p_open) spawn(2) // The only work around that works. Downside is that the door will be gone for a millisecond. flick("o_door_opening", src) //can not use flick due to BYOND bug updating overlays right before flicking @@ -836,7 +843,8 @@ About the new airlock wires panel: flick("door_opening", src)//[machine_stat ? "_stat":] update_icon() if("closing") - if(overlays) overlays.Cut() + if(overlays) + cut_overlays() if(p_open) spawn(2) flick("o_door_closing", src) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 5decfa37486..169ded32681 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -436,29 +436,34 @@ /obj/machinery/door/firedoor/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + if(density) icon_state = "door_closed" if(prying) icon_state = "prying_closed" if(hatch_open) - overlays += "hatch" + overlays_to_add += "hatch" if(blocked) - overlays += "welded" + overlays_to_add += "welded" if(pdiff_alert) - overlays += "palert" + overlays_to_add += "palert" if(dir_alerts) for(var/d=1;d<=4;d++) var/cdir = GLOB.cardinal[d] for(var/i=1;i<=ALERT_STATES.len;i++) if(dir_alerts[d] & (1<<(i-1))) - overlays += new/icon(icon,"alert_[ALERT_STATES[i]]", dir=cdir) + overlays_to_add += new/icon(icon,"alert_[ALERT_STATES[i]]", dir=cdir) else icon_state = "door_open" if(prying) icon_state = "prying_open" if(blocked) - overlays += "welded_open" + overlays_to_add += "welded_open" + + add_overlay(overlays_to_add) + return //These are playing merry hell on ZAS. Sorry fellas :( diff --git a/code/game/machinery/event.dm b/code/game/machinery/event.dm index 60c31caf6ac..06e51d10684 100644 --- a/code/game/machinery/event.dm +++ b/code/game/machinery/event.dm @@ -92,13 +92,13 @@ The goal here is to create esoteric or niche, specialized machines that follow t return /obj/machinery/magma_pump/update_icon() - overlays.Cut() + cut_overlays() if(on) set_light(3, 3, "#FFCC00") - src.icon_state = "[icon_state]_1" + icon_state = "[icon_state]_1" else set_light(0) - src.icon_state = initial(icon_state) + icon_state = initial(icon_state) /obj/structure/broken_pump name = "broken pump" @@ -240,13 +240,13 @@ The goal here is to create esoteric or niche, specialized machines that follow t return /obj/machinery/magma_reservoir/update_icon() - overlays.Cut() + cut_overlays() if(on) set_light(3, 3, "#FFCC00") - src.icon_state = "[icon_state]_1" + icon_state = "[icon_state]_1" else set_light(0) - src.icon_state = initial(icon_state) + icon_state = initial(icon_state) /obj/structure/broken_reservoir name = "broken reservoir" diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index f3307d032ac..169be8c134d 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -102,7 +102,7 @@ if(unlocked) if(open) open = FALSE - overlays = null + cut_overlays() to_chat(user, SPAN_NOTICE("You crowbar the battery panel in place.")) else if(unlocked) diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index f6706ae81a0..6105ffc5e6a 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -119,7 +119,7 @@ var/list/floor_light_cache = list() update_icon() /obj/machinery/floor_light/update_icon() - overlays.Cut() + cut_overlays() if(use_power && !broken()) if(isnull(damaged)) var/cache_key = "floorlight-[default_light_colour]" @@ -128,7 +128,7 @@ var/list/floor_light_cache = list() I.color = default_light_colour I.layer = layer+0.001 floor_light_cache[cache_key] = I - overlays |= floor_light_cache[cache_key] + add_overlay(floor_light_cache[cache_key]) else if(damaged == 0) //Needs init. damaged = rand(1,4) @@ -138,7 +138,7 @@ var/list/floor_light_cache = list() I.color = default_light_colour I.layer = layer+0.001 floor_light_cache[cache_key] = I - overlays |= floor_light_cache[cache_key] + add_overlay(floor_light_cache[cache_key]) /obj/machinery/floor_light/proc/broken() return (machine_stat & (BROKEN|NOPOWER)) diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index a432f2d3acc..c139fc8c268 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -37,14 +37,14 @@ overlay = image(icon, "light1-overlay") overlay.plane = ABOVE_LIGHTING_PLANE - overlays.Cut() + cut_overlays() if(machine_stat & NOPOWER) icon_state = "light-p" set_light(0) else icon_state = "light[on]" overlay.icon_state = "light[on]-overlay" - overlays += overlay + add_overlay(overlay) set_light(2, 0.1, on ? "#82FF4C" : "#F86060") /obj/machinery/light_switch/examine(mob/user) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 85882122f0a..97fb14a8853 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -200,21 +200,21 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(!ispowered || isbroken) icon_state = "newscaster_off" if(isbroken) //If the thing is smashed, add crack overlay on top of the unpowered sprite. - overlays.Cut() - overlays += image(icon, "crack3") + cut_overlays() + add_overlay(image(icon, "crack3")) return - overlays.Cut() //reset overlays + cut_overlays() //reset overlays if(news_network.wanted_issue) //wanted icon state, there can be no overlays on it as it's a priority message icon_state = "newscaster_wanted" return if(alert) //new message alert overlay - overlays += "newscaster_alert" + add_overlay("newscaster_alert") if(hitstaken > 0) //Cosmetic damage overlay - overlays += image(icon, "crack[hitstaken]") + add_overlay(image(icon, "crack[hitstaken]")) icon_state = "newscaster_normal" return diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 4f17a21311d..3caf088364b 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -61,19 +61,19 @@ var/bomb_set if(auth) if(opened == FALSE) opened = TRUE - overlays += image(icon, "npanel_open") + add_overlay(image(icon, "npanel_open")) to_chat(user, "You unscrew the control panel of [src].") else opened = FALSE - overlays -= image(icon, "npanel_open") + cut_overlay(image(icon, "npanel_open")) to_chat(user, "You screw the control panel of [src] back on.") else if(opened == FALSE) to_chat(user, "The [src] emits a buzzing noise, the panel staying locked in.") if(opened == TRUE) opened = FALSE - overlays -= image(icon, "npanel_open") + cut_overlay(image(icon, "npanel_open")) to_chat(user, "You screw the control panel of [src] back on.") flick("nuclearbombc", src) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 38fa263f5e5..62fcb753168 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -205,20 +205,20 @@ desc += "
It is capable of repairing burn damage." /obj/machinery/recharge_station/proc/build_overlays() - overlays.Cut() + cut_overlays() switch(round(chargepercentage())) if(1 to 20) - overlays += image('icons/obj/objects.dmi', "statn_c0") + add_overlay(image('icons/obj/objects.dmi', "statn_c0")) if(21 to 40) - overlays += image('icons/obj/objects.dmi', "statn_c20") + add_overlay(image('icons/obj/objects.dmi', "statn_c20")) if(41 to 60) - overlays += image('icons/obj/objects.dmi', "statn_c40") + add_overlay(image('icons/obj/objects.dmi', "statn_c40")) if(61 to 80) - overlays += image('icons/obj/objects.dmi', "statn_c60") + add_overlay(image('icons/obj/objects.dmi', "statn_c60")) if(81 to 98) - overlays += image('icons/obj/objects.dmi', "statn_c80") + add_overlay(image('icons/obj/objects.dmi', "statn_c80")) if(99 to 110) - overlays += image('icons/obj/objects.dmi', "statn_c100") + add_overlay(image('icons/obj/objects.dmi', "statn_c100")) /obj/machinery/recharge_station/update_icon() ..() diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 220e83848c7..9590f04bbe1 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -19,10 +19,10 @@ update_icon() /obj/machinery/space_heater/update_icon() - overlays.Cut() + cut_overlays() icon_state = "sheater[on]" if(panel_open) - overlays += "sheater-open" + add_overlay("sheater-open") if(on) set_light(3, 3, "#FFCC00") else @@ -288,14 +288,16 @@ env.merge(removed) /obj/machinery/power/thermoregulator/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(on) - overlays += "lasergen-on" + overlays_to_add += "lasergen-on" switch(mode) if(MODE_HEATING) - overlays += "lasergen-heat" + overlays_to_add += "lasergen-heat" if(MODE_COOLING) - overlays += "lasergen-cool" + overlays_to_add += "lasergen-cool" + add_overlay(overlays_to_add) /obj/machinery/power/thermoregulator/proc/turn_off() on = 0 diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index d4af5bdeb3d..af1b09e7b2e 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -187,7 +187,7 @@ if(!picture || picture_state != state) picture_state = state picture = image('icons/obj/status_display.dmi', icon_state=picture_state) - overlays |= picture + add_overlay(picture) /obj/machinery/status_display/proc/update_display(line1, line2) line1 = uppertext(line1) @@ -226,7 +226,7 @@ /obj/machinery/status_display/proc/remove_display() if(overlays.len) - overlays.Cut() + cut_overlays() if(maptext) maptext = "" diff --git a/code/game/machinery/status_display_ai.dm b/code/game/machinery/status_display_ai.dm index 99c9ce62cbc..622a7e25503 100644 --- a/code/game/machinery/status_display_ai.dm +++ b/code/game/machinery/status_display_ai.dm @@ -91,7 +91,7 @@ var/list/ai_status_emotions = list( /obj/machinery/ai_status_display/proc/update() if(mode==0) //Blank - overlays.Cut() + cut_overlays() return if(mode==1) // AI emoticon @@ -106,13 +106,13 @@ var/list/ai_status_emotions = list( /obj/machinery/ai_status_display/proc/set_picture(state) picture_state = state if(overlays.len) - overlays.Cut() - overlays += image('icons/obj/status_display.dmi', icon_state=picture_state) + cut_overlays() + add_overlay(image('icons/obj/status_display.dmi', icon_state=picture_state)) /obj/machinery/ai_status_display/power_change() ..() if(machine_stat & NOPOWER) if(overlays.len) - overlays.Cut() + cut_overlays() else update() diff --git a/code/game/machinery/teleporter/pad.dm b/code/game/machinery/teleporter/pad.dm index 329fa6965e3..41adee93bf2 100644 --- a/code/game/machinery/teleporter/pad.dm +++ b/code/game/machinery/teleporter/pad.dm @@ -22,13 +22,13 @@ update_icon() /obj/machinery/tele_pad/update_icon() - overlays.Cut() + cut_overlays() if(com?.projector?.engaged) update_use_power(USE_POWER_ACTIVE) var/image/I = image(icon, src, "[initial(icon_state)]_active_overlay") I.plane = ABOVE_LIGHTING_PLANE I.layer = ABOVE_LIGHTING_LAYER - overlays += I + add_overlay(I) set_light(0.4, 1.2, 4, 10) else set_light(0) @@ -37,7 +37,7 @@ var/image/I = image(icon, src, "[initial(icon_state)]_idle_overlay") I.plane = ABOVE_LIGHTING_PLANE I.layer = ABOVE_LIGHTING_LAYER - overlays += I + add_overlay(I) /obj/machinery/tele_pad/Bumped(M as mob|obj) if(com?.projector?.engaged) diff --git a/code/game/machinery/teleporter/projector.dm b/code/game/machinery/teleporter/projector.dm index 7f3379b8815..c7aa06e5b77 100644 --- a/code/game/machinery/teleporter/projector.dm +++ b/code/game/machinery/teleporter/projector.dm @@ -29,22 +29,22 @@ break /obj/machinery/tele_projector/update_icon() - overlays.Cut() + cut_overlays() if(engaged) update_use_power(USE_POWER_ACTIVE) var/image/I = image(icon, src, "[initial(icon_state)]_active_overlay") I.plane = ABOVE_LIGHTING_PLANE I.layer = ABOVE_LIGHTING_LAYER - overlays += I + add_overlay(I) else update_use_power(USE_POWER_IDLE) if(operable()) var/image/I = image(icon, src, "[initial(icon_state)]_idle_overlay") I.plane = ABOVE_LIGHTING_PLANE I.layer = ABOVE_LIGHTING_LAYER - overlays += I + add_overlay(I) -/obj/machinery/tele_projector/attackby(var/obj/item/W) +/obj/machinery/tele_projector/attackby(obj/item/W) attack_hand() /obj/machinery/tele_projector/attack_ai() diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index c051c62b487..5e76927d6aa 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -215,9 +215,9 @@ panel_open = !panel_open to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.") playsound(src, W.tool_sound, 50, 1) - overlays.Cut() + cut_overlays() if(panel_open) - overlays += image(icon, "[initial(icon_state)]-panel") + add_overlay(image(icon, "[initial(icon_state)]-panel")) SSnanoui.update_uis(src) // Speaker switch is on the main UI, not wires UI return diff --git a/code/game/mecha/equipment/tools/shield.dm b/code/game/mecha/equipment/tools/shield.dm index aa74a9ec13b..27ad7f591e1 100644 --- a/code/game/mecha/equipment/tools/shield.dm +++ b/code/game/mecha/equipment/tools/shield.dm @@ -28,7 +28,7 @@ return /obj/item/mecha_parts/mecha_equipment/combat_shield/Destroy() - chassis.overlays -= drone_overlay + chassis.cut_overlay(drone_overlay) my_shield.forceMove(src) my_shield.destroy_shields() my_shield.my_tool = null @@ -37,11 +37,11 @@ my_shield = null ..() -/obj/item/mecha_parts/mecha_equipment/combat_shield/add_equip_overlay(obj/mecha/M as obj) +/obj/item/mecha_parts/mecha_equipment/combat_shield/add_equip_overlay(obj/mecha/M) ..() if(!drone_overlay) drone_overlay = new(src.icon, icon_state = "shield_droid") - M.overlays += drone_overlay + M.add_overlay(drone_overlay) return /obj/item/mecha_parts/mecha_equipment/combat_shield/attach(obj/mecha/M as obj) @@ -53,7 +53,7 @@ return /obj/item/mecha_parts/mecha_equipment/combat_shield/detach() - chassis.overlays -= drone_overlay + chassis.cut_overlay(drone_overlay) ..() my_shield.destroy_shields() my_shield.my_mecha = null diff --git a/code/game/mecha/equipment/weapons/reticent.dm b/code/game/mecha/equipment/weapons/reticent.dm index 9b3e28d4201..30cad526eea 100644 --- a/code/game/mecha/equipment/weapons/reticent.dm +++ b/code/game/mecha/equipment/weapons/reticent.dm @@ -114,10 +114,10 @@ desc = "A Silencium infused linear combat shield. Its faint presence cannot be easily detected." icon_state = "shield_mime" -/obj/item/mecha_parts/mecha_equipment/combat_shield/reticent/add_equip_overlay(obj/mecha/M as obj) +/obj/item/mecha_parts/mecha_equipment/combat_shield/reticent/add_equip_overlay(obj/mecha/M) if(!drone_overlay) drone_overlay = new(src.icon, icon_state = "shield_droid_mime") - M.overlays += drone_overlay + M.add_overlay(drone_overlay) return //The shield effect. diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm index de80d07fb9b..65782d651de 100644 --- a/code/game/mecha/mecha_construction_paths.dm +++ b/code/game/mecha/mecha_construction_paths.dm @@ -79,7 +79,7 @@ /datum/construction/mecha/ripley_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 @@ -92,7 +92,7 @@ const_holder.icon = 'icons/mecha/mech_construction.dmi' const_holder.icon_state = "ripley0" const_holder.density = 1 - const_holder.overlays.len = 0 + const_holder.cut_overlays() spawn() qdel(src) return @@ -291,7 +291,7 @@ /datum/construction/mecha/gygax_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 @@ -575,7 +575,7 @@ /datum/construction/mecha/serenity_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 @@ -862,7 +862,7 @@ if(!user.attempt_consume_item_for_construction(I, src)) return user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") return 1 /datum/construction/mecha/firefighter_chassis/action(obj/item/I,mob/user as mob) @@ -1084,7 +1084,7 @@ /datum/construction/mecha/geiger_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 @@ -1097,7 +1097,7 @@ const_holder.icon = 'icons/mecha/mech_construction.dmi' const_holder.icon_state = "ripley0" const_holder.density = 1 - const_holder.overlays.len = 0 + const_holder.cut_overlays() spawn() qdel(src) return @@ -1297,7 +1297,7 @@ /datum/construction/mecha/durand_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 @@ -1581,7 +1581,7 @@ /datum/construction/mecha/odysseus_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 @@ -1794,7 +1794,7 @@ /datum/construction/mecha/phazon_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 @@ -2076,7 +2076,7 @@ /datum/construction/mecha/janus_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 @@ -2381,7 +2381,7 @@ /datum/construction/mecha/honker_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 @@ -2664,7 +2664,7 @@ /datum/construction/mecha/reticent_chassis/custom_action(step, obj/item/I, mob/user) user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]") - holder.overlays += I.icon_state+"+o" + holder.add_overlay("[I.icon_state]+o") qdel(I) return 1 diff --git a/code/game/mecha/micro/mecha_construction_paths_vr.dm b/code/game/mecha/micro/mecha_construction_paths_vr.dm index c0c1f764531..5c99283dd27 100644 --- a/code/game/mecha/micro/mecha_construction_paths_vr.dm +++ b/code/game/mecha/micro/mecha_construction_paths_vr.dm @@ -9,7 +9,7 @@ /datum/construction/mecha/polecat_chassis/custom_action(step, atom/used_atom, mob/user) user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]") - holder.overlays += used_atom.icon_state+"+o" + holder.add_overlay("[used_atom.icon_state]+o") qdel(used_atom) return 1 @@ -22,7 +22,7 @@ const_holder.icon = 'icons/mecha/mech_construction_vr.dmi' const_holder.icon_state = "polecat0" const_holder.density = TRUE - const_holder.overlays.len = 0 + const_holder.cut_overlays() spawn() qdel(src) return @@ -290,7 +290,7 @@ /datum/construction/mecha/gopher_chassis/custom_action(step, atom/used_atom, mob/user) user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]") - holder.overlays += used_atom.icon_state+"+o" + holder.add_overlay("[used_atom.icon_state]+o") qdel(used_atom) return 1 @@ -303,7 +303,7 @@ const_holder.icon = 'icons/mecha/mech_construction_vr.dmi' const_holder.icon_state = "gopher0" const_holder.density = TRUE - const_holder.overlays.len = 0 + const_holder.cut_overlays() spawn() qdel(src) return @@ -499,7 +499,7 @@ /datum/construction/reversible/mecha/gopher/custom_action(step, atom/used_atom, mob/user) user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]") - holder.overlays += used_atom.icon_state+"+o" + holder.add_overlay("[used_atom.icon_state]+o") qdel(used_atom) return 1 @@ -512,7 +512,7 @@ const_holder.icon = 'icons/mecha/mech_construction_vr.dmi' const_holder.icon_state = "weasel0" const_holder.density = TRUE - const_holder.overlays.len = 0 + const_holder.cut_overlays() spawn() qdel(src) return diff --git a/code/game/objects/_items.dm b/code/game/objects/_items.dm index abba441333b..2b98abe9903 100644 --- a/code/game/objects/_items.dm +++ b/code/game/objects/_items.dm @@ -542,7 +542,7 @@ /obj/item/clean_blood() . = ..() if(blood_overlay) - overlays.Remove(blood_overlay) + cut_overlay(blood_overlay) if(istype(src, /obj/item/clothing/gloves)) var/obj/item/clothing/gloves/G = src G.transfer_blood = 0 @@ -567,7 +567,7 @@ //Make the blood_overlay have the proper color then apply it. blood_overlay.color = blood_color - overlays += blood_overlay + add_overlay(blood_overlay) //if this blood isn't already in the list, add it if(istype(M)) diff --git a/code/game/objects/effects/alien/aliens.dm b/code/game/objects/effects/alien/aliens.dm index 66b987e08b0..00b09b882c8 100644 --- a/code/game/objects/effects/alien/aliens.dm +++ b/code/game/objects/effects/alien/aliens.dm @@ -214,7 +214,8 @@ /obj/effect/alien/weeds/proc/updateWeedOverlays() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(!weedImageCache || !weedImageCache.len) weedImageCache = list() @@ -230,16 +231,18 @@ var/turf/W = get_step(src, WEST) if(!locate(/obj/effect/alien) in N.contents) if(istype(N, /turf/simulated/floor)) - overlays += weedImageCache[WEED_SOUTH_EDGING] + overlays_to_add += weedImageCache[WEED_SOUTH_EDGING] if(!locate(/obj/effect/alien) in S.contents) if(istype(S, /turf/simulated/floor)) - overlays += weedImageCache[WEED_NORTH_EDGING] + overlays_to_add += weedImageCache[WEED_NORTH_EDGING] if(!locate(/obj/effect/alien) in E.contents) if(istype(E, /turf/simulated/floor)) - overlays += weedImageCache[WEED_WEST_EDGING] + overlays_to_add += weedImageCache[WEED_WEST_EDGING] if(!locate(/obj/effect/alien) in W.contents) if(istype(W, /turf/simulated/floor)) - overlays += weedImageCache[WEED_EAST_EDGING] + overlays_to_add += weedImageCache[WEED_EAST_EDGING] + + add_overlay(overlays_to_add) /obj/effect/alien/weeds/proc/fullUpdateWeedOverlays() for (var/obj/effect/alien/weeds/W in range(1,src)) diff --git a/code/game/objects/effects/debris/cleanable/crayon.dm b/code/game/objects/effects/debris/cleanable/crayon.dm index dd5df33da94..bff61028d1b 100644 --- a/code/game/objects/effects/debris/cleanable/crayon.dm +++ b/code/game/objects/effects/debris/cleanable/crayon.dm @@ -23,8 +23,10 @@ mainOverlay.Blend(main,ICON_ADD) shadeOverlay.Blend(shade,ICON_ADD) - overlays += mainOverlay - overlays += shadeOverlay + var/list/overlays_to_add = list() + overlays_to_add += mainOverlay + overlays_to_add += shadeOverlay + add_overlay(overlays_to_add) add_hiddenprint(usr) @@ -53,7 +55,9 @@ mainOverlay.Blend(main,ICON_ADD) shadeOverlay.Blend(shade,ICON_ADD) - overlays += mainOverlay - overlays += shadeOverlay + var/list/overlays_to_add = list() + overlays_to_add += mainOverlay + overlays_to_add += shadeOverlay + add_overlay(overlays_to_add) add_hiddenprint(usr) diff --git a/code/game/objects/effects/debris/cleanable/humans.dm b/code/game/objects/effects/debris/cleanable/humans.dm index d920fd65cbe..f42e2a0ee72 100644 --- a/code/game/objects/effects/debris/cleanable/humans.dm +++ b/code/game/objects/effects/debris/cleanable/humans.dm @@ -95,10 +95,10 @@ var/global/list/image/splatter_cache=list() if(!S.blood_DNA) S.blood_DNA = list() S.blood_overlay.color = basecolor - S.overlays += S.blood_overlay + S.add_overlay(S.blood_overlay) if(S.blood_overlay && S.blood_overlay.color != basecolor) S.blood_overlay.color = basecolor - S.overlays += S.blood_overlay + S.add_overlay(S.blood_overlay) S.blood_DNA |= blood_DNA.Copy() perp.update_inv_shoes() @@ -199,8 +199,8 @@ var/global/list/image/splatter_cache=list() blood.Blend(basecolor,ICON_MULTIPLY) icon = blood - overlays.Cut() - overlays += giblets + cut_overlays() + add_overlay(giblets) /obj/effect/debris/cleanable/blood/gibs/up random_icon_states = list("gib1", "gib2", "gib3", "gib5", "gib6","gibup1","gibup1","gibup1") diff --git a/code/game/objects/effects/debris/cleanable/tracks.dm b/code/game/objects/effects/debris/cleanable/tracks.dm index 2a96ed37f7b..01a53d06f75 100644 --- a/code/game/objects/effects/debris/cleanable/tracks.dm +++ b/code/game/objects/effects/debris/cleanable/tracks.dm @@ -127,7 +127,7 @@ var/global/list/image/fluidtrack_cache=list() update_icon() /obj/effect/debris/cleanable/blood/tracks/update_icon() - overlays.Cut() + cut_overlays() color = "#FFFFFF" var/truedir=0 @@ -148,7 +148,7 @@ var/global/list/image/fluidtrack_cache=list() track.fresh=0 track.overlay=I stack[stack_idx]=track - overlays += I + add_overlay(I) updatedtracks=0 // Clear our memory of updated tracks. /obj/effect/debris/cleanable/blood/tracks/footprints diff --git a/code/game/objects/effects/decals/warning_stripes.dm b/code/game/objects/effects/decals/warning_stripes.dm index b6e7d8e0372..3da7a76daa3 100644 --- a/code/game/objects/effects/decals/warning_stripes.dm +++ b/code/game/objects/effects/decals/warning_stripes.dm @@ -6,5 +6,5 @@ var/turf/T=get_turf(src) var/image/I=image(icon, icon_state = icon_state, dir = dir) I.color=color - T.overlays += I + T.add_overlay(I) qdel(src) diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index adc47411457..e14bf94d674 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -43,7 +43,7 @@ storage_capacity = (MOB_MEDIUM * 2) - 1 var/contains_body = 0 -/obj/structure/closet/body_bag/attackby(var/obj/item/W as obj, mob/user as mob) +/obj/structure/closet/body_bag/attackby(obj/item/W, mob/user) if (istype(W, /obj/item/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text if (user.get_active_held_item() != W) @@ -52,17 +52,17 @@ return t = sanitizeSafe(t, MAX_NAME_LEN) if (t) - src.name = "body bag - " - src.name += t - src.overlays += image(src.icon, "bodybag_label") + name = "body bag - " + name += t + add_overlay(image(src.icon, "bodybag_label")) else - src.name = "body bag" + name = "body bag" //..() //Doesn't need to run the parent. Since when can fucking bodybags be welded shut? -Agouri return else if(W.is_wirecutter()) to_chat(user, "You cut the tag off the bodybag") - src.name = "body bag" - src.overlays.Cut() + name = "body bag" + cut_overlays() return /obj/structure/closet/body_bag/store_mobs(var/stored_units) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index efa4a592af2..1ed50a0a095 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -984,9 +984,9 @@ GLOBAL_LIST_EMPTY(PDAs) /obj/item/pda/update_icon() ..() - overlays.Cut() + cut_overlays() if(new_message || new_news) - overlays += image(icon, "pda-r") + add_overlay(image(icon, "pda-r")) /obj/item/pda/proc/detonate_act(var/obj/item/pda/P) //TODO: sometimes these attacks show up on the message server diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 08f984a04c5..23028422896 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -86,10 +86,10 @@ return 1 /obj/item/aicard/update_icon() - overlays.Cut() + cut_overlays() if(carded_ai) if (!carded_ai.control_disabled) - overlays += image('icons/obj/pda.dmi', "aicard-on") + add_overlay(image('icons/obj/pda.dmi', "aicard-on")) if(carded_ai.stat) icon_state = "aicard-404" else @@ -170,10 +170,10 @@ icon_state = "aitater" /obj/item/aicard/aitater/update_icon() - overlays.Cut() + cut_overlays() if(carded_ai) if (!carded_ai.control_disabled) - overlays += image('icons/obj/pda.dmi', "aitater-on") + add_overlay(image('icons/obj/pda.dmi', "aitater-on")) if(carded_ai.stat) icon_state = "aitater-404" else @@ -187,10 +187,10 @@ icon_state = "aispook" /obj/item/aicard/aispook/update_icon() - overlays.Cut() + cut_overlays() if(carded_ai) if (!carded_ai.control_disabled) - overlays += image('icons/obj/pda.dmi', "aispook-on") + add_overlay(image('icons/obj/pda.dmi', "aispook-on")) if(carded_ai.stat) icon_state = "aispook-404" else diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index 793f23044f8..511fbda7171 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -36,7 +36,7 @@ saved_item = target.type saved_icon = target.icon saved_icon_state = target.icon_state - saved_overlays = target.overlays + saved_overlays = copy_overlays(target) /obj/item/chameleon/proc/toggle() if(!can_use || !saved_item) return diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm index ee31c521df4..e18b58ba460 100644 --- a/code/game/objects/items/devices/defib.dm +++ b/code/game/objects/items/devices/defib.dm @@ -41,6 +41,8 @@ /obj/item/defib_kit/update_icon() + + cut_overlays() var/list/new_overlays = list() if(paddles && paddles.loc == src) //in case paddles got destroyed somehow. @@ -59,7 +61,7 @@ else new_overlays += "[initial(icon_state)]-nocell" - overlays = new_overlays + add_overlay(new_overlays) /obj/item/defib_kit/ui_action_click() toggle_paddles() diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index 9115cddc23a..399c096b2bd 100755 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -39,9 +39,9 @@ if(colorable) switch(pick("red","green","yellow")) if ("red") - overlays += "multi_r" + add_overlay("multi_r") if ("green") - overlays += "multi_g" + add_overlay("multi_g") if ("yellow") return update_icon() diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 430541703be..5c916ac4187 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -24,7 +24,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/paicard) /obj/item/paicard/Initialize(mapload) . = ..() - overlays += "pai-off" + add_overlay("pai-off") /obj/item/paicard/Destroy() //Will stop people throwing friend pAIs into the singularity so they can respawn @@ -279,35 +279,54 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/paicard) // WIRE_TRANSMIT = 4 /obj/item/paicard/proc/setPersonality(mob/living/silicon/pai/personality) - src.pai = personality - src.overlays += "pai-happy" + pai = personality + cut_overlays() + add_overlay("pai-happy") /obj/item/paicard/proc/removePersonality() - src.pai = null - src.overlays.Cut() - src.overlays += "pai-off" + pai = null + cut_overlays() + add_overlay("pai-off") /obj/item/paicard var/current_emotion = 1 -/obj/item/paicard/proc/setEmotion(var/emotion) + +//! WHAT THE FUCK +/obj/item/paicard/proc/setEmotion(emotion) if(pai) - src.overlays.Cut() + cut_overlays() switch(emotion) - if(1) src.overlays += "pai-happy" - if(2) src.overlays += "pai-cat" - if(3) src.overlays += "pai-extremely-happy" - if(4) src.overlays += "pai-face" - if(5) src.overlays += "pai-laugh" - if(6) src.overlays += "pai-off" - if(7) src.overlays += "pai-sad" - if(8) src.overlays += "pai-angry" - if(9) src.overlays += "pai-what" - if(10) src.overlays += "pai-neutral" - if(11) src.overlays += "pai-silly" - if(12) src.overlays += "pai-nose" - if(13) src.overlays += "pai-smirk" - if(14) src.overlays += "pai-exclamation" - if(15) src.overlays += "pai-question" + if(1) + add_overlay("pai-happy") + if(2) + add_overlay("pai-cat") + if(3) + add_overlay("pai-extremely-happy") + if(4) + add_overlay("pai-face") + if(5) + add_overlay("pai-laugh") + if(6) + add_overlay("pai-off") + if(7) + add_overlay("pai-sad") + if(8) + add_overlay("pai-angry") + if(9) + add_overlay("pai-what") + if(10) + add_overlay("pai-neutral") + if(11) + add_overlay("pai-silly") + if(12) + add_overlay("pai-nose") + if(13) + add_overlay("pai-smirk") + if(14) + add_overlay("pai-exclamation") + if(15) + add_overlay("pai-question") + current_emotion = emotion /obj/item/paicard/proc/alertUpdate() diff --git a/code/game/objects/items/devices/radio/jammer.dm b/code/game/objects/items/devices/radio/jammer.dm index c9848d68526..0690793db07 100644 --- a/code/game/objects/items/devices/radio/jammer.dm +++ b/code/game/objects/items/devices/radio/jammer.dm @@ -110,9 +110,9 @@ var/global/list/active_radio_jammers = list() // Only Cut() if we need to. if(overlay_percent != last_overlay_percent) - overlays.Cut() + cut_overlays() var/image/I = image(src.icon, src, "jammer_overlay_[overlay_percent]") - overlays += I + add_overlay(I) last_overlay_percent = overlay_percent //Unlimited use, unlimited range jammer for admins. Turn it on, drop it somewhere, it works. diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index 2e5d0bbd90f..146058facd6 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -91,10 +91,10 @@ if(istype(scanned, /obj/machinery/atmospherics/pipe)) var/obj/machinery/atmospherics/pipe/P = scanned I.color = P.pipe_color - I.overlays += P.overlays + I.add_overlay(P.overlays) I.alpha = 128 - I.mouse_opacity = 0 + I.mouse_opacity = MOUSE_OPACITY_TRANSPARENT . = I // Add it to cache, cutting old entries if the list is too long diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 0c27edc9d43..dfb0da8817f 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -378,9 +378,9 @@ /obj/item/cassette_tape/update_icon() - overlays.Cut() + cut_overlays() if(ruined) - overlays += "ribbonoverlay" + add_overlay("ribbonoverlay") /obj/item/cassette_tape/fire_act() diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm index bbeb4e108c6..51de7f8a0b4 100644 --- a/code/game/objects/items/glassjar.dm +++ b/code/game/objects/items/glassjar.dm @@ -80,7 +80,7 @@ /obj/item/glass_jar/update_icon() // Also updates name and desc underlays.Cut() - overlays.Cut() + cut_overlays() switch(contains) if(0) name = initial(name) diff --git a/code/game/objects/items/robobag.dm b/code/game/objects/items/robobag.dm index 22224379ce5..1366a830d7e 100644 --- a/code/game/objects/items/robobag.dm +++ b/code/game/objects/items/robobag.dm @@ -32,7 +32,7 @@ . += "\The [src] has a [corptag] attached to it." /obj/structure/closet/body_bag/cryobag/robobag/update_icon() - overlays.Cut() + cut_overlays() ..() if(corptag) var/corptag_icon_state = "tag_blank" @@ -46,7 +46,7 @@ corptag_icon_state = corptag.icon_state var/image/I = image(icon, corptag_icon_state) - overlays += I + add_overlay(I) /obj/structure/closet/body_bag/cryobag/robobag/AltClick(mob/user) if(!Adjacent(user)) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index bc90bdfd8c0..ea7e4a48d90 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -70,19 +70,23 @@ updateicon() /obj/item/robot_parts/robot_suit/proc/updateicon() - src.overlays.Cut() - if(src.l_arm) - src.overlays += "l_arm+o" - if(src.r_arm) - src.overlays += "r_arm+o" - if(src.chest) - src.overlays += "chest+o" - if(src.l_leg) - src.overlays += "l_leg+o" - if(src.r_leg) - src.overlays += "r_leg+o" - if(src.head) - src.overlays += "head+o" + cut_overlays() + + var/list/overlays_to_add = list() + if(l_arm) + overlays_to_add += "l_arm+o" + if(r_arm) + overlays_to_add += "r_arm+o" + if(chest) + overlays_to_add += "chest+o" + if(l_leg) + overlays_to_add += "l_leg+o" + if(r_leg) + overlays_to_add += "r_leg+o" + if(head) + overlays_to_add += "head+o" + + add_overlay(overlays_to_add) /obj/item/robot_parts/robot_suit/proc/check_completion() if(src.l_arm && src.r_arm) diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index 45fc39eeaf1..fde2d5cf42a 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -23,7 +23,7 @@ . = CLICKCHAIN_DO_NOT_PROPAGATE var/obj/item/weldingtool/WT = W if(WT.remove_fuel(0, user)) - overlays.Cut() + cut_overlays() to_chat(usr, "You slice off [src]'s uneven chunks of aluminum and scorch marks.") else return ..() @@ -127,7 +127,7 @@ virtualIcon.DrawBox(null, B.b1x1, B.b1y, B.b1x2, B.b1y) // horizontal line, left to right virtualIcon.DrawBox(null, B.b2x, B.b2y1, B.b2x, B.b2y2) // vertical line, top to bottom - overlays += bmark // add the decal + add_overlay(bmark) // add the decal icon = virtualIcon // apply bulletholes over decals diff --git a/code/game/objects/items/storage/_storage.dm b/code/game/objects/items/storage/_storage.dm index dfc1890adeb..eb9f92f0491 100644 --- a/code/game/objects/items/storage/_storage.dm +++ b/code/game/objects/items/storage/_storage.dm @@ -204,7 +204,7 @@ src.closer.screen_loc = "LEFT+[3+cols+1]:16,BOTTOM+1:16" return -/obj/item/storage/proc/space_orient_objs(var/list/obj/item/display_contents) +/obj/item/storage/proc/space_orient_objs(list/obj/item/display_contents) var/baseline_max_storage_space = INVENTORY_STANDARD_SPACE / 2 //should be equal to default backpack capacity // This is a lie. // Above var is misleading, what it does upon changing is makes smaller inventory sizes have smaller space on the UI. @@ -214,15 +214,15 @@ var/stored_cap_width = 4 //length of sprite for start and end of the box representing the stored item var/storage_width = min( round( 224 * max_storage_space/baseline_max_storage_space ,1) ,274) //length of sprite for the box representing total storage space - storage_start.overlays.Cut() + storage_start.cut_overlays() var/matrix/M = matrix() M.Scale((storage_width-storage_cap_width*2+3)/32,1) - src.storage_continue.transform = M + storage_continue.transform = M - src.storage_start.screen_loc = "LEFT+3:16,BOTTOM+1:16" - src.storage_continue.screen_loc = "LEFT+3:[storage_cap_width+(storage_width-storage_cap_width*2)/2+2],BOTTOM+1:16" - src.storage_end.screen_loc = "LEFT+3:[19+storage_width-storage_cap_width],BOTTOM+1:16" + storage_start.screen_loc = "LEFT+3:16,BOTTOM+1:16" + storage_continue.screen_loc = "LEFT+3:[storage_cap_width+(storage_width-storage_cap_width*2)/2+2],BOTTOM+1:16" + storage_end.screen_loc = "LEFT+3:[19+storage_width-storage_cap_width],BOTTOM+1:16" var/startpoint = 0 var/endpoint = 1 @@ -238,18 +238,21 @@ M_continue.Scale((endpoint-startpoint-stored_cap_width*2)/32,1) M_continue.Translate(startpoint+stored_cap_width+(endpoint-startpoint-stored_cap_width*2)/2 - 16,0) M_end.Translate(endpoint-stored_cap_width,0) - src.stored_start.transform = M_start - src.stored_continue.transform = M_continue - src.stored_end.transform = M_end - storage_start.overlays += src.stored_start - storage_start.overlays += src.stored_continue - storage_start.overlays += src.stored_end + stored_start.transform = M_start + stored_continue.transform = M_continue + stored_end.transform = M_end + + var/list/overlays_to_add = list() + overlays_to_add += stored_start + overlays_to_add += stored_continue + overlays_to_add += stored_end + storage_start.add_overlay(overlays_to_add) O.screen_loc = "LEFT+3:[round((startpoint+endpoint)/2)+2],BOTTOM+1:16" O.maptext = "" O.hud_layerise() - src.closer.screen_loc = "LEFT+3:[storage_width+19],BOTTOM+1:16" + closer.screen_loc = "LEFT+3:[storage_width+19],BOTTOM+1:16" return @@ -680,7 +683,7 @@ var/closed_state /obj/item/storage/trinketbox/update_icon() - overlays.Cut() + cut_overlays() if(open) icon_state = open_state @@ -693,7 +696,7 @@ else if(istype(contents[1], /obj/item/clothing/accessory/medal)) contained_image = "medal_trinket" if(contained_image) - overlays += contained_image + add_overlay(contained_image) else icon_state = closed_state diff --git a/code/game/objects/items/storage/fancy.dm b/code/game/objects/items/storage/fancy.dm index 80735e48d26..2443d74b87a 100644 --- a/code/game/objects/items/storage/fancy.dm +++ b/code/game/objects/items/storage/fancy.dm @@ -124,9 +124,9 @@ /obj/item/storage/fancy/crayons/update_icon() var/mutable_appearance/ma = new(src) - ma.overlays = list() + ma.cut_overlays() for(var/obj/item/pen/crayon/crayon in contents) - ma.overlays += image('icons/obj/crayons.dmi',crayon.colourName) + ma.add_overlay(image('icons/obj/crayons.dmi',crayon.colourName)) appearance = ma /obj/item/storage/fancy/crayons/attackby(obj/item/W as obj, mob/user as mob) @@ -168,7 +168,7 @@ var/mutable_appearance/ma = new(src) ma.overlays = list() for(var/obj/item/pen/crayon/marker/marker in contents) - ma.overlays += image('icons/obj/crayons.dmi',"m"+marker.colourName) + ma.add_overlay(image('icons/obj/crayons.dmi',"m"+marker.colourName)) appearance = ma /obj/item/storage/fancy/markers/attackby(obj/item/W as obj, mob/user as mob) @@ -207,7 +207,7 @@ var/mutable_appearance/ma = new(src) ma.overlays = list() for(var/obj/item/pen/crayon/chalk/chalk in contents) - ma.overlays += image('icons/obj/crayons.dmi',"c"+chalk.colourName) + ma.add_overlay(image('icons/obj/crayons.dmi',"c"+chalk.colourName)) appearance = ma /* @@ -426,16 +426,22 @@ . = ..() update_icon() -/obj/item/storage/lockbox/vials/update_icon(var/itemremoved = 0) +/obj/item/storage/lockbox/vials/update_icon(itemremoved = 0) var/total_contents = contents.len - itemremoved icon_state = "vialbox[total_contents]" - overlays.Cut() + + cut_overlays() + + var/list/overlays_to_add = list() if (!broken) - overlays += image(icon, src, "led[locked]") + overlays_to_add += image(icon, src, "led[locked]") if(locked) - overlays += image(icon, src, "cover") + overlays_to_add += image(icon, src, "cover") else - overlays += image(icon, src, "ledb") + overlays_to_add += image(icon, src, "ledb") + + add_overlay(overlays_to_add) + return /obj/item/storage/lockbox/vials/attackby(obj/item/W as obj, mob/user as mob) diff --git a/code/game/objects/items/storage/misc.dm b/code/game/objects/items/storage/misc.dm index d6bf39c655b..9e045b85404 100644 --- a/code/game/objects/items/storage/misc.dm +++ b/code/game/objects/items/storage/misc.dm @@ -16,10 +16,10 @@ update_icon() /obj/item/storage/box/donut/update_icon() - overlays.Cut() + cut_overlays() var/i = 0 for(var/obj/item/reagent_containers/food/snacks/donut/D in contents) - overlays += image('icons/obj/food.dmi', "[i][D.overlay_state]") + add_overlay(image('icons/obj/food.dmi', "[i][D.overlay_state]")) i++ /obj/item/storage/box/donut/empty diff --git a/code/game/objects/items/storage/secure.dm b/code/game/objects/items/storage/secure.dm index 456e674368f..6a593b5a6e8 100644 --- a/code/game/objects/items/storage/secure.dm +++ b/code/game/objects/items/storage/secure.dm @@ -95,43 +95,44 @@ /obj/item/storage/secure/Topic(href, href_list) if ((usr.stat || usr.restrained()) || (get_dist(src, usr) > 1)) - ..() - return + return ..() + if (href_list["type"]) if (href_list["type"] == "E") - if ((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR")) - src.l_code = src.code - src.l_set = 1 - else if ((src.code == src.l_code) && (src.emagged == 0) && (src.l_set == 1)) - src.locked = 0 - src.overlays = null - overlays += image('icons/obj/storage.dmi', icon_opened) - src.code = null + if ((l_set == 0) && (length(code) == 5) && (!l_setshort) && (code != "ERROR")) + l_code = code + l_set = 1 + else if ((code == l_code) && (emagged == 0) && (l_set == 1)) + locked = 0 + cut_overlays() + add_overlay(image('icons/obj/storage.dmi', icon_opened)) + code = null else - src.code = "ERROR" + code = "ERROR" else - if ((href_list["type"] == "R") && (src.emagged == 0) && (!src.l_setshort)) - src.locked = 1 - src.overlays = null - src.code = null - src.close(usr) + if ((href_list["type"] == "R") && (emagged == 0) && (!l_setshort)) + locked = 1 + cut_overlays() + code = null + close(usr) else - src.code += text("[]", href_list["type"]) + code += text("[]", href_list["type"]) if (length(src.code) > 5) - src.code = "ERROR" - for(var/mob/M in viewers(1, src.loc)) + code = "ERROR" + + for(var/mob/M in viewers(1, loc)) if ((M.client && M.machine == src)) - src.attack_self(M) + attack_self(M) return return -/obj/item/storage/secure/emag_act(var/remaining_charges, var/mob/user, var/feedback) +/obj/item/storage/secure/emag_act(remaining_charges, mob/user, feedback) if(!emagged) emagged = 1 - src.overlays += image('icons/obj/storage.dmi', icon_sparking) + add_overlay(image('icons/obj/storage.dmi', icon_sparking)) sleep(6) - src.overlays = null - overlays += image('icons/obj/storage.dmi', icon_locking) + cut_overlays() + add_overlay(image('icons/obj/storage.dmi', icon_locking)) locked = 0 to_chat(user, (feedback ? feedback : "You short out the lock of \the [src].")) return 1 diff --git a/code/game/objects/items/storage/wallets.dm b/code/game/objects/items/storage/wallets.dm index 4a3861f1f26..fd80260b5bc 100644 --- a/code/game/objects/items/storage/wallets.dm +++ b/code/game/objects/items/storage/wallets.dm @@ -63,14 +63,14 @@ update_icon() /obj/item/storage/wallet/update_icon() - overlays.Cut() + cut_overlays() if(front_id) var/tiny_state = "id-generic" if(("id-"+front_id.icon_state) in icon_states(icon)) tiny_state = "id-"+front_id.icon_state var/image/tiny_image = new/image(icon, icon_state = tiny_state) tiny_image.appearance_flags = RESET_COLOR - overlays += tiny_image + add_overlay(tiny_image) /obj/item/storage/wallet/GetID() return front_id diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 77683eca6ae..02775016421 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -202,11 +202,12 @@ /obj/item/weldingtool/update_icon() ..() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() // Welding overlay. if(welding) var/image/I = image(icon, src, "[icon_state]-on") - overlays.Add(I) + overlays_to_add += I item_state = "[initial(item_state)]1" else item_state = initial(item_state) @@ -216,7 +217,9 @@ var/ratio = get_fuel() / get_max_fuel() ratio = CEILING(ratio * 4, 1) * 25 var/image/I = image(icon, src, "[icon_state][ratio]") - overlays.Add(I) + overlays_to_add += I + + add_overlay(overlays_to_add) // Lights if(welding && flame_intensity) diff --git a/code/game/objects/items/weapons/barrier_tape.dm b/code/game/objects/items/weapons/barrier_tape.dm index c5e7e8e8b9a..20e74ffa9c0 100644 --- a/code/game/objects/items/weapons/barrier_tape.dm +++ b/code/game/objects/items/weapons/barrier_tape.dm @@ -114,7 +114,7 @@ var/list/tape_roll_applications = list() color = COLOR_DEEP_SKY_BLUE /obj/item/barrier_tape_roll/update_icon() - overlays.Cut() + cut_overlays() var/image/overlay = image(icon = src.icon) overlay.appearance_flags = RESET_COLOR if(ismob(loc)) @@ -122,7 +122,7 @@ var/list/tape_roll_applications = list() overlay.icon_state = "start" else overlay.icon_state = "stop" - overlays += overlay + add_overlay(overlay) /obj/item/barrier_tape_roll/dropped(mob/user, flags, atom/newLoc) @@ -303,11 +303,11 @@ var/list/tape_roll_applications = list() if(tape_roll_applications[F] & direction) // hazard_overlay in F.overlays wouldn't work. user.visible_message("\The [user] uses the adhesive of \the [src] to remove area markings from \the [F].", "You use the adhesive of \the [src] to remove area markings from \the [F].") - F.overlays -= hazard_overlay + F.cut_overlay(hazard_overlay) tape_roll_applications[F] &= ~direction else user.visible_message("\The [user] applied \the [src] on \the [F] to create area markings.", "You apply \the [src] on \the [F] to create area markings.") - F.overlays |= hazard_overlay + F.add_overlay(hazard_overlay) tape_roll_applications[F] |= direction return diff --git a/code/game/objects/items/weapons/duct_tape.dm b/code/game/objects/items/weapons/duct_tape.dm index aa7d9f1a8f2..5338eed6c13 100644 --- a/code/game/objects/items/weapons/duct_tape.dm +++ b/code/game/objects/items/weapons/duct_tape.dm @@ -167,12 +167,12 @@ else return ..() -/obj/item/duct_tape_piece/proc/attach(var/obj/item/W) +/obj/item/duct_tape_piece/proc/attach(obj/item/W) stuck = W W.forceMove(src) icon_state = W.icon_state + "_taped" name = W.name + " (taped)" - overlays = W.overlays + copy_overlays(W) /obj/item/duct_tape_piece/attack_self(mob/user) if(!stuck) @@ -183,7 +183,7 @@ if(!user.put_in_hands(stuck)) stuck.forceMove(user.drop_location()) stuck = null - overlays = null + cut_overlays() qdel(src) /obj/item/duct_tape_piece/attackby(var/obj/item/I, var/mob/user) diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index ba0ebf5e5ea..7a3722100b2 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -65,7 +65,7 @@ message_admins("[key_name(user, user.client)](?) planted [src.name] on [target.name] at ([target.x],[target.y],[target.z] - JMP) with [timer] second fuse",0,1) log_game("[key_name(user)] planted [src.name] on [target.name] at ([target.x],[target.y],[target.z]) with [timer] second fuse") - target.overlays += image_overlay + target.add_overlay(image_overlay) to_chat(user, "Bomb has been planted. Timer counting down from [timer].") spawn(timer*10) explode(get_turf(target)) @@ -87,7 +87,7 @@ else LEGACY_EX_ACT(target, 1, null) if(target) - target.overlays -= image_overlay + target.cut_overlay(image_overlay) qdel(src) /obj/item/plastique/attack(mob/M as mob, mob/user as mob, def_zone) @@ -130,7 +130,7 @@ var/turf/T = get_turf(target) if(onstation_weapon_locked(T.z)) target.visible_message("\The [src] lets out a loud beep as safeties trigger, before imploding and falling apart.") - target.overlays -= image_overlay + target.cut_overlay(image_overlay) qdel(src) return 0 else diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index a1f12e9bb89..ccc1cef0e0f 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -44,16 +44,21 @@ location.hotspot_expose(700, 2) /obj/item/flamethrower/update_icon() - overlays.Cut() + cut_overlays() + + var/list/overlays_to_add = list() if(igniter) - overlays += "+igniter[status]" + overlays_to_add += "+igniter[status]" if(ptank) - overlays += "+ptank" + overlays_to_add += "+ptank" if(lit) - overlays += "+lit" + overlays_to_add += "+lit" item_state = "flamethrower_1" else item_state = "flamethrower_0" + + add_overlay(overlays_to_add) + return /obj/item/flamethrower/afterattack(atom/target, mob/user, proximity) diff --git a/code/game/objects/items/weapons/grenades/supermatter.dm b/code/game/objects/items/weapons/grenades/supermatter.dm index 2b80b3caf06..d63c30e26a5 100644 --- a/code/game/objects/items/weapons/grenades/supermatter.dm +++ b/code/game/objects/items/weapons/grenades/supermatter.dm @@ -19,9 +19,9 @@ playsound(src, 'sound/weapons/wave.ogg', 100) /obj/item/grenade/supermatter/update_icon() - overlays.Cut() + cut_overlays() if(implode_at) - overlays += image(icon = 'icons/rust.dmi', icon_state = "emfield_s1") + add_overlay(image(icon = 'icons/rust.dmi', icon_state = "emfield_s1")) /obj/item/grenade/supermatter/process(delta_time) if(!isturf(loc)) diff --git a/code/game/objects/items/weapons/material/ashtray.dm b/code/game/objects/items/weapons/material/ashtray.dm index 3507d81691f..ff3154123d3 100644 --- a/code/game/objects/items/weapons/material/ashtray.dm +++ b/code/game/objects/items/weapons/material/ashtray.dm @@ -22,27 +22,32 @@ var/global/list/ashtray_cache = list() /obj/item/material/ashtray/update_icon() color = null - overlays.Cut() + + cut_overlays() + var/list/overlays_to_add = list() + var/cache_key = "base-[material.name]" if(!ashtray_cache[cache_key]) var/image/I = image('icons/obj/objects.dmi',"ashtray") I.color = material.icon_colour ashtray_cache[cache_key] = I - overlays |= ashtray_cache[cache_key] + overlays_to_add += ashtray_cache[cache_key] if (contents.len == max_butts) if(!ashtray_cache["full"]) ashtray_cache["full"] = image('icons/obj/objects.dmi',"ashtray_full") - overlays |= ashtray_cache["full"] + overlays_to_add += ashtray_cache["full"] desc = "It's stuffed full." else if (contents.len > max_butts/2) if(!ashtray_cache["half"]) ashtray_cache["half"] = image('icons/obj/objects.dmi',"ashtray_half") - overlays |= ashtray_cache["half"] + overlays_to_add += ashtray_cache["half"] desc = "It's half-filled." else desc = "An ashtray made of [material.display_name]." + add_overlay(overlays_to_add) + /obj/item/material/ashtray/attackby(obj/item/W as obj, mob/user as mob) if (health <= 0) return ..() diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm index 78008ac0952..7a5073197fd 100644 --- a/code/game/objects/items/weapons/material/kitchen.dm +++ b/code/game/objects/items/weapons/material/kitchen.dm @@ -48,7 +48,7 @@ return M.visible_message("\The [user] feeds some [loaded] to \the [M] with \the [src].") playsound(M.loc,'sound/items/eatfood.ogg', rand(10,40), 1) - overlays.Cut() + cut_overlays() return else to_chat(user, "You don't have anything on \the [src].") //if we have help intent and no food scooped up DON'T STAB OURSELVES WITH THE FORK diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index a56680461f1..7702e266f22 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -83,12 +83,12 @@ playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1) add_fingerprint(user) if(blood_overlay && blood_DNA && (blood_DNA.len >= 1)) //updates blood overlay, if any - overlays.Cut()//this might delete other item overlays as well but eeeeeeeh + cut_overlays() //this might delete other item overlays as well but eeeeeeeh var/icon/I = new /icon(src.icon, src.icon_state) I.Blend(new /icon('icons/effects/blood.dmi', rgb(255,255,255)),ICON_ADD) I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY) blood_overlay = I - overlays += blood_overlay + add_overlay(blood_overlay) return /obj/item/melee/telebaton/attack(mob/target as mob, mob/living/user as mob) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 38d258a9211..72659b8957d 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -110,10 +110,10 @@ var/list/global/tank_gauge_cache = list() . += "\The [src] emergency relief valve has been welded shut!" -/obj/item/tank/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/tank/attackby(obj/item/W, mob/user) ..() - if (istype(src.loc, /obj/item/assembly)) - icon = src.loc + if (istype(loc, /obj/item/assembly)) + icon = loc if ((istype(W, /obj/item/analyzer)) && get_dist(user, src) <= 1) var/obj/item/analyzer/A = W @@ -121,50 +121,50 @@ var/list/global/tank_gauge_cache = list() else if (istype(W,/obj/item/latexballon)) var/obj/item/latexballon/LB = W LB.blow(src) - src.add_fingerprint(user) + add_fingerprint(user) if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = W if(C.use(1)) wired = 1 to_chat(user, "You attach the wires to the tank.") - src.add_bomb_overlay() + add_bomb_overlay() if(W.is_wirecutter()) - if(wired && src.proxyassembly.assembly) + if(wired && proxyassembly.assembly) to_chat(user, "You carefully begin clipping the wires that attach to the tank.") - if(do_after(user, 100,src)) + if(do_after(user, 100, src)) wired = 0 - src.overlays -= "bomb_assembly" + cut_overlay("bomb_assembly") to_chat(user, "You cut the wire and remove the device.") - var/obj/item/assembly_holder/assy = src.proxyassembly.assembly + var/obj/item/assembly_holder/assy = proxyassembly.assembly if(assy.a_left && assy.a_right) assy.dropInto(usr.loc) assy.master = null - src.proxyassembly.assembly = null + proxyassembly.assembly = null else - if(!src.proxyassembly.assembly.a_left) + if(!proxyassembly.assembly.a_left) assy.a_right.dropInto(usr.loc) assy.a_right.holder = null assy.a_right = null - src.proxyassembly.assembly = null + proxyassembly.assembly = null qdel(assy) - src.overlays.Cut() + cut_overlays() last_gauge_pressure = 0 update_gauge() else to_chat(user, "You slip and bump the igniter!") if(prob(85)) - src.proxyassembly.receive_signal() + proxyassembly.receive_signal() else if(wired) if(do_after(user, 10, src)) to_chat(user, "You quickly clip the wire from the tank.") wired = 0 - src.overlays -= "bomb_assembly" + cut_overlay("bomb_assembly") else to_chat(user, "There are no wires to cut!") @@ -176,8 +176,8 @@ var/list/global/tank_gauge_cache = list() to_chat(user, "You begin attaching the assembly to \the [src].") if(do_after(user, 50, src)) to_chat(user, "You finish attaching the assembly to \the [src].") - bombers += "[key_name(user)] attached an assembly to a wired [src]. Temp: [src.air_contents.temperature-T0C]" - message_admins("[key_name_admin(user)] attached an assembly to a wired [src]. Temp: [src.air_contents.temperature-T0C]") + bombers += "[key_name(user)] attached an assembly to a wired [src]. Temp: [air_contents.temperature-T0C]" + message_admins("[key_name_admin(user)] attached an assembly to a wired [src]. Temp: [air_contents.temperature-T0C]") assemble_bomb(W,user) else to_chat(user, "You stop attaching the assembly.") @@ -192,16 +192,16 @@ var/list/global/tank_gauge_cache = list() to_chat(user, "You begin welding the \the [src] emergency pressure relief valve.") if(do_after(user, 40,src)) to_chat(user, "You carefully weld \the [src] emergency pressure relief valve shut. \The [src] may now rupture under pressure!") - src.valve_welded = 1 - src.leaking = 0 + valve_welded = 1 + leaking = 0 else - bombers += "[key_name(user)] attempted to weld a [src]. [src.air_contents.temperature-T0C]" - message_admins("[key_name_admin(user)] attempted to weld a [src]. [src.air_contents.temperature-T0C]") + bombers += "[key_name(user)] attempted to weld a [src]. [air_contents.temperature-T0C]" + message_admins("[key_name_admin(user)] attempted to weld a [src]. [air_contents.temperature-T0C]") if(WT.welding) to_chat(user, "You accidentally rake \the [W] across \the [src]!") max_integrity -= rand(2,6) integrity = min(integrity,max_integrity) - src.air_contents.adjust_thermal_energy(rand(2000,50000)) + air_contents.adjust_thermal_energy(rand(2000,50000)) WT.eyecheck(user) else to_chat(user, "The emergency pressure relief valve has already been welded.") @@ -359,13 +359,16 @@ var/list/global/tank_gauge_cache = list() /obj/item/tank/proc/add_bomb_overlay() - if(src.wired) - src.overlays += "bomb_assembly" - if(src.proxyassembly.assembly) - var/icon/test = get_flat_icon(src.proxyassembly.assembly) + cut_overlays() + var/list/overlays_to_add = list() + if(wired) + overlays_to_add += "bomb_assembly" + if(proxyassembly.assembly) + var/icon/test = get_flat_icon(proxyassembly.assembly) test.Shift(SOUTH,1) test.Shift(WEST,3) - overlays += test + overlays_to_add += test + add_overlay(overlays_to_add) /obj/item/tank/proc/update_gauge() @@ -381,16 +384,11 @@ var/list/global/tank_gauge_cache = list() return last_gauge_pressure = gauge_pressure - overlays.Cut() add_bomb_overlay() var/indicator = "[gauge_icon][(gauge_pressure == -1) ? "overload" : gauge_pressure]" if(!tank_gauge_cache[indicator]) tank_gauge_cache[indicator] = image(icon, indicator) - overlays += tank_gauge_cache[indicator] - - - - + add_overlay(tank_gauge_cache[indicator]) /obj/item/tank/proc/check_status() @@ -540,7 +538,7 @@ var/list/global/tank_gauge_cache = list() ///Onetankbombs (added as actual items) ///////////////////////////////// -/obj/item/tank/proc/onetankbomb(var/fill = 1) +/obj/item/tank/proc/onetankbomb(fill = 1) var/phoron_amt = 4 + rand(4) var/oxygen_amt = 6 + rand(8) @@ -552,21 +550,21 @@ var/list/global/tank_gauge_cache = list() oxygen_amt = 4.5 - src.air_contents.gas[/datum/gas/phoron] = phoron_amt - src.air_contents.gas[/datum/gas/oxygen] = oxygen_amt - src.air_contents.update_values() - src.valve_welded = 1 - src.air_contents.temperature = PHORON_MINIMUM_BURN_TEMPERATURE-1 + air_contents.gas[/datum/gas/phoron] = phoron_amt + air_contents.gas[/datum/gas/oxygen] = oxygen_amt + air_contents.update_values() + valve_welded = 1 + air_contents.temperature = PHORON_MINIMUM_BURN_TEMPERATURE-1 - src.wired = 1 + wired = 1 var/obj/item/assembly_holder/H = new(src) - src.proxyassembly.assembly = H - H.master = src.proxyassembly + proxyassembly.assembly = H + H.master = proxyassembly H.update_icon() - src.overlays += "bomb_assembly" + add_overlay("bomb_assembly") /obj/item/tank/phoron/onetankbomb/Initialize(mapload) @@ -613,7 +611,7 @@ var/list/global/tank_gauge_cache = list() tank = null assembly = null -/obj/item/tank/proc/assemble_bomb(W,user) //Bomb assembly proc. This turns assembly+tank into a bomb +/obj/item/tank/proc/assemble_bomb(W, user) //Bomb assembly proc. This turns assembly+tank into a bomb var/obj/item/assembly_holder/S = W var/mob/M = user if(!S.secured) //Check if the assembly is secured @@ -625,20 +623,20 @@ var/list/global/tank_gauge_cache = list() if(!M.put_in_active_hand(src)) //Equips the bomb if possible, or puts it on the floor. forceMove(M.drop_location()) - src.proxyassembly.assembly = S //Tell the bomb about its assembly part - S.master = src.proxyassembly //Tell the assembly about its new owner + proxyassembly.assembly = S //Tell the bomb about its assembly part + S.master = proxyassembly //Tell the assembly about its new owner S.forceMove(src) //Move the assembly - src.update_icon() + update_icon() - src.add_bomb_overlay() + add_bomb_overlay() return ///This happens when a bomb is told to explode /obj/item/tank/proc/ignite() - var/obj/item/assembly_holder/assy = src.proxyassembly.assembly + var/obj/item/assembly_holder/assy = proxyassembly.assembly var/ign = assy.a_right var/obj/item/other = assy.a_left @@ -649,10 +647,10 @@ var/list/global/tank_gauge_cache = list() other.dropInto(get_turf(src)) qdel(ign) assy.master = null - src.proxyassembly.assembly = null + proxyassembly.assembly = null qdel(assy) - src.update_icon() - src.update_gauge() + update_icon() + update_gauge() air_contents.adjust_thermal_energy(15000) @@ -660,11 +658,11 @@ var/list/global/tank_gauge_cache = list() /obj/item/tankassemblyproxy/update_icon() if(assembly) tank.update_icon() - tank.overlays += "bomb_assembly" + tank.add_overlay("bomb_assembly") else tank.update_icon() - tank.overlays -= "bomb_assembly" + tank.cut_overlay("bomb_assembly") -/obj/item/tankassemblyproxy/HasProximity(atom/movable/AM as mob|obj) - if(src.assembly) - src.assembly.HasProximity(AM) +/obj/item/tankassemblyproxy/HasProximity(atom/movable/AM) + if(assembly) + assembly.HasProximity(AM) diff --git a/code/game/objects/items/weapons/trays.dm b/code/game/objects/items/weapons/trays.dm index f3815f24c68..660840a26c0 100644 --- a/code/game/objects/items/weapons/trays.dm +++ b/code/game/objects/items/weapons/trays.dm @@ -18,7 +18,7 @@ /obj/item/tray/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) user.setClickCooldown(user.get_attack_speed(src)) // Drop all the things. All of them. - overlays.Cut() + cut_overlays() for(var/obj/item/I in carrying) I.loc = M.loc carrying.Remove(I) @@ -193,7 +193,7 @@ var/obj/item/material/O = I if(O.applies_material_colour) Img.color = O.color - overlays += Img + add_overlay(Img) /obj/item/tray/dropped(mob/user, flags, atom/newLoc) . = ..() @@ -204,7 +204,7 @@ noTable = 1 if(isturf(loc) && !(locate(/mob/living) in src.loc)) - overlays.Cut() + cut_overlays() for(var/obj/item/I in carrying) I.forceMove(src.loc) carrying.Remove(I) diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm index 518c60c0698..6232e595ee3 100644 --- a/code/game/objects/structures/bonfire.dm +++ b/code/game/objects/structures/bonfire.dm @@ -199,7 +199,8 @@ L.IgniteMob() /obj/structure/bonfire/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(burning) var/state switch(get_fuel_amount()) @@ -209,14 +210,14 @@ state = "bonfire_hot" var/image/I = image(icon, state) I.appearance_flags = RESET_COLOR - overlays += I + overlays_to_add += I if(has_buckled_mobs() && get_fuel_amount() >= 5) I = image(icon, "bonfire_intense") I.pixel_y = 13 I.layer = MOB_LAYER + 0.1 I.appearance_flags = RESET_COLOR - overlays += I + overlays_to_add += I var/light_strength = max(get_fuel_amount() / 2, 2) set_light(light_strength, light_strength, "#FF9933") @@ -226,7 +227,9 @@ if(grill) var/image/grille_image = image(icon, "bonfire_grill") grille_image.appearance_flags = RESET_COLOR - overlays += grille_image + overlays_to_add += grille_image + + add_overlay(overlays_to_add) /obj/structure/bonfire/process(delta_time) @@ -327,7 +330,7 @@ qdel(consumed_fuel) // Don't know, don't care. return FALSE - + if(consumed_fuel.use(1)) if(istype(consumed_fuel, /obj/item/stack/material/log)) next_fuel_consumption = world.time + 10 MINUTES @@ -369,7 +372,7 @@ O.fire_act(null, 1000, 500) /obj/structure/fireplace/update_icon() - overlays.Cut() + cut_overlays() if(burning) var/state switch(get_fuel_amount()) @@ -381,7 +384,7 @@ state = "fireplace_intense" //don't need to throw a corpse inside to make it burn hotter. var/image/I = image(icon, state) I.appearance_flags = RESET_COLOR - overlays += I + add_overlay(I) var/light_strength = max(get_fuel_amount() / 2, 2) set_light(light_strength, light_strength, "#FF9933") diff --git a/code/game/objects/structures/coathanger.dm b/code/game/objects/structures/coathanger.dm index 8781512870f..e02d1ab2c70 100644 --- a/code/game/objects/structures/coathanger.dm +++ b/code/game/objects/structures/coathanger.dm @@ -45,10 +45,14 @@ return 1 /obj/structure/coatrack/update_icon() - overlays.Cut() + cut_overlays() + + var/list/overlays_to_add = list() if (istype(coat, /obj/item/clothing/suit/storage/toggle/labcoat)) - overlays += image(icon, icon_state = "coat_lab") + overlays_to_add += image(icon, icon_state = "coat_lab") if (istype(coat, /obj/item/clothing/suit/storage/toggle/labcoat/cmo)) - overlays += image(icon, icon_state = "coat_cmo") + overlays_to_add += image(icon, icon_state = "coat_cmo") if (istype(coat, /obj/item/clothing/suit/storage/det_trench)) - overlays += image(icon, icon_state = "coat_det") + overlays_to_add += image(icon, icon_state = "coat_det") + + add_overlay(overlays_to_add) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 34abb760a73..89f0a32d2c9 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -395,11 +395,11 @@ to_chat(usr, "This mob type can't use this verb.") /obj/structure/closet/update_icon()//Putting the sealed stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot) - overlays.Cut() + cut_overlays() if(!opened) icon_state = icon_closed if(sealed) - overlays += "welded" + add_overlay("welded") else icon_state = icon_opened diff --git a/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm b/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm index d2470cef10f..7218bf831de 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm @@ -18,9 +18,10 @@ update_icon() /obj/structure/closet/secure_closet/guncabinet/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(opened) - overlays += icon(icon,"door_open") + overlays_to_add += icon(icon,"door_open") else var/lazors = 0 var/shottas = 0 @@ -39,19 +40,21 @@ shottas-- gun.icon_state = "projectile" gun.pixel_x = i*4 - overlays += gun + overlays_to_add += gun - overlays += icon(src.icon, "door") + overlays_to_add += icon(src.icon, "door") if(sealed) - overlays += icon(src.icon,"sealed") + overlays_to_add += icon(src.icon,"sealed") if(broken) - overlays += icon(src.icon,"broken") + overlays_to_add += icon(src.icon,"broken") else if (locked) - overlays += icon(src.icon,"locked") + overlays_to_add += icon(src.icon,"locked") else - overlays += icon(src.icon,"open") + overlays_to_add += icon(src.icon,"open") + + add_overlay(overlays_to_add) //SC Guncabinet files /obj/structure/closet/secure_closet/guncabinet/sidearm diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index fa7e3fb0e06..b14dbf504cd 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -144,7 +144,7 @@ to_chat(usr, "This mob type can't use this verb.") /obj/structure/closet/secure_closet/update_icon()//Putting the sealed stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot) - overlays.Cut() + cut_overlays() if(!opened) if(broken) @@ -154,12 +154,13 @@ else icon_state = icon_closed if(sealed) - overlays += "sealed" + add_overlay("sealed") else icon_state = icon_opened /obj/structure/closet/secure_closet/req_breakout() - if(!opened && locked) return 1 + if(!opened && locked) + return 1 return ..() //It's a secure closet, but isn't locked. /obj/structure/closet/secure_closet/break_open() diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 42271f329b8..89c71e1399c 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -147,12 +147,11 @@ /obj/structure/closet/crate/secure/Initialize(mapload) . = ..() + cut_overlays() if(locked) - overlays.Cut() - overlays += redlight + add_overlay(redlight) else - overlays.Cut() - overlays += greenlight + add_overlay(greenlight) /obj/structure/closet/crate/secure/can_open() return !locked @@ -170,14 +169,15 @@ to_chat(user, "Access Denied") /obj/structure/closet/crate/secure/proc/set_locked(var/newlocked, mob/user = null) - if(locked == newlocked) return + if(locked == newlocked) + return locked = newlocked if(user) for(var/mob/O in viewers(user, 3)) O.show_message( "The crate has been [locked ? null : "un"]locked by [user].", 1) - overlays.Cut() - overlays += locked ? redlight : greenlight + cut_overlays() + add_overlay(locked ? redlight : greenlight) /obj/structure/closet/crate/secure/verb/verb_togglelock() set src in oview(1) // One square distance @@ -210,15 +210,18 @@ return return ..() -/obj/structure/closet/crate/secure/emag_act(var/remaining_charges, var/mob/user) +/obj/structure/closet/crate/secure/emag_act(remaining_charges, mob/user) if(!broken) - overlays.Cut() - overlays += emag - overlays += sparks - spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface* + cut_overlays() + var/list/overlays_to_add = list() + overlays_to_add += emag + overlays_to_add += sparks + add_overlay(overlays_to_add) + spawn(6) + cut_overlay(sparks) //Tried lots of stuff but nothing works right. so i have to use this *sadface* playsound(src.loc, "sparks", 60, 1) - src.locked = 0 - src.broken = 1 + locked = 0 + broken = 1 to_chat(user, "You unlock \the [src].") return 1 @@ -226,23 +229,25 @@ for(var/obj/O in src) O.emp_act(severity) if(!broken && !opened && prob(50/severity)) + cut_overlays() + var/list/overlays_to_add = list() if(!locked) - src.locked = 1 - overlays.Cut() - overlays += redlight + locked = 1 + overlays_to_add += redlight else - overlays.Cut() - overlays += emag - overlays += sparks - spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface* + overlays_to_add += emag + overlays_to_add += sparks + add_overlay(overlays_to_add) + spawn(6) + cut_overlay(sparks) //Tried lots of stuff but nothing works right. so i have to use this *sadface* playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1) - src.locked = 0 + locked = 0 if(!opened && prob(20/severity)) if(!locked) open() else - src.req_access = list() - src.req_access += pick(get_all_station_access()) + req_access = list() + req_access += pick(get_all_station_access()) ..() /obj/structure/closet/crate/secure/bullet_act(var/obj/item/projectile/Proj) diff --git a/code/game/objects/structures/crates_lockers/vehiclecage.dm b/code/game/objects/structures/crates_lockers/vehiclecage.dm index 1667b7200a9..d9119aef180 100644 --- a/code/game/objects/structures/crates_lockers/vehiclecage.dm +++ b/code/game/objects/structures/crates_lockers/vehiclecage.dm @@ -44,13 +44,13 @@ /obj/structure/vehiclecage/update_icon() ..() - overlays.Cut() + cut_overlays() underlays.Cut() var/image/framepaint = new(icon = 'icons/obj/storage.dmi', icon_state = "[initial(icon_state)]_a", layer = MOB_LAYER + 1.1) framepaint.plane = MOB_PLANE framepaint.color = paint_color - overlays += framepaint + add_overlay(framepaint) for(var/obj/vehicle_old/V in src.contents) var/image/showcase = new(V) diff --git a/code/game/objects/structures/flora/trees.dm b/code/game/objects/structures/flora/trees.dm index 703e2df4773..f4ba01a090e 100644 --- a/code/game/objects/structures/flora/trees.dm +++ b/code/game/objects/structures/flora/trees.dm @@ -115,7 +115,7 @@ is_stump = TRUE density = FALSE icon_state = "[base_state]_stump" - overlays.Cut() // For the Sif tree and other future glowy trees. + cut_overlays() // For the Sif tree and other future glowy trees. set_light(0) /obj/structure/flora/tree/legacy_ex_act(var/severity) @@ -290,4 +290,4 @@ set_light(5 - light_shift, 1, "#33ccff") // 5 variants, missing bulbs. 5th has no bulbs, so no glow. var/image/glow = image(icon = icon, icon_state = "[base_state][light_shift]_glow") glow.plane = ABOVE_LIGHTING_PLANE - overlays = list(glow) + add_overlay(glow) diff --git a/code/game/objects/structures/holoplant.dm b/code/game/objects/structures/holoplant.dm index 535d5c98035..b89b51d35a5 100644 --- a/code/game/objects/structures/holoplant.dm +++ b/code/game/objects/structures/holoplant.dm @@ -46,12 +46,12 @@ return plant = prepare_icon(emagged ? "emagged" : null) - overlays += plant + add_overlay(plant) set_light(2) use_power = USE_POWER_ACTIVE /obj/machinery/holoplant/proc/deactivate() - overlays -= plant + cut_overlay(plant) QDEL_NULL(plant) set_light(0) use_power = USE_POWER_OFF @@ -66,20 +66,20 @@ /obj/machinery/holoplant/proc/flicker() interference = TRUE spawn(0) - overlays -= plant + cut_overlay(plant) set_light(0) sleep(rand(2,4)) - overlays += plant + add_overlay(plant) set_light(2) sleep(rand(2,4)) - overlays -= plant + cut_overlay(plant) set_light(0) sleep(rand(2,4)) - overlays += plant + add_overlay(plant) set_light(2) interference = FALSE -/obj/machinery/holoplant/proc/prepare_icon(var/state) +/obj/machinery/holoplant/proc/prepare_icon(state) if(!state) state = pick(possible_plants) var/plant_icon = icon(icon, state) diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 7741ae1b049..18c695f7a05 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -151,18 +151,21 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart) /obj/structure/janitorialcart/update_icon() - overlays = null - if(mybag) - overlays += "cart_garbage" - if(mymop) - overlays += "cart_mop" - if(myspray) - overlays += "cart_spray" - if(myreplacer) - overlays += "cart_replacer" - if(signs) - overlays += "cart_sign[signs]" + cut_overlays() + var/list/overlays_to_add = list() + if(mybag) + overlays_to_add += "cart_garbage" + if(mymop) + overlays_to_add += "cart_mop" + if(myspray) + overlays_to_add += "cart_spray" + if(myreplacer) + overlays_to_add += "cart_replacer" + if(signs) + overlays_to_add += "cart_sign[signs]" + + add_overlay(overlays_to_add) //old style stupido-cart /obj/structure/bed/chair/janicart diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 9a02876376e..bf80818c47e 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -86,7 +86,7 @@ //if(!(istype(src.loc, /turf/space))) // qdel(src) spawn(1) - overlays = list() + cut_overlays() var/dir_sum = 0 diff --git a/code/game/objects/structures/medical_stand_vr.dm b/code/game/objects/structures/medical_stand_vr.dm index 6ed8ff3a7ef..051c8294745 100644 --- a/code/game/objects/structures/medical_stand_vr.dm +++ b/code/game/objects/structures/medical_stand_vr.dm @@ -29,32 +29,33 @@ update_icon() /obj/structure/medical_stand/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if (tank) if (breather) - overlays += "tube_active" + overlays_to_add += "tube_active" else - overlays += "tube" + overlays_to_add += "tube" if(istype(tank,/obj/item/tank/anesthetic)) - overlays += "tank_anest" + overlays_to_add += "tank_anest" else if(istype(tank,/obj/item/tank/nitrogen)) - overlays += "tank_nitro" + overlays_to_add += "tank_nitro" else if(istype(tank,/obj/item/tank/oxygen)) - overlays += "tank_oxyg" + overlays_to_add += "tank_oxyg" else if(istype(tank,/obj/item/tank/phoron)) - overlays += "tank_plasma" + overlays_to_add += "tank_plasma" //else if(istype(tank,/obj/item/tank/hydrogen)) - // overlays += "tank_hydro" + // overlays_to_add += "tank_hydro" else - overlays += "tank_other" + overlays_to_add += "tank_other" if(beaker) - overlays += "beaker" + overlays_to_add += "beaker" if(attached) - overlays += "line_active" + overlays_to_add += "line_active" else - overlays += "line" + overlays_to_add += "line" var/datum/reagents/reagents = beaker.reagents var/percent = round((reagents.total_volume / beaker.volume) * 100) if(reagents.total_volume) @@ -69,7 +70,9 @@ if(91 to INFINITY) filling.icon_state = "reagent100" if (filling.icon) filling.icon += reagents.get_color() - overlays += filling + overlays_to_add += filling + + add_overlay(overlays_to_add) /obj/structure/medical_stand/Destroy() STOP_PROCESSING(SSobj,src) diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index b897b4398e3..1785eb1ed44 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -105,30 +105,34 @@ if (UpdateNeighbors) R.update_icon() -/obj/structure/railing/update_icon(var/UpdateNeighgors = 1) +/obj/structure/railing/update_icon(UpdateNeighgors = TRUE) NeighborsCheck(UpdateNeighgors) //layer = (dir == SOUTH) ? FLY_LAYER : initial(layer) // wtf does this even do - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + if (!check || !anchored)//|| !anchored icon_state = "railing0" else icon_state = "railing1" if (check & 32) - overlays += image ('icons/obj/railing.dmi', src, "corneroverlay") + overlays_to_add += image ('icons/obj/railing.dmi', src, "corneroverlay") if ((check & 16) || !(check & 32) || (check & 64)) - overlays += image ('icons/obj/railing.dmi', src, "frontoverlay_l") + overlays_to_add += image ('icons/obj/railing.dmi', src, "frontoverlay_l") if (!(check & 2) || (check & 1) || (check & 4)) - overlays += image ('icons/obj/railing.dmi', src, "frontoverlay_r") + overlays_to_add += image ('icons/obj/railing.dmi', src, "frontoverlay_r") if(check & 4) switch (src.dir) if (NORTH) - overlays += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_x = 32) + overlays_to_add += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_x = 32) if (SOUTH) - overlays += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_x = -32) + overlays_to_add += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_x = -32) if (EAST) - overlays += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_y = -32) + overlays_to_add += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_y = -32) if (WEST) - overlays += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_y = 32) + overlays_to_add += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_y = 32) + + add_overlay(overlays_to_add) /obj/structure/railing/verb/rotate_counterclockwise() set name = "Rotate Railing Counter-Clockwise" diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index d1de4e28801..615ca51f35c 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -43,7 +43,8 @@ /obj/structure/bed/update_icon() // Prep icon. icon_state = "" - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() // Base icon. var/cache_key = "[base_icon]-[material.name]" if(isnull(stool_cache[cache_key])) @@ -51,7 +52,7 @@ if(applies_material_colour) I.color = material.icon_colour stool_cache[cache_key] = I - overlays |= stool_cache[cache_key] + overlays_to_add += stool_cache[cache_key] // Padding overlay. if(padding_material) var/padding_cache_key = "[base_icon]-padding-[padding_material.name]" @@ -59,7 +60,7 @@ var/image/I = image(icon, "[base_icon]_padding") I.color = padding_material.icon_colour stool_cache[padding_cache_key] = I - overlays |= stool_cache[padding_cache_key] + overlays_to_add += stool_cache[padding_cache_key] // Strings. desc = initial(desc) if(padding_material) @@ -69,6 +70,8 @@ name = "[material.display_name] [initial(name)]" desc += " It's made of [material.use_name]." + add_overlay(overlays_to_add) + /obj/structure/bed/legacy_ex_act(severity) switch(severity) if(1.0) diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 09457142fe8..ed032c287c8 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -60,7 +60,7 @@ I.plane = MOB_PLANE I.color = padding_material.icon_colour stool_cache[cache_key] = I - overlays |= stool_cache[cache_key] + add_overlay(stool_cache[cache_key]) /obj/structure/bed/chair/proc/update_layer() if(src.dir == NORTH) diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index 5a59a94bde3..0d500c89ed7 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -35,14 +35,15 @@ var/global/list/stool_cache = list() //haha stool /obj/item/stool/update_icon() // Prep icon. icon_state = "" - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() // Base icon. var/cache_key = "stool-[material.name]" if(isnull(stool_cache[cache_key])) var/image/I = image(icon, base_icon) I.color = material.icon_colour stool_cache[cache_key] = I - overlays |= stool_cache[cache_key] + overlays_to_add += stool_cache[cache_key] // Padding overlay. if(padding_material) var/padding_cache_key = "stool-padding-[padding_material.name]" @@ -50,7 +51,7 @@ var/global/list/stool_cache = list() //haha stool var/image/I = image(icon, "stool_padding") I.color = padding_material.icon_colour stool_cache[padding_cache_key] = I - overlays |= stool_cache[padding_cache_key] + overlays_to_add += stool_cache[padding_cache_key] // Strings. if(padding_material) name = "[padding_material.display_name] [initial(name)]" //this is not perfect but it will do for now. @@ -59,6 +60,8 @@ var/global/list/stool_cache = list() //haha stool name = "[material.display_name] [initial(name)]" desc = "A stool. Apply butt with care. It's made of [material.use_name]." + add_overlay(overlays_to_add) + /obj/item/stool/proc/add_padding(var/padding_type) padding_material = get_material_by_name(padding_type) update_icon() diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index 116acfc4138..84f2dffc6ae 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -15,9 +15,9 @@ /obj/structure/bed/chair/wheelchair/setDir() ..() - overlays = null + cut_overlays() var/image/O = image(icon = 'icons/obj/furniture.dmi', icon_state = "w_overlay", layer = FLY_LAYER, dir = src.dir) - overlays += O + add_overlay(O) if(has_buckled_mobs()) for(var/A in buckled_mobs) var/mob/living/L = A @@ -224,9 +224,9 @@ /obj/structure/bed/chair/wheelchair/dolly/setDir() ..() - overlays = null + cut_overlays() var/image/O = image(icon = 'icons/obj/furniture.dmi', icon_state = "d_overlay", layer = FLY_LAYER, dir = src.dir) - overlays += O + add_overlay(O) if(has_buckled_mobs()) for(var/A in buckled_mobs) var/mob/living/L = A diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index 363cb5338e2..d307c34caa9 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -22,13 +22,22 @@ update_icon() /obj/structure/dispenser/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + switch(oxygentanks) - if(1 to 3) overlays += "oxygen-[oxygentanks]" - if(4 to INFINITY) overlays += "oxygen-4" + if(1 to 3) + overlays_to_add += "oxygen-[oxygentanks]" + if(4 to INFINITY) + overlays_to_add += "oxygen-4" + switch(phorontanks) - if(1 to 4) overlays += "phoron-[phorontanks]" - if(5 to INFINITY) overlays += "phoron-5" + if(1 to 4) + overlays_to_add += "phoron-[phorontanks]" + if(5 to INFINITY) + overlays_to_add += "phoron-5" + + add_overlay(overlays_to_add) /obj/structure/dispenser/attack_ai(mob/user as mob) if(user.Adjacent(src)) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index ed894d35b34..4ac0bc3d1ab 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -183,13 +183,13 @@ add_fingerprint(user) /obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up - overlays.Cut() //once it's been on for a while, in addition to handling the water overlay. + cut_overlays() //once it's been on for a while, in addition to handling the water overlay. if(mymist) qdel(mymist) mymist = null if(on) - overlays += image('icons/obj/watercloset.dmi', src, "water", MOB_LAYER + 1, dir) + add_overlay(image('icons/obj/watercloset.dmi', src, "water", MOB_LAYER + 1, dir)) if(temperature_settings[watertemp] < T20C) return //no mist for cold water if(!ismist) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 9825b7fe218..fdb1ec7ef07 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -102,13 +102,13 @@ /obj/structure/window/proc/updateSilicate() if (overlays) - overlays.Cut() + cut_overlays() update_icon() var/image/img = image(src) img.color = "#ffffff" img.alpha = silicate * 255 / 100 - overlays += img + add_overlay(img) /obj/structure/window/proc/shatter(var/display_message = 1) playsound(src, "shatter", 70, 1) @@ -442,7 +442,8 @@ /obj/structure/window/update_icon() //A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong. //this way it will only update full-tile ones - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(!is_fulltile()) icon_state = "[basestate]" return @@ -457,16 +458,19 @@ icon_state = "" for(var/i = 1 to 4) var/image/I = image(icon, "[basestate][connections[i]]", dir = 1<<(i-1)) - overlays += I + overlays_to_add += I // Damage overlays. var/ratio = health / maxhealth ratio = CEILING(ratio * 4, 1) * 25 if(ratio > 75) + add_overlay(overlays_to_add) return var/image/I = image(icon, "damage[ratio]", layer = layer + 0.1) - overlays += I + overlays_to_add += I + + add_overlay(overlays_to_add) return diff --git a/code/game/turfs/space/cracked_asteroid.dm b/code/game/turfs/space/cracked_asteroid.dm index dae0d5a1296..f23748e1de4 100644 --- a/code/game/turfs/space/cracked_asteroid.dm +++ b/code/game/turfs/space/cracked_asteroid.dm @@ -14,4 +14,4 @@ // /turf/space/cracked_asteroid/New() // ..() // spawn(2 SECONDS) -// overlays.Cut() +// cut_overlays() diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 9e9be1e1b8b..754cd59a974 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1507,7 +1507,7 @@ datum/admins/var/obj/item/paper/admin/faxreply // var to hold fax replies in if(!P.stamped) P.stamped = new P.stamped += /obj/item/stamp/centcomm - P.overlays += stampoverlay + P.add_overlay(stampoverlay) var/obj/item/rcvdcopy rcvdcopy = destination.copy(P) diff --git a/code/modules/ai/ai_holder_movement.dm b/code/modules/ai/ai_holder_movement.dm index 2fd43bbae5c..e90531d556d 100644 --- a/code/modules/ai/ai_holder_movement.dm +++ b/code/modules/ai/ai_holder_movement.dm @@ -119,7 +119,7 @@ if(path_display) var/turf/T = src.path[1] - T.overlays -= path_overlay + T.cut_overlay(path_overlay) // step_towards(holder, src.path[1]) if(holder.IMove(get_step_towards(holder, src.path[1])) != MOVEMENT_ON_COOLDOWN) diff --git a/code/modules/ai/ai_holder_pathfinding.dm b/code/modules/ai/ai_holder_pathfinding.dm index 77841eac201..e9dd528af82 100644 --- a/code/modules/ai/ai_holder_pathfinding.dm +++ b/code/modules/ai/ai_holder_pathfinding.dm @@ -14,7 +14,7 @@ ai_log("forget_path() : Entering.", AI_LOG_DEBUG) if(path_display) for(var/turf/T in path) - T.overlays -= path_overlay + T.cut_overlay(path_overlay) path.Cut() ai_log("forget_path() : Exiting.", AI_LOG_DEBUG) @@ -49,7 +49,7 @@ ai_log("get_path() : Made new path.",AI_LOG_DEBUG) if(path_display) for(var/turf/T in path) - T.overlays |= path_overlay + T.add_overlay(path_overlay) else ai_log("get_path() : Failed to make new path. Exiting.",AI_LOG_DEBUG) return 0 diff --git a/code/modules/ai/ai_holder_targeting.dm b/code/modules/ai/ai_holder_targeting.dm index 8d930bf16af..0f8f2157d63 100644 --- a/code/modules/ai/ai_holder_targeting.dm +++ b/code/modules/ai/ai_holder_targeting.dm @@ -207,17 +207,17 @@ lose_target_position() if(last_turf_display && target_last_seen_turf) - target_last_seen_turf.overlays -= last_turf_overlay + target_last_seen_turf.cut_overlay(last_turf_overlay) target_last_seen_turf = get_turf(target) if(last_turf_display) - target_last_seen_turf.overlays += last_turf_overlay + target_last_seen_turf.add_overlay(last_turf_overlay) // Resets the last known position to null. /datum/ai_holder/proc/lose_target_position() if(last_turf_display && target_last_seen_turf) - target_last_seen_turf.overlays -= last_turf_overlay + target_last_seen_turf.cut_overlay(last_turf_overlay) ai_log("lose_target_position() : Last position is being reset.", AI_LOG_INFO) target_last_seen_turf = null diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 97b3e95a580..41e4b74e4a1 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -61,11 +61,11 @@ STOP_PROCESSING(SSfastprocess, src) /obj/item/assembly/infra/update_icon() - overlays.Cut() + cut_overlays() attached_overlays = list() if(on) - overlays += "infrared_on" - attached_overlays += "infrared_on" + add_overlay("infrared_on") + attached_overlays += "infrared_on" // TODO: Investigate??? if(holder) holder.update_icon() diff --git a/code/modules/atmospherics/environmental/zas/controller.dm b/code/modules/atmospherics/environmental/zas/controller.dm index 627e61af912..1785ac624ee 100644 --- a/code/modules/atmospherics/environmental/zas/controller.dm +++ b/code/modules/atmospherics/environmental/zas/controller.dm @@ -158,7 +158,7 @@ Class Procs: #endif tiles_to_update += T #ifdef ZAS_DEBUG_GRAPHICS - T.overlays += mark + T.add_overlay(mark) #endif /datum/controller/subsystem/air/proc/mark_zone_update(datum/zas_zone/Z) diff --git a/code/modules/atmospherics/environmental/zas/debug.dm b/code/modules/atmospherics/environmental/zas/debug.dm index 259c6cf492a..bec702288f4 100644 --- a/code/modules/atmospherics/environmental/zas/debug.dm +++ b/code/modules/atmospherics/environmental/zas/debug.dm @@ -11,9 +11,10 @@ var/image/mark = image('icons/Testing/Zone.dmi', icon_state = "mark") /turf/var/tmp/dbg_img /turf/proc/dbg(image/img, d = 0) - if(d > 0) img.dir = d - overlays -= dbg_img - overlays += img + if(d > 0) + img.dir = d + cut_overlay(dbg_img) + add_overlay(img) dbg_img = img /proc/soft_assert(thing,fail) diff --git a/code/modules/atmospherics/environmental/zas/phoron.dm b/code/modules/atmospherics/environmental/zas/phoron.dm index 999026b63f3..28d0cb90dc5 100644 --- a/code/modules/atmospherics/environmental/zas/phoron.dm +++ b/code/modules/atmospherics/environmental/zas/phoron.dm @@ -23,11 +23,11 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') else if(!contaminated) contaminated = 1 - overlays += contamination_overlay + add_overlay(contamination_overlay) /obj/item/proc/decontaminate() contaminated = 0 - overlays -= contamination_overlay + cut_overlay(contamination_overlay) /mob/proc/contaminate() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/algae_generator_vr.dm b/code/modules/atmospherics/machinery/components/binary_devices/algae_generator_vr.dm index a9011a3f04b..811600c636c 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/algae_generator_vr.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/algae_generator_vr.dm @@ -42,13 +42,15 @@ desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]." default_apply_parts() update_icon() + var/list/overlays_to_add = list() // TODO - Make these in actual icon states so its not silly like this var/image/I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = dir) I.color = PIPE_COLOR_BLUE - overlays += I + overlays_to_add += I I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = GLOB.reverse_dir[dir]) I.color = PIPE_COLOR_BLACK - overlays += I + overlays_to_add += I + add_overlay(overlays_to_add) /obj/machinery/atmospherics/component/binary/algae_farm/Destroy() . = ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index c4d628e6f10..e2351e35cac 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -60,11 +60,11 @@ air1.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800 air2.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800 -/obj/machinery/atmospherics/component/binary/dp_vent_pump/update_icon(var/safety = 0) +/obj/machinery/atmospherics/component/binary/dp_vent_pump/update_icon(safety = 0) if(!check_icon_cache()) return - overlays.Cut() + cut_overlays() var/vent_icon = "vent" @@ -80,7 +80,7 @@ else vent_icon += "[use_power ? "[pump_direction ? "out" : "in"]" : "off"]" - overlays += icon_manager.get_atmos_icon("device", , , vent_icon) + add_overlay(icon_manager.get_atmos_icon("device", , , vent_icon)) /obj/machinery/atmospherics/component/binary/dp_vent_pump/update_underlays() if(..()) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/massive_gas_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/massive_gas_pump.dm index b1d0a5bf727..020f33c52e4 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/massive_gas_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/massive_gas_pump.dm @@ -40,13 +40,15 @@ desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]." default_apply_parts() update_icon() + var/list/overlays_to_add = list() // TODO - Make these in actual icon states so its not silly like this var/image/I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = dir) I.color = PIPE_COLOR_GREY - overlays += I + overlays_to_add += I I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = GLOB.reverse_dir[dir]) I.color = PIPE_COLOR_GREY - overlays += I + overlays_to_add += I + add_overlay(overlays_to_add) /obj/machinery/atmospherics/component/binary/massive_gas_pump/Destroy() . = ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/massive_heat_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/massive_heat_pump.dm index debae301f57..25863bb5a4b 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/massive_heat_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/massive_heat_pump.dm @@ -43,13 +43,15 @@ desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]." default_apply_parts() update_icon() + var/list/overlays_to_add = list() // TODO - Make these in actual icon states so its not silly like this var/image/I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = dir) I.color = PIPE_COLOR_GREY - overlays += I + overlays_to_add += I I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = GLOB.reverse_dir[dir]) I.color = PIPE_COLOR_GREY - overlays += I + overlays_to_add += I + add_overlay(overlays_to_add) /obj/machinery/atmospherics/component/binary/massive_heat_pump/Destroy() . = ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm b/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm index 3ea59e9d6af..8eb3f247940 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm @@ -72,15 +72,19 @@ network2.update = 1 /obj/machinery/atmospherics/pipeturbine/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + if (dP > 10) - overlays += image('icons/obj/pipeturbine.dmi', "moto-turb") + overlays_to_add += image('icons/obj/pipeturbine.dmi', "moto-turb") if (kin_energy > 100000) - overlays += image('icons/obj/pipeturbine.dmi', "low-turb") + overlays_to_add += image('icons/obj/pipeturbine.dmi', "low-turb") if (kin_energy > 500000) - overlays += image('icons/obj/pipeturbine.dmi', "med-turb") + overlays_to_add += image('icons/obj/pipeturbine.dmi', "med-turb") if (kin_energy > 1000000) - overlays += image('icons/obj/pipeturbine.dmi', "hi-turb") + overlays_to_add += image('icons/obj/pipeturbine.dmi', "hi-turb") + + add_overlay(overlays_to_add) /obj/machinery/atmospherics/pipeturbine/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench()) diff --git a/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm b/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm index 7c6dc50899e..6e7c8822331 100644 --- a/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm +++ b/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm @@ -48,12 +48,13 @@ build_icons() /obj/machinery/atmospherics/component/quaternary/update_icon() + cut_overlays() if(machine_stat & NOPOWER) - overlays = overlays_off + add_overlay(overlays_off) else if(error_check()) - overlays = overlays_error + add_overlay(overlays_error) else - overlays = use_power ? (overlays_on) : (overlays_off) + add_overlay(use_power ? (overlays_on) : (overlays_off)) underlays = underlays_current diff --git a/code/modules/atmospherics/machinery/components/unary/retro_pump_and_scrubber.dm b/code/modules/atmospherics/machinery/components/unary/retro_pump_and_scrubber.dm index e6e0f28c29b..2fd98e972dc 100644 --- a/code/modules/atmospherics/machinery/components/unary/retro_pump_and_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary/retro_pump_and_scrubber.dm @@ -12,11 +12,11 @@ /obj/machinery/atmospherics/component/unary/vent_pump/retro/on/welded welded = 1 -/obj/machinery/atmospherics/component/unary/vent_pump/retro/update_icon(var/safety = 0) +/obj/machinery/atmospherics/component/unary/vent_pump/retro/update_icon(safety = 0) if(!check_icon_cache()) return - overlays.Cut() + cut_overlays() var/vent_icon = "vent" @@ -34,7 +34,7 @@ else vent_icon += "[pump_direction ? "retro_out" : "retro_in"]" - overlays += icon_manager.get_atmos_icon("device", , , vent_icon) + add_overlay(icon_manager.get_atmos_icon("device", , , vent_icon)) ////////////////////// @@ -50,11 +50,11 @@ /obj/machinery/atmospherics/component/unary/vent_scrubber/retro/on/welded welded = 1 -/obj/machinery/atmospherics/component/unary/vent_scrubber/retro/update_icon(var/safety = 0) +/obj/machinery/atmospherics/component/unary/vent_scrubber/retro/update_icon(safety = 0) if(!check_icon_cache()) return - overlays.Cut() + cut_overlays() var/scrubber_icon = "scrubber" @@ -69,4 +69,4 @@ else scrubber_icon += "[use_power ? "[scrubbing ? "retro_on" : "retro_in"]" : "retro_off"]" - overlays += icon_manager.get_atmos_icon("device", , , scrubber_icon) + add_overlay(icon_manager.get_atmos_icon("device", , , scrubber_icon)) diff --git a/code/modules/atmospherics/machinery/components/unary/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary/vent_pump.dm index e06ba75a02b..38a3b1d9ed5 100644 --- a/code/modules/atmospherics/machinery/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary/vent_pump.dm @@ -144,11 +144,11 @@ . = ..() air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //meant to match air injector -/obj/machinery/atmospherics/component/unary/vent_pump/update_icon(var/safety = 0) +/obj/machinery/atmospherics/component/unary/vent_pump/update_icon(safety = 0) if(!check_icon_cache()) return - overlays.Cut() + cut_overlays() var/vent_icon = "vent" @@ -166,7 +166,7 @@ else vent_icon += "[pump_direction ? "out" : "in"]" - overlays += icon_manager.get_atmos_icon("device", , , vent_icon) + add_overlay(icon_manager.get_atmos_icon("device", , , vent_icon)) /obj/machinery/atmospherics/component/unary/vent_pump/update_underlays() if(..()) diff --git a/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm index 084bccf5bf1..03b41029371 100644 --- a/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm @@ -64,11 +64,11 @@ return ..() -/obj/machinery/atmospherics/component/unary/vent_scrubber/update_icon(var/safety = 0) +/obj/machinery/atmospherics/component/unary/vent_scrubber/update_icon(safety = 0) if(!check_icon_cache()) return - overlays.Cut() + cut_overlays() var/scrubber_icon = "scrubber" @@ -83,7 +83,7 @@ else scrubber_icon += "[use_power ? "[scrubbing ? "on" : "in"]" : "off"]" - overlays += icon_manager.get_atmos_icon("device", , , scrubber_icon) + add_overlay(icon_manager.get_atmos_icon("device", , , scrubber_icon)) /obj/machinery/atmospherics/component/unary/vent_scrubber/update_underlays() if(..()) diff --git a/code/modules/atmospherics/machinery/pipes/cap.dm b/code/modules/atmospherics/machinery/pipes/cap.dm index bc733bdda01..539058c60a2 100644 --- a/code/modules/atmospherics/machinery/pipes/cap.dm +++ b/code/modules/atmospherics/machinery/pipes/cap.dm @@ -47,14 +47,14 @@ if(node) node.update_underlays() -/obj/machinery/atmospherics/pipe/cap/update_icon(var/safety = 0) +/obj/machinery/atmospherics/pipe/cap/update_icon(safety = 0) if(!check_icon_cache()) return alpha = 255 - overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "cap[icon_connect_type]") + cut_overlays() + add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "cap[icon_connect_type]")) /obj/machinery/atmospherics/pipe/cap/atmos_init() for(var/obj/machinery/atmospherics/target in get_step(src, dir)) diff --git a/code/modules/atmospherics/machinery/pipes/manifold.dm b/code/modules/atmospherics/machinery/pipes/manifold.dm index 373bbc7a0a4..e3ff5ba2209 100644 --- a/code/modules/atmospherics/machinery/pipes/manifold.dm +++ b/code/modules/atmospherics/machinery/pipes/manifold.dm @@ -81,15 +81,17 @@ if(node3) node3.update_underlays() -/obj/machinery/atmospherics/pipe/manifold/update_icon(var/safety = 0) +/obj/machinery/atmospherics/pipe/manifold/update_icon(safety = 0) if(!check_icon_cache()) return alpha = 255 - overlays.Cut() - overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type) - overlays += icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type) + cut_overlays() + var/list/overlays_to_add = list() + overlays_to_add += icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type) + overlays_to_add += icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type) + add_overlay(overlays_to_add) underlays.Cut() var/turf/T = get_turf(src) diff --git a/code/modules/atmospherics/machinery/pipes/manifold4w.dm b/code/modules/atmospherics/machinery/pipes/manifold4w.dm index 834c8b7e9cf..23f83c6489e 100644 --- a/code/modules/atmospherics/machinery/pipes/manifold4w.dm +++ b/code/modules/atmospherics/machinery/pipes/manifold4w.dm @@ -81,15 +81,17 @@ if(node4) node4.update_underlays() -/obj/machinery/atmospherics/pipe/manifold4w/update_icon(var/safety = 0) +/obj/machinery/atmospherics/pipe/manifold4w/update_icon(safety = 0) if(!check_icon_cache()) return alpha = 255 - overlays.Cut() - overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type) - overlays += icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type) + cut_overlays() + var/list/overlays_to_add = list() + overlays_to_add += icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type) + overlays_to_add += icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type) + add_overlay(overlays_to_add) underlays.Cut() /* diff --git a/code/modules/atmospherics/machinery/pipes/simple.dm b/code/modules/atmospherics/machinery/pipes/simple.dm index 3dc320dfa4d..27042ec6474 100644 --- a/code/modules/atmospherics/machinery/pipes/simple.dm +++ b/code/modules/atmospherics/machinery/pipes/simple.dm @@ -103,18 +103,18 @@ if(node2) node2.update_underlays() -/obj/machinery/atmospherics/pipe/simple/update_icon(var/safety = 0) +/obj/machinery/atmospherics/pipe/simple/update_icon(safety = 0) if(!check_icon_cache()) return alpha = 255 - overlays.Cut() + cut_overlays() if(node1 && node2) - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]intact[icon_connect_type]") + add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]intact[icon_connect_type]")) else - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]exposed[node1?1:0][node2?1:0][icon_connect_type]") + add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]exposed[node1?1:0][node2?1:0][icon_connect_type]")) /obj/machinery/atmospherics/pipe/simple/update_underlays() return diff --git a/code/modules/atmospherics/machinery/pipes/universal.dm b/code/modules/atmospherics/machinery/pipes/universal.dm index 194bcdc060c..a1b022f8491 100644 --- a/code/modules/atmospherics/machinery/pipes/universal.dm +++ b/code/modules/atmospherics/machinery/pipes/universal.dm @@ -10,14 +10,14 @@ construction_type = /obj/item/pipe/binary pipe_state = "universal" -/obj/machinery/atmospherics/pipe/simple/visible/universal/update_icon(var/safety = 0) +/obj/machinery/atmospherics/pipe/simple/visible/universal/update_icon(safety = 0) if(!check_icon_cache()) return alpha = 255 - overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") + cut_overlays() + add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")) underlays.Cut() if (node1) @@ -48,14 +48,14 @@ construction_type = /obj/item/pipe/binary pipe_state = "universal" -/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_icon(var/safety = 0) +/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_icon(safety = 0) if(!check_icon_cache()) return alpha = 255 - overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") + cut_overlays() + add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")) underlays.Cut() if (node1) diff --git a/code/modules/blob2/blobs/core.dm b/code/modules/blob2/blobs/core.dm index 9ee4038470a..812d00c5249 100644 --- a/code/modules/blob2/blobs/core.dm +++ b/code/modules/blob2/blobs/core.dm @@ -102,14 +102,17 @@ var/list/blob_cores = list() return ..() /obj/structure/blob/core/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() color = null var/mutable_appearance/blob_overlay = mutable_appearance('icons/mob/blob.dmi', "blob") if(overmind) blob_overlay.color = overmind.blob_type.color name = "[overmind.blob_type.name] [base_name]" - overlays += blob_overlay - overlays += mutable_appearance('icons/mob/blob.dmi', "blob_core_overlay") + overlays_to_add += blob_overlay + overlays_to_add += mutable_appearance('icons/mob/blob.dmi', "blob_core_overlay") + + add_overlay(overlays_to_add) /obj/structure/blob/core/process(delta_time) set waitfor = FALSE diff --git a/code/modules/blob2/blobs/node.dm b/code/modules/blob2/blobs/node.dm index c794db195b1..c4493972082 100644 --- a/code/modules/blob2/blobs/node.dm +++ b/code/modules/blob2/blobs/node.dm @@ -21,14 +21,17 @@ var/list/blob_nodes = list() return ..() /obj/structure/blob/node/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() color = null var/mutable_appearance/blob_overlay = mutable_appearance('icons/mob/blob.dmi', "blob") if(overmind) name = "[overmind.blob_type.name] [base_name]" blob_overlay.color = overmind.blob_type.color - overlays += blob_overlay - overlays += mutable_appearance('icons/mob/blob.dmi', "blob_node_overlay") + overlays_to_add += blob_overlay + overlays_to_add += mutable_appearance('icons/mob/blob.dmi', "blob_node_overlay") + + add_overlay(overlays_to_add) /obj/structure/blob/node/process(delta_time) set waitfor = FALSE diff --git a/code/modules/blob2/mobs/spore.dm b/code/modules/blob2/mobs/spore.dm index 223be777c29..7fede56754f 100644 --- a/code/modules/blob2/mobs/spore.dm +++ b/code/modules/blob2/mobs/spore.dm @@ -61,14 +61,16 @@ set_light(0) if(is_infesting) - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = (infested.overlays ? infested.overlays : list()) icon = infested.icon - overlays = infested.overlays var/mutable_appearance/blob_head_overlay = mutable_appearance('icons/mob/blob.dmi', "blob_head") if(overmind) blob_head_overlay.color = overmind.blob_type.complementary_color color = initial(color)//looks better. - overlays += blob_head_overlay + overlays_to_add += blob_head_overlay + + add_overlay(overlays_to_add) /mob/living/simple_mob/hostile/blob/spore/Life(seconds, times_fired) if(can_infest && !is_infesting && isturf(src.loc)) diff --git a/code/modules/clothing/clothing_icons.dm b/code/modules/clothing/clothing_icons.dm index 3344bea4715..47040493a6e 100644 --- a/code/modules/clothing/clothing_icons.dm +++ b/code/modules/clothing/clothing_icons.dm @@ -4,7 +4,7 @@ return if(LAZYLEN(accessories)) for(var/obj/item/clothing/accessory/A in accessories) - MA.overlays += A.get_mob_overlay() + MA.add_overlay(A.get_mob_overlay()) /obj/item/clothing/render_apply_blood(mutable_appearance/MA, bodytype, inhands, datum/inventory_slot_meta/slot_meta) . = ..() @@ -12,9 +12,9 @@ return if(blood_DNA && blood_sprite_state && ishuman(loc)) var/mob/living/carbon/human/H = loc - var/image/bloodsies = image(icon = H.species.get_blood_mask(H), icon_state = blood_sprite_state) - bloodsies.color = blood_color - MA.overlays += bloodsies + var/image/bloodsies = image(icon = H.species.get_blood_mask(H), icon_state = blood_sprite_state) + bloodsies.color = blood_color + MA.add_overlay(bloodsies) //HELMET: May have a lighting overlay /obj/item/clothing/head/render_apply_overlays(mutable_appearance/MA, bodytype, inhands, datum/inventory_slot_meta/slot_meta) @@ -32,6 +32,6 @@ return if(blood_DNA && blood_sprite_state && ishuman(loc)) var/mob/living/carbon/human/H = loc - var/image/bloodsies = image(icon = H.species.get_blood_mask(H), icon_state = "[blood_overlay_type]blood") - bloodsies.color = blood_color - MA.overlays += bloodsies + var/image/bloodsies = image(icon = H.species.get_blood_mask(H), icon_state = "[blood_overlay_type]blood") + bloodsies.color = blood_color + MA.add_overlay(bloodsies) diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index 09d779f66d1..b8d1ec06b85 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -59,7 +59,7 @@ if(usr.put_in_hands(holding)) usr.visible_message("\The [usr] pulls a knife out of their boot!") holding = null - overlays -= image(icon, "[icon_state]_knife") + cut_overlay(image(icon, "[icon_state]_knife")) else to_chat(usr, "Your need an empty, unbroken hand to do that.") if(!holding) @@ -123,19 +123,23 @@ update_icon() /obj/item/clothing/shoes/update_icon() - overlays.Cut() //This removes all the overlays on the sprite and then goes down a checklist adding them as required. + cut_overlays() + var/list/overlays_to_add = list() if(blood_DNA) add_blood() if(holding) - overlays += image(icon, "[icon_state]_knife") + overlays_to_add += image(icon, "[icon_state]_knife") if(contaminated) - overlays += contamination_overlay + overlays_to_add += contamination_overlay if(gurgled) decontaminate() gurgle_contaminate() if(ismob(usr)) var/mob/M = usr M.update_inv_shoes() + + add_overlay(overlays_to_add) + return ..() /obj/item/clothing/shoes/clean_blood() diff --git a/code/modules/clothing/suits/_suit.dm b/code/modules/clothing/suits/_suit.dm index 4541e2263e5..051952d25dd 100644 --- a/code/modules/clothing/suits/_suit.dm +++ b/code/modules/clothing/suits/_suit.dm @@ -50,7 +50,7 @@ for(var/obj/item/clothing/accessory/A in accessories) var/image/I = new(A.get_mob_overlay()) I.pixel_x = 16 //Opposite of the pixel_x on the suit (-16) from taurization to cancel it out and puts the accessory in the correct place on the body. - MA.overlays += I + MA.add_overlay(I) return MA else return ..() diff --git a/code/modules/detectivework/microscope/dnascanner.dm b/code/modules/detectivework/microscope/dnascanner.dm index bd87374495a..c7e9ec40c2e 100644 --- a/code/modules/detectivework/microscope/dnascanner.dm +++ b/code/modules/detectivework/microscope/dnascanner.dm @@ -121,7 +121,8 @@ var/obj/item/paper/P = new(src) P.name = "[src] report #[++report_num]: [bloodsamp.name]" P.stamped = list(/obj/item/stamp) - P.overlays = list("paper_stamped") + P.cut_overlays() + P.add_overlay("paper_stamped") //dna data itself var/data = "No scan information available." if(bloodsamp.dna != null) diff --git a/code/modules/detectivework/microscope/microscope.dm b/code/modules/detectivework/microscope/microscope.dm index 748318b24b5..dcf202519b5 100644 --- a/code/modules/detectivework/microscope/microscope.dm +++ b/code/modules/detectivework/microscope/microscope.dm @@ -40,7 +40,8 @@ to_chat(user, "Printing findings now...") var/obj/item/paper/report = new(get_turf(src)) report.stamped = list(/obj/item/stamp) - report.overlays = list("paper_stamped") + report.cut_overlays() + report.add_overlay("paper_stamped") report_num++ if(istype(sample, /obj/item/forensics/swab)) diff --git a/code/modules/detectivework/tools/evidencebag.dm b/code/modules/detectivework/tools/evidencebag.dm index 2ee5eecb524..0cf76334e8d 100644 --- a/code/modules/detectivework/tools/evidencebag.dm +++ b/code/modules/detectivework/tools/evidencebag.dm @@ -59,8 +59,10 @@ var/image/img = image("icon"=I, "layer"=FLOAT_LAYER) //take a snapshot. (necessary to stop the underlays appearing under our inventory-HUD slots ~Carn I.pixel_x = xx //and then return it I.pixel_y = yy - overlays += img - overlays += "evidence" //should look nicer for transparent stuff. not really that important, but hey. + var/list/overlays_to_add = list() + overlays_to_add += img + overlays_to_add += "evidence" //should look nicer for transparent stuff. not really that important, but hey. + add_overlay(overlays_to_add) desc = "An evidence bag containing [I]." I.loc = src @@ -74,7 +76,7 @@ var/obj/item/I = contents[1] user.visible_message("[user] takes [I] out of [src]", "You take [I] out of [src].",\ "You hear someone rustle around in a plastic bag, and remove something.") - overlays.Cut() //remove the overlays + cut_overlays() user.put_in_hands(I) stored_item = null diff --git a/code/modules/detectivework/tools/uvlight.dm b/code/modules/detectivework/tools/uvlight.dm index bab21aa5e36..f582a9e8971 100644 --- a/code/modules/detectivework/tools/uvlight.dm +++ b/code/modules/detectivework/tools/uvlight.dm @@ -43,7 +43,7 @@ stored_alpha.Cut() if(reset_objects.len) for(var/obj/item/I in reset_objects) - I.overlays -= I.blood_overlay + I.cut_overlay(I.blood_overlay) if(I.fluorescent == 2) I.fluorescent = 1 reset_objects.Cut() @@ -67,5 +67,5 @@ if(istype(A, /obj/item)) var/obj/item/O = A if(O.was_bloodied && !(O.blood_overlay in O.overlays)) - O.overlays |= O.blood_overlay + O.add_overlay(O.blood_overlay) reset_objects |= O diff --git a/code/modules/economy/Accounts.dm b/code/modules/economy/Accounts.dm index 44f9d720739..5034c5c3e1b 100644 --- a/code/modules/economy/Accounts.dm +++ b/code/modules/economy/Accounts.dm @@ -67,7 +67,7 @@ if(!R.stamped) R.stamped = new R.stamped += /obj/item/stamp - R.overlays += stampoverlay + R.add_overlay(stampoverlay) R.stamps += "
This paper has been stamped by the Accounts Database." //add the account diff --git a/code/modules/economy/items/EFTPOS.dm b/code/modules/economy/items/EFTPOS.dm index 87f6cf29717..3be47575122 100644 --- a/code/modules/economy/items/EFTPOS.dm +++ b/code/modules/economy/items/EFTPOS.dm @@ -61,7 +61,7 @@ R.offset_y += 0 R.ico += "paper_stamp-cent" R.stamped += /obj/item/stamp - R.overlays += stampoverlay + R.add_overlay(stampoverlay) R.stamps += "
This paper has been stamped by the EFTPOS device." /obj/item/eftpos/proc/print_reference() @@ -77,7 +77,7 @@ if(!R.stamped) R.stamped = new R.stamped += /obj/item/stamp - R.overlays += stampoverlay + R.add_overlay(stampoverlay) R.stamps += "
This paper has been stamped by the EFTPOS device." var/obj/item/smallDelivery/D = new(R.loc) R.loc = D diff --git a/code/modules/economy/items/cash.dm b/code/modules/economy/items/cash.dm index a365d661932..38163aeaea6 100644 --- a/code/modules/economy/items/cash.dm +++ b/code/modules/economy/items/cash.dm @@ -35,13 +35,16 @@ qdel(src) /obj/item/spacecash/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + name = "[worth] Thaler\s" if(worth in list(1000,500,200,100,50,20,10,1)) icon_state = "spacecash[worth]" desc = "It's worth [worth] Thalers." return - var/sum = src.worth + + var/sum = worth var/num = 0 for(var/i in list(1000,500,200,100,50,20,10,1)) while(sum >= i && num < 50) @@ -52,15 +55,19 @@ M.Translate(rand(-6, 6), rand(-4, 8)) M.Turn(pick(-45, -27.5, 0, 0, 0, 0, 0, 0, 0, 27.5, 45)) banknote.transform = M - src.overlays += banknote + overlays_to_add += banknote + if(num == 0) // Less than one thaler, let's just make it look like 1 for ease var/image/banknote = image('icons/obj/items.dmi', "spacecash1") var/matrix/M = matrix() M.Translate(rand(-6, 6), rand(-4, 8)) M.Turn(pick(-45, -27.5, 0, 0, 0, 0, 0, 0, 0, 27.5, 45)) banknote.transform = M - src.overlays += banknote - src.desc = "They are worth [worth] Thalers." + overlays_to_add += banknote + + desc = "They are worth [worth] Thalers." + + add_overlay(overlays_to_add) /obj/item/spacecash/proc/adjust_worth(var/adjust_worth = 0, var/update = 1) worth += adjust_worth diff --git a/code/modules/economy/items/coins.dm b/code/modules/economy/items/coins.dm index fb7ba43b9a0..87c898deba4 100644 --- a/code/modules/economy/items/coins.dm +++ b/code/modules/economy/items/coins.dm @@ -77,14 +77,14 @@ name = "supermatter coin" icon_state = "coin_supermatter" -/obj/item/coin/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/coin/attackby(obj/item/W, mob/user) if(istype(W,/obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/CC = W if(string_attached) to_chat(user, "There already is a string attached to this coin.") return if (CC.use(1)) - overlays += image('icons/obj/items.dmi',"coin_string_overlay") + add_overlay(image('icons/obj/items.dmi',"coin_string_overlay")) string_attached = 1 to_chat(user, "You attach a string to the coin.") else @@ -98,7 +98,7 @@ var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc) CC.amount = 1 CC.update_icon() - overlays = list() + cut_overlays() string_attached = null to_chat(user, "You detach the string from the coin.") else ..() diff --git a/code/modules/economy/machines/ATM.dm b/code/modules/economy/machines/ATM.dm index 46524b2e0e7..030eb204c30 100644 --- a/code/modules/economy/machines/ATM.dm +++ b/code/modules/economy/machines/ATM.dm @@ -383,7 +383,7 @@ log transactions if(!R.stamped) R.stamped = new R.stamped += /obj/item/stamp - R.overlays += stampoverlay + R.add_overlay(stampoverlay) R.stamps += "
This paper has been stamped by the Automatic Teller Machine." if(prob(50)) @@ -425,7 +425,7 @@ log transactions if(!R.stamped) R.stamped = new R.stamped += /obj/item/stamp - R.overlays += stampoverlay + R.add_overlay(stampoverlay) R.stamps += "
This paper has been stamped by the Automatic Teller Machine." if(prob(50)) diff --git a/code/modules/economy/machines/cash_register.dm b/code/modules/economy/machines/cash_register.dm index 11eef2c7909..130d5c6d25f 100644 --- a/code/modules/economy/machines/cash_register.dm +++ b/code/modules/economy/machines/cash_register.dm @@ -47,7 +47,7 @@ if(cash_stored) spawn_money(cash_stored, loc, user) cash_stored = 0 - overlays -= "register_cash" + cut_overlay("register_cash") else open_cash_box() else @@ -178,7 +178,7 @@ if(cash_open) to_chat(user, "You neatly sort the cash into the box.") cash_stored += SC.worth - overlays |= "register_cash" + add_overlay("register_cash") qdel(SC) else scan_cash(SC) @@ -455,19 +455,24 @@ set desc = "Open/closes the register's cash box." set src in view(1) - if(usr.stat) return + if(usr.stat) + return if(cash_open) cash_open = 0 - overlays -= "register_approve" - overlays -= "register_open" - overlays -= "register_cash" + var/list/overlays_to_remove = list() + overlays_to_remove.Add("register_approve") + overlays_to_remove.Add("register_open") + overlays_to_remove.Add("register_cash") + cut_overlays(overlays_to_remove) else if(!cash_locked) + var/list/overlays_to_add = list() cash_open = 1 - overlays += "register_approve" - overlays += "register_open" + overlays_to_add.Add("register_approve") + overlays_to_add.Add("register_open") if(cash_stored) - overlays += "register_cash" + overlays_to_add.Add("register_cash") + add_overlay(overlays_to_add) else to_chat(usr, "The cash box is locked.") diff --git a/code/modules/economy/machines/mint.dm b/code/modules/economy/machines/mint.dm index f4d31c7fd16..26acb475529 100644 --- a/code/modules/economy/machines/mint.dm +++ b/code/modules/economy/machines/mint.dm @@ -397,14 +397,14 @@ else icon_state = icon_on -/obj/machinery/coinbank/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/coinbank/attackby(obj/item/O, mob/user) if(O.is_screwdriver()) panel_open = !panel_open user.visible_message("[user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].", "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].") playsound(src, O.tool_sound, 50, 1) - overlays.Cut() + cut_overlays() if(panel_open) - overlays += image(icon, icon_panel) + add_overlay(image(icon, icon_panel)) SSnanoui.update_uis(src) return diff --git a/code/modules/fishing/fishing_net.dm b/code/modules/fishing/fishing_net.dm index 8bd2fc74592..f232eccfe0a 100644 --- a/code/modules/fishing/fishing_net.dm +++ b/code/modules/fishing/fishing_net.dm @@ -78,7 +78,7 @@ /obj/item/material/fishing_net/update_icon() // Also updates name and desc underlays.Cut() - overlays.Cut() + cut_overlays() ..() diff --git a/code/modules/fishing/fishing_rod.dm b/code/modules/fishing/fishing_rod.dm index da7d1339ca2..cf1d5ff1dab 100644 --- a/code/modules/fishing/fishing_rod.dm +++ b/code/modules/fishing/fishing_rod.dm @@ -79,10 +79,10 @@ return ..() /obj/item/material/fishing_rod/update_icon() - overlays.Cut() + cut_overlays() ..() if(strung) - overlays += image(icon, "[icon_state]_string") + add_overlay(image(icon, "[icon_state]_string")) /obj/item/material/fishing_rod/proc/update_bait() if(istype(Bait, bait_type)) diff --git a/code/modules/food/food/drinks/drinkingglass.dm b/code/modules/food/food/drinks/drinkingglass.dm index e088eebcb26..07ffb310d1a 100644 --- a/code/modules/food/food/drinks/drinkingglass.dm +++ b/code/modules/food/food/drinks/drinkingglass.dm @@ -116,18 +116,21 @@ matter = list(MAT_GLASS = 175) /obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/on_reagent_change() - overlays.Cut() + cut_overlays() if(reagents.total_volume) var/image/filling = image('icons/obj/medical/reagentfillings.dmi', src, "[icon_state]1") switch(reagents.total_volume) - if(0 to 3) filling.icon_state = "[icon_state]1" - if(4 to 7) filling.icon_state = "[icon_state]5" - if(8 to INFINITY) filling.icon_state = "[icon_state]12" + if(0 to 3) + filling.icon_state = "[icon_state]1" + if(4 to 7) + filling.icon_state = "[icon_state]5" + if(8 to INFINITY) + filling.icon_state = "[icon_state]12" filling.color += reagents.get_color() - overlays += filling + add_overlay(filling) name = "shot glass of " + reagents.get_master_reagent_name() //No matter what, the glass will tell you the reagent's name. Might be too abusable in the future. else name = "shot glass" @@ -144,25 +147,35 @@ icon_state = pick("fitness-cup_black", "fitness-cup_red", "fitness-cup_black") /obj/item/reagent_containers/food/drinks/drinkingglass/fitnessflask/on_reagent_change() - overlays.Cut() + cut_overlays() if(reagents.total_volume) var/image/filling = image('icons/obj/medical/reagentfillings.dmi', src, "fitness-cup10") switch(reagents.total_volume) - if(0 to 10) filling.icon_state = "fitness-cup10" - if(11 to 20) filling.icon_state = "fitness-cup20" - if(21 to 29) filling.icon_state = "fitness-cup30" - if(30 to 39) filling.icon_state = "fitness-cup40" - if(40 to 49) filling.icon_state = "fitness-cup50" - if(50 to 59) filling.icon_state = "fitness-cup60" - if(60 to 69) filling.icon_state = "fitness-cup70" - if(70 to 79) filling.icon_state = "fitness-cup80" - if(80 to 89) filling.icon_state = "fitness-cup90" - if(90 to INFINITY) filling.icon_state = "fitness-cup100" + if(0 to 10) + filling.icon_state = "fitness-cup10" + if(11 to 20) + filling.icon_state = "fitness-cup20" + if(21 to 29) + filling.icon_state = "fitness-cup30" + if(30 to 39) + filling.icon_state = "fitness-cup40" + if(40 to 49) + filling.icon_state = "fitness-cup50" + if(50 to 59) + filling.icon_state = "fitness-cup60" + if(60 to 69) + filling.icon_state = "fitness-cup70" + if(70 to 79) + filling.icon_state = "fitness-cup80" + if(80 to 89) + filling.icon_state = "fitness-cup90" + if(90 to INFINITY) + filling.icon_state = "fitness-cup100" filling.color += reagents.get_color() - overlays += filling + add_overlay(filling) /obj/item/reagent_containers/food/drinks/drinkingglass/fitnessflask/proteinshake name = "protein shake" diff --git a/code/modules/food/food/sandwich.dm b/code/modules/food/food/sandwich.dm index 9cb89d206af..94d01682371 100644 --- a/code/modules/food/food/sandwich.dm +++ b/code/modules/food/food/sandwich.dm @@ -46,7 +46,8 @@ var/fullname = "" //We need to build this from the contents of the var. var/i = 0 - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() for(var/obj/item/reagent_containers/food/snacks/O in ingredients) @@ -62,17 +63,20 @@ I.color = O.filling_color I.pixel_x = pick(list(-1,0,1)) I.pixel_y = (i*2)+1 - overlays += I + overlays_to_add += (I) var/image/T = new(src.icon, "sandwich_top") T.pixel_x = pick(list(-1,0,1)) T.pixel_y = (ingredients.len * 2)+1 - overlays += T + overlays_to_add += T name = lowertext("[fullname] sandwich") - if(length(name) > 80) name = "[pick(list("absurd","colossal","enormous","ridiculous"))] sandwich" + if(length(name) > 80) + name = "[pick(list("absurd","colossal","enormous","ridiculous"))] sandwich" w_class = CEILING(clamp((ingredients.len/2),2,4), 1) + add_overlay(overlays_to_add) + /obj/item/reagent_containers/food/snacks/csandwich/Destroy() for(var/obj/item/O in ingredients) qdel(O) diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index fc7af89e8ea..a4144241bdb 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -144,7 +144,7 @@ else . += "\The [src] was bitten multiple times!" -/obj/item/reagent_containers/food/snacks/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/reagent_containers/food/snacks/attackby(obj/item/W, mob/user) if(istype(W,/obj/item/storage)) . = ..() // -> item/attackby() return @@ -165,12 +165,12 @@ "You scoop up some [src] with \the [U]!" \ ) - src.bitecount++ - U.overlays.Cut() + bitecount++ + U.cut_overlays() U.loaded = "[src]" var/image/I = new(U.icon, "loadedfood") - I.color = src.filling_color - U.overlays += I + I.color = filling_color + U.add_overlay(I) reagents.trans_to_obj(U, min(reagents.total_volume,5)) @@ -180,11 +180,11 @@ if (is_sliceable()) //these are used to allow hiding edge items in food that is not on a table/tray - var/can_slice_here = isturf(src.loc) && ((locate(/obj/structure/table) in src.loc) || (locate(/obj/machinery/optable) in src.loc) || (locate(/obj/item/tray) in src.loc)) + var/can_slice_here = isturf(loc) && ((locate(/obj/structure/table) in loc) || (locate(/obj/machinery/optable) in loc) || (locate(/obj/item/tray) in loc)) var/hide_item = !has_edge(W) || !can_slice_here if (hide_item) - if (W.w_class >= src.w_class || is_robot_module(W)) + if (W.w_class >= w_class || is_robot_module(W)) return if(!user.attempt_insert_item_for_installation(W, src)) return @@ -207,7 +207,7 @@ var/reagents_per_slice = reagents.total_volume/slices_num for(var/i=1 to (slices_num-slices_lost)) - var/obj/slice = new slice_path (src.loc) + var/obj/slice = new slice_path (loc) reagents.trans_to_obj(slice, reagents_per_slice) qdel(src) return @@ -3158,7 +3158,8 @@ /obj/item/pizzabox/update_icon() - overlays = list() + cut_overlays() + var/list/overlays_to_add = list() // Set appropriate description if( open && pizza ) @@ -3186,7 +3187,7 @@ if( pizza ) var/image/pizzaimg = image(icon = pizza.icon, icon_state = pizza.icon_state) pizzaimg.pixel_y = -3 - overlays += pizzaimg + overlays_to_add += pizzaimg return else @@ -3203,9 +3204,10 @@ if( doimgtag ) var/image/tagimg = image("food.dmi", icon_state = "pizzabox_tag") tagimg.pixel_y = boxes.len * 3 - overlays += tagimg + overlays_to_add += tagimg icon_state = "pizzabox[boxes.len+1]" + add_overlay(overlays_to_add) /obj/item/pizzabox/attack_hand( mob/user as mob ) @@ -4002,11 +4004,12 @@ END CITADEL CHANGE */ color = "#FFFFFF" //Some fruits use the color var. Reset this so it doesnt tint the batter I.Blend(new /icon('icons/obj/food_custom.dmi', rgb(255,255,255)),ICON_ADD) I.Blend(new /icon('icons/obj/food_custom.dmi', coating.icon_raw),ICON_MULTIPLY) - var/image/J = image(I) - J.alpha = 200 - J.blend_mode = BLEND_OVERLAY - J.tag = "coating" - overlays += J + + var/image/coating_image = image(I) + coating_image.alpha = 200 + coating_image.blend_mode = BLEND_OVERLAY + coating_image.tag = "coating" + add_overlay(coating_image) if (user) user.visible_message(SPAN_NOTICE("[user] dips \the [src] into \the [coating.name]"), SPAN_NOTICE("You dip \the [src] into \the [coating.name]")) @@ -4034,10 +4037,10 @@ END CITADEL CHANGE */ color = "#FFFFFF" //Some fruits use the color var I.Blend(new /icon('icons/obj/food_custom.dmi', rgb(255,255,255)),ICON_ADD) I.Blend(new /icon('icons/obj/food_custom.dmi', coating.icon_cooked),ICON_MULTIPLY) - var/image/J = image(I) - J.alpha = 200 - J.tag = "coating" - overlays += J + var/image/coating_image = image(I) + coating_image.alpha = 200 + coating_image.tag = "coating" + add_overlay(coating_image) if (do_coating_prefix == 1) diff --git a/code/modules/food/food/z_custom_food_vr.dm b/code/modules/food/food/z_custom_food_vr.dm index bfc7477d88c..3d7bcafb5f9 100644 --- a/code/modules/food/food/z_custom_food_vr.dm +++ b/code/modules/food/food/z_custom_food_vr.dm @@ -52,15 +52,15 @@ var/global/ingredientLimit = 20 ingredients += S - if(src.addTop) - overlays -= topping //thank you Comic + if(addTop) + cut_overlay(topping) //thank you Comic if(!fullyCustom && !stackIngredients && overlays.len) - overlays -= filling //we can't directly modify the overlay, so we have to remove it and then add it again + cut_overlay(filling) //we can't directly modify the overlay, so we have to remove it and then add it again var/newcolor = S.filling_color != "#FFFFFF" ? S.filling_color : AverageColor(get_flat_icon(S, S.dir, 0), 1, 1) filling.color = BlendRGB(filling.color, newcolor, 1/ingredients.len) - overlays += filling + add_overlay(filling) else - overlays += generateFilling(S) + add_overlay(generateFilling(S)) if(addTop) drawTopping() @@ -70,7 +70,7 @@ var/global/ingredientLimit = 20 . = ..() return -/obj/item/reagent_containers/food/snacks/customizable/proc/generateFilling(var/obj/item/reagent_containers/food/snacks/S, params) +/obj/item/reagent_containers/food/snacks/customizable/proc/generateFilling(obj/item/reagent_containers/food/snacks/S, params) var/image/I if(fullyCustom) var/icon/C = get_flat_icon(S, S.dir, 0) @@ -82,11 +82,12 @@ var/global/ingredientLimit = 20 I.color = S.filling_color else I.color = AverageColor(get_flat_icon(S, S.dir, 0), 1, 1) - if(src.stackIngredients) - I.pixel_y = src.ingredients.len * 2 + if(stackIngredients) + I.pixel_y = ingredients.len * 2 else - src.overlays.len = 0 - if(src.fullyCustom || src.stackIngredients) + cut_overlays() + + if(fullyCustom || stackIngredients) var/clicked_x = text2num(params2list(params)["icon-x"]) if (isnull(clicked_x)) I.pixel_x = 0 @@ -127,7 +128,7 @@ var/global/ingredientLimit = 20 /obj/item/reagent_containers/food/snacks/customizable/proc/drawTopping() var/image/I = topping I.pixel_y = (ingredients.len+1)*2 - overlays += I + add_overlay(I) // Sandwiches ////////////////////////////////////////////////// diff --git a/code/modules/food/glass/bottle.dm b/code/modules/food/glass/bottle.dm index cd74c6cf7df..4dc98425d45 100644 --- a/code/modules/food/glass/bottle.dm +++ b/code/modules/food/glass/bottle.dm @@ -35,27 +35,37 @@ icon_state = "bottle-[rand(1,4)]" /obj/item/reagent_containers/glass/bottle/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(reagents.total_volume && (icon_state == "bottle-1" || icon_state == "bottle-2" || icon_state == "bottle-3" || icon_state == "bottle-4")) var/image/filling = image('icons/obj/medical/reagentfillings.dmi', src, "[icon_state]10") var/percent = round((reagents.total_volume / volume) * 100) switch(percent) - if(0 to 9) filling.icon_state = "[icon_state]--10" - if(10 to 24) filling.icon_state = "[icon_state]-10" - if(25 to 49) filling.icon_state = "[icon_state]-25" - if(50 to 74) filling.icon_state = "[icon_state]-50" - if(75 to 79) filling.icon_state = "[icon_state]-75" - if(80 to 90) filling.icon_state = "[icon_state]-80" - if(91 to INFINITY) filling.icon_state = "[icon_state]-100" + if(0 to 9) + filling.icon_state = "[icon_state]--10" + if(10 to 24) + filling.icon_state = "[icon_state]-10" + if(25 to 49) + filling.icon_state = "[icon_state]-25" + if(50 to 74) + filling.icon_state = "[icon_state]-50" + if(75 to 79) + filling.icon_state = "[icon_state]-75" + if(80 to 90) + filling.icon_state = "[icon_state]-80" + if(91 to INFINITY) + filling.icon_state = "[icon_state]-100" filling.color = reagents.get_color() - overlays += filling + overlays_to_add += filling if (!is_open_container()) var/image/lid = image(icon, src, "lid_bottle") - overlays += lid + overlays_to_add += lid + + add_overlay(overlays_to_add) /obj/item/reagent_containers/glass/bottle/inaprovaline name = "inaprovaline bottle" diff --git a/code/modules/food/kitchen/cooking_machines/cereal.dm b/code/modules/food/kitchen/cooking_machines/cereal.dm index f3c1f5fb7d7..be18c743359 100644 --- a/code/modules/food/kitchen/cooking_machines/cereal.dm +++ b/code/modules/food/kitchen/cooking_machines/cereal.dm @@ -35,10 +35,10 @@ var/image/food_image = image(CI.object.icon, CI.object.icon_state) food_image.color = CI.object.color - food_image.overlays += CI.object.overlays + food_image.add_overlay(CI.object.overlays) food_image.transform *= 0.7 - product.overlays += food_image + product.add_overlay(food_image) */ /obj/machinery/appliance/mixer/cereal/update_icon() @@ -82,4 +82,4 @@ result.color = result.filling_color for (var/i in images) - result.overlays += images[i] + result.add_overlay(images[i]) diff --git a/code/modules/food/kitchen/icecream.dm b/code/modules/food/kitchen/icecream.dm index 60346734b32..d65574af97c 100644 --- a/code/modules/food/kitchen/icecream.dm +++ b/code/modules/food/kitchen/icecream.dm @@ -184,7 +184,7 @@ /obj/item/reagent_containers/food/snacks/icecream/proc/add_ice_cream(var/flavour_name) name = "[flavour_name] icecream" - src.overlays += "icecream_[flavour_name]" + add_overlay("icecream_[flavour_name]") desc = "Delicious [cone_type] cone with a dollop of [flavour_name] ice cream." ice_creamed = 1 diff --git a/code/modules/food/kitchen/smartfridge.dm b/code/modules/food/kitchen/smartfridge.dm index 4664ab27083..0803605fd28 100644 --- a/code/modules/food/kitchen/smartfridge.dm +++ b/code/modules/food/kitchen/smartfridge.dm @@ -164,7 +164,8 @@ update_icon() /obj/machinery/smartfridge/drying_rack/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() var/not_working = machine_stat & (BROKEN|NOPOWER) if(not_working) icon_state = icon_off @@ -176,9 +177,10 @@ hasItems = 1 break if(hasItems) - overlays += "drying_rack_filled" + overlays_to_add += "drying_rack_filled" if(!not_working) - overlays += "drying_rack_drying" + overlays_to_add += "drying_rack_drying" + add_overlay(overlays_to_add) /obj/machinery/smartfridge/drying_rack/attackby(var/obj/item/O as obj, mob/user) . = ..() @@ -239,14 +241,14 @@ * Item Adding ********************/ -/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/smartfridge/attackby(obj/item/O, mob/user) if(O.is_screwdriver()) panel_open = !panel_open user.visible_message("[user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].", "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].") playsound(src, O.tool_sound, 50, 1) - overlays.Cut() + cut_overlays() if(panel_open) - overlays += image(icon, icon_panel) + add_overlay(image(icon, icon_panel)) SSnanoui.update_uis(src) return diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 5cd692b1b6d..d7842749ddc 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -392,7 +392,7 @@ qdel(src) return -/obj/item/hand/update_icon(var/direction = 0) +/obj/item/hand/update_icon(direction = 0) if(!cards.len) return // about to be deleted if(cards.len > 1) @@ -402,7 +402,7 @@ name = "a playing card" desc = "A playing card." - overlays.Cut() + cut_overlays() if(cards.len == 1) @@ -410,7 +410,7 @@ var/image/I = new(src.icon, (concealed ? "[P.back_icon]" : "[P.card_icon]") ) I.pixel_x += (-5+rand(10)) I.pixel_y += (-5+rand(10)) - overlays += I + add_overlay(I) return var/offset = FLOOR(20/cards.len, 1) @@ -442,7 +442,7 @@ else I.pixel_x = -7+(offset*i) I.transform = M - overlays += I + add_overlay(I) i++ /obj/item/hand/dropped(mob/user, flags, atom/newLoc) diff --git a/code/modules/holomap/holomap_datum.dm b/code/modules/holomap/holomap_datum.dm index af4cc6f2744..f6d4f61bba5 100644 --- a/code/modules/holomap/holomap_datum.dm +++ b/code/modules/holomap/holomap_datum.dm @@ -20,15 +20,15 @@ legend.pixel_x = HOLOMAP_LEGEND_X(T.z) legend.pixel_y = HOLOMAP_LEGEND_Y(T.z) - station_map.overlays |= cursor - station_map.overlays |= legend + station_map.add_overlay(cursor) + station_map.add_overlay(legend) /datum/station_holomap/proc/initialize_holomap_bogus() station_map = image('icons/480x480.dmi', "stationmap") legend = image('icons/effects/64x64.dmi', "notfound") legend.pixel_x = 7 * WORLD_ICON_SIZE legend.pixel_y = 7 * WORLD_ICON_SIZE - station_map.overlays |= legend + station_map.add_overlay(legend) // TODO - Strategic Holomap support // /datum/station_holomap/strategic/initialize_holomap(var/turf/T, var/isAI=null, var/mob/user=null) @@ -37,4 +37,4 @@ // legend = image('icons/effects/64x64.dmi', "strategic") // legend.pixel_x = 3*WORLD_ICON_SIZE // legend.pixel_y = 3*WORLD_ICON_SIZE -// station_map.overlays |= legend +// station_map.add_overlay(legend) diff --git a/code/modules/holomap/station_holomap.dm b/code/modules/holomap/station_holomap.dm index f91273cc611..01cec16fd1a 100644 --- a/code/modules/holomap/station_holomap.dm +++ b/code/modules/holomap/station_holomap.dm @@ -167,7 +167,8 @@ update_icon() /obj/machinery/station_map/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(machine_stat & BROKEN) icon_state = "station_mapb" else if((machine_stat & NOPOWER) || !anchored) @@ -179,20 +180,22 @@ holomap_datum.initialize_holomap_bogus() else small_station_map.icon = SSholomaps.extraMiniMaps["[HOLOMAP_EXTRA_STATIONMAPSMALL]_[original_zLevel]"] - overlays |= small_station_map + overlays_to_add += small_station_map holomap_datum.initialize_holomap(get_turf(src)) // Put the little "map" overlay down where it looks nice if(floor_markings) - floor_markings.dir = src.dir - floor_markings.pixel_x = -src.pixel_x - floor_markings.pixel_y = -src.pixel_y - overlays += floor_markings + floor_markings.dir = dir + floor_markings.pixel_x = -pixel_x + floor_markings.pixel_y = -pixel_y + overlays_to_add += floor_markings if(panel_open) - overlays += "station_map-panel" + overlays_to_add += "station_map-panel" else - overlays -= "station_map-panel" + overlays_to_add -= "station_map-panel" + + add_overlay(overlays_to_add) /obj/machinery/station_map/attackby(obj/item/W as obj, mob/user as mob) src.add_fingerprint(user) diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm index c068c5f0d72..64b2c00a41c 100644 --- a/code/modules/hydroponics/beekeeping/beehive.dm +++ b/code/modules/hydroponics/beekeeping/beehive.dm @@ -13,22 +13,25 @@ var/maxFrames = 5 /obj/machinery/beehive/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() icon_state = "beehive" if(closed) - overlays += "lid" + overlays_to_add += "lid" if(frames) - overlays += "empty[frames]" + overlays_to_add += "empty[frames]" if(honeycombs >= 100) - overlays += "full[round(honeycombs / 100)]" + overlays_to_add += "full[round(honeycombs / 100)]" if(!smoked) switch(bee_count) if(1 to 40) - overlays += "bees1" + overlays_to_add += "bees1" if(41 to 80) - overlays += "bees2" + overlays_to_add += "bees2" if(81 to 100) - overlays += "bees3" + overlays_to_add += "bees3" + + add_overlay(overlays_to_add) /obj/machinery/beehive/examine(mob/user) . = ..() diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 2c2a84ab229..2fbfef84341 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -125,7 +125,7 @@ /obj/item/reagent_containers/food/snacks/grown/update_icon() if(!seed || !SSplants || !SSplants.plant_icon_cache) return - overlays.Cut() + cut_overlays() var/image/plant_icon var/icon_key = "fruit-[seed.get_trait(TRAIT_PRODUCT_ICON)]-[seed.get_trait(TRAIT_PRODUCT_COLOUR)]-[seed.get_trait(TRAIT_PLANT_COLOUR)]" if(SSplants.plant_icon_cache[icon_key]) @@ -134,13 +134,13 @@ plant_icon = image('icons/obj/hydroponics_products.dmi',"blank") var/image/fruit_base = image('icons/obj/hydroponics_products.dmi',"[seed.get_trait(TRAIT_PRODUCT_ICON)]-product") fruit_base.color = "[seed.get_trait(TRAIT_PRODUCT_COLOUR)]" - plant_icon.overlays |= fruit_base + plant_icon.add_overlay(fruit_base) if("[seed.get_trait(TRAIT_PRODUCT_ICON)]-leaf" in icon_states('icons/obj/hydroponics_products.dmi')) var/image/fruit_leaves = image('icons/obj/hydroponics_products.dmi',"[seed.get_trait(TRAIT_PRODUCT_ICON)]-leaf") fruit_leaves.color = "[seed.get_trait(TRAIT_PLANT_COLOUR)]" - plant_icon.overlays |= fruit_leaves + plant_icon.add_overlay(fruit_leaves) SSplants.plant_icon_cache[icon_key] = plant_icon - overlays |= plant_icon + add_overlay(plant_icon) /obj/item/reagent_containers/food/snacks/grown/Crossed(var/mob/living/M) . = ..() @@ -346,6 +346,8 @@ var/list/fruit_icon_cache = list() name = "[S.seed_name] slice" desc = "A slice of \a [S.seed_name]. Tasty, probably." + var/list/overlays_to_add = list() + var/rind_colour = S.get_trait(TRAIT_PRODUCT_COLOUR) var/flesh_colour = S.get_trait(TRAIT_FLESH_COLOUR) if(!flesh_colour) flesh_colour = rind_colour @@ -353,9 +355,11 @@ var/list/fruit_icon_cache = list() var/image/I = image(icon,"fruit_rind") I.color = rind_colour fruit_icon_cache["rind-[rind_colour]"] = I - overlays |= fruit_icon_cache["rind-[rind_colour]"] + overlays_to_add += fruit_icon_cache["rind-[rind_colour]"] if(!fruit_icon_cache["slice-[rind_colour]"]) var/image/I = image(icon,"fruit_slice") I.color = flesh_colour fruit_icon_cache["slice-[rind_colour]"] = I - overlays |= fruit_icon_cache["slice-[rind_colour]"] + overlays_to_add += fruit_icon_cache["slice-[rind_colour]"] + + add_overlay(overlays_to_add) diff --git a/code/modules/hydroponics/seed_packets.dm b/code/modules/hydroponics/seed_packets.dm index 2f05829f47b..7993c97f50b 100644 --- a/code/modules/hydroponics/seed_packets.dm +++ b/code/modules/hydroponics/seed_packets.dm @@ -31,7 +31,9 @@ GLOBAL_LIST_BOILERPLATE(all_seed_packs, /obj/item/seeds) return // Update icon. - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + var/is_seeds = ((seed.seed_noun in list("seeds","pits","nodes")) ? 1 : 0) var/image/seed_mask var/seed_base_key = "base-[is_seeds ? seed.get_trait(TRAIT_PLANT_COLOUR) : "spores"]" @@ -52,8 +54,9 @@ GLOBAL_LIST_BOILERPLATE(all_seed_packs, /obj/item/seeds) seed_overlay.color = seed.get_trait(TRAIT_PRODUCT_COLOUR) plant_seed_sprites[seed_overlay_key] = seed_overlay - overlays |= seed_mask - overlays |= seed_overlay + overlays_to_add += seed_mask + overlays_to_add += seed_overlay + add_overlay(overlays_to_add) if(is_seeds) src.name = "packet of [seed.seed_name] [seed.seed_noun]" diff --git a/code/modules/hydroponics/seed_storage.dm b/code/modules/hydroponics/seed_storage.dm index 408c1f70cb2..eab86f4e5fe 100644 --- a/code/modules/hydroponics/seed_storage.dm +++ b/code/modules/hydroponics/seed_storage.dm @@ -408,9 +408,9 @@ panel_open = !panel_open to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.") playsound(src, O.tool_sound, 50, 1) - overlays.Cut() + cut_overlays() if(panel_open) - overlays += image(icon, "[initial(icon_state)]-panel") + add_overlay(image(icon, "[initial(icon_state)]-panel")) else if((O.is_wirecutter() || istype(O, /obj/item/multitool)) && panel_open) wires.Interact(user) diff --git a/code/modules/hydroponics/trays/tray_update_icons.dm b/code/modules/hydroponics/trays/tray_update_icons.dm index 538c7e2cdeb..e1a497e4ae4 100644 --- a/code/modules/hydroponics/trays/tray_update_icons.dm +++ b/code/modules/hydroponics/trays/tray_update_icons.dm @@ -12,12 +12,14 @@ if(labelled) name += " ([labelled])" - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + // Updates the plant overlay. if(!isnull(seed)) if(mechanical && health <= (seed.get_trait(TRAIT_ENDURANCE) / 2)) - overlays += "over_lowhealth3" + overlays_to_add += "over_lowhealth3" if(dead) var/ikey = "[seed.get_trait(TRAIT_PLANT_ICON)]-dead" @@ -25,12 +27,13 @@ if(!dead_overlay) dead_overlay = image('icons/obj/hydroponics_growing.dmi', "[ikey]") dead_overlay.color = DEAD_PLANT_COLOUR - overlays |= dead_overlay + overlays_to_add += dead_overlay else if(!seed.growth_stages) seed.update_growth_stages() if(!seed.growth_stages) to_chat(world, "Seed type [seed.get_trait(TRAIT_PLANT_ICON)] cannot find a growth stage value.") + add_overlay(overlays_to_add) return var/overlay_stage = 1 if(age >= seed.get_trait(TRAIT_MATURATION)) @@ -49,7 +52,7 @@ plant_overlay = image('icons/obj/hydroponics_growing.dmi', "[ikey]") plant_overlay.color = seed.get_trait(TRAIT_PLANT_COLOUR) SSplants.plant_icon_cache["[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"] = plant_overlay - overlays |= plant_overlay + overlays_to_add += plant_overlay if(harvest && overlay_stage == seed.growth_stages) ikey = "[seed.get_trait(TRAIT_PRODUCT_ICON)]" @@ -58,25 +61,27 @@ harvest_overlay = image('icons/obj/hydroponics_products.dmi', "[ikey]") harvest_overlay.color = seed.get_trait(TRAIT_PRODUCT_COLOUR) SSplants.plant_icon_cache["product-[ikey]-[seed.get_trait(TRAIT_PRODUCT_COLOUR)]"] = harvest_overlay - overlays |= harvest_overlay + overlays_to_add += harvest_overlay //Draw the cover. if(closed_system) - overlays += "hydrocover" + overlays_to_add += "hydrocover" //Updated the various alert icons. if(mechanical) if(waterlevel <= 10) - overlays += "over_lowwater3" + overlays_to_add += "over_lowwater3" if(nutrilevel <= 2) - overlays += "over_lownutri3" + overlays_to_add += "over_lownutri3" if(weedlevel >= 5 || pestlevel >= 5 || toxins >= 40) - overlays += "over_alert3" + overlays_to_add += "over_alert3" if(harvest) - overlays += "over_harvest3" + overlays_to_add += "over_harvest3" if(frozen) - overlays += "over_frozen3" + overlays_to_add += "over_frozen3" + + add_overlay(overlays_to_add) // Update bioluminescence. if(seed) diff --git a/code/modules/mining/mine_outcrops.dm b/code/modules/mining/mine_outcrops.dm index 2119c9106dc..988a35162de 100644 --- a/code/modules/mining/mine_outcrops.dm +++ b/code/modules/mining/mine_outcrops.dm @@ -14,7 +14,7 @@ /obj/structure/outcrop/Initialize(mapload) . = ..() if(prob(1)) - overlays += image(icon, "[initial(icon_state)]-egg") + add_overlay(image(icon, "[initial(icon_state)]-egg")) /obj/structure/outcrop/diamond name = "shiny outcrop" diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 00fe1d2d59e..d3e27bd4be0 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -789,7 +789,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(choice) icon = 'icons/mob/ghost.dmi' - overlays.Cut() + cut_overlays() if(icon_state && icon) previous_state = icon_state @@ -820,9 +820,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(PP.pai == null) count++ PP.icon = 'icons/obj/pda_vr.dmi' - PP.overlays += "pai-ghostalert" + PP.add_overlay("pai-ghostalert") spawn(54) - PP.overlays.Cut() + PP.cut_overlays() to_chat(usr,"Flashing the displays of [count] unoccupied PAIs.") else to_chat(usr,"You have 'Be pAI' disabled in your character prefs, so we can't help you.") diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index a1a2f6f71ee..6900cd96bcf 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -83,7 +83,7 @@ see_invisible = SEE_INVISIBLE_LEVEL_TWO if(healths) - healths.overlays = null // This is specific to humans but the relevant code is here; shouldn't mess with other mobs. + healths.cut_overlays() // This is specific to humans but the relevant code is here; shouldn't mess with other mobs. healths.icon_state = "health6" timeofdeath = world.time diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index b54f4a16d88..3f906f34203 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -67,19 +67,19 @@ var/obj/item/I = GetID() return I ? I.GetAccess() : ..() -/obj/item/holder/proc/sync(var/mob/living/M) +/obj/item/holder/proc/sync(mob/living/M) dir = SOUTH - overlays.len = 0 + cut_overlays() // appearance clone their ass var/mutable_appearance/MA = new MA.appearance = M MA.plane = plane MA.dir = SOUTH - // ok this was a bad idea + // ok this was a bad idea // todo: refactor holders entirely, we shouldn't be cloning mob state??? // icon = M.icon // legacy icon_state = M.icon_state // legacy - overlays += MA + add_overlay(MA) name = M.name desc = M.desc update_worn_icon() diff --git a/code/modules/mob/living/bot/mulebot.dm b/code/modules/mob/living/bot/mulebot.dm index e54d7046964..b1d964427c1 100644 --- a/code/modules/mob/living/bot/mulebot.dm +++ b/code/modules/mob/living/bot/mulebot.dm @@ -314,7 +314,7 @@ C.pixel_y += 9 if(C.layer < layer) C.layer = layer + 0.1 - overlays += C + add_overlay(C) busy = 0 diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index 7d9807ca3a5..90bb9025614 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -414,7 +414,7 @@ var/obj/item/secbot_assembly/Sa = new /obj/item/secbot_assembly(Tsec) Sa.build_step = 1 - Sa.overlays += image('icons/obj/aibots.dmi', "hs_hole") + Sa.add_overlay(image('icons/obj/aibots.dmi', "hs_hole")) Sa.created_name = name new /obj/item/assembly/prox_sensor(Tsec) new used_weapon(Tsec) @@ -485,7 +485,7 @@ var/obj/item/weldingtool/WT = W if(WT.remove_fuel(0, user)) build_step = 1 - overlays += image('icons/obj/aibots.dmi', "hs_hole") + add_overlay(image('icons/obj/aibots.dmi', "hs_hole")) to_chat(user, "You weld a hole in \the [src].") else if(isprox(W) && (build_step == 1)) @@ -493,7 +493,7 @@ return build_step = 2 to_chat(user, "You add \the [W] to [src].") - overlays += image('icons/obj/aibots.dmi', "hs_eye") + add_overlay(image('icons/obj/aibots.dmi', "hs_eye")) name = "helmet/signaler/prox sensor assembly" else if((istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm) || (istype(W, /obj/item/organ/external/arm) && ((W.name == "robotic right arm") || (W.name == "robotic left arm")))) && build_step == 2) @@ -502,7 +502,7 @@ build_step = 3 to_chat(user, "You add \the [W] to [src].") name = "helmet/signaler/prox sensor/robot arm assembly" - overlays += image('icons/obj/aibots.dmi', "hs_arm") + add_overlay(image('icons/obj/aibots.dmi', "hs_arm")) else if(istype(W, /obj/item/melee/baton) && build_step == 3) if(!user.attempt_insert_item_for_installation(W, src)) diff --git a/code/modules/mob/living/carbon/alien/diona/update_icons.dm b/code/modules/mob/living/carbon/alien/diona/update_icons.dm index 33a80b2a4ac..39f271f3514 100644 --- a/code/modules/mob/living/carbon/alien/diona/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/diona/update_icons.dm @@ -7,9 +7,9 @@ else icon_state = "[initial(icon_state)]" - overlays.Cut() + cut_overlays() if(hat) var/mutable_appearance/MA = hat.render_mob_appearance(src, SLOT_ID_HEAD) MA.pixel_x = 0 MA.pixel_y = -8 - overlays |= MA + add_overlay(MA) diff --git a/code/modules/mob/living/carbon/alien/update_icons.dm b/code/modules/mob/living/carbon/alien/update_icons.dm index 7bb90a4d9e2..a91445cc44a 100644 --- a/code/modules/mob/living/carbon/alien/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/update_icons.dm @@ -1,5 +1,5 @@ /mob/living/carbon/alien/regenerate_icons() - overlays = list() + cut_overlays() update_icons() /mob/living/carbon/alien/update_icons() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index fc530599258..33b70f6c914 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1254,12 +1254,18 @@ if(hurtdamage) var/severity = 0 switch(hurtdamage) - if(10 to 25) severity = 1 - if(25 to 40) severity = 2 - if(40 to 55) severity = 3 - if(55 to 70) severity = 4 - if(70 to 85) severity = 5 - if(85 to INFINITY) severity = 6 + if(10 to 25) + severity = 1 + if(25 to 40) + severity = 2 + if(40 to 55) + severity = 3 + if(55 to 70) + severity = 4 + if(70 to 85) + severity = 5 + if(85 to INFINITY) + severity = 6 overlay_fullscreen("brute", /atom/movable/screen/fullscreen/scaled/brute, severity) else clear_fullscreen("brute") @@ -1271,7 +1277,7 @@ // Generate a by-limb health display. var/mutable_appearance/healths_ma = new(healths) healths_ma.icon_state = "blank" - healths_ma.overlays = null + healths_ma.cut_overlays() healths_ma.plane = PLANE_PLAYER_HUD var/no_damage = 1 @@ -1300,62 +1306,93 @@ else if(no_damage) health_images += image('icons/mob/screen1_health.dmi',"fullhealth") - healths_ma.overlays += health_images + healths_ma.add_overlay(health_images) healths.appearance = healths_ma if(nutrition_icon) switch(nutrition/species.max_nutrition) - if(1 to INFINITY) nutrition_icon.icon_state = "nutrition0" - if(0.778 to 1) nutrition_icon.icon_state = "nutrition1" - if(0.556 to 0.778) nutrition_icon.icon_state = "nutrition2" - if(0.333 to 0.556) nutrition_icon.icon_state = "nutrition3" - else nutrition_icon.icon_state = "nutrition4" + if(1 to INFINITY) + nutrition_icon.icon_state = "nutrition0" + if(0.778 to 1) + nutrition_icon.icon_state = "nutrition1" + if(0.556 to 0.778) + nutrition_icon.icon_state = "nutrition2" + if(0.333 to 0.556) + nutrition_icon.icon_state = "nutrition3" + else + nutrition_icon.icon_state = "nutrition4" if(hydration_icon) switch(hydration) - if(450 to INFINITY) hydration_icon.icon_state = "hydration0" - if(350 to 450) hydration_icon.icon_state = "hydration1" - if(250 to 350) hydration_icon.icon_state = "hydration2" - if(150 to 250) hydration_icon.icon_state = "hydration3" - else hydration_icon.icon_state = "hydration4" + if(450 to INFINITY) + hydration_icon.icon_state = "hydration0" + if(350 to 450) + hydration_icon.icon_state = "hydration1" + if(250 to 350) + hydration_icon.icon_state = "hydration2" + if(150 to 250) + hydration_icon.icon_state = "hydration3" + else + hydration_icon.icon_state = "hydration4" if(synthbattery_icon) switch(nutrition) - if(350 to INFINITY) synthbattery_icon.icon_state = "charge4" - if(250 to 350) synthbattery_icon.icon_state = "charge3" - if(100 to 250) synthbattery_icon.icon_state = "charge2" - else synthbattery_icon.icon_state = "charge1" + if(350 to INFINITY) + synthbattery_icon.icon_state = "charge4" + if(250 to 350) + synthbattery_icon.icon_state = "charge3" + if(100 to 250) + synthbattery_icon.icon_state = "charge2" + else + synthbattery_icon.icon_state = "charge1" if(stat == DEAD) synthbattery_icon.icon_state = "charge0" if(pressure) pressure.icon_state = "pressure[pressure_alert]" -// if(rest) //Not used with new UI -// if(resting || lying || sleeping) rest.icon_state = "rest1" -// else rest.icon_state = "rest0" + // if(rest) //Not used with new UI + // if(resting || lying || sleeping) + // rest.icon_state = "rest1" + // else + // rest.icon_state = "rest0" if(toxin) - if(hal_screwyhud == 4 || (phoron_alert && !does_not_breathe)) toxin.icon_state = "tox1" - else toxin.icon_state = "tox0" + if(hal_screwyhud == 4 || (phoron_alert && !does_not_breathe)) + toxin.icon_state = "tox1" + else + toxin.icon_state = "tox0" if(oxygen) - if(hal_screwyhud == 3 || (oxygen_alert && !does_not_breathe)) oxygen.icon_state = "oxy1" - else oxygen.icon_state = "oxy0" + if(hal_screwyhud == 3 || (oxygen_alert && !does_not_breathe)) + oxygen.icon_state = "oxy1" + else + oxygen.icon_state = "oxy0" if(fire) - if(fire_alert) fire.icon_state = "fire[fire_alert]" //fire_alert is either 0 if no alert, 1 for cold and 2 for heat. - else fire.icon_state = "fire0" + if(fire_alert) + fire.icon_state = "fire[fire_alert]" //fire_alert is either 0 if no alert, 1 for cold and 2 for heat. + else + fire.icon_state = "fire0" if(bodytemp) if (!species) switch(bodytemperature) //310.055 optimal body temp - if(370 to INFINITY) bodytemp.icon_state = "temp4" - if(350 to 370) bodytemp.icon_state = "temp3" - if(335 to 350) bodytemp.icon_state = "temp2" - if(320 to 335) bodytemp.icon_state = "temp1" - if(300 to 320) bodytemp.icon_state = "temp0" - if(295 to 300) bodytemp.icon_state = "temp-1" - if(280 to 295) bodytemp.icon_state = "temp-2" - if(260 to 280) bodytemp.icon_state = "temp-3" - else bodytemp.icon_state = "temp-4" + if(370 to INFINITY) + bodytemp.icon_state = "temp4" + if(350 to 370) + bodytemp.icon_state = "temp3" + if(335 to 350) + bodytemp.icon_state = "temp2" + if(320 to 335) + bodytemp.icon_state = "temp1" + if(300 to 320) + bodytemp.icon_state = "temp0" + if(295 to 300) + bodytemp.icon_state = "temp-1" + if(280 to 295) + bodytemp.icon_state = "temp-2" + if(260 to 280) + bodytemp.icon_state = "temp-3" + else + bodytemp.icon_state = "temp-4" else //TODO: precalculate all of this stuff when the species datum is created var/base_temperature = species.body_temperature diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index bacbe0f7e2b..078b6fc279e 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -151,7 +151,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) else DI = GLOB.damage_icon_parts[cache_index] - standing_image.overlays += DI + standing_image.add_overlay(DI) overlays_standing[DAMAGE_LAYER] = standing_image apply_layer(DAMAGE_LAYER) @@ -1046,7 +1046,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) for(var/datum/modifier/M in modifiers) if(M.mob_overlay_state) var/image/I = image(icon = 'icons/mob/modifier_effects.dmi', icon_state = M.mob_overlay_state) - effects.overlays += I //TODO, this compositing is annoying. + effects.add_overlay(I) //TODO, this compositing is annoying. overlays_standing[MODIFIER_EFFECTS_LAYER] = effects @@ -1128,7 +1128,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) for(var/obj/item/organ/external/E in organs) if(E.open) var/image/I = image(icon = 'icons/mob/surgery.dmi', icon_state = "[E.icon_name][round(E.open)]", layer = BODY_LAYER+SURGERY_LAYER) - total.overlays += I //TODO: This compositing is annoying + total.add_overlay(I) //TODO: This compositing is annoying if(total.overlays.len) overlays_standing[SURGERY_LAYER] = total diff --git a/code/modules/mob/living/carbon/metroid/update_icons.dm b/code/modules/mob/living/carbon/metroid/update_icons.dm index 83abd98dcaa..416579d4d55 100644 --- a/code/modules/mob/living/carbon/metroid/update_icons.dm +++ b/code/modules/mob/living/carbon/metroid/update_icons.dm @@ -3,7 +3,7 @@ icon_state = "[colour] baby slime dead" else icon_state = "[colour] [is_adult ? "adult" : "baby"] slime[Victim ? "" : " eat"]" - overlays.len = 0 + cut_overlays() if (mood) - overlays += image('icons/mob/slimes.dmi', icon_state = "aslime-[mood]") + add_overlay(image('icons/mob/slimes.dmi', icon_state = "aslime-[mood]")) ..() diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 320f2e867de..0f882d1ce53 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -152,16 +152,19 @@ /mob/living/silicon/robot/drone/updateicon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(stat == 0) - overlays += "eyes-[icon_state]" + overlays_to_add += "eyes-[icon_state]" else - overlays -= "eyes" + overlays_to_add -= "eyes" if(hat) // Let the drones wear hats. var/mutable_appearance/MA = hat.render_mob_appearance(src, SLOT_ID_HEAD, BODYTYPE_DEFAULT) MA.pixel_x = hat_x_offset MA.pixel_y = hat_y_offset - overlays |= MA + overlays_to_add += MA + + add_overlay(overlays_to_add) /mob/living/silicon/robot/drone/choose_icon() return diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 693d86b6724..3ea192642ef 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -319,9 +319,9 @@ return canmove /mob/living/silicon/robot/update_fire() - overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state" = get_fire_icon_state()) + cut_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state" = get_fire_icon_state())) if(on_fire) - overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state" = get_fire_icon_state()) + add_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state" = get_fire_icon_state())) /mob/living/silicon/robot/fire_act() if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index 9939f083cc4..a9ecbb21c63 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -211,7 +211,7 @@ I.loc = src carrying.Add(I) - overlays += image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = 30 + I.layer) + add_overlay(image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = 30 + I.layer)) addedSomething = 1 if ( addedSomething ) user.visible_message("[user] loads some items onto their service tray.") @@ -237,7 +237,7 @@ dropspot = target.loc - overlays = null + cut_overlays() var droppedSomething = 0 diff --git a/code/modules/mob/living/silicon/robot/subtypes/gravekeeper.dm b/code/modules/mob/living/silicon/robot/subtypes/gravekeeper.dm index 2054786913a..e10d1039fd5 100644 --- a/code/modules/mob/living/silicon/robot/subtypes/gravekeeper.dm +++ b/code/modules/mob/living/silicon/robot/subtypes/gravekeeper.dm @@ -23,7 +23,7 @@ mmi = new /obj/item/mmi/digital/robot(src) // Explicitly a drone. module = new /obj/item/robot_module/robot/gravekeeper(src) - overlays.Cut() + cut_overlays() init_id() updatename("Gravekeeper") diff --git a/code/modules/mob/living/silicon/robot/subtypes/lost_drone.dm b/code/modules/mob/living/silicon/robot/subtypes/lost_drone.dm index 2978be28f9d..faa65999cd1 100644 --- a/code/modules/mob/living/silicon/robot/subtypes/lost_drone.dm +++ b/code/modules/mob/living/silicon/robot/subtypes/lost_drone.dm @@ -23,7 +23,7 @@ mmi = new /obj/item/mmi/digital/robot(src) // Explicitly a drone. module = new /obj/item/robot_module/robot/lost(src) - overlays.Cut() + cut_overlays() init_id() updatename("Lost") diff --git a/code/modules/mob/living/silicon/robot/subtypes/lost_drone_vr.dm b/code/modules/mob/living/silicon/robot/subtypes/lost_drone_vr.dm index def157d600f..a62ffa4d392 100644 --- a/code/modules/mob/living/silicon/robot/subtypes/lost_drone_vr.dm +++ b/code/modules/mob/living/silicon/robot/subtypes/lost_drone_vr.dm @@ -23,7 +23,7 @@ mmi = new /obj/item/mmi/digital/robot(src) // Explicitly a drone. module = new /obj/item/robot_module/robot/stray(src) - overlays.Cut() + cut_overlays() init_id() updatename("Stray") diff --git a/code/modules/mob/living/silicon/robot/subtypes/syndicate.dm b/code/modules/mob/living/silicon/robot/subtypes/syndicate.dm index a109841d26b..f227ad97b0a 100644 --- a/code/modules/mob/living/silicon/robot/subtypes/syndicate.dm +++ b/code/modules/mob/living/silicon/robot/subtypes/syndicate.dm @@ -24,7 +24,7 @@ aiCamera = new/obj/item/camera/siliconcam/robot_camera(src) mmi = new /obj/item/mmi/digital/robot(src) // Explicitly a drone. - overlays.Cut() + cut_overlays() init_id() updatename("Syndicate") diff --git a/code/modules/mob/living/silicon/robot/syndicate.dm b/code/modules/mob/living/silicon/robot/syndicate.dm index e8eb5853e8d..4c3a1dc1b56 100644 --- a/code/modules/mob/living/silicon/robot/syndicate.dm +++ b/code/modules/mob/living/silicon/robot/syndicate.dm @@ -17,7 +17,7 @@ aiCamera = new/obj/item/camera/siliconcam/robot_camera(src) laws = new /datum/ai_laws/syndicate_override - overlays.Cut() + cut_overlays() init_id() new /obj/item/robot_module/robot/syndicate(src) diff --git a/code/modules/mob/living/simple_animal/constructs/constructs.dm b/code/modules/mob/living/simple_animal/constructs/constructs.dm index 200a06565f9..3c079894cc4 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs.dm @@ -120,7 +120,7 @@ updateicon() /mob/living/simple_animal/construct/updateicon() - overlays.Cut() + cut_overlays() ..() if(do_glow) add_glow() @@ -428,11 +428,11 @@ /mob/living/simple_animal/construct/proc/add_glow() var/image/eye_glow = image(icon,"glow-[icon_state]") eye_glow.plane = ABOVE_LIGHTING_PLANE - overlays += eye_glow + add_overlay(eye_glow) set_light(2, -2, l_color = "#FFFFFF") /mob/living/simple_animal/construct/proc/remove_glow() - overlays.Cut() + cut_overlays() ////////////////HUD////////////////////// diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index e95f02c75b6..b6817ef7bec 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -167,20 +167,21 @@ else icon_state = "[icon_state_override ? "[icon_state_override] slime" : "slime"] [is_adult ? "adult" : "baby"][victim ? " eating":""]" - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(stat != DEAD) var/image/I = image(icon, src, "slime light") I.appearance_flags = RESET_COLOR - overlays += I + overlays_to_add += I if(shiny) I = image(icon, src, "slime shiny") I.appearance_flags = RESET_COLOR - overlays += I + overlays_to_add += I I = image(icon, src, "aslime-[mood]") I.appearance_flags = RESET_COLOR - overlays += I + overlays_to_add += I if(glows) set_light(3, 2, color) @@ -190,10 +191,12 @@ var/image/I = image('icons/mob/head.dmi', src, hat_state) I.pixel_y = -7 // Slimes are small. I.appearance_flags = RESET_COLOR - overlays += I + overlays_to_add += I if(modifier_overlay) // Restore our modifier overlay. - overlays += modifier_overlay + overlays_to_add += modifier_overlay + + add_overlay(overlays_to_add) /mob/living/simple_animal/slime/proc/update_mood() var/old_mood = mood diff --git a/code/modules/mob/living/simple_mob/appearance.dm b/code/modules/mob/living/simple_mob/appearance.dm index 27c9eccae35..c14f12c7b83 100644 --- a/code/modules/mob/living/simple_mob/appearance.dm +++ b/code/modules/mob/living/simple_mob/appearance.dm @@ -41,7 +41,7 @@ // appearance = ma -// If your simple mob's update_icon() call calls overlays.Cut(), this needs to be called after this, or manually apply modifier_overly to overlays. +// If your simple mob's update_icon() call calls cut_overlays(), this needs to be called after this, or manually apply modifier_overly to overlays. /mob/living/simple_mob/update_modifier_visuals() var/image/effects = null if(modifier_overlay) diff --git a/code/modules/mob/living/simple_mob/simple_hud.dm b/code/modules/mob/living/simple_mob/simple_hud.dm index f32d1d704df..ea4d31871ce 100644 --- a/code/modules/mob/living/simple_mob/simple_hud.dm +++ b/code/modules/mob/living/simple_mob/simple_hud.dm @@ -214,8 +214,8 @@ zone_sel.icon = ui_style zone_sel.color = ui_color zone_sel.alpha = ui_alpha - zone_sel.overlays.Cut() - zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[zone_sel.selecting]") + zone_sel.cut_overlays() + zone_sel.add_overlay(image('icons/mob/zone_sel.dmi', "[zone_sel.selecting]")) hud_elements |= zone_sel //Hand things diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/passive/fish.dm b/code/modules/mob/living/simple_mob/subtypes/animal/passive/fish.dm index 8042451f428..442a60fc06d 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/passive/fish.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/passive/fish.dm @@ -212,7 +212,7 @@ update_icon() /mob/living/simple_mob/animal/passive/fish/icebass/update_icon() - overlays.Cut() + cut_overlays() ..() if(!dorsal_image) dorsal_image = image(icon, "[icon_state]_mask-body") @@ -221,9 +221,10 @@ dorsal_image.color = dorsal_color belly_image.color = belly_color - - overlays += dorsal_image - overlays += belly_image + var/list/overlays_to_add = list() + overlays_to_add += dorsal_image + overlays_to_add += belly_image + add_overlay(overlays_to_add) /datum/category_item/catalogue/fauna/rockfish name = "Sivian Fauna - Rock Puffer" @@ -280,14 +281,14 @@ head_color = rgb(rand(min_red,max_red), rand(min_green,max_green), rand(min_blue,max_blue)) /mob/living/simple_mob/animal/passive/fish/rockfish/update_icon() - overlays.Cut() + cut_overlays() ..() if(!head_image) head_image = image(icon, "[icon_state]_mask") head_image.color = head_color - overlays += head_image + add_overlay(head_image) /datum/category_item/catalogue/fauna/solarfish name = "Sivian Fauna - Solar Fin" diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat_vr.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat_vr.dm index 362baa55d9a..f86822527a9 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat_vr.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat_vr.dm @@ -75,11 +75,10 @@ //Emergency teleport - Until a spriter makes something better /mob/living/simple_mob/animal/passive/cat/tabiranth/death(gibbed, deathmessage = "teleports away!") - overlays = list() + cut_overlays() icon_state = "" flick("kphaseout",src) spawn(1 SECOND) qdel(src) //Back from whence you came! . = ..(FALSE, deathmessage) - diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/dog.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/dog.dm index 38e722ca4f2..fe00122ced4 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/dog.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/dog.dm @@ -54,7 +54,7 @@ ..() /mob/living/simple_mob/animal/passive/dog/regenerate_icons() - overlays = list() + cut_overlays() if(inventory_head) var/head_icon_state = inventory_head.icon_state @@ -63,7 +63,7 @@ var/icon/head_icon = image('icons/mob/corgi_head.dmi',head_icon_state) if(head_icon) - overlays += head_icon + add_overlay(head_icon) if(inventory_back) var/back_icon_state = inventory_back.icon_state @@ -72,7 +72,7 @@ var/icon/back_icon = image('icons/mob/corgi_back.dmi',back_icon_state) if(back_icon) - overlays += back_icon + add_overlay(back_icon) return diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/racoon.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/racoon.dm index 7b9bde2ceb5..ebb1799fc27 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/racoon.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/racoon.dm @@ -144,7 +144,7 @@ ..() /mob/living/simple_mob/animal/sif/sakimm/update_icon() - overlays.Cut() + cut_overlays() ..() if(hat) var/mutable_appearance/MA = hat.render_mob_appearance(src, SLOT_ID_HEAD, BODYTYPE_STRING_DEFAULT) diff --git a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/_construct.dm b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/_construct.dm index fc3a8cb80b8..37d43e77c34 100644 --- a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/_construct.dm +++ b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/_construct.dm @@ -183,8 +183,8 @@ /mob/living/simple_mob/construct/proc/add_glow() var/image/eye_glow = image(icon,"glow-[icon_state]") eye_glow.plane = ABOVE_LIGHTING_PLANE - overlays += eye_glow + add_overlay(eye_glow) set_light(2, -2, l_color = "#FFFFFF") /mob/living/simple_mob/construct/proc/remove_glow() - overlays.Cut() + cut_overlays() diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities.dm b/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities.dm index 866952b6ba7..9f14b5e0892 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities.dm @@ -36,7 +36,7 @@ var/obj/belly/B = belly B.escapable = initial(B.escapable) - overlays.Cut() + cut_overlays() alpha = initial(alpha) invisibility = initial(invisibility) see_invisible = initial(see_invisible) @@ -93,7 +93,7 @@ var/obj/belly/B = belly B.escapable = FALSE - overlays.Cut() + cut_overlays() flick("phaseout",src) sleep(30) invisibility = INVISIBILITY_LEVEL_TWO @@ -149,7 +149,7 @@ var/obj/belly/B = belly B.escapable = FALSE - overlays.Cut() + cut_overlays() flick("phaseout",src) sleep(30) invisibility = INVISIBILITY_LEVEL_TWO @@ -170,7 +170,7 @@ var/obj/belly/B = belly B.escapable = initial(B.escapable) - overlays.Cut() + cut_overlays() alpha = initial(alpha) invisibility = initial(invisibility) see_invisible = initial(see_invisible) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm index 4251b00c900..6d6da467b68 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm @@ -135,7 +135,7 @@ icon_state = initial(icon_state) size_multiplier = 0 resize(our_size_multiplier) - overlays.Cut() + cut_overlays() density = initial(density) //Baseline stats diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm index 8825103b197..9bfd153c1c9 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm @@ -25,7 +25,7 @@ var/obj/belly/B = belly B.escapable = initial(B.escapable) - overlays.Cut() + cut_overlays() alpha = initial(alpha) invisibility = initial(invisibility) see_invisible = initial(see_invisible) @@ -80,7 +80,7 @@ var/obj/belly/B = belly B.escapable = FALSE - overlays.Cut() + cut_overlays() flick("tp_out",src) sleep(5) invisibility = INVISIBILITY_LEVEL_TWO diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm index bb8e3a71828..3fb1ae6d9ab 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm @@ -226,7 +226,7 @@ //They phase back to the dark when killed /mob/living/simple_mob/shadekin/death(gibbed, deathmessage = "phases to somewhere far away!") - overlays = list() + cut_overlays() icon_state = "" flick("tp_out",src) spawn(1 SECOND) diff --git a/code/modules/mob/living/voice/voice.dm b/code/modules/mob/living/voice/voice.dm index ee833a494e0..66756a497df 100644 --- a/code/modules/mob/living/voice/voice.dm +++ b/code/modules/mob/living/voice/voice.dm @@ -22,7 +22,7 @@ if(ismob(speaker)) icon = speaker.icon icon_state = speaker.icon_state - overlays = speaker.overlays + copy_overlays(speaker) timeofdeath = speaker.timeofdeath alpha = 127 //Maybe we'll have hologram calls later. diff --git a/code/modules/modular_computers/computers/modular_computer/core.dm b/code/modules/modular_computers/computers/modular_computer/core.dm index d6101840e56..049013530c1 100644 --- a/code/modules/modular_computers/computers/modular_computer/core.dm +++ b/code/modules/modular_computers/computers/modular_computer/core.dm @@ -71,22 +71,25 @@ /obj/item/modular_computer/update_icon() icon_state = icon_state_unpowered - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(bsod) - overlays.Add("bsod") + add_overlay("bsod") return if(!enabled) if(icon_state_screensaver) - overlays.Add(icon_state_screensaver) + add_overlay(icon_state_screensaver) set_light(0) return set_light(light_strength) if(active_program) - overlays.Add(active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu) + overlays_to_add.Add(active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu) if(active_program.program_key_state) - overlays.Add(active_program.program_key_state) + overlays_to_add.Add(active_program.program_key_state) else - overlays.Add(icon_state_menu) + overlays_to_add.Add(icon_state_menu) + + add_overlay(overlays_to_add) /obj/item/modular_computer/proc/turn_on(mob/user) if(bsod) diff --git a/code/modules/modular_computers/computers/subtypes/dev_laptop.dm b/code/modules/modular_computers/computers/subtypes/dev_laptop.dm index b7d6dc4802c..c417eac71be 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_laptop.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_laptop.dm @@ -39,7 +39,7 @@ if(anchored) ..() else - overlays.Cut() + cut_overlays() set_light(0) // No glow from closed laptops icon_state = icon_state_closed diff --git a/code/modules/multiz/turf.dm b/code/modules/multiz/turf.dm index 2baf2c7a352..6804c9dc390 100644 --- a/code/modules/multiz/turf.dm +++ b/code/modules/multiz/turf.dm @@ -214,14 +214,15 @@ * Update icon and overlays of open space to be that of the turf below, plus any visible objects on that turf. */ /turf/simulated/open/update_icon() - overlays.len = 0 + cut_overlays() + var/turf/below = GetBelow(src) if(below) var/below_is_open = isopenturf(below) if(below_is_open) underlays = below.underlays - overlays = below.overlays + copy_overlays(below) else var/image/bottom_turf = image(icon = below.icon, icon_state = below.icon_state, dir=below.dir, layer=below.layer) bottom_turf.plane = src.plane @@ -234,15 +235,17 @@ // Get objects (not mobs, they are handled by /obj/zshadow) var/list/o_img = list() for(var/obj/O in below) - if(O.invisibility) continue // Ignore objects that have any form of invisibility - if(O.loc != below) continue // Ignore multi-turf objects not directly below + if(O.invisibility) + continue // Ignore objects that have any form of invisibility + if(O.loc != below) + continue // Ignore multi-turf objects not directly below var/image/temp2 = image(O, dir = O.dir, layer = O.layer) temp2.plane = src.plane temp2.color = O.color - temp2.overlays += O.overlays + temp2.add_overlay(O.overlays) // TODO Is pixelx/y needed? o_img += temp2 - overlays += o_img + add_overlay(o_img) overlays |= /obj/effect/abstract/over_openspace_darkness return return PROCESS_KILL diff --git a/code/modules/multiz/zshadow.dm b/code/modules/multiz/zshadow.dm index 7ed6e481005..2c808f996aa 100644 --- a/code/modules/multiz/zshadow.dm +++ b/code/modules/multiz/zshadow.dm @@ -61,7 +61,7 @@ icon_state = M.icon_state //color = M.color color = "#848484" - overlays = M.overlays + copy_overlays(M) transform = M.transform dir = M.dir invisibility = M.invisibility @@ -126,10 +126,10 @@ typing_indicator.icon = 'icons/mob/talk_vr.dmi' typing_indicator.icon_state = "typing" if(state && !typing) - overlays += typing_indicator + add_overlay(typing_indicator) typing = 1 else if(!state && typing) - overlays -= typing_indicator + cut_overlay(typing_indicator) typing = 0 if(shadow) shadow.set_typing_indicator(state) diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index 9f88b94ddf0..4fe1b549a9c 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -542,7 +542,7 @@ dummy.alpha = 192 // remove hudlist - dummy.overlays -= dummy.hud_list + dummy.cut_overlay(dummy.hud_list) // appearance clone immediately appearance = dummy.appearance plane = PLANE_AUGMENTED diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 65732bdc4d6..4267d9a392d 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -367,7 +367,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5 var/obj/effect/debris/cleanable/blood/drip/drop = B if(istype(drop) && drips && drips.len && !large) - drop.overlays |= drips + drop.add_overlay(drips) drop.drips |= drips // If there's no data to copy, call it quits here. diff --git a/code/modules/organs/external/_external_icons.dm b/code/modules/organs/external/_external_icons.dm index 6841a47add5..46519ac9a03 100644 --- a/code/modules/organs/external/_external_icons.dm +++ b/code/modules/organs/external/_external_icons.dm @@ -6,7 +6,7 @@ GLOBAL_LIST_EMPTY(limb_icon_cache) for(var/obj/item/organ/external/organ in contents) if(organ.children && organ.children.len) for(var/obj/item/organ/external/child in organ.children) - overlays += child.mob_icon + add_overlay(child.mob_icon) add_overlay(organ.mob_icon) /obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human) diff --git a/code/modules/organs/external/standard_vr.dm b/code/modules/organs/external/standard_vr.dm index f9dd58d46e5..33ad5c1ddaf 100644 --- a/code/modules/organs/external/standard_vr.dm +++ b/code/modules/organs/external/standard_vr.dm @@ -3,15 +3,17 @@ /// For custom heads with custom parts since the base code is restricted to a single icon file. /obj/item/organ/external/head/vr/get_icon() ..() - overlays.Cut() + cut_overlays() if(!owner || !owner.species) return + var/list/overlays_to_add = list() + for(var/M in markings) var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"] var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]") mark_s.Blend(markings[M]["color"], mark_style.color_blend_mode) - overlays |= mark_s //So when it's not on your body, it has icons + overlays_to_add.Add(mark_s) //So when it's not on your body, it has icons mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons icon_cache_key += "[M][markings[M]["color"]]" @@ -25,11 +27,11 @@ else eyes_icon.Blend(rgb(128,0,0), ICON_ADD) mob_icon.Blend(eyes_icon, ICON_OVERLAY) - overlays |= eyes_icon + overlays_to_add.Add(eyes_icon) if(owner.lip_style && (species && (species.species_appearance_flags & HAS_LIPS))) var/icon/lip_icon = new/icon('icons/mob/human_face.dmi', "lips_[owner.lip_style]_s") - overlays |= lip_icon + overlays_to_add.Add(lip_icon) mob_icon.Blend(lip_icon, ICON_OVERLAY) if(owner.f_style) @@ -38,7 +40,7 @@ var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s") if(facial_hair_style.do_colouration) facial_s.Blend(rgb(owner.r_facial, owner.g_facial, owner.b_facial), ICON_ADD) - overlays |= image(facial_s, "pixel_y" = head_offset) + overlays_to_add.Add(image(facial_s, "pixel_y" = head_offset)) if(owner.h_style && !(owner.head && (owner.head.flags_inv & BLOCKHEADHAIR))) var/datum/sprite_accessory/hair_style = GLOB.legacy_hair_lookup[owner.h_style] @@ -46,7 +48,10 @@ var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s") if(hair_style.do_colouration && islist(h_col) && h_col.len >= 3) hair_s.Blend(rgb(h_col[1], h_col[2], h_col[3]), ICON_MULTIPLY) - overlays |= image(hair_s, "pixel_y" = head_offset) + overlays_to_add.Add(image(hair_s, "pixel_y" = head_offset)) + + add_overlay(overlays_to_add) + return mob_icon /obj/item/organ/external/head/vr diff --git a/code/modules/overmap/overmap_object.dm b/code/modules/overmap/overmap_object.dm index 0037ec8e4a9..e622281c5fe 100644 --- a/code/modules/overmap/overmap_object.dm +++ b/code/modules/overmap/overmap_object.dm @@ -48,7 +48,7 @@ if(isnull(parallax_image_holder)) return parallax_image_holder.layer = PARALLAX_PLANE - parallax_image_holder.overlays = list(I) + parallax_image_holder.add_overlay(I) return parallax_image_holder //Overlay of how this object should look on other skyboxes diff --git a/code/modules/overmap/overmap_planet.dm b/code/modules/overmap/overmap_planet.dm index bee2a5c53cd..38b749da6b6 100644 --- a/code/modules/overmap/overmap_planet.dm +++ b/code/modules/overmap/overmap_planet.dm @@ -22,29 +22,31 @@ /obj/effect/overmap/visitable/planet/get_skybox_representation() var/image/skybox_image = image('icons/skybox/planet.dmi', "") - skybox_image.overlays += get_base_image() + var/list/overlays_to_add = list() + + overlays_to_add += (get_base_image()) // for(var/datum/exoplanet_theme/theme in themes) -// skybox_image.overlays += theme.get_planet_image_extra() +// overlays_to_add += theme.get_planet_image_extra() if(mountain_color) var/image/mountains = image('icons/skybox/planet.dmi', "mountains") mountains.color = mountain_color mountains.appearance_flags = PIXEL_SCALE - skybox_image.overlays += mountains + overlays_to_add += mountains if(water_color) var/image/water = image('icons/skybox/planet.dmi', "water") water.color = water_color water.appearance_flags = PIXEL_SCALE // water.transform = water.transform.Turn(rand(0,360)) - skybox_image.overlays += water + overlays_to_add += water if(icecaps) var/image/ice = image('icons/skybox/planet.dmi', icecaps) ice.color = ice_color ice.appearance_flags = PIXEL_SCALE - skybox_image.overlays += ice + overlays_to_add += ice if(atmosphere && atmosphere.return_pressure() > SOUND_MINIMUM_PRESSURE) @@ -55,20 +57,20 @@ var/image/clouds = image('icons/skybox/planet.dmi', "weak_clouds") if(water_color) - clouds.overlays += image('icons/skybox/planet.dmi', "clouds") + clouds.add_overlay(image('icons/skybox/planet.dmi', "clouds")) clouds.color = atmo_color - skybox_image.overlays += clouds + overlays_to_add += clouds var/image/atmo = image('icons/skybox/planet.dmi', "atmoring") skybox_image.underlays += atmo var/image/shadow = image('icons/skybox/planet.dmi', "shadow") shadow.blend_mode = BLEND_MULTIPLY - skybox_image.overlays += shadow + overlays_to_add += shadow var/image/light = image('icons/skybox/planet.dmi', "lightrim") - skybox_image.overlays += light + overlays_to_add += light if(has_rings) var/image/rings = image('icons/skybox/planet_rings.dmi') @@ -79,7 +81,9 @@ rings.color = ring_color rings.pixel_x = -128 rings.pixel_y = -128 - skybox_image.overlays += rings + overlays_to_add += rings + + skybox_image.add_overlay(overlays_to_add) skybox_image.pixel_x = rand(0,64) + skybox_offset_x skybox_image.pixel_y = rand(128,256) + skybox_offset_y diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index b17c0048a80..896ade6120f 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -16,13 +16,17 @@ update_icon() /obj/item/clipboard/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(toppaper) - overlays += toppaper.icon_state - overlays += toppaper.overlays + overlays_to_add += toppaper.icon_state + overlays_to_add += copy_overlays(toppaper) if(haspen) - overlays += "clipboard_pen" - overlays += "clipboard_over" + overlays_to_add += "clipboard_pen" + overlays_to_add += "clipboard_over" + + add_overlay(overlays_to_add) + return /obj/item/clipboard/attackby(obj/item/W as obj, mob/user as mob) diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index ce0731745fd..94c0aea5ce6 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -57,9 +57,9 @@ icon_state = "folder_hos" /obj/item/folder/update_icon() - overlays.Cut() + cut_overlays() if(contents.len) - overlays += "folder_paper" + add_overlay("folder_paper") return /obj/item/folder/attackby(obj/item/W as obj, mob/user as mob) diff --git a/code/modules/paperwork/paper/paper.dm b/code/modules/paperwork/paper/paper.dm index fc6d7c74531..d01e706333b 100644 --- a/code/modules/paperwork/paper/paper.dm +++ b/code/modules/paperwork/paper/paper.dm @@ -235,7 +235,7 @@ stamps = null free_space = MAX_PAPER_MESSAGE_LEN stamped = list() - overlays.Cut() + cut_overlays() updateinfolinks() update_icon() @@ -507,7 +507,7 @@ if(!stamped) stamped = new stamped += P.type - overlays += stampoverlay + add_overlay(stampoverlay) to_chat(user, "You stamp the paper with your rubber stamp.") diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index 91cb0f8937a..475bbb54b8a 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -211,7 +211,7 @@ /obj/item/paper_bundle/update_icon() var/obj/item/paper/P = pages[1] icon_state = P.icon_state - overlays = P.overlays + copy_overlays(P) underlays = 0 var/i = 0 var/photo @@ -229,12 +229,12 @@ var/obj/item/photo/Ph = O img = Ph.tiny photo = 1 - overlays += img + add_overlay(img) if(i>1) desc = "[i] papers clipped to each other." else desc = "A single sheet of paper." if(photo) desc += "\nThere is a photo attached to it." - overlays += image('icons/obj/bureaucracy.dmi', "clip") + add_overlay(image('icons/obj/bureaucracy.dmi', "clip")) return diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index 31071594f9c..bcdb4f8ddbb 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -35,7 +35,9 @@ return ..() /obj/item/paperplane/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + var/list/stamped = internalPaper.stamped if(!stamped) stamped = new @@ -43,7 +45,9 @@ for(var/S in stamped) var/obj/item/stamp/ = S var/image/stampoverlay = image('icons/obj/bureaucracy.dmi', "paperplane_[initial(stamp.icon_state)]") - overlays += stampoverlay + overlays_to_add.Add(stampoverlay) + + add_overlay(overlays_to_add) /obj/item/paperplane/attack_self(mob/user) to_chat(user, "You unfold [src].") diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index 58b584ba91d..87a910afa8d 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -131,15 +131,19 @@ update_icon() /obj/machinery/papershredder/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + if(operable()) icon_state = "shredder-on" else icon_state = "shredder-off" // Fullness overlay - overlays += "shredder-[max(0,min(5,FLOOR(paperamount/max_paper*5, 1)))]" + overlays_to_add += "shredder-[max(0,min(5,FLOOR(paperamount/max_paper*5, 1)))]" if (panel_open) - overlays += "panel_open" + overlays_to_add += "panel_open" + + add_overlay(overlays_to_add) // // Shredded Paper Item diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 1e8bef00fc4..ea78ccf24a8 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -220,7 +220,7 @@ c.ico = copy.ico c.offset_x = copy.offset_x c.offset_y = copy.offset_y - var/list/temp_overlays = copy.overlays //Iterates through stamps + var/list/temp_overlays = copy_overlays(copy) //Iterates through stamps var/image/img //and puts a matching for (var/j = 1, j <= min(temp_overlays.len, copy.ico.len), j++) //gray overlay onto the copy if (findtext(copy.ico[j], "cap") || findtext(copy.ico[j], "cent")) @@ -231,7 +231,7 @@ img = image('icons/obj/bureaucracy.dmi', "paper_stamp-dots") img.pixel_x = copy.offset_x[j] img.pixel_y = copy.offset_y[j] - c.overlays += img + c.add_overlay(img) c.updateinfolinks() if(need_toner) toner-- diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm index 15864fab948..c5946f5832b 100644 --- a/code/modules/power/antimatter/shielding.dm +++ b/code/modules/power/antimatter/shielding.dm @@ -106,17 +106,22 @@ /obj/machinery/am_shielding/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + for(var/direction in GLOB.alldirs) var/machine = locate(/obj/machinery, get_step(loc, direction)) if((istype(machine, /obj/machinery/am_shielding) && machine:control_unit == control_unit)||(istype(machine, /obj/machinery/power/am_control_unit) && machine == control_unit)) - overlays += "shield_[direction]" + overlays_to_add += "shield_[direction]" if(core_check()) - overlays += "core" - if(!processing) setup_core() - else if(processing) shutdown_core() + overlays_to_add += "core" + if(!processing) + setup_core() + else if(processing) + shutdown_core() + add_overlay(overlays_to_add) /obj/machinery/am_shielding/attackby(obj/item/W, mob/user) if(!istype(W) || !user) return diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 79c9bcf1c3c..88cb355b2d0 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -516,19 +516,22 @@ GLOBAL_LIST_EMPTY(apcs) if(!(update_state & UPDATE_ALLGOOD)) if(overlays.len) - overlays = 0 + cut_overlays() return if(update & 2) if(overlays.len) - overlays.len = 0 + cut_overlays() if(!(machine_stat & (BROKEN|MAINT)) && update_state & UPDATE_ALLGOOD) - overlays += status_overlays_lock[locked+1] - overlays += status_overlays_charging[charging+1] + var/list/overlays_to_add = list() + overlays_to_add += status_overlays_lock[locked+1] + overlays_to_add += status_overlays_charging[charging+1] if(operating) - overlays += status_overlays_equipment[equipment+1] - overlays += status_overlays_lighting[lighting+1] - overlays += status_overlays_environ[environ+1] + overlays_to_add += status_overlays_equipment[equipment+1] + overlays_to_add += status_overlays_lighting[lighting+1] + overlays_to_add += status_overlays_environ[environ+1] + + add_overlay(overlays_to_add) if(update & 3) if(update_state & UPDATE_BLUESCREEN) diff --git a/code/modules/power/cells/power_cells.dm b/code/modules/power/cells/power_cells.dm index 62a8255385f..be9df145020 100644 --- a/code/modules/power/cells/power_cells.dm +++ b/code/modules/power/cells/power_cells.dm @@ -117,12 +117,12 @@ . = ..() -/obj/item/fbp_backup_cell/proc/use(var/mob/living/user, var/mob/living/target) +/obj/item/fbp_backup_cell/proc/use(mob/living/user, mob/living/target) if(used) return used = TRUE desc += " This one has already been used." - overlays.Cut() + cut_overlays() target.nutrition += amount user.custom_emote(message = "connects \the [src] to [user == target ? "their" : "[target]'s"] charging port, expending it.") diff --git a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm index 2d37f317a23..5e69be998f1 100644 --- a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm +++ b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm @@ -38,7 +38,7 @@ icon_state = "blank" var/image/I = image(icon, "fuel_assembly") I.color = fuel_colour - overlays += list(I, image(icon, "fuel_assembly_bracket")) + add_overlay(list(I, image(icon, "fuel_assembly_bracket"))) rod_quantities[fuel_type] = initial_amount /obj/item/fuel_assembly/process(delta_time) diff --git a/code/modules/power/generator_type2.dm b/code/modules/power/generator_type2.dm index ed3d8fdae51..b10e006a388 100644 --- a/code/modules/power/generator_type2.dm +++ b/code/modules/power/generator_type2.dm @@ -26,14 +26,13 @@ updateicon() /obj/machinery/power/generator_type2/proc/updateicon() + cut_overlays() if(machine_stat & (NOPOWER|BROKEN)) - overlays.Cut() - else - overlays.Cut() + return - if(lastgenlev != 0) - overlays += image('icons/obj/power.dmi', "teg-op[lastgenlev]") + if(lastgenlev != 0) + add_overlay(image('icons/obj/power.dmi', "teg-op[lastgenlev]")) /// generator output coefficient from Q #define GENRATE 800 diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index deb204c7aa1..936c99a23f0 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -128,13 +128,18 @@ var/global/list/rad_collectors = list() last_power_new = power_produced /obj/machinery/power/rad_collector/proc/update_icons() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(P) - overlays += image('icons/obj/singularity.dmi', "ptank") - if(machine_stat & (NOPOWER|BROKEN)) - return - if(active) - overlays += image('icons/obj/singularity.dmi', "on") + overlays_to_add += image('icons/obj/singularity.dmi', "ptank") + + if(!(machine_stat & (NOPOWER|BROKEN)) && active) + overlays_to_add += image('icons/obj/singularity.dmi', "on") + + add_overlay(overlays_to_add) + + return + /obj/machinery/power/rad_collector/proc/toggle_power() active = !active diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index eb752aff6a9..2a17f6b6fec 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -116,6 +116,7 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) if (force_size) temp_allowed_size = force_size + cut_overlays() switch (temp_allowed_size) if (STAGE_ONE) name = "gravitational singularity" @@ -130,9 +131,8 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) dissipate_delay = 10 dissipate_track = 0 dissipate_strength = 1 - overlays = 0 if(chained) - overlays = "chain_s1" + add_overlay("chain_s1") visible_message("The singularity has shrunk to a rather pitiful size.") if (STAGE_TWO) if(check_cardinals_range(1, TRUE)) @@ -148,9 +148,8 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) dissipate_delay = 10 dissipate_track = 0 dissipate_strength = 5 - overlays = 0 if(chained) - overlays = "chain_s3" + add_overlay("chain_s3") if(growing) visible_message("The singularity noticeably grows in size.") else @@ -169,9 +168,8 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) dissipate_delay = 4 dissipate_track = 0 dissipate_strength = 20 - overlays = 0 if(chained) - overlays = "chain_s5" + add_overlay("chain_s5") if(growing) visible_message("The singularity expands to a reasonable size.") else @@ -190,9 +188,8 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) dissipate_delay = 10 dissipate_track = 0 dissipate_strength = 8 - overlays = 0 if(chained) - overlays = "chain_s7" + add_overlay("chain_s7") if(growing) visible_message("The singularity expands to a dangerous size.") else @@ -208,9 +205,8 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) grav_pull = 10 consume_range = 4 dissipate = 0 //It cant go smaller due to e loss. - overlays = 0 if(chained) - overlays = "chain_s9" + add_overlay("chain_s9") if(growing) visible_message("The singularity has grown out of control!") else @@ -228,7 +224,7 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) dissipate = 0 //It cant go smaller due to e loss event_chance = 25 //Events will fire off more often. if(chained) - overlays = "chain_s9" + add_overlay("chain_s9") visible_message("You witness the creation of a destructive force that cannot possibly be stopped by human hands.") if (current_size == allowed_size) @@ -464,30 +460,30 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) /obj/singularity/proc/on_capture() chained = 1 - overlays = 0 + cut_overlays() move_self = 0 switch (current_size) if(STAGE_ONE) - overlays += image('icons/obj/singularity.dmi',"chain_s1") + add_overlay(image('icons/obj/singularity.dmi',"chain_s1")) if(STAGE_TWO) - overlays += image('icons/effects/96x96.dmi',"chain_s3") + add_overlay(image('icons/effects/96x96.dmi',"chain_s3")) if(STAGE_THREE) - overlays += image('icons/effects/160x160.dmi',"chain_s5") + add_overlay(image('icons/effects/160x160.dmi',"chain_s5")) if(STAGE_FOUR) - overlays += image('icons/effects/224x224.dmi',"chain_s7") + add_overlay(image('icons/effects/224x224.dmi',"chain_s7")) if(STAGE_FIVE) - overlays += image('icons/effects/288x288.dmi',"chain_s9") + add_overlay(image('icons/effects/288x288.dmi',"chain_s9")) /obj/singularity/proc/on_release() chained = 0 - overlays = 0 + cut_overlays() move_self = 1 /obj/singularity/singularity_act(S, size) - if(current_size <= size) - var/gain = (energy/2) - var/dist = max((current_size - 2), 1) - explosion(src.loc,(dist),(dist*2),(dist*4)) - spawn(0) - qdel(src) - return gain + if(current_size <= size) + var/gain = (energy/2) + var/dist = max((current_size - 2), 1) + explosion(src.loc,(dist),(dist*2),(dist*4)) + spawn(0) + qdel(src) + return gain diff --git a/code/modules/power/smes/smes.dm b/code/modules/power/smes/smes.dm index bcd2b152433..cfecd4e6c4f 100644 --- a/code/modules/power/smes/smes.dm +++ b/code/modules/power/smes/smes.dm @@ -105,23 +105,28 @@ GLOBAL_LIST_EMPTY(smeses) return 0 /obj/machinery/power/smes/update_icon() - overlays.Cut() + cut_overlays() if(machine_stat & BROKEN) return - overlays += image('icons/obj/power.dmi', "smes-op[outputting]") + var/list/overlays_to_add = list() + + overlays_to_add += image('icons/obj/power.dmi', "smes-op[outputting]") if(inputting == 2) - overlays += image('icons/obj/power.dmi', "smes-oc2") + overlays_to_add += image('icons/obj/power.dmi', "smes-oc2") else if (inputting == 1) - overlays += image('icons/obj/power.dmi', "smes-oc1") + overlays_to_add += image('icons/obj/power.dmi', "smes-oc1") else if(input_attempt) - overlays += image('icons/obj/power.dmi', "smes-oc0") + overlays_to_add += image('icons/obj/power.dmi', "smes-oc0") var/clevel = chargedisplay() if(clevel>0) - overlays += image('icons/obj/power.dmi', "smes-og[clevel]") + overlays_to_add += image('icons/obj/power.dmi', "smes-og[clevel]") + + add_overlay(overlays_to_add) + return diff --git a/code/modules/power/smes/smes_construction.dm b/code/modules/power/smes/smes_construction.dm index c5042c9e9a5..3e6e604c1a9 100644 --- a/code/modules/power/smes/smes_construction.dm +++ b/code/modules/power/smes/smes_construction.dm @@ -263,8 +263,8 @@ // Description: Allows us to use special icon overlay for critical SMESs /obj/machinery/power/smes/buildable/update_icon() if (failing) - overlays.Cut() - overlays += image('icons/obj/power.dmi', "smes-crit") + cut_overlays() + add_overlay(image('icons/obj/power.dmi', "smes-crit")) else ..() diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 55032b4db2d..21400a33050 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -99,12 +99,12 @@ GLOBAL_LIST_EMPTY(solars_list) /obj/machinery/power/solar/update_icon() ..() - overlays.Cut() + cut_overlays() if(machine_stat & BROKEN) - overlays += image('icons/obj/power.dmi', icon_state = "solar_panel-b", layer = FLY_LAYER) + add_overlay(image('icons/obj/power.dmi', icon_state = "solar_panel-b", layer = FLY_LAYER)) else - overlays += image('icons/obj/power.dmi', icon_state = "solar_panel", layer = FLY_LAYER) - src.setDir(angle2dir(adir)) + add_overlay(image('icons/obj/power.dmi', icon_state = "solar_panel", layer = FLY_LAYER)) + setDir(angle2dir(adir)) return //calculates the fraction of the SSsun.sunlight that the panel recieves @@ -385,18 +385,16 @@ GLOBAL_LIST_EMPTY(solars_list) updateDialog() /obj/machinery/power/solar_control/update_icon() + cut_overlays() if(machine_stat & BROKEN) icon_state = "broken" - overlays.Cut() return if(machine_stat & NOPOWER) icon_state = "c_unpowered" - overlays.Cut() return icon_state = "solar" - overlays.Cut() if(cdir > -1) - overlays += image('icons/obj/computer.dmi', "solcon-o", FLY_LAYER, angle2dir(cdir)) + add_overlay(image('icons/obj/computer.dmi', "solcon-o", FLY_LAYER, angle2dir(cdir))) return /obj/machinery/power/solar_control/attack_hand(mob/user) diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 3a766962d9f..3badd5149a1 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -150,7 +150,7 @@ return if(!starter) return - overlays.Cut() + cut_overlays() rpm = 0.9* rpm + 0.1 * rpmtarget var/datum/gas_mixture/environment = inturf.return_air() @@ -172,13 +172,13 @@ rpmtarget = 0 if(rpm>50000) - overlays += image('icons/obj/pipes.dmi', "comp-o4", FLY_LAYER) + add_overlay(image('icons/obj/pipes.dmi', "comp-o4", FLY_LAYER)) else if(rpm>10000) - overlays += image('icons/obj/pipes.dmi', "comp-o3", FLY_LAYER) + add_overlay(image('icons/obj/pipes.dmi', "comp-o3", FLY_LAYER)) else if(rpm>2000) - overlays += image('icons/obj/pipes.dmi', "comp-o2", FLY_LAYER) + add_overlay(image('icons/obj/pipes.dmi', "comp-o2", FLY_LAYER)) else if(rpm>500) - overlays += image('icons/obj/pipes.dmi', "comp-o1", FLY_LAYER) + add_overlay(image('icons/obj/pipes.dmi', "comp-o1", FLY_LAYER)) //TODO: DEFERRED @@ -248,7 +248,7 @@ return if(!compressor.starter) return - overlays.Cut() + cut_overlays() // This is the power generation function. If anything is needed it's good to plot it in EXCEL before modifying // the TURBGENQ and TURBGENG values @@ -271,7 +271,7 @@ // If it works, put an overlay that it works! if(lastgen > 100) - overlays += image('icons/obj/pipes.dmi', "turb-o", FLY_LAYER) + add_overlay(image('icons/obj/pipes.dmi', "turb-o", FLY_LAYER)) updateDialog() diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index 7675cfb029a..ad1a09134b9 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -180,7 +180,7 @@ break icon_state = (new_state)? new_state : initial(icon_state) if(ammo_mark) - overlays += "[initial(icon_state)]_[ammo_mark]" + add_overlay("[initial(icon_state)]_[ammo_mark]") /obj/item/ammo_magazine/examine(mob/user) . = ..() diff --git a/code/modules/projectiles/guns/energy/netgun_vr.dm b/code/modules/projectiles/guns/energy/netgun_vr.dm index 02a91dc3a84..b88709e1c0f 100644 --- a/code/modules/projectiles/guns/energy/netgun_vr.dm +++ b/code/modules/projectiles/guns/energy/netgun_vr.dm @@ -18,7 +18,8 @@ ) /obj/item/gun/energy/netgun/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(power_supply) var/ratio = power_supply.charge / power_supply.maxcharge @@ -28,6 +29,8 @@ else ratio = max(round(ratio, 0.25) * 100, 25) - overlays += "[initial(icon_state)]_cell" - overlays += "[initial(icon_state)]_[ratio]" - overlays += "[initial(icon_state)]_[mode_name]" + overlays_to_add += "[initial(icon_state)]_cell" + overlays_to_add += "[initial(icon_state)]_[ratio]" + overlays_to_add += "[initial(icon_state)]_[mode_name]" + + add_overlay(overlays_to_add) diff --git a/code/modules/projectiles/guns/magnetic/magnetic.dm b/code/modules/projectiles/guns/magnetic/magnetic.dm index 312f23fd4d7..d4918085565 100644 --- a/code/modules/projectiles/guns/magnetic/magnetic.dm +++ b/code/modules/projectiles/guns/magnetic/magnetic.dm @@ -63,7 +63,7 @@ if(loaded) overlays_to_add += image(icon, "[icon_state]_loaded") - overlays = overlays_to_add + add_overlay(overlays_to_add) ..() /obj/item/gun/magnetic/proc/show_ammo(var/mob/user) diff --git a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm index e0dba5730d3..20ea3ff677d 100644 --- a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm +++ b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm @@ -391,7 +391,7 @@ if(istype(T, /turf/simulated/wall)) var/turf/simulated/wall/W = T W.thermite = 1 - W.overlays += image('icons/effects/effects.dmi',icon_state = "#673910") + W.add_overlay(image('icons/effects/effects.dmi',icon_state = "#673910")) remove_self(5) return @@ -679,4 +679,3 @@ reagent_state = REAGENT_SOLID color = "#464650" taste_description = "salt" - diff --git a/code/modules/reagents/machinery/dispenser/reagent_tank.dm b/code/modules/reagents/machinery/dispenser/reagent_tank.dm index c177946352d..68e7a0e8161 100644 --- a/code/modules/reagents/machinery/dispenser/reagent_tank.dm +++ b/code/modules/reagents/machinery/dispenser/reagent_tank.dm @@ -158,7 +158,7 @@ usr.visible_message("[usr] detaches [rig] from \the [src].", "You detach [rig] from \the [src]") rig.loc = get_turf(usr) rig = null - overlays = new/list() + cut_overlays() /obj/structure/reagent_dispensers/fueltank/attackby(obj/item/W as obj, mob/user as mob) src.add_fingerprint(user) @@ -192,7 +192,7 @@ var/icon/test = get_flat_icon(W) test.Shift(NORTH,1) test.Shift(EAST,6) - overlays += test + add_overlay(test) return ..() @@ -388,11 +388,11 @@ /obj/structure/reagent_dispensers/water_cooler/update_icon() icon_state = "water_cooler" - overlays.Cut() + cut_overlays() var/image/I if(bottle) I = image(icon, "water_cooler_bottle") - overlays += I + add_overlay(I) return /obj/structure/reagent_dispensers/beerkeg diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 0b37d1dfae0..cc63b8d9e3b 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -172,7 +172,8 @@ update_icon() /obj/item/reagent_containers/glass/beaker/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(reagents.total_volume) var/image/filling = image('icons/obj/medical/reagentfillings.dmi', src, "[base_icon_state]10") @@ -188,11 +189,13 @@ if(91 to INFINITY) filling.icon_state = "[base_icon_state]100" filling.color = reagents.get_color() - overlays += filling + overlays_to_add += filling if (!is_open_container()) var/image/lid = image(icon, src, "lid_[base_icon_state]") - overlays += lid + overlays_to_add += lid + + add_overlay(overlays_to_add) /obj/item/reagent_containers/glass/beaker/large name = "large beaker" @@ -298,10 +301,10 @@ return ..() /obj/item/reagent_containers/glass/bucket/update_icon() - overlays.Cut() + cut_overlays() if (!is_open_container()) var/image/lid = image(icon, src, "lid_[initial(icon_state)]") - overlays += lid + add_overlay(lid) /obj/item/reagent_containers/glass/bucket/wood desc = "An old wooden bucket." diff --git a/code/modules/reagents/reagent_containers/organic.dm b/code/modules/reagents/reagent_containers/organic.dm index 9a3d00ef5c5..8bff574eaab 100644 --- a/code/modules/reagents/reagent_containers/organic.dm +++ b/code/modules/reagents/reagent_containers/organic.dm @@ -72,11 +72,11 @@ update_icon() /obj/item/reagent_containers/organic/update_icon() - overlays.Cut() + cut_overlays() if (!is_open_container()) var/image/lid = image(icon, src, "lid_[initial(icon_state)]") - overlays += lid + add_overlay(lid) /obj/item/reagent_containers/organic/attack(mob/M as mob, mob/user as mob, def_zone) if(force && !(item_flags & ITEM_NOBLUDGEON) && user.a_intent == INTENT_HARM) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 3bd525d49f7..d999894e8c9 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -323,30 +323,35 @@ // update the icon & overlays to reflect mode & status /obj/machinery/disposal/proc/update() - overlays.Cut() + cut_overlays() if(machine_stat & BROKEN) icon_state = "disposal-broken" mode = 0 flush = 0 return + var/list/overlays_to_add = list() + // flush handle if(flush) - overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle") + overlays_to_add += image('icons/obj/pipes/disposal.dmi', "dispover-handle") // only handle is shown if no power if(machine_stat & NOPOWER || mode == -1) + add_overlay(overlays_to_add) return // check for items in disposal - occupied light if(contents.len > 0) - overlays += image('icons/obj/pipes/disposal.dmi', "dispover-full") + overlays_to_add += image('icons/obj/pipes/disposal.dmi', "dispover-full") // charging and ready light if(mode == 1) - overlays += image('icons/obj/pipes/disposal.dmi', "dispover-charge") + overlays_to_add += image('icons/obj/pipes/disposal.dmi', "dispover-charge") else if(mode == 2) - overlays += image('icons/obj/pipes/disposal.dmi', "dispover-ready") + overlays_to_add += image('icons/obj/pipes/disposal.dmi', "dispover-ready") + + add_overlay(overlays_to_add) // timed process // charge the gas reservoir and perform flush if ready diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index ab9ac2a5fc7..26771fc16b9 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -69,7 +69,7 @@ return /obj/structure/bigDelivery/update_icon() - overlays = new() + cut_overlays() if(nameset || examtext) var/image/I = new/image('icons/obj/storage.dmi',"delivery_label") if(icon_state == "deliverycloset") @@ -82,8 +82,8 @@ label_x = rand(-8, 6) I.pixel_x = label_x I.pixel_y = -3 - overlays += I - if(src.sortTag) + add_overlay(I) + if(sortTag) var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") if(icon_state == "deliverycloset") if(tag_x == null) @@ -95,7 +95,7 @@ tag_x = rand(-8, 6) I.pixel_x = tag_x I.pixel_y = -3 - overlays += I + add_overlay(I) /obj/structure/bigDelivery/examine(mob/user) . = ..() @@ -190,13 +190,13 @@ return /obj/item/smallDelivery/update_icon() - overlays = new() + cut_overlays() if((nameset || examtext) && icon_state != "deliverycrate1") var/image/I = new/image('icons/obj/storage.dmi',"delivery_label") if(icon_state == "deliverycrate5") I.pixel_y = -1 - overlays += I - if(src.sortTag) + add_overlay(I) + if(sortTag) var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") switch(icon_state) if("deliverycrate1") @@ -212,7 +212,7 @@ I.pixel_y = 3 if("deliverycrate5") I.pixel_y = -3 - overlays += I + add_overlay(I) /obj/item/smallDelivery/examine(mob/user) . = ..() diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 2e9361e662f..a21386d06c3 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -174,9 +174,9 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid). if(materials[S.material.name] + amnt <= max_res_amount) if(S && S.get_amount() >= 1) var/count = 0 - overlays += "fab-load-metal" + add_overlay("fab-load-metal") spawn(10) - overlays -= "fab-load-metal" + cut_overlay("fab-load-metal") while(materials[S.material.name] + amnt <= max_res_amount && S.get_amount() >= 1) materials[S.material.name] += amnt S.use(1) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 952c8e31a0b..0b68557ecca 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -133,9 +133,9 @@ if(materials[S.material.name] + amnt <= max_res_amount) if(S && S.get_amount() >= 1) var/count = 0 - overlays += "fab-load-metal" + add_overlay("fab-load-metal") spawn(10) - overlays -= "fab-load-metal" + cut_overlay("fab-load-metal") while(materials[S.material.name] + amnt <= max_res_amount && S.get_amount() >= 1) materials[S.material.name] += amnt S.use(1) @@ -147,9 +147,9 @@ var/stacktype = S.type var/t = getMaterialName(stacktype) - overlays += "protolathe_[t]" + add_overlay("protolathe_[t]") spawn(10) - overlays -= "protolathe_[t]" + cut_overlay("protolathe_[t]") updateUsrDialog() return diff --git a/code/modules/resleeving/sleevecard.dm b/code/modules/resleeving/sleevecard.dm index 87ae3ae47b3..6f4b4cc14bb 100644 --- a/code/modules/resleeving/sleevecard.dm +++ b/code/modules/resleeving/sleevecard.dm @@ -80,13 +80,13 @@ /obj/item/sleevecard/proc/turnOff() if(infomorph) infomorph.close_up() - overlays.Cut() + cut_overlays() name = "[initial(name)]" -/obj/item/sleevecard/proc/setEmotion(var/emotion) +/obj/item/sleevecard/proc/setEmotion(emotion) if(infomorph && emotion) - overlays.Cut() - overlays += emotion + cut_overlays() + add_overlay(emotion) current_emotion = emotion /obj/item/sleevecard/emp_act(severity) diff --git a/code/modules/rigsuits/_rig.dm b/code/modules/rigsuits/_rig.dm index 1a8f89b3b94..5273a46837a 100644 --- a/code/modules/rigsuits/_rig.dm +++ b/code/modules/rigsuits/_rig.dm @@ -705,10 +705,10 @@ ui.open() ui.set_auto_update(1) -/obj/item/rig/update_icon(var/update_mob_icon) +/obj/item/rig/update_icon(update_mob_icon) //TODO: Maybe consider a cache for this (use mob_icon as blank canvas, use suit icon overlay). - overlays.Cut() + cut_overlays() if(!mob_icon || update_mob_icon) var/species_icon = 'icons/mob/clothing/rig_back.dmi' // Since setting mob_icon will override the species checks in @@ -720,7 +720,7 @@ if(installed_modules.len) for(var/obj/item/rig_module/module in installed_modules) if(module.suit_overlay) - chest.overlays += image("icon" = 'icons/mob/clothing/rig_modules.dmi', "icon_state" = "[module.suit_overlay]", "dir" = SOUTH) + chest.add_overlay(image("icon" = 'icons/mob/clothing/rig_modules.dmi', "icon_state" = "[module.suit_overlay]", "dir" = SOUTH)) if(wearer) wearer.update_inv_shoes() diff --git a/code/modules/shieldgen/energy_field.dm b/code/modules/shieldgen/energy_field.dm index 2abd2de7e1f..f70ed205a0f 100644 --- a/code/modules/shieldgen/energy_field.dm +++ b/code/modules/shieldgen/energy_field.dm @@ -108,8 +108,9 @@ update_icon() update_nearby_tiles() -/obj/effect/energy_field/update_icon(var/update_neightbors = 0) - overlays.Cut() +/obj/effect/energy_field/update_icon(update_neightbors = 0) + cut_overlays() + var/list/adjacent_shields_dir = list() for(var/direction in GLOB.cardinal) var/turf/T = get_step(src, direction) @@ -127,10 +128,12 @@ icon_state = "shield_broken" set_light(3, 5, "#FF9900") + var/list/overlays_to_add = list() // Edge overlays for(var/found_dir in adjacent_shields_dir) - overlays += image(src.icon, src, icon_state = "shield_edge", dir = found_dir) + overlays_to_add += image(src.icon, src, icon_state = "shield_edge", dir = found_dir) + add_overlay(overlays_to_add) // Small visual effect, makes the shield tiles brighten up by becoming more opaque for a moment, and spreads to nearby shields. /obj/effect/energy_field/proc/impact_effect(var/i, var/list/affected_shields = list()) diff --git a/code/modules/shieldgen/energy_shield.dm b/code/modules/shieldgen/energy_shield.dm index e4a108d6bdf..26d374106a7 100644 --- a/code/modules/shieldgen/energy_shield.dm +++ b/code/modules/shieldgen/energy_shield.dm @@ -27,6 +27,7 @@ if(!enabled_icon_state) enabled_icon_state = icon_state + // HACK: This is dumb, but whatever. if(disabled_for || diffused_for) icon_state = "shield_broken" overlays.Cut() //NOT ssoverlays diff --git a/code/modules/species/shadekin/shadekin_abilities.dm b/code/modules/species/shadekin/shadekin_abilities.dm index e71aacdf403..44a7f3edd36 100644 --- a/code/modules/species/shadekin/shadekin_abilities.dm +++ b/code/modules/species/shadekin/shadekin_abilities.dm @@ -96,7 +96,7 @@ var/obj/belly/B = belly B.escapable = initial(B.escapable) - //overlays.Cut() + // cut_overlays() invisibility = initial(invisibility) see_invisible = initial(see_invisible) incorporeal_move = initial(incorporeal_move) @@ -156,7 +156,7 @@ sleep(5) invisibility = INVISIBILITY_LEVEL_TWO see_invisible = INVISIBILITY_LEVEL_TWO - //overlays.Cut() + // cut_overlays() update_icon() alpha = 127 diff --git a/code/modules/species/xenomorphs/alien_embryo.dm b/code/modules/species/xenomorphs/alien_embryo.dm index 4781e3701a6..a6c15d1055f 100644 --- a/code/modules/species/xenomorphs/alien_embryo.dm +++ b/code/modules/species/xenomorphs/alien_embryo.dm @@ -89,9 +89,9 @@ return if(affected_mob.lying) - affected_mob.overlays += image('icons/mob/alien.dmi', loc = affected_mob, icon_state = "burst_lie") + affected_mob.add_overlay(image('icons/mob/alien.dmi', loc = affected_mob, icon_state = "burst_lie")) else - affected_mob.overlays += image('icons/mob/alien.dmi', loc = affected_mob, icon_state = "burst_stand") + affected_mob.add_overlay(image('icons/mob/alien.dmi', loc = affected_mob, icon_state = "burst_stand")) spawn(6) var/mob/living/carbon/alien/larva/new_xeno = new(affected_mob.loc) new_xeno.key = picked diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index a314e7718a8..0ddc839fe41 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -358,33 +358,34 @@ var/list/table_icon_cache = list() return I /obj/structure/table/update_icon() + cut_overlays() + var/list/overlays_to_add = list() + if(flipped != 1) icon_state = "blank" - overlays.Cut() // Base frame shape. Mostly done for glass/diamond tables, where this is visible. for(var/i = 1 to 4) var/image/I = get_table_image(icon, connections[i], 1<<(i-1)) - overlays += I + overlays_to_add += I // Standard table image if(material) for(var/i = 1 to 4) var/image/I = get_table_image(icon, "[material.icon_base]_[connections[i]]", 1<<(i-1), material.icon_colour, 255 * material.opacity) - overlays += I + overlays_to_add += I // Reinforcements if(reinforced) for(var/i = 1 to 4) var/image/I = get_table_image(icon, "[reinforced.icon_reinf]_[connections[i]]", 1<<(i-1), reinforced.icon_colour, 255 * reinforced.opacity) - overlays += I + overlays_to_add += I if(carpeted) for(var/i = 1 to 4) var/image/I = get_table_image(icon, "carpet_[connections[i]]", 1<<(i-1)) - overlays += I + overlays_to_add += I else - overlays.Cut() var/type = 0 var/tabledirs = 0 for(var/direction in list(turn(dir,90), turn(dir,-90)) ) @@ -405,7 +406,7 @@ var/list/table_icon_cache = list() var/image/I = image(icon, "[material.icon_base]_flip[type]") I.color = material.icon_colour I.alpha = 255 * material.opacity - overlays += I + overlays_to_add += I name = "[material.display_name] table" else name = "table frame" @@ -414,10 +415,12 @@ var/list/table_icon_cache = list() var/image/I = image(icon, "[reinforced.icon_reinf]_flip[type]") I.color = reinforced.icon_colour I.alpha = 255 * reinforced.opacity - overlays += I + overlays_to_add += I if(carpeted) - overlays += "carpet_flip[type]" + overlays_to_add += "carpet_flip[type]" + + add_overlay(overlays_to_add) // set propagate if you're updating a table that should update tables around it too, for example if it's a new table or something important has changed (like material). /obj/structure/table/update_connections(propagate=0) diff --git a/code/modules/vehicles/ridden/quad.dm b/code/modules/vehicles/ridden/quad.dm index 23edfd2c89e..14486a5cdc3 100644 --- a/code/modules/vehicles/ridden/quad.dm +++ b/code/modules/vehicles/ridden/quad.dm @@ -60,11 +60,12 @@ /obj/vehicle/ridden/quadbike/update_icon() ..() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(custom_frame) var/image/Bodypaint = new(icon = 'icons/obj/custom_items_vehicle.dmi', icon_state = "[frame_state]_a", layer = src.layer) Bodypaint.color = paint_color - overlays += Bodypaint + overlays_to_add += Bodypaint var/image/Overmob = new(icon = 'icons/obj/custom_items_vehicle.dmi', icon_state = "[frame_state]_overlay", layer = src.layer + 0.2) //over mobs var/image/Overmob_color = new(icon = 'icons/obj/custom_items_vehicle.dmi', icon_state = "[frame_state]_overlay_a", layer = src.layer + 0.2) //over the over mobs, gives the color. @@ -72,13 +73,14 @@ Overmob_color.plane = FLY_LAYER Overmob_color.color = paint_color - overlays += Overmob - overlays += Overmob_color + overlays_to_add += Overmob + overlays_to_add += Overmob_color + add_overlay(overlays_to_add) return var/image/Bodypaint = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_a", layer = src.layer) Bodypaint.color = paint_color - overlays += Bodypaint + overlays_to_add += Bodypaint var/image/Overmob = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_overlay", layer = src.layer + 0.2) //over mobs var/image/Overmob_color = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_overlay_a", layer = src.layer + 0.2) //over the over mobs, gives the color. @@ -86,7 +88,7 @@ Overmob_color.plane = FLY_LAYER Overmob_color.color = paint_color - overlays += Overmob - overlays += Overmob_color - + overlays_to_add += Overmob + overlays_to_add += Overmob_color + add_overlay(overlays_to_add) diff --git a/code/modules/vehicles/ridden/wheelchair.dm b/code/modules/vehicles/ridden/wheelchair.dm index 57fbc4a9594..d7720ddcb1a 100644 --- a/code/modules/vehicles/ridden/wheelchair.dm +++ b/code/modules/vehicles/ridden/wheelchair.dm @@ -9,9 +9,9 @@ /obj/vehicle/ridden/wheelchair/update_icon() ..() - overlays.Cut() + cut_overlays() var/image/O = image(icon = 'icons/obj/furniture.dmi', icon_state = "w_overlay", layer = src.layer + 1) - overlays += O + add_overlay(O) return @@ -85,9 +85,9 @@ /obj/structure/bed/chair/wheelchair/dolly/setDir() ..() - overlays = null + cut_overlays() var/image/O = image(icon = 'icons/obj/furniture.dmi', icon_state = "d_overlay", layer = FLY_LAYER, dir = src.dir) - overlays += O + add_overlay(O) if(has_buckled_mobs()) for(var/A in buckled_mobs) var/mob/living/L = A diff --git a/code/modules/vehicles_legacy/Securitrain_vr.dm b/code/modules/vehicles_legacy/Securitrain_vr.dm index 5b95b6470d6..24bb18bc94a 100644 --- a/code/modules/vehicles_legacy/Securitrain_vr.dm +++ b/code/modules/vehicles_legacy/Securitrain_vr.dm @@ -64,7 +64,7 @@ cell = new /obj/item/cell/high(src) key = new(src) var/image/I = new(icon = 'icons/obj/vehicles.dmi', icon_state = "cargo_engine_overlay", layer = src.layer + 0.2) //over mobs - overlays += I + add_overlay(I) turn_off() //so engine verbs are correctly set /obj/vehicle_old/train/security/engine/Move(var/turf/destination) @@ -299,7 +299,7 @@ //This prevents the object from being interacted with until it has // been unloaded. A dummy object is loaded instead so the loading // code knows to handle it correctly. -/obj/vehicle_old/train/security/trolley/proc/load_object(var/atom/movable/C) +/obj/vehicle_old/train/security/trolley/proc/load_object(atom/movable/C) if(!isturf(C.loc)) //To prevent loading things from someone's inventory, which wouldn't get handled properly. return 0 if(load || C.anchored) @@ -318,20 +318,20 @@ C.pixel_y += load_offset_y C.layer = layer - overlays += C + add_overlay(C) //we can set these back now since we have already cloned the icon into the overlay C.pixel_x = initial(C.pixel_x) C.pixel_y = initial(C.pixel_y) C.layer = initial(C.layer) -/obj/vehicle_old/train/security/trolley/unload(var/mob/user, var/direction) +/obj/vehicle_old/train/security/trolley/unload(mob/user, direction) if(istype(load, /datum/vehicle_dummy_load)) var/datum/vehicle_dummy_load/dummy_load = load load = dummy_load.actual_load dummy_load.actual_load = null qdel(dummy_load) - overlays.Cut() + cut_overlay() ..() //------------------------------------------- diff --git a/code/modules/vehicles_legacy/bike.dm b/code/modules/vehicles_legacy/bike.dm index b40487b5f09..6fff3be32e3 100644 --- a/code/modules/vehicles_legacy/bike.dm +++ b/code/modules/vehicles_legacy/bike.dm @@ -181,21 +181,22 @@ ..() /obj/vehicle_old/bike/update_icon() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() if(custom_icon) if(on) var/image/bodypaint = image('icons/obj/custom_items_vehicle.dmi', "[bike_icon]_on_a", src.layer) bodypaint.color = paint_color - overlays += bodypaint + overlays_to_add += bodypaint var/image/overmob = image('icons/obj/custom_items_vehicle.dmi', "[bike_icon]_on_overlay", MOB_LAYER + 1) var/image/overmob_color = image('icons/obj/custom_items_vehicle.dmi', "[bike_icon]_on_overlay_a", MOB_LAYER + 1) overmob.plane = MOB_PLANE overmob_color.plane = MOB_PLANE overmob_color.color = paint_color - overlays += overmob - overlays += overmob_color + overlays_to_add += overmob + overlays_to_add += overmob_color if(open) icon_state = "[bike_icon]_on-open" else @@ -203,34 +204,35 @@ else var/image/bodypaint = image('icons/obj/custom_items_vehicle.dmi', "[bike_icon]_off_a", src.layer) bodypaint.color = paint_color - overlays += bodypaint + overlays_to_add += bodypaint var/image/overmob = image('icons/obj/custom_items_vehicle.dmi', "[bike_icon]_off_overlay", MOB_LAYER + 1) var/image/overmob_color = image('icons/obj/custom_items_vehicle.dmi', "[bike_icon]_off_overlay_a", MOB_LAYER + 1) overmob.plane = MOB_PLANE overmob_color.plane = MOB_PLANE overmob_color.color = paint_color - overlays += overmob - overlays += overmob_color + overlays_to_add += overmob + overlays_to_add += overmob_color if(open) icon_state = "[bike_icon]_off-open" else icon_state = "[bike_icon]_off" + add_overlay(overlays_to_add) ..() return if(on) var/image/bodypaint = image('icons/obj/bike.dmi', "[bike_icon]_on_a", src.layer) bodypaint.color = paint_color - overlays += bodypaint + overlays_to_add += bodypaint var/image/overmob = image('icons/obj/bike.dmi', "[bike_icon]_on_overlay", MOB_LAYER + 1) var/image/overmob_color = image('icons/obj/bike.dmi', "[bike_icon]_on_overlay_a", MOB_LAYER + 1) overmob.plane = MOB_PLANE overmob_color.plane = MOB_PLANE overmob_color.color = paint_color - overlays += overmob - overlays += overmob_color + overlays_to_add += overmob + overlays_to_add += overmob_color if(open) icon_state = "[bike_icon]_on-open" else @@ -238,22 +240,23 @@ else var/image/bodypaint = image('icons/obj/bike.dmi', "[bike_icon]_off_a", src.layer) bodypaint.color = paint_color - overlays += bodypaint + overlays_to_add += bodypaint var/image/overmob = image('icons/obj/bike.dmi', "[bike_icon]_off_overlay", MOB_LAYER + 1) var/image/overmob_color = image('icons/obj/bike.dmi', "[bike_icon]_off_overlay_a", MOB_LAYER + 1) overmob.plane = MOB_PLANE overmob_color.plane = MOB_PLANE overmob_color.color = paint_color - overlays += overmob - overlays += overmob_color + overlays_to_add += overmob + overlays_to_add += overmob_color if(open) icon_state = "[bike_icon]_off-open" else icon_state = "[bike_icon]_off" - ..() + add_overlay(overlays_to_add) + ..() /obj/vehicle_old/bike/Destroy() qdel(ion) diff --git a/code/modules/vehicles_legacy/cargo_train.dm b/code/modules/vehicles_legacy/cargo_train.dm index 2fb7141806c..1f299c2adcb 100644 --- a/code/modules/vehicles_legacy/cargo_train.dm +++ b/code/modules/vehicles_legacy/cargo_train.dm @@ -48,7 +48,7 @@ cell = new cell(src) key = new key_type(src) var/image/I = new(icon = 'icons/obj/vehicles.dmi', icon_state = "cargo_engine_overlay", layer = src.layer + 0.2) //over mobs - overlays += I + add_overlay(I) turn_off() //so engine verbs are correctly set /obj/vehicle_old/train/engine/Move(var/turf/destination) @@ -300,7 +300,7 @@ //This prevents the object from being interacted with until it has // been unloaded. A dummy object is loaded instead so the loading // code knows to handle it correctly. -/obj/vehicle_old/train/trolley/proc/load_object(var/atom/movable/C) +/obj/vehicle_old/train/trolley/proc/load_object(atom/movable/C) if(!isturf(C.loc)) //To prevent loading things from someone's inventory, which wouldn't get handled properly. return 0 if(load || C.anchored) @@ -319,20 +319,20 @@ C.pixel_y += load_offset_y C.layer = layer - overlays += C + add_overlay(C) //we can set these back now since we have already cloned the icon into the overlay C.pixel_x = initial(C.pixel_x) C.pixel_y = initial(C.pixel_y) C.layer = initial(C.layer) -/obj/vehicle_old/train/trolley/unload(var/mob/user, var/direction) +/obj/vehicle_old/train/trolley/unload(mob/user, direction) if(istype(load, /datum/vehicle_dummy_load)) var/datum/vehicle_dummy_load/dummy_load = load load = dummy_load.actual_load dummy_load.actual_load = null qdel(dummy_load) - overlays.Cut() + cut_overlays() ..() //------------------------------------------- diff --git a/code/modules/vehicles_legacy/quad.dm b/code/modules/vehicles_legacy/quad.dm index 69007de8685..c7a7d252ce4 100644 --- a/code/modules/vehicles_legacy/quad.dm +++ b/code/modules/vehicles_legacy/quad.dm @@ -80,11 +80,13 @@ /obj/vehicle_old/train/engine/quadbike/update_icon() ..() - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() + if(custom_frame) var/image/Bodypaint = new(icon = 'icons/obj/custom_items_vehicle.dmi', icon_state = "[frame_state]_a", layer = src.layer) Bodypaint.color = paint_color - overlays += Bodypaint + overlays_to_add += Bodypaint var/image/Overmob = new(icon = 'icons/obj/custom_items_vehicle.dmi', icon_state = "[frame_state]_overlay", layer = src.layer + 0.2) //over mobs var/image/Overmob_color = new(icon = 'icons/obj/custom_items_vehicle.dmi', icon_state = "[frame_state]_overlay_a", layer = src.layer + 0.2) //over the over mobs, gives the color. @@ -92,13 +94,14 @@ Overmob_color.plane = MOB_PLANE Overmob_color.color = paint_color - overlays += Overmob - overlays += Overmob_color + overlays_to_add += Overmob + overlays_to_add += Overmob_color + add_overlay(overlays_to_add) return var/image/Bodypaint = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_a", layer = src.layer) Bodypaint.color = paint_color - overlays += Bodypaint + overlays_to_add += Bodypaint var/image/Overmob = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_overlay", layer = src.layer + 0.2) //over mobs var/image/Overmob_color = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_overlay_a", layer = src.layer + 0.2) //over the over mobs, gives the color. @@ -106,8 +109,10 @@ Overmob_color.plane = MOB_PLANE Overmob_color.color = paint_color - overlays += Overmob - overlays += Overmob_color + overlays_to_add += Overmob + overlays_to_add += Overmob_color + + add_overlay(overlays_to_add) /obj/vehicle_old/train/engine/quadbike/Bump(atom/Obstacle) if(!istype(Obstacle, /atom/movable)) @@ -239,11 +244,11 @@ /obj/vehicle_old/train/trolley/trailer/update_icon() ..() - overlays.Cut() + cut_overlay() var/image/Bodypaint = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[initial(icon_state)]_a", layer = src.layer) Bodypaint.color = paint_color - overlays += Bodypaint + add_overlay(Bodypaint) /obj/vehicle_old/train/trolley/trailer/attackby(obj/item/W as obj, mob/user as mob) if(istype(W, /obj/item/multitool) && open) diff --git a/code/modules/vehicles_legacy/rover_vr.dm b/code/modules/vehicles_legacy/rover_vr.dm index bc80daffee2..697a5e30245 100644 --- a/code/modules/vehicles_legacy/rover_vr.dm +++ b/code/modules/vehicles_legacy/rover_vr.dm @@ -309,7 +309,7 @@ //This prevents the object from being interacted with until it has // been unloaded. A dummy object is loaded instead so the loading // code knows to handle it correctly. -/obj/vehicle_old/train/rover/trolley/proc/load_object(var/atom/movable/C) +/obj/vehicle_old/train/rover/trolley/proc/load_object(atom/movable/C) if(!isturf(C.loc)) //To prevent loading things from someone's inventory, which wouldn't get handled properly. return 0 if(load || C.anchored) @@ -328,7 +328,7 @@ C.pixel_y += load_offset_y C.layer = layer - overlays += C + add_overlay(C) //we can set these back now since we have already cloned the icon into the overlay C.pixel_x = initial(C.pixel_x) @@ -341,7 +341,7 @@ load = dummy_load.actual_load dummy_load.actual_load = null qdel(dummy_load) - overlays.Cut() + cut_overlay() ..() //------------------------------------------- diff --git a/code/modules/virus2/biohazard destroyer.dm b/code/modules/virus2/biohazard destroyer.dm index 894f35c519e..45886d02757 100644 --- a/code/modules/virus2/biohazard destroyer.dm +++ b/code/modules/virus2/biohazard destroyer.dm @@ -11,9 +11,8 @@ for(var/path in accepts) if(I.type in typesof(path)) qdel(I) - overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle") + add_overlay(image('icons/obj/pipes/disposal.dmi', "dispover-handle")) for(var/mob/O in hearers(src, null)) O.show_message("[icon2html(thing = src, target = O)] The [src.name] beeps.", 2) return CLICKCHAIN_DO_NOT_PROPAGATE return ..() - diff --git a/code/modules/vore/eating/contaminate_vr.dm b/code/modules/vore/eating/contaminate_vr.dm index aea2513c980..4ece5cec674 100644 --- a/code/modules/vore/eating/contaminate_vr.dm +++ b/code/modules/vore/eating/contaminate_vr.dm @@ -32,7 +32,7 @@ var/list/gurgled_overlays = list( if(!gurgled) gurgled = TRUE gurgled_color = contamination_color - overlays += gurgled_overlays[gurgled_color] + add_overlay(gurgled_overlays[gurgled_color]) var/list/pickfrom = contamination_flavors[contamination_flavor] var/gurgleflavor = pick(pickfrom) cleanname = src.name @@ -54,7 +54,7 @@ var/list/gurgled_overlays = list( /obj/item/decontaminate() //Decontaminate the sogginess as well. ..() gurgled = FALSE - overlays -= gurgled_overlays[gurgled_color] + cut_overlay(gurgled_overlays[gurgled_color]) if(cleanname) name = cleanname if(cleandesc) diff --git a/code/modules/vore/fluffstuff/custom_guns.dm b/code/modules/vore/fluffstuff/custom_guns.dm index bc477680e7f..e27b98b84d9 100644 --- a/code/modules/vore/fluffstuff/custom_guns.dm +++ b/code/modules/vore/fluffstuff/custom_guns.dm @@ -381,12 +381,12 @@ END OF CITADEL CHANGES */ origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 4) /obj/item/gun/projectile/lamia/update_icon() - overlays.Cut() + cut_overlay() if(!ammo_magazine) return var/ratio = ammo_magazine.stored_ammo.len * 100 / ammo_magazine.max_ammo ratio = round(ratio, 33) - overlays += "deagle_[ratio]"*/ // Fugly. + add_overlay("deagle_[ratio]")*/ // Fugly. //Civilian gun @@ -471,11 +471,11 @@ END OF CITADEL CHANGES */ if(ratio < 0.25 && ratio != 0) ratio = 0.25 ratio = round(ratio, 0.25) * 100 - overlays += "smg_[ratio]" + add_overlay("smg_[ratio]") /obj/item/gun/projectile/automatic/sol/update_icon() icon_state = (ammo_magazine)? "SMG-IS" : "SMG-IS-empty" - overlays.Cut() + cut_overlay() update_charge() //HoP gun diff --git a/code/modules/vore/fluffstuff/guns/gunsword.dm b/code/modules/vore/fluffstuff/guns/gunsword.dm index a4ba4a4d49d..d53471b6a4d 100644 --- a/code/modules/vore/fluffstuff/guns/gunsword.dm +++ b/code/modules/vore/fluffstuff/guns/gunsword.dm @@ -124,4 +124,4 @@ return (BRUTELOSS|FIRELOSS) /obj/item/cell/device/weapon/gunsword/update_icon() - overlays.Cut() + cut_overlay() diff --git a/code/modules/vore/fluffstuff/guns/protector.dm b/code/modules/vore/fluffstuff/guns/protector.dm index b224b4413f4..51cd1a74748 100644 --- a/code/modules/vore/fluffstuff/guns/protector.dm +++ b/code/modules/vore/fluffstuff/guns/protector.dm @@ -54,7 +54,8 @@ //Update icons from /tg/, so fancy! Use this more! /obj/item/gun/energy/protector/update_icon() - overlays.Cut() + cut_overlay() + var/list/overlays_to_add = list() var/ratio = 0 /* Don't have one for this gun @@ -65,7 +66,7 @@ var/iconState = "[icon_state]_charge" if (modifystate) - overlays += "[icon_state]_[modifystate]" + overlays_to_add += "[icon_state]_[modifystate]" iconState += "_[modifystate]" /* Don't have one for this gun if(itemState) @@ -75,21 +76,21 @@ ratio = CEILING(((power_supply.charge / power_supply.maxcharge) * charge_sections), 1) if(power_supply.charge < charge_cost) - overlays += "[icon_state]_empty" + overlays_to_add += "[icon_state]_empty" else if(!shaded_charge) var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState) for(var/i = ratio, i >= 1, i--) charge_overlay.pixel_x = ammo_x_offset * (i - 1) - overlays += charge_overlay + overlays_to_add += charge_overlay else - overlays += "[icon_state]_[modifystate][ratio]" + overlays_to_add += "[icon_state]_[modifystate][ratio]" if(can_flashlight & gun_light) var/mutable_appearance/flashlight_overlay = mutable_appearance(icon, light_state) flashlight_overlay.pixel_x = flight_x_offset flashlight_overlay.pixel_y = flight_y_offset - overlays += flashlight_overlay + overlays_to_add += flashlight_overlay /* Don't have one for this gun if(itemState) @@ -100,6 +101,8 @@ // todo: burn this entire proc to the ground, because the writer deserves to have their eyelids replaced with lemons // "this goodd system but i'm going to snowflake it for one gun" + add_overlay(overlays_to_add) + return ..() diff --git a/code/modules/xenoarcheaology/misc.dm b/code/modules/xenoarcheaology/misc.dm index 971793eff31..9da2251d4af 100644 --- a/code/modules/xenoarcheaology/misc.dm +++ b/code/modules/xenoarcheaology/misc.dm @@ -8,31 +8,31 @@ P.name = "Memo RE: proper analysis procedure" P.info = "
We keep test dummies in pens here for a reason, so standard procedure should be to activate newfound alien artifacts and place the two in close proximity. Promising items I might even approve monkey testing on." P.stamped = list(/obj/item/stamp/rd) - P.overlays = list("paper_stamped_rd") + P.add_overlay(list("paper_stamped_rd")) P = new(src) P.name = "Memo RE: materials gathering" P.info = "Corasang,
the hands-on approach to gathering our samples may very well be slow at times, but it's safer than allowing the blundering miners to roll willy-nilly over our dig sites in their mechs, destroying everything in the process. And don't forget the escavation tools on your way out there!
- R.W" P.stamped = list(/obj/item/stamp/rd) - P.overlays = list("paper_stamped_rd") + P.add_overlay(list("paper_stamped_rd")) P = new(src) P.name = "Memo RE: ethical quandaries" P.info = "Darion-

I don't care what his rank is, our business is that of science and knowledge - questions of moral application do not come into this. Sure, so there are those who would employ the energy-wave particles my modified device has managed to abscond for their own personal gain, but I can hardly see the practical benefits of some of these artifacts our benefactors left behind. Ward--" P.stamped = list(/obj/item/stamp/rd) - P.overlays = list("paper_stamped_rd") + P.add_overlay(list("paper_stamped_rd")) P = new(src) P.name = "READ ME! Before you people destroy any more samples" P.info = "how many times do i have to tell you people, these xeno-arch samples are del-i-cate, and should be handled so! careful application of a focussed, concentrated heat or some corrosive liquids should clear away the extraneous carbon matter, while application of an energy beam will most decidedly destroy it entirely - like someone did to the chemical dispenser! W, the one who signs your paychecks" P.stamped = list(/obj/item/stamp/rd) - P.overlays = list("paper_stamped_rd") + P.add_overlay(list("paper_stamped_rd")) P = new(src) P.name = "Reminder regarding the anomalous material suits" P.info = "Do you people think the anomaly suits are cheap to come by? I'm about a hair trigger away from instituting a log book for the damn things. Only wear them if you're going out for a dig, and for god's sake don't go tramping around in them unless you're field testing something, R" P.stamped = list(/obj/item/stamp/rd) - P.overlays = list("paper_stamped_rd") + P.add_overlay(list("paper_stamped_rd")) /obj/structure/bookcase/manuals/xenoarchaeology name = "Xenoarchaeology Manuals bookcase" diff --git a/code/modules/xenoarcheaology/sampling.dm b/code/modules/xenoarcheaology/sampling.dm index 18304bbd895..101ad6db746 100644 --- a/code/modules/xenoarcheaology/sampling.dm +++ b/code/modules/xenoarcheaology/sampling.dm @@ -143,8 +143,8 @@ //update the sample bag filled_bag.icon_state = "evidence" var/image/I = image("icon"=R, "layer"=FLOAT_LAYER) - filled_bag.overlays += I - filled_bag.overlays += "evidence" + filled_bag.add_overlay(I) + filled_bag.add_overlay("evidence") filled_bag.w_class = ITEMSIZE_TINY to_chat(user, "You take a core sample of the [item_to_sample].") diff --git a/code/modules/xenoarcheaology/tools/artifact_analyser.dm b/code/modules/xenoarcheaology/tools/artifact_analyser.dm index d3c963ab8f9..898019ed7ec 100644 --- a/code/modules/xenoarcheaology/tools/artifact_analyser.dm +++ b/code/modules/xenoarcheaology/tools/artifact_analyser.dm @@ -107,7 +107,7 @@ P.info += "
" P.info += "\icon[scanned_object] [results]" P.stamped = list(/obj/item/stamp) - P.overlays = list("paper_stamped") + P.add_overlay(list("paper_stamped")) if(scanned_object && istype(scanned_object, /obj/machinery/artifact)) var/obj/machinery/artifact/A = scanned_object diff --git a/code/modules/xenoarcheaology/tools/geosample_scanner.dm b/code/modules/xenoarcheaology/tools/geosample_scanner.dm index a1e5d8d7f9c..d7a409b7ae7 100644 --- a/code/modules/xenoarcheaology/tools/geosample_scanner.dm +++ b/code/modules/xenoarcheaology/tools/geosample_scanner.dm @@ -301,7 +301,7 @@ var/obj/item/paper/P = new(src) P.name = "[src] report #[++report_num]: [scanned_item.name]" P.stamped = list(/obj/item/stamp) - P.overlays = list("paper_stamped") + P.add_overlay(list("paper_stamped")) //work out data var/data = " - Mundane object: [scanned_item.desc ? scanned_item.desc : "No information on record."]
" diff --git a/code/modules/xenoarcheaology/tools/suspension_generator.dm b/code/modules/xenoarcheaology/tools/suspension_generator.dm index 2449f90b310..6032a9d1acf 100644 --- a/code/modules/xenoarcheaology/tools/suspension_generator.dm +++ b/code/modules/xenoarcheaology/tools/suspension_generator.dm @@ -30,7 +30,7 @@ for(var/obj/item/I in T) if(!suspension_field.contents.len) suspension_field.icon_state = "energynet" - suspension_field.overlays += "shield2" + suspension_field.add_overlay("shield2") I.forceMove(suspension_field) else deactivate() @@ -151,7 +151,7 @@ if(collected) suspension_field.icon_state = "energynet" - suspension_field.overlays += "shield2" + suspension_field.add_overlay("shield2") visible_message(SPAN_NOTICE("[icon2html(thing = suspension_field, target = world)] [suspension_field] gently absconds [collected > 1 ? "something" : "several things"].")) else if(istype(T,/turf/simulated/mineral) || istype(T,/turf/simulated/wall)) diff --git a/code/modules/xenobio2/mob/slime/slime life.dm b/code/modules/xenobio2/mob/slime/slime life.dm index aa821e964a1..fde2ae06ace 100644 --- a/code/modules/xenobio2/mob/slime/slime life.dm +++ b/code/modules/xenobio2/mob/slime/slime life.dm @@ -36,7 +36,7 @@ Slime specific life events go here. I.icon_state = "aslime-sad" else I.icon_state = "aslime-angry" - overlays += I + add_overlay(I) emote_on = 1 spawn(30) GenerateAdultIcon() @@ -46,7 +46,7 @@ Slime specific life events go here. if(is_child) icon_state = "slime baby dead" else - overlays.Cut() + cut_overlay() icon_state = "slime adult dead" color = traitdat.traits[TRAIT_XENO_COLOR] diff --git a/code/modules/xenobio2/mob/slime/slime procs.dm b/code/modules/xenobio2/mob/slime/slime procs.dm index f236d0ac3a5..116a463e985 100644 --- a/code/modules/xenobio2/mob/slime/slime procs.dm +++ b/code/modules/xenobio2/mob/slime/slime procs.dm @@ -61,7 +61,7 @@ Slime specific procs go here. GenerateAdult() /mob/living/simple_mob/xeno/slime/proc/GenerateChild() - overlays.Cut() + cut_overlay() name = "[nameVar] baby slime" real_name = "[nameVar] baby slime" desc = "A shifting blob of [nameVar] goo." @@ -75,7 +75,7 @@ Slime specific procs go here. return 1 /mob/living/simple_mob/xeno/slime/proc/GenerateAdult() - overlays.Cut() + cut_overlay() name = "[nameVar] slime" real_name = "[nameVar] slime" desc = "A shifting mass of [nameVar] goo." @@ -85,12 +85,13 @@ Slime specific procs go here. GenerateAdultIcon() /mob/living/simple_mob/xeno/slime/proc/GenerateAdultIcon() //Hack and slash adventure game to make slimes have no color on light effects later - overlays.Cut() + cut_overlays() + var/list/overlays_to_add = list() var/image/Img = new(src.icon) Img.icon_state = "slime adult" Img.color = traitdat.traits[TRAIT_XENO_COLOR] Img.layer = src.layer - overlays += Img + overlays_to_add += Img switch(overlay) if(SHINYOVERLAY) @@ -99,7 +100,7 @@ Slime specific procs go here. I.icon_state = "slime shiny" I.layer = src.layer + 0.1 I.color = "#FFFFFF" - overlays += I + overlays_to_add += I if(LIGHTOVERLAY) var/image/I = new(src.icon) I.icon = src.icon @@ -107,7 +108,8 @@ Slime specific procs go here. I.icon_state = "slime light" I.layer = src.layer + 0.1 I.color = "#FFFFFF" - overlays += I + overlays_to_add += I + add_overlay(overlays_to_add) /mob/living/simple_mob/xeno/slime/handle_reagents() if(!stasis)