diff --git a/code/ZAS/Phoron.dm b/code/ZAS/Phoron.dm index f32f2b6e391..187fc3bed65 100644 --- a/code/ZAS/Phoron.dm +++ b/code/ZAS/Phoron.dm @@ -51,11 +51,11 @@ obj/var/contaminated = 0 //Do a contamination overlay? Temporary measure to keep contamination less deadly than it was. if(!contaminated) contaminated = 1 - overlays += contamination_overlay + add_overlay(contamination_overlay, TRUE) /obj/item/proc/decontaminate() contaminated = 0 - overlays -= contamination_overlay + cut_overlay(contamination_overlay, TRUE) /mob/proc/contaminate() diff --git a/code/controllers/subsystems/icon_cache.dm b/code/controllers/subsystems/icon_cache.dm index 7dc36cbe0b1..c448fa53df0 100644 --- a/code/controllers/subsystems/icon_cache.dm +++ b/code/controllers/subsystems/icon_cache.dm @@ -19,6 +19,10 @@ var/list/magazine_icondata_keys = list() var/list/magazine_icondata_states = list() + var/list/stool_cache = list() + var/list/floor_light_cache = list() + var/list/ashtray_cache = list() + /* Global associative list for caching humanoid icons. Index format m or f, followed by a string of 0 and 1 to represent bodyparts followed by husk fat hulk skeleton 1 or 0. diff --git a/code/controllers/subsystems/initialization/xenoarch.dm b/code/controllers/subsystems/initialization/xenoarch.dm index 89feb979b43..ebbe07799bc 100644 --- a/code/controllers/subsystems/initialization/xenoarch.dm +++ b/code/controllers/subsystems/initialization/xenoarch.dm @@ -68,7 +68,7 @@ var/datum/controller/subsystem/xenoarch/SSxenoarch var/datum/find/F = archeo_turf.finds[1] if(F.excavation_required <= F.view_range) archeo_turf.archaeo_overlay = "overlay_archaeo[rand(1,3)]" - archeo_turf.overlays += archeo_turf.archaeo_overlay + archeo_turf.add_overlay(archeo_turf.archaeo_overlay) //have a chance for an artifact to spawn here, but not in animal or plant digsites if(isnull(M.artifact_find) && digsite != 1 && digsite != 2) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index b4a26160792..d160a5c9f7a 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -237,30 +237,33 @@ user.pulling = null /obj/machinery/atmospherics/unary/cryo_cell/update_icon() - overlays.Cut() + cut_overlays() + var/list/ovr = list() icon_state = "pod[on]" var/image/I I = image(icon, "pod[on]_top") I.layer = 5 // this needs to be fairly high so it displays over most things, but it needs to be under lighting (at 10) I.pixel_z = 32 - overlays += I + ovr += I if(occupant) var/image/pickle = image(occupant.icon, occupant.icon_state) pickle.overlays = occupant.overlays pickle.pixel_z = 18 pickle.layer = 5 - overlays += pickle + ovr += pickle I = image(icon, "lid[on]") I.layer = 5 - overlays += I + ovr += I I = image(icon, "lid[on]_top") I.layer = 5 I.pixel_z = 32 - overlays += I + ovr += I + + add_overlay(ovr) /obj/machinery/atmospherics/unary/cryo_cell/proc/process_occupant() if(air_contents.total_moles < 10) diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index 4fa321f4dda..592323fc23f 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -104,16 +104,17 @@ var/list/floor_light_cache = list() update_icon() /obj/machinery/floor_light/update_icon() - overlays.Cut() + cut_overlays() + var/list/floor_light_cache = SSicon_cache.floor_light_cache if(use_power && !broken()) - if(isnull(damaged)) + if(damaged == null) var/cache_key = "floorlight-[default_light_colour]" if(!floor_light_cache[cache_key]) var/image/I = image("[on_state]") 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) @@ -123,7 +124,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 (stat & (BROKEN|NOPOWER)) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index df18a935fe1..072510eea27 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -16,7 +16,7 @@ else icon_state = "" - overlays = null + cut_overlays() if(beaker) var/datum/reagents/reagents = beaker.reagents @@ -34,7 +34,7 @@ if(91 to INFINITY) filling.icon_state = "reagent100" filling.icon += reagents.get_color() - overlays += filling + add_overlay(filling) /obj/machinery/iv_drip/MouseDrop(over_object, src_location, over_location) ..() diff --git a/code/game/machinery/station_holomap.dm b/code/game/machinery/station_holomap.dm index 25667125db4..dde509c6718 100644 --- a/code/game/machinery/station_holomap.dm +++ b/code/game/machinery/station_holomap.dm @@ -213,12 +213,12 @@ 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) diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm index 98e81cb83fd..8490e902f8b 100644 --- a/code/game/mecha/mecha_construction_paths.dm +++ b/code/game/mecha/mecha_construction_paths.dm @@ -77,7 +77,7 @@ 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 @@ -90,11 +90,8 @@ const_holder.icon = 'icons/mecha/mech_construction.dmi' const_holder.icon_state = "ripley0" const_holder.density = 1 - const_holder.overlays.len = 0 - spawn() - qdel(src) - return - + const_holder.cut_overlays() + qdel(src) /datum/construction/reversible/mecha/ripley result = "/obj/mecha/working/ripley" @@ -288,7 +285,7 @@ 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 @@ -568,7 +565,7 @@ 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") user.drop_item() qdel(used_atom) return 1 @@ -792,7 +789,7 @@ 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 @@ -1074,7 +1071,7 @@ 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 @@ -1095,7 +1092,7 @@ 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 diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 2f6864bf703..4680b0be64d 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -14,10 +14,10 @@ var/open_panel = 0 var/image_overlay = null -/obj/item/weapon/plastique/New() +/obj/item/weapon/plastique/Initialize() + . = ..() wires = new(src) image_overlay = image('icons/obj/assemblies.dmi', "plastic-explosive2") - ..() /obj/item/weapon/plastique/Destroy() qdel(wires) @@ -62,13 +62,15 @@ else 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",ckey=key_name(user)) - - target.overlays += image_overlay + + target.add_overlay(image_overlay, TRUE) user << "Bomb has been planted. Timer counting down from [timer]." - spawn(timer*10) - explode(get_turf(target)) -/obj/item/weapon/plastique/proc/explode(var/turf/location) + addtimer(CALLBACK(src, .proc/explode, get_turf(target)), timer * 10) + +/obj/item/weapon/plastique/proc/explode(turf/location) + target.cut_overlay(image_overlay, TRUE) + if(!target) target = get_atom_on_turf(src) if(!target) diff --git a/code/game/objects/items/weapons/material/ashtray.dm b/code/game/objects/items/weapons/material/ashtray.dm index d5e7cd67bb7..bce7a8c19f1 100644 --- a/code/game/objects/items/weapons/material/ashtray.dm +++ b/code/game/objects/items/weapons/material/ashtray.dm @@ -1,5 +1,3 @@ -var/global/list/ashtray_cache = list() - /obj/item/weapon/material/ashtray name = "ashtray" icon = 'icons/obj/objects.dmi' @@ -22,23 +20,20 @@ var/global/list/ashtray_cache = list() /obj/item/weapon/material/ashtray/update_icon() color = null - overlays.Cut() + cut_overlays() + var/list/ashtray_cache = SSicon_cache.ashtray_cache 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] + add_overlay(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"] + add_overlay("ashtray_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"] + add_overlay("ashtray_half") desc = "It's half-filled." else desc = "An ashtray made of [material.display_name]." diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index c4bcf5c854a..a6b4877a8f3 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -216,7 +216,7 @@ 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) ,284) //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) @@ -243,14 +243,14 @@ stored_start.transform = M_start stored_continue.transform = M_continue stored_end.transform = M_end - storage_start.overlays += stored_start - storage_start.overlays += stored_continue - storage_start.overlays += stored_end + storage_start.add_overlay(list(stored_start, stored_continue, stored_end)) O.screen_loc = "4:[round((startpoint+endpoint)/2)+2],2:16" O.maptext = "" O.layer = 20 + storage_start.compile_overlays() + closer.screen_loc = "4:[storage_width+19],2:16" return diff --git a/code/game/objects/items/weapons/trays.dm b/code/game/objects/items/weapons/trays.dm index 08e6d67ebea..439d357efa6 100644 --- a/code/game/objects/items/weapons/trays.dm +++ b/code/game/objects/items/weapons/trays.dm @@ -238,8 +238,8 @@ user.remove_from_mob(I) I.loc = src current_weight += I.w_class - carrying.Add(I) - overlays += image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = 30 + I.layer, "pixel_x" = I.pixel_x, "pixel_y" = I.pixel_y) + carrying += I + add_overlay(image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = 30 + I.layer, "pixel_x" = I.pixel_x, "pixel_y" = I.pixel_y)) //rand(0, (max_offset_y*2)-3)-(max_offset_y)-3 /obj/item/weapon/tray/verb/unload() @@ -255,8 +255,9 @@ for(var/obj/item/I in carrying) I.loc = dropspot - carrying.Remove(I) - overlays.Cut() + carrying -= I + + cut_overlays() current_weight = 0 usr.visible_message("[usr] unloads the tray.", "You unload the tray.") @@ -270,7 +271,9 @@ for(var/obj/item/I in carrying) I.loc = dropspot - carrying.Remove(I) + carrying -= I + + cut_overlays() overlays.Cut() current_weight = 0 usr.visible_message("[usr] unloads the tray.", "You unload the tray.") @@ -281,7 +284,7 @@ //its also called when a cyborg uses its tray on the floor if (current_weight > 0)//can't spill a tray with nothing on it - overlays.Cut() + cut_overlays() //First we have to find where the items are being dropped, unless a location has been passed in if (!dropspot) 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 e43690e0a2a..2252d917195 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -41,22 +41,23 @@ /obj/structure/bed/update_icon() // Prep icon. icon_state = "" - overlays.Cut() + cut_overlays() + var/list/stool_cache = SSicon_cache.stool_cache // Base icon. var/cache_key = "[base_icon]-[material.name]" - if(isnull(stool_cache[cache_key])) + if(!stool_cache[cache_key]) var/image/I = image('icons/obj/furniture.dmi', base_icon) I.color = material.icon_colour stool_cache[cache_key] = I - overlays |= stool_cache[cache_key] + add_overlay(stool_cache[cache_key]) // Padding overlay. if(padding_material) var/padding_cache_key = "[base_icon]-padding-[padding_material.name]" - if(isnull(stool_cache[padding_cache_key])) + if(!stool_cache[padding_cache_key]) 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] + add_overlay(stool_cache[padding_cache_key]) // Strings. desc = initial(desc) 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 14c2ee13461..531ab35010a 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -37,13 +37,15 @@ /obj/structure/bed/chair/update_icon() ..() + var/list/stool_cache = SSicon_cache.stool_cache + var/cache_key = "[base_icon]-[material.name]-over" if(isnull(stool_cache[cache_key])) var/image/I = image('icons/obj/furniture.dmi', "[base_icon]_over") I.color = material.icon_colour I.layer = FLY_LAYER stool_cache[cache_key] = I - overlays |= stool_cache[cache_key] + add_overlay(stool_cache[cache_key]) // Padding overlay. if(padding_material) var/padding_cache_key = "[base_icon]-padding-[padding_material.name]-over" @@ -52,7 +54,7 @@ I.color = padding_material.icon_colour I.layer = FLY_LAYER stool_cache[padding_cache_key] = I - overlays |= stool_cache[padding_cache_key] + add_overlay(stool_cache[padding_cache_key]) if(buckled_mob && padding_material) cache_key = "[base_icon]-armrest-[padding_material.name]" @@ -61,7 +63,7 @@ I.layer = MOB_LAYER + 0.1 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/set_dir() ..() @@ -187,7 +189,7 @@ . = ..() var/image/I = image(icon, "[icon_state]_over") I.layer = FLY_LAYER - overlays += I + add_overlay(I) // Chair types /obj/structure/bed/chair/wood @@ -207,7 +209,7 @@ . = ..(mapload, "wood") var/image/I = image(icon, "[icon_state]_over") I.layer = FLY_LAYER - overlays += I + add_overlay(I) /obj/structure/bed/chair/wood/wings icon_state = "wooden_chair_wings" 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 ee1397fb048..1637ac8b776 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -1,5 +1,4 @@ //Todo: add leather and cloth for arbitrary coloured stools. -var/global/list/stool_cache = list() //haha stool /obj/item/weapon/stool name = "stool" @@ -39,22 +38,23 @@ var/global/list/stool_cache = list() //haha stool /obj/item/weapon/stool/update_icon() // Prep icon. icon_state = "" - overlays.Cut() + cut_overlays() + var/list/stool_cache = SSicon_cache.stool_cache // Base icon. var/cache_key = "stool-[material.name]" - if(isnull(stool_cache[cache_key])) + if(!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] + add_overlay(stool_cache[cache_key]) // Padding overlay. if(padding_material) var/padding_cache_key = "stool-padding-[padding_material.name]" - if(isnull(stool_cache[padding_cache_key])) - var/image/I = image(icon, "stool_padding") + if(!stool_cache[padding_cache_key]) + 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] + add_overlay(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. 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 76ea627eac8..5232a6a7b20 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -10,13 +10,11 @@ var/bloodiness /obj/structure/bed/chair/wheelchair/update_icon() - return + cut_overlays() + add_overlay(image(icon = 'icons/obj/furniture.dmi', icon_state = "w_overlay", layer = FLY_LAYER)) /obj/structure/bed/chair/wheelchair/set_dir() ..() - overlays = null - var/image/O = image(icon = 'icons/obj/furniture.dmi', icon_state = "w_overlay", layer = FLY_LAYER, dir = src.dir) - overlays += O if(buckled_mob) buckled_mob.set_dir(dir) diff --git a/code/modules/economy/cash.dm b/code/modules/economy/cash.dm index 2d1a2fb36ae..e9286f73fea 100644 --- a/code/modules/economy/cash.dm +++ b/code/modules/economy/cash.dm @@ -47,7 +47,8 @@ worth = 0 /obj/item/weapon/spacecash/bundle/update_icon() - overlays.Cut() + cut_overlays() + var/list/ovr = list() var/sum = src.worth var/num = 0 for(var/i in list(1000,500,200,100,50,20,10,1)) @@ -59,14 +60,17 @@ 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 + ovr += banknote if(num == 0) // Less than one credit, 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 + ovr += banknote + + add_overlay(ovr) + compile_overlays() // The delay looks weird, so we force an update immediately. src.desc = "They are worth [worth] credits." /obj/item/weapon/spacecash/bundle/attack_self() @@ -196,4 +200,4 @@ proc/spawn_money(var/sum, spawnloc, mob/living/carbon/human/human_user as mob) worth = 0 user << "The card reads [worth]. Not your lucky day!" scratched = 1 - owner_name = user.name \ No newline at end of file + owner_name = user.name 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 1d694cf6247..ee38c573592 100644 --- a/code/modules/mob/living/carbon/alien/diona/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/diona/update_icons.dm @@ -7,6 +7,6 @@ else icon_state = "[initial(icon_state)]" - overlays.Cut() + cut_overlays() if(hat) - overlays |= get_hat_icon(hat, 0, -8) \ No newline at end of file + add_overlay(get_hat_icon(hat, 0, -8)) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index fc83347fcc0..7c27dc171b3 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -340,9 +340,9 @@ return canmove /mob/living/silicon/robot/update_fire() - overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing") + cut_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")) if(on_fire) - overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing") + add_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")) /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/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 4a608463d48..db5524a4d64 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -79,7 +79,7 @@ ..() /mob/living/simple_animal/corgi/regenerate_icons() - overlays = list() + cut_overlays() if(inventory_head) var/head_icon_state = inventory_head.icon_state @@ -88,7 +88,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 @@ -97,12 +97,10 @@ var/icon/back_icon = image('icons/mob/corgi_back.dmi',back_icon_state) if(back_icon) - overlays += back_icon - return - + add_overlay(back_icon) /mob/living/simple_animal/corgi/puppy - name = "\improper corgi puppy" + name = "corgi puppy" real_name = "corgi" desc = "It's a corgi puppy." icon_state = "puppy" diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 5b7c02b7d90..968d6838ca1 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -296,8 +296,8 @@ proc/blood_splatter(var/target,var/datum/reagent/blood/source,var/large) B = new decal_type(T) var/obj/effect/decal/cleanable/blood/drip/drop = B - if(istype(drop) && drips && drips.len && !large) - drop.overlays |= drips + if(istype(drop) && LAZYLEN(drips) && !large) + drop.add_overlay(drips) drop.drips |= drips // If there's no data to copy, call it quits here. diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index ce56376b3b0..bc720b26c77 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -936,8 +936,8 @@ obj/structure/cable/proc/cableColor(var/colorC) return ..() -/obj/structure/noose/New() - ..() +/obj/structure/noose/Initialize() + . = ..() pixel_y += 16 //Noose looks like it's "hanging" in the air over = image(icon, "noose_overlay") over.layer = MOB_LAYER + 0.1 @@ -949,14 +949,14 @@ obj/structure/cable/proc/cableColor(var/colorC) /obj/structure/noose/post_buckle_mob(mob/living/M) if(M == buckled_mob) layer = MOB_LAYER - overlays += over - processing_objects |= src + add_overlay(over) + START_PROCESSING(SSprocessing, src) M.pixel_y = initial(M.pixel_y) + 8 //rise them up a bit M.dir = SOUTH else layer = initial(layer) - overlays -= over - processing_objects -= src + cut_overlay(over) + STOP_PROCESSING(SSprocessing, src) pixel_x = initial(pixel_x) M.pixel_x = initial(M.pixel_x) M.pixel_y = initial(M.pixel_y) diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 012ebd7f845..920862033ac 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -25,14 +25,14 @@ return use(cell_amt) / CELLRATE /obj/item/weapon/cell/update_icon() - overlays.Cut() + cut_overlays() if(charge < 0.01) return else if(charge/maxcharge >=0.995) - overlays += image('icons/obj/power.dmi', "cell-o2") + add_overlay("cell-o2") else - overlays += image('icons/obj/power.dmi', "cell-o1") + add_overlay("cell-o1") /obj/item/weapon/cell/proc/percent() // return % charge of cell return 100.0*charge/maxcharge diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm index 543514be9da..186f6fe173d 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm @@ -266,7 +266,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 diff --git a/code/modules/reagents/reagent_containers/food/sandwich.dm b/code/modules/reagents/reagent_containers/food/sandwich.dm index d4a154184f3..b88c2391f88 100644 --- a/code/modules/reagents/reagent_containers/food/sandwich.dm +++ b/code/modules/reagents/reagent_containers/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/ovr = list() for(var/obj/item/weapon/reagent_containers/food/snacks/O in ingredients) @@ -62,12 +63,14 @@ I.color = O.filling_color I.pixel_x = pick(list(-1,0,1)) I.pixel_y = (i*2)+1 - overlays += I + ovr += 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 + ovr += T + + add_overlay(ovr) name = lowertext("[fullname] sandwich") if(length(name) > 80) name = "[pick(list("absurd","colossal","enormous","ridiculous"))] sandwich" diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index 864cbfe4375..8cce8056b02 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -184,11 +184,11 @@ ) src.bitecount++ - U.overlays.Cut() + U.cut_overlays() U.loaded = "[src]" var/image/I = new(U.icon, "loadedfood") I.color = src.filling_color - U.overlays += I + U.add_overlay(I) reagents.trans_to_obj(U, min(reagents.total_volume,5)) @@ -3924,8 +3924,7 @@ var/boxtag = "" /obj/item/pizzabox/update_icon() - - overlays = list() + cut_overlays() // Set appropriate description if( open && pizza ) @@ -3951,9 +3950,9 @@ icon_state = "pizzabox_open" if( pizza ) - var/image/pizzaimg = image("food.dmi", icon_state = pizza.icon_state) + var/image/pizzaimg = image(icon, icon_state = pizza.icon_state) pizzaimg.pixel_y = -3 - overlays += pizzaimg + add_overlay(pizzaimg) return else @@ -3968,9 +3967,9 @@ doimgtag = 1 if( doimgtag ) - var/image/tagimg = image("food.dmi", icon_state = "pizzabox_tag") + var/image/tagimg = image(icon, icon_state = "pizzabox_tag") tagimg.pixel_y = boxes.len * 3 - overlays += tagimg + add_overlay(tagimg) icon_state = "pizzabox[boxes.len+1]" diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 259d7a115d3..087d4bfd3ea 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -141,7 +141,7 @@ update_icon() update_icon() - overlays.Cut() + cut_overlays() if(reagents.total_volume) var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10") @@ -157,11 +157,10 @@ if(91 to INFINITY) filling.icon_state = "[icon_state]100" filling.color = reagents.get_color() - overlays += filling + add_overlay(filling) if (!is_open_container()) - var/image/lid = image(icon, src, "lid_[initial(icon_state)]") - overlays += lid + add_overlay("lid_[initial(icon_state)]") /obj/item/weapon/reagent_containers/glass/beaker/large name = "large beaker" @@ -249,10 +248,9 @@ return ..() /obj/item/weapon/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_[initial(icon_state)]") /* /obj/item/weapon/reagent_containers/glass/blender_jug diff --git a/code/modules/reagents/reagent_containers/glass/bottle.dm b/code/modules/reagents/reagent_containers/glass/bottle.dm index cbfea73a94a..fb5ce1c5976 100644 --- a/code/modules/reagents/reagent_containers/glass/bottle.dm +++ b/code/modules/reagents/reagent_containers/glass/bottle.dm @@ -33,7 +33,7 @@ icon_state = "bottle-[rand(1,4)]" update_icon() - overlays.Cut() + cut_overlays() 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/reagentfillings.dmi', src, "[icon_state]10") @@ -49,11 +49,10 @@ if(91 to INFINITY) filling.icon_state = "[icon_state]-100" filling.color = reagents.get_color() - overlays += filling + add_overlay(filling) if (!is_open_container()) - var/image/lid = image(icon, src, "lid_bottle") - overlays += lid + add_overlay("lid_bottle") /obj/item/weapon/reagent_containers/glass/bottle/inaprovaline name = "inaprovaline bottle" @@ -370,4 +369,4 @@ New() ..() reagents.add_reagent("frostoil", 60) - update_icon() + update_icon() diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index d6f6d00d4d6..5e534f87d67 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -204,7 +204,7 @@ return update_icon() - overlays.Cut() + cut_overlays() if(mode == SYRINGE_BROKEN) icon_state = "broken" @@ -218,7 +218,7 @@ injoverlay = "draw" if (SYRINGE_INJECT) injoverlay = "inject" - overlays += injoverlay + add_overlay(injoverlay) icon_state = "[rounded_vol]" item_state = "syringe_[rounded_vol]" @@ -228,7 +228,7 @@ filling.icon_state = "syringe[rounded_vol]" filling.color = reagents.get_color() - overlays += filling + add_overlay(filling) proc/syringestab(mob/living/carbon/target as mob, mob/living/carbon/user as mob) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index f728be370f5..cf3161489bc 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -74,7 +74,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") @@ -87,7 +87,7 @@ label_x = rand(-8, 6) I.pixel_x = label_x I.pixel_y = -3 - overlays += I + add_overlay(I) if(src.sortTag) var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") if(icon_state == "deliverycloset") @@ -100,7 +100,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) if(..(user, 4)) @@ -182,12 +182,12 @@ 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 + add_overlay(I) if(src.sortTag) var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") switch(icon_state) @@ -204,7 +204,7 @@ I.pixel_y = 3 if("deliverycrate5") I.pixel_y = -3 - overlays += I + add_overlay(I) /obj/item/smallDelivery/examine(mob/user) if(..(user, 4)) diff --git a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm index 06c1335996f..1bba8c03f4f 100644 --- a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm +++ b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm @@ -43,7 +43,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.loc = suspension_field for(var/mob/living/simple_animal/M in T) @@ -291,7 +291,7 @@ if(collected) suspension_field.icon_state = "energynet" - suspension_field.overlays += "shield2" + suspension_field.add_overlay("shield2") src.visible_message("\icon[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/research/xenoarchaeology/tools/tools_coresampler.dm b/code/modules/research/xenoarchaeology/tools/tools_coresampler.dm index 3162fb413c3..b974d16a492 100644 --- a/code/modules/research/xenoarchaeology/tools/tools_coresampler.dm +++ b/code/modules/research/xenoarchaeology/tools/tools_coresampler.dm @@ -72,8 +72,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 = 1 user << "You take a core sample of the [item_to_sample]." diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm index 01f3bb8d309..cfe5d404506 100644 --- a/code/modules/vehicles/bike.dm +++ b/code/modules/vehicles/bike.dm @@ -21,11 +21,11 @@ var/datum/effect_system/ion_trail/ion var/kickstand = 1 -/obj/vehicle/bike/New() - ..() +/obj/vehicle/bike/Initialize() + . = ..() ion = new(src) turn_off() - overlays += image('icons/obj/bike.dmi', "[icon_state]_off_overlay", MOB_LAYER + 1) + add_overlay(image('icons/obj/bike.dmi', "[icon_state]_off_overlay", MOB_LAYER + 1)) icon_state = "[bike_icon]_off" /obj/vehicle/bike/verb/toggle() @@ -134,13 +134,13 @@ ..() /obj/vehicle/bike/update_icon() - overlays.Cut() + cut_overlays() if(on) - overlays += image('icons/obj/bike.dmi', "[bike_icon]_on_overlay", MOB_LAYER + 1) + add_overlay(image('icons/obj/bike.dmi', "[bike_icon]_on_overlay", MOB_LAYER + 1)) icon_state = "[bike_icon]_on" else - overlays += image('icons/obj/bike.dmi', "[bike_icon]_off_overlay", MOB_LAYER + 1) + add_overlay(image('icons/obj/bike.dmi', "[bike_icon]_off_overlay", MOB_LAYER + 1)) icon_state = "[bike_icon]_off" ..() diff --git a/code/modules/vehicles/cargo_train.dm b/code/modules/vehicles/cargo_train.dm index c8700d5a63a..f4c8fc7544b 100644 --- a/code/modules/vehicles/cargo_train.dm +++ b/code/modules/vehicles/cargo_train.dm @@ -43,7 +43,7 @@ cell = new /obj/item/weapon/cell/high(src) key = new(src) var/image/I = new(icon = icon, icon_state = "[icon_state]_overlay", layer = src.layer + 0.2) //over mobs - overlays += I + add_overlay(I) turn_off() //so engine verbs are correctly set /obj/vehicle/train/cargo/engine/Move(var/turf/destination)