diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index 8e7637e6f1..8af0308677 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -48,12 +48,15 @@ build_icons() /obj/machinery/atmospherics/omni/update_icon() + cut_overlays() if(stat & NOPOWER) - overlays = overlays_off + add_overlay(overlays_off) else if(error_check()) - overlays = overlays_error + add_overlay(overlays_error) + else if (use_power) + add_overlay(overlays_on) else - overlays = use_power ? (overlays_on) : (overlays_off) + add_overlay(overlays_off) underlays = underlays_current diff --git a/code/ATMOSPHERICS/pipes/universal.dm b/code/ATMOSPHERICS/pipes/universal.dm index e6a0af680b..f2a5307485 100644 --- a/code/ATMOSPHERICS/pipes/universal.dm +++ b/code/ATMOSPHERICS/pipes/universal.dm @@ -54,8 +54,10 @@ alpha = 255 - overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") + cut_overlays() + var/icon/add = icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") + add_overlay(add) + underlays.Cut() if (node1) diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm index 5d82b722eb..3c62e20093 100644 --- a/code/_onclick/hud/ability_screen_objects.dm +++ b/code/_onclick/hud/ability_screen_objects.dm @@ -53,14 +53,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() /obj/screen/movable/ability_master/proc/open_ability_master() diff --git a/code/_onclick/hud/picture_in_picture.dm b/code/_onclick/hud/picture_in_picture.dm index 88312441e8..93c41e7c10 100644 --- a/code/_onclick/hud/picture_in_picture.dm +++ b/code/_onclick/hud/picture_in_picture.dm @@ -59,7 +59,7 @@ var/matrix/M = matrix() M.Translate(0, (height + 0.25) * world.icon_size) move_tab.transform = M - overlays += move_tab + add_overlay(move_tab) if(!button_x) button_x = new /obj/screen/component_button(null, src) @@ -102,6 +102,7 @@ /obj/screen/movable/pic_in_pic/proc/add_background() if((width > 0) && (height > 0)) + var/list/add = list() for(var/mutable_appearance/dir in background_mas) var/matrix/M = matrix() var/x_scale = 1 @@ -129,7 +130,8 @@ M.Scale(x_scale, y_scale) M.Translate(x_off, y_off) dir.transform = M - overlays += dir + add += dir + add_overlay(add) /obj/screen/movable/pic_in_pic/proc/set_view_size(width, height, do_refresh = TRUE) width = clamp(width, 0, max_dimensions) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 826ed07e46..e33d596ac0 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -873,13 +873,13 @@ var/hud_state = ammo_type[1] var/hud_state_empty = ammo_type[2] - overlays.Cut() + cut_overlays() var/empty = image('icons/mob/screen_ammo.dmi', src, "[hud_state_empty]") if(rounds == 0) if(warned) - overlays += empty + add_overlay(empty) else warned = TRUE var/obj/screen/ammo/F = new /obj/screen/ammo(src) @@ -889,24 +889,26 @@ spawn(20) user.client.screen -= F qdel(F) - overlays += empty + add_overlay(empty) else warned = FALSE - overlays += image('icons/mob/screen_ammo.dmi', src, "[hud_state]") + var/image/image = image('icons/mob/screen_ammo.dmi', src, "[hud_state]") + add_overlay(image) + var/list/add = list() rounds = num2text(rounds) - //Handle the amount of rounds switch(length(rounds)) if(1) - overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[1]]") + add += image('icons/mob/screen_ammo.dmi', src, "o[rounds[1]]") if(2) - overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[2]]") - overlays += image('icons/mob/screen_ammo.dmi', src, "t[rounds[1]]") + add += image('icons/mob/screen_ammo.dmi', src, "o[rounds[2]]") + add += image('icons/mob/screen_ammo.dmi', src, "t[rounds[1]]") if(3) - overlays += image('icons/mob/screen_ammo.dmi', src, "o[rounds[3]]") - overlays += image('icons/mob/screen_ammo.dmi', src, "t[rounds[2]]") - overlays += image('icons/mob/screen_ammo.dmi', src, "h[rounds[1]]") + add += image('icons/mob/screen_ammo.dmi', src, "o[rounds[3]]") + add += image('icons/mob/screen_ammo.dmi', src, "t[rounds[2]]") + add += image('icons/mob/screen_ammo.dmi', src, "h[rounds[1]]") else //"0" is still length 1 so this means it's over 999 - overlays += image('icons/mob/screen_ammo.dmi', src, "o9") - overlays += image('icons/mob/screen_ammo.dmi', src, "t9") - overlays += image('icons/mob/screen_ammo.dmi', src, "h9") \ No newline at end of file + add += image('icons/mob/screen_ammo.dmi', src, "o9") + add += image('icons/mob/screen_ammo.dmi', src, "t9") + add += image('icons/mob/screen_ammo.dmi', src, "h9") + add_overlay(add) diff --git a/code/_onclick/hud/spell_screen_objects.dm b/code/_onclick/hud/spell_screen_objects.dm index cbd60b4c2b..5b668e915b 100644 --- a/code/_onclick/hud/spell_screen_objects.dm +++ b/code/_onclick/hud/spell_screen_objects.dm @@ -43,14 +43,14 @@ spell_holder.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) open_spellmaster() update_spells(1) showing = 1 - overlays.len = 0 - overlays.Add(open_state) + cut_overlays() + add_overlay(open_state) /obj/screen/movable/spell_master/proc/open_spellmaster() var/list/screen_loc_xy = splittext(screen_loc,",") @@ -189,7 +189,7 @@ 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) cut_overlay(last_charged_icon) last_charged_icon = partial_charge diff --git a/code/controllers/subsystems/skybox.dm b/code/controllers/subsystems/skybox.dm index 3df25b0f4f..65b0917fca 100644 --- a/code/controllers/subsystems/skybox.dm +++ b/code/controllers/subsystems/skybox.dm @@ -78,25 +78,29 @@ SUBSYSTEM_DEF(skybox) if(settings.use_stars) var/image/stars = image(settings.icon, settings.star_state) stars.appearance_flags = RESET_COLOR - base.overlays += stars + base.add_overlay(stars) - res.overlays += base + res.add_overlay(base) if(global.using_map.use_overmap && settings.use_overmap_details) var/obj/effect/overmap/visitable/O = get_overmap_sector(z) if(istype(O)) var/image/overmap = image(settings.icon) - overmap.overlays += O.generate_skybox() + overmap.add_overlay(O.generate_skybox()) + var/list/add = list() for(var/obj/effect/overmap/visitable/other in O.loc) if(other != O) - overmap.overlays += other.get_skybox_representation() + add += other.get_skybox_representation() + overmap.add_overlay(add) overmap.appearance_flags = RESET_COLOR - res.overlays += overmap + res.add_overlay(overmap) // Allow events to apply custom overlays to skybox! (Awesome!) + var/list/add = list() for(var/datum/event/E in SSevents.active_events) if(E.has_skybox_image && E.isRunning && (z in E.affecting_z)) - res.overlays += E.get_skybox_image() + add += E.get_skybox_image() + res.add_overlay(add) return res diff --git a/code/game/gamemodes/cult/cultify/mob.dm b/code/game/gamemodes/cult/cultify/mob.dm index 9c63b8857e..fa263e8c85 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 5290dc86f0..a5c44ffbea 100644 --- a/code/game/gamemodes/cult/soulstone.dm +++ b/code/game/gamemodes/cult/soulstone.dm @@ -140,7 +140,7 @@ S.real_name = "Shade of [T.real_name]" S.icon = T.icon S.icon_state = T.icon_state - S.overlays = T.overlays + S.copy_overlays(T, TRUE) 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 44b64b2691..65094bba7b 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() for(var/mob/M in player_list) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index fe40d63d4e..89692d30af 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -131,7 +131,7 @@ update_flag */ if (src.destroyed) - src.overlays = 0 + cut_overlays() src.icon_state = text("[]-1", src.canister_color) return diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 51155e6c53..98213ecb66 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -175,7 +175,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 && !(stat & (NOPOWER|BROKEN))) icon_state = "scrubber:1" diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index f6ce390c86..7575d8b697 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -69,11 +69,11 @@ return ..() /obj/machinery/organ_printer/update_icon() - overlays.Cut() + cut_overlays() if(panel_open) - overlays += "bioprinter_panel_open" + add_overlay("bioprinter_panel_open") if(printing) - overlays += "bioprinter_working" + add_overlay("bioprinter_working") /obj/machinery/organ_printer/Initialize() . = ..() diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 6951d0abb2..e23a4daf20 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -759,7 +759,7 @@ About the new airlock wires panel: else icon_state = "door_closed" if(p_open || welded) - overlays = list() + cut_overlays() if(p_open) add_overlay("panel_open") if (!(stat & NOPOWER)) diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 437814cbc4..f3c5e33ae5 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -109,7 +109,7 @@ if(unlocked) if(open) open = 0 - overlays = null + cut_overlays() to_chat(user, "You crowbar the battery panel in place.") else if(unlocked) diff --git a/code/game/mecha/mech_prosthetics.dm b/code/game/mecha/mech_prosthetics.dm index 05f0e71c86..14e30b5b19 100644 --- a/code/game/mecha/mech_prosthetics.dm +++ b/code/game/mecha/mech_prosthetics.dm @@ -49,11 +49,11 @@ update_icon() /obj/machinery/pros_fabricator/update_icon() - overlays.Cut() + cut_overlays() icon_state = initial(icon_state) if(panel_open) - overlays.Add(image(icon, "[icon_state]_panel")) + add_overlay(image(icon, "[icon_state]_panel")) if(stat & NOPOWER) return if(busy) diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm index 2e21990246..529c6e5405 100644 --- a/code/game/mecha/mecha_construction_paths.dm +++ b/code/game/mecha/mecha_construction_paths.dm @@ -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 diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 635df3e730..e61fe74c51 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -604,7 +604,7 @@ var/list/global/slot_flags_enumeration = list( /obj/item/clean_blood() . = ..() if(blood_overlay) - overlays.Remove(blood_overlay) + cut_overlay(blood_overlay) /obj/item/reveal_blood() if(was_bloodied && !fluorescent) @@ -626,7 +626,7 @@ var/list/global/slot_flags_enumeration = list( //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/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 79d1a97411..07e6787741 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -87,10 +87,10 @@ return TRUE /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 @@ -182,4 +182,4 @@ AI.adjustOxyLoss(2) AI.updatehealth() sleep(10) - flush = FALSE \ No newline at end of file + flush = FALSE diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index 0a2c81fbb3..ab27511e43 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -39,7 +39,7 @@ saved_item = target.type saved_icon = target.icon saved_icon_state = target.icon_state - saved_overlays = target.overlays + saved_overlays = target.overlays.Copy() /obj/item/chameleon/proc/toggle() if(!can_use || !saved_item) return @@ -99,7 +99,8 @@ desc = O.desc icon = new_icon icon_state = new_iconstate - overlays = new_overlays + cut_overlays() + add_overlay(new_overlays) set_dir(O.dir) M.loc = src master = C diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index bb565340fd..1d41d3ee9a 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -308,7 +308,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/paicard) var/current_emotion = 1 /obj/item/paicard/proc/setEmotion(var/emotion) if(pai) - src.overlays.Cut() + cut_overlays() switch(emotion) if(1) add_overlay("pai-happy") if(2) add_overlay("pai-cat") diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index 3edc307a3a..e490770da8 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -90,7 +90,7 @@ if(istype(scanned, /obj/machinery/atmospherics/pipe)) var/obj/machinery/atmospherics/pipe/P = scanned I.color = P.pipe_color - I.add_overlay(P.overlays) + I.copy_overlays(P) I.alpha = 128 I.mouse_opacity = 0 diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm index 8c674ea50b..1fc526d3d7 100644 --- a/code/game/objects/items/weapons/policetape.dm +++ b/code/game/objects/items/weapons/policetape.dm @@ -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/tape.dm b/code/game/objects/items/weapons/tape.dm index 9c3fa43f68..3eccb48678 100644 --- a/code/game/objects/items/weapons/tape.dm +++ b/code/game/objects/items/weapons/tape.dm @@ -134,7 +134,7 @@ W.forceMove(src) icon_state = W.icon_state + "_taped" name = W.name + " (taped)" - overlays = W.overlays + copy_overlays(W, TRUE) /obj/item/ducttape/attack_self(mob/user) if(!stuck) @@ -146,7 +146,7 @@ stuck.forceMove(get_turf(src)) user.put_in_hands(stuck) stuck = null - overlays = null + cut_overlays() qdel(src) /obj/item/ducttape/attackby(var/obj/item/I, var/mob/user) diff --git a/code/game/objects/structures/flora/trees.dm b/code/game/objects/structures/flora/trees.dm index 3a6eda3aea..6b8ca8c5d1 100644 --- a/code/game/objects/structures/flora/trees.dm +++ b/code/game/objects/structures/flora/trees.dm @@ -292,4 +292,5 @@ 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 = PLANE_LIGHTING_ABOVE - overlays = list(glow) + cut_overlays() + add_overlay(glow) 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 bcf36bb620..d8c6b33387 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -313,7 +313,7 @@ var/image/I = image(icon, "[base_icon]_over") I.layer = ABOVE_MOB_LAYER I.plane = MOB_PLANE - overlays |= I + add_overlay(I) /obj/structure/bed/chair/modern_bar_stool name = "bar stool" diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index f1fb7ba3ca..c70cf37449 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -84,14 +84,13 @@ updateSilicate() /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) @@ -458,7 +457,7 @@ /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() if(!is_fulltile()) // Rotate the sprite somewhat so non-fulltiled windows can be seen as needing repair. var/full_tilt_degrees = 15 @@ -478,9 +477,11 @@ var/list/connections = dirs_to_corner_states(dirs) icon_state = "" + var/list/add = list() for(var/i = 1 to 4) - var/image/I = image(icon, "[basestate][connections[i]]", dir = 1<<(i-1)) - overlays += I + var/image/image = image(icon, "[basestate][connections[i]]", dir = 1<<(i-1)) + add += image + add_overlay(add) // Damage overlays. var/ratio = health / maxhealth @@ -488,8 +489,7 @@ if(ratio > 75) return - var/image/I = image(icon, "damage[ratio]", layer = layer + 0.1) - overlays += I + add_overlay(image(icon, "damage[ratio]", layer = layer + 0.1)) return diff --git a/code/modules/admin/verbs/grief_fixers.dm b/code/modules/admin/verbs/grief_fixers.dm index b8815876b2..a2eb2df3d1 100644 --- a/code/modules/admin/verbs/grief_fixers.dm +++ b/code/modules/admin/verbs/grief_fixers.dm @@ -40,7 +40,7 @@ for(var/turf/simulated/T in world) T.air = null - T.overlays.Remove(unsorted_overlays) + T.cut_overlay(unsorted_overlays) T.zone = null to_chat(usr, "\[4/5\] - All turfs reset to roundstart values.") diff --git a/code/modules/blob2/mobs/spore.dm b/code/modules/blob2/mobs/spore.dm index 91aa9d47c9..e8ee223eed 100644 --- a/code/modules/blob2/mobs/spore.dm +++ b/code/modules/blob2/mobs/spore.dm @@ -63,7 +63,7 @@ if(is_infesting) cut_overlays() icon = infested.icon - add_overlay(infested.overlays) + copy_overlays(infested) 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 diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index db48e9e9d5..41eeb32f63 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -51,7 +51,7 @@ set_clothing_index() /obj/item/clothing/update_icon() - overlays.Cut() //This removes all the overlays on the sprite and then goes down a checklist adding them as required. + cut_overlays() if(blood_DNA) add_blood() . = ..() @@ -618,7 +618,7 @@ usr.visible_message("\The [usr] pulls a knife out of their boot!") playsound(src, 'sound/weapons/holster/sheathout.ogg', 25) 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.") holding.forceMove(src) @@ -665,7 +665,7 @@ /obj/item/clothing/shoes/update_icon() . = ..() if(holding) - overlays += image(icon, "[icon_state]_knife") + add_overlay(image(icon, "[icon_state]_knife")) if(ismob(usr)) var/mob/M = usr M.update_inv_shoes() diff --git a/code/modules/compass/compass_holder.dm b/code/modules/compass/compass_holder.dm index b4f739224e..2f1e065b7d 100644 --- a/code/modules/compass/compass_holder.dm +++ b/code/modules/compass/compass_holder.dm @@ -72,10 +72,12 @@ . = 0 /obj/compass_holder/update_icon() - var/set_overlays = (compass_static_labels | compass_waypoint_markers) + var/list/add = (compass_static_labels | compass_waypoint_markers) if(show_heading) - set_overlays |= compass_heading_marker - overlays = set_overlays + add |= compass_heading_marker + if (add.len) + cut_overlays() + add_overlay(add) /obj/compass_holder/proc/clear_waypoint(var/id) LAZYREMOVE(compass_waypoints, id) diff --git a/code/modules/detectivework/microscope/microscope.dm b/code/modules/detectivework/microscope/microscope.dm index 62675a5d64..012f014cec 100644 --- a/code/modules/detectivework/microscope/microscope.dm +++ b/code/modules/detectivework/microscope/microscope.dm @@ -39,7 +39,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/food/food/snacks.dm b/code/modules/food/food/snacks.dm index c56d6741d1..352041986d 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -4319,16 +4319,13 @@ //Called by cooking machines. This is mainly intended to set properties on the food that differ between raw/cooked /obj/item/reagent_containers/food/snacks/proc/cook() if (coating) - var/list/temp = overlays.Copy() - for (var/i in temp) - if (istype(i, /image)) - var/image/I = i - if (I.tag == "coating") - temp.Remove(I) - break - - overlays = temp - //Carefully removing the old raw-batter overlay + var/image/coating_overlay + for (var/image/image in overlays) + if (image.tag == "coating") + coating_overlay = image + break + if (coating_overlay) + cut_overlay(coating_overlay) if (!flat_icon) flat_icon = getFlatIcon(src) diff --git a/code/modules/food/kitchen/cooking_machines/cereal.dm b/code/modules/food/kitchen/cooking_machines/cereal.dm index 14839cfcf9..cafb952288 100644 --- a/code/modules/food/kitchen/cooking_machines/cereal.dm +++ b/code/modules/food/kitchen/cooking_machines/cereal.dm @@ -48,7 +48,7 @@ var/image/food_image = image(I.icon, I.icon_state) food_image.color = I.color - food_image.add_overlay(I.overlays) + food_image.copy_overlays(I) food_image.transform *= 0.7 - (num * 0.05) food_image.pixel_x = rand(-2,2) food_image.pixel_y = rand(-3,5) diff --git a/code/modules/hydroponics/trays/tray_update_icons.dm b/code/modules/hydroponics/trays/tray_update_icons.dm index 1a816abb3f..7930965979 100644 --- a/code/modules/hydroponics/trays/tray_update_icons.dm +++ b/code/modules/hydroponics/trays/tray_update_icons.dm @@ -17,15 +17,14 @@ if(!isnull(seed)) if(mechanical && health <= (seed.get_trait(TRAIT_ENDURANCE) / 2)) - overlays += "over_lowhealth3" - + add_overlay("over_lowhealth3") if(dead) var/ikey = "[seed.get_trait(TRAIT_PLANT_ICON)]-dead" var/image/dead_overlay = plant_controller.plant_icon_cache["[ikey]"] if(!dead_overlay) dead_overlay = image('icons/obj/hydroponics_growing.dmi', "[ikey]") dead_overlay.color = DEAD_PLANT_COLOUR - overlays |= dead_overlay + add_overlay(dead_overlay) else if(!seed.growth_stages) seed.update_growth_stages() @@ -49,7 +48,7 @@ plant_overlay = image('icons/obj/hydroponics_growing.dmi', "[ikey]") plant_overlay.color = seed.get_trait(TRAIT_PLANT_COLOUR) plant_controller.plant_icon_cache["[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"] = plant_overlay - overlays |= plant_overlay + add_overlay(plant_overlay) if(harvest && overlay_stage == seed.growth_stages) ikey = "[seed.get_trait(TRAIT_PRODUCT_ICON)]" @@ -58,25 +57,27 @@ harvest_overlay = image('icons/obj/hydroponics_products.dmi', "[ikey]") harvest_overlay.color = seed.get_trait(TRAIT_PRODUCT_COLOUR) plant_controller.plant_icon_cache["product-[ikey]-[seed.get_trait(TRAIT_PRODUCT_COLOUR)]"] = harvest_overlay - overlays |= harvest_overlay + add_overlay(harvest_overlay) //Draw the cover. if(closed_system) - overlays += "hydrocover" + add_overlay("hydrocover") //Updated the various alert icons. if(mechanical) + var/list/add = list() if(waterlevel <= 10) - overlays += "over_lowwater3" + add += "over_lowwater3" if(nutrilevel <= 2) - overlays += "over_lownutri3" + add += "over_lownutri3" if(weedlevel >= 5 || pestlevel >= 5 || toxins >= 40) - overlays += "over_alert3" + add += "over_alert3" if(harvest) - overlays += "over_harvest3" + add += "over_harvest3" if(frozen) - overlays += "over_frozen3" + add += "over_frozen3" + add_overlay(add) // Update bioluminescence. if(seed) diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 18d843ab46..4103e777f2 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -93,7 +93,7 @@ drop_l_hand() 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() healths.icon_state = "health6" timeofdeath = world.time diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index eaa302191d..70189568a1 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -441,7 +441,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")) qdel(W) else if(istype(W, /obj/item/melee/baton) && build_step == 3) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index ed6ae55d9c..4589645ed6 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -195,7 +195,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() else DI = damage_icon_parts[cache_index] - standing_image.overlays += DI + standing_image.add_overlay(DI) overlays_standing[MOB_DAM_LAYER] = standing_image apply_layer(MOB_DAM_LAYER) @@ -537,7 +537,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() for(var/mut in mutations) if(mut == LASER) - standing.overlays += "lasereyes_s" //TODO + standing.add_overlay("lasereyes_s") overlays_standing[MUTATIONS_LAYER] = standing apply_layer(MUTATIONS_LAYER) @@ -1038,7 +1038,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() 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) overlays_standing[MODIFIER_EFFECTS_LAYER] = effects @@ -1084,7 +1084,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() 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) if(total.overlays.len) overlays_standing[SURGERY_LAYER] = total diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index f423f8963b..d4055812b2 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -237,7 +237,7 @@ dropspot = target.loc - overlays = null + cut_overlays() var droppedSomething = 0 diff --git a/code/modules/mob/living/voice/voice.dm b/code/modules/mob/living/voice/voice.dm index 575c85b088..7d595423ab 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, TRUE) 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 b482146835..febb587480 100644 --- a/code/modules/modular_computers/computers/modular_computer/core.dm +++ b/code/modules/modular_computers/computers/modular_computer/core.dm @@ -74,20 +74,23 @@ cut_overlays() if(bsod) - overlays += image(icon = overlay_icon, icon_state = "bsod") + add_overlay(image(overlay_icon, "bsod")) return if(!enabled) if(icon_state_screensaver) - overlays += image(icon = overlay_icon, icon_state = icon_state_screensaver) + add_overlay(image(overlay_icon, icon_state_screensaver)) set_light(0) return set_light(light_strength) if(active_program) - overlays += image(icon = overlay_icon, icon_state = active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu) - if(active_program.program_key_state) - overlays += image(icon = overlay_icon, icon_state = active_program.program_key_state) + var/list/add = list( + image(overlay_icon, active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu) + ) + if (active_program.program_key_state) + add += image(overlay_icon, active_program.program_key_state) + add_overlay(add) else - overlays += image(icon = overlay_icon, icon_state = icon_state_menu) + add_overlay(image(overlay_icon, icon_state_menu)) /obj/item/modular_computer/proc/turn_on(var/mob/user) if(bsod) diff --git a/code/modules/multiz/turf.dm b/code/modules/multiz/turf.dm index e97ba76a0a..c833a6251c 100644 --- a/code/modules/multiz/turf.dm +++ b/code/modules/multiz/turf.dm @@ -128,7 +128,7 @@ temp2.icon_state = null temp2.plane = src.plane temp2.color = O.color - temp2.overlays += O.overlays + temp2.copy_overlays(O) // TODO Is pixelx/y needed? o_img += temp2 add_overlay(o_img) diff --git a/code/modules/multiz/zshadow.dm b/code/modules/multiz/zshadow.dm index f3ae564b43..ad86c06425 100644 --- a/code/modules/multiz/zshadow.dm +++ b/code/modules/multiz/zshadow.dm @@ -55,7 +55,7 @@ INITIALIZE_IMMEDIATE(/mob/zshadow) icon_state = M.icon_state //color = M.color color = "#848484" - overlays = M.overlays + copy_overlays(M, TRUE) transform = M.transform dir = M.dir invisibility = M.invisibility @@ -118,10 +118,10 @@ INITIALIZE_IMMEDIATE(/mob/zshadow) if(!typing_indicator) init_typing_indicator("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/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index 2d2b43be5c..3de1c505ce 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -38,7 +38,7 @@ cut_overlays() if(toppaper) add_overlay(toppaper.icon_state) - add_overlay(toppaper.overlays) + copy_overlays(toppaper) if(haspen) add_overlay("clipboard_pen") add_overlay("clipboard_over") diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index b686fc368c..890520d685 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -369,12 +369,17 @@ GLOBAL_LIST_EMPTY(apcs) if(update & 2) cut_overlays() if(!(stat & (BROKEN|MAINT)) && update_state & UPDATE_ALLGOOD) - overlays += status_overlays_lock[locked+1] - overlays += 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] + var/list/add = list( + status_overlays_lock[locked+1], + status_overlays_charging[charging+1] + ) + if (operating) + add += list( + status_overlays_equipment[equipment+1], + status_overlays_lighting[lighting+1], + status_overlays_environ[environ+1] + ) + add_overlay(add) if(update & 3) if(update_state & UPDATE_BLUESCREEN) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index d22a8f9f1e..386dcb46bc 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -132,9 +132,9 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) dissipate_delay = 10 dissipate_track = 0 dissipate_strength = 1 - overlays = 0 + cut_overlays() if(chained) - overlays = "chain_s1" + add_overlay("chain_s1") visible_message("The singularity has shrunk to a rather pitiful size.") if (STAGE_TWO) //1 to 3 does not check for the turfs if you put the gens right next to a 1x1 then its going to eat them. name = "gravitational singularity" @@ -149,9 +149,9 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) dissipate_delay = 10 dissipate_track = 0 dissipate_strength = 5 - overlays = 0 + cut_overlays() if(chained) - overlays = "chain_s3" + add_overlay("chain_s3") if(growing) visible_message("The singularity noticeably grows in size.") else @@ -170,9 +170,9 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) dissipate_delay = 4 dissipate_track = 0 dissipate_strength = 20 - overlays = 0 + cut_overlays() if(chained) - overlays = "chain_s5" + add_overlay("chain_s5") if(growing) visible_message("The singularity expands to a reasonable size.") else @@ -191,9 +191,9 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) dissipate_delay = 10 dissipate_track = 0 dissipate_strength = 8 - overlays = 0 + cut_overlays() if(chained) - overlays = "chain_s7" + add_overlay("chain_s7") if(growing) visible_message("The singularity expands to a dangerous size.") else @@ -209,9 +209,9 @@ 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 + cut_overlays() if(chained) - overlays = "chain_s9" + add_overlay("chain_s9") if(growing) visible_message("The singularity has grown out of control!") else @@ -229,7 +229,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) @@ -456,7 +456,7 @@ 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) @@ -472,7 +472,7 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) /obj/singularity/proc/on_release() chained = 0 - overlays = 0 + cut_overlays() move_self = 1 /obj/singularity/singularity_act(S, size) diff --git a/code/modules/projectiles/guns/magnetic/bore.dm b/code/modules/projectiles/guns/magnetic/bore.dm index 9f046c560a..41ebae01d8 100644 --- a/code/modules/projectiles/guns/magnetic/bore.dm +++ b/code/modules/projectiles/guns/magnetic/bore.dm @@ -49,8 +49,8 @@ overlays_to_add += image(icon, "[icon_state]_green") if(mat_storage) overlays_to_add += image(icon, "[icon_state]_loaded") - - overlays = overlays_to_add + cut_overlays() + add_overlay(overlays_to_add) ..() /obj/item/gun/magnetic/matfed/attack_hand(var/mob/user) // It doesn't keep a loaded item inside. diff --git a/code/modules/reagents/machinery/dispenser/reagent_tank.dm b/code/modules/reagents/machinery/dispenser/reagent_tank.dm index 62e720ddc8..098938a901 100644 --- a/code/modules/reagents/machinery/dispenser/reagent_tank.dm +++ b/code/modules/reagents/machinery/dispenser/reagent_tank.dm @@ -129,7 +129,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) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index cdb76f3163..6b17cac379 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -92,7 +92,7 @@ icon_state = initial(icon_state) if(panel_open) - overlays.Add(image(icon, "[icon_state]_panel")) + add_overlay(image(icon, "[icon_state]_panel")) if(stat & NOPOWER) return diff --git a/code/modules/virus2/biohazard destroyer.dm b/code/modules/virus2/biohazard destroyer.dm index 9d86e2217f..3bd256cf7b 100644 --- a/code/modules/virus2/biohazard destroyer.dm +++ b/code/modules/virus2/biohazard destroyer.dm @@ -11,7 +11,7 @@ if(I.type in typesof(path)) user.drop_item() qdel(I) - overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle") + add_overlay(image('icons/obj/pipes/disposal.dmi', "dispover-handle")) return user.drop_item() I.loc = src.loc diff --git a/code/modules/xenoarcheaology/tools/suspension_generator.dm b/code/modules/xenoarcheaology/tools/suspension_generator.dm index dc2491dde7..cda00891d0 100644 --- a/code/modules/xenoarcheaology/tools/suspension_generator.dm +++ b/code/modules/xenoarcheaology/tools/suspension_generator.dm @@ -194,7 +194,7 @@ if(collected) suspension_field.icon_state = "energynet" - suspension_field.overlays += "shield2" + add_overlay("shield2") src.visible_message("[bicon(suspension_field)] [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 4853454476..b0b148f458 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_overlays() 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 f2ee6013b7..7533b388c5 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_animal/xeno/slime/proc/GenerateChild() - overlays.Cut() + cut_overlays() 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_animal/xeno/slime/proc/GenerateAdult() - overlays.Cut() + cut_overlays() name = "[nameVar] slime" real_name = "[nameVar] slime" desc = "A shifting mass of [nameVar] goo." @@ -85,12 +85,12 @@ Slime specific procs go here. GenerateAdultIcon() /mob/living/simple_animal/xeno/slime/proc/GenerateAdultIcon() //Hack and slash adventure game to make slimes have no color on light effects later - overlays.Cut() + cut_overlays() var/image/Img = new(src.icon) Img.icon_state = "slime adult" Img.color = traitdat.traits[TRAIT_XENO_COLOR] Img.layer = src.layer - overlays += Img + add_overlay(Img) switch(overlay) if(SHINYOVERLAY) @@ -99,7 +99,7 @@ Slime specific procs go here. I.icon_state = "slime shiny" I.layer = src.layer + 0.1 I.color = "#FFFFFF" - overlays += I + add_overlay(I) if(LIGHTOVERLAY) var/image/I = new(src.icon) I.icon = src.icon @@ -107,7 +107,7 @@ Slime specific procs go here. I.icon_state = "slime light" I.layer = src.layer + 0.1 I.color = "#FFFFFF" - overlays += I + add_overlay(I) /mob/living/simple_animal/xeno/slime/handle_reagents() if(!stasis)