diff --git a/code/game/objects/items/storage/fancy.dm b/code/game/objects/items/storage/fancy.dm
index 933b42d2bed..bd5e96939c7 100644
--- a/code/game/objects/items/storage/fancy.dm
+++ b/code/game/objects/items/storage/fancy.dm
@@ -323,7 +323,7 @@
STR.max_items = 5
STR.set_holdable(list(/obj/item/clothing/mask/cigarette/cigar))
-/obj/item/storage/fancy/cigarettes/cigars/update_icon()
+/obj/item/storage/fancy/cigarettes/cigars/update_icon_state()
if(fancy_open)
icon_state = "[initial(icon_state)]_open"
else
diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm
index cd8b759c0b8..fc0578889da 100644
--- a/code/game/objects/items/stunbaton.dm
+++ b/code/game/objects/items/stunbaton.dm
@@ -283,7 +283,7 @@
return ..()
-/obj/item/melee/baton/boomerang/update_icon()
+/obj/item/melee/baton/boomerang/update_icon_state()
if(turned_on)
icon_state = "[initial(icon_state)]_active"
else if(!cell)
diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm
index 646732ebba9..246e4234e10 100644
--- a/code/game/objects/structures/ai_core.dm
+++ b/code/game/objects/structures/ai_core.dm
@@ -255,7 +255,7 @@
return
return ..()
-/obj/structure/AIcore/update_icon()
+/obj/structure/AIcore/update_icon_state()
switch(state)
if(EMPTY_CORE)
icon_state = "0"
diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm
index 0b746d34bfa..29d192da39a 100644
--- a/code/game/objects/structures/aliens.dm
+++ b/code/game/objects/structures/aliens.dm
@@ -229,8 +229,7 @@
if(status == BURST)
obj_integrity = integrity_failure * max_integrity
-/obj/structure/alien/egg/update_icon()
- ..()
+/obj/structure/alien/egg/update_icon_state()
switch(status)
if(GROWING)
icon_state = "[base_icon]_growing"
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index 2d51eca9489..7d07df3703f 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -306,7 +306,7 @@ LINEN BINS
. += "There are [amount] bed sheets in the bin."
-/obj/structure/bedsheetbin/update_icon()
+/obj/structure/bedsheetbin/update_icon_state()
switch(amount)
if(0)
icon_state = "linenbin-empty"
diff --git a/code/game/objects/structures/crates_lockers/closets/bodybag.dm b/code/game/objects/structures/crates_lockers/closets/bodybag.dm
index f75c5008492..ef054006ce2 100644
--- a/code/game/objects/structures/crates_lockers/closets/bodybag.dm
+++ b/code/game/objects/structures/crates_lockers/closets/bodybag.dm
@@ -49,10 +49,10 @@
tagged = 0
update_icon()
-/obj/structure/closet/body_bag/update_icon()
- ..()
- if (tagged)
- add_overlay("bodybag_label")
+/obj/structure/closet/body_bag/update_overlays()
+ . = ..()
+ if(tagged)
+ . += "bodybag_label"
/obj/structure/closet/body_bag/open(mob/living/user)
. = ..()
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index f6fd2c5e171..c8503e0beaa 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -36,12 +36,13 @@
if(!locatedcrate.opened) //otherwise, if the located crate is closed, allow entering
return TRUE
-/obj/structure/closet/crate/update_icon()
+/obj/structure/closet/crate/update_icon_state()
icon_state = "[initial(icon_state)][opened ? "open" : ""]"
- cut_overlays()
+/obj/structure/closet/crate/update_overlays()
+ . = ..()
if(manifest)
- add_overlay("manifest")
+ . += "manifest"
/obj/structure/closet/crate/attack_hand(mob/user)
. = ..()
diff --git a/code/game/objects/structures/crates_lockers/crates/bins.dm b/code/game/objects/structures/crates_lockers/crates/bins.dm
index 9bdc222425e..efc7fb3a097 100644
--- a/code/game/objects/structures/crates_lockers/crates/bins.dm
+++ b/code/game/objects/structures/crates_lockers/crates/bins.dm
@@ -12,15 +12,14 @@
. = ..()
update_icon()
-/obj/structure/closet/crate/bin/update_icon()
- ..()
- cut_overlays()
+/obj/structure/closet/crate/bin/update_overlays()
+ . = ..()
if(contents.len == 0)
- add_overlay("largebing")
+ . += "largebing"
else if(contents.len >= storage_capacity)
- add_overlay("largebinr")
+ . += "largebinr"
else
- add_overlay("largebino")
+ . += "largebino"
/obj/structure/closet/crate/bin/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/storage/bag/trash))
diff --git a/code/game/objects/structures/crates_lockers/crates/critter.dm b/code/game/objects/structures/crates_lockers/crates/critter.dm
index 30f734800a6..452f439ede2 100644
--- a/code/game/objects/structures/crates_lockers/crates/critter.dm
+++ b/code/game/objects/structures/crates_lockers/crates/critter.dm
@@ -26,14 +26,14 @@
return ..()
-/obj/structure/closet/crate/critter/update_icon()
- cut_overlays()
+/obj/structure/closet/crate/critter/update_overlays()
+ . = ..()
if(opened)
- add_overlay("crittercrate_door_open")
+ . += "crittercrate_door_open"
else
- add_overlay("crittercrate_door")
+ . += "crittercrate_door"
if(manifest)
- add_overlay("manifest")
+ . += "manifest"
/obj/structure/closet/crate/critter/return_air()
if(tank)
diff --git a/code/game/objects/structures/crates_lockers/crates/secure.dm b/code/game/objects/structures/crates_lockers/crates/secure.dm
index 86369a13789..baf60779997 100644
--- a/code/game/objects/structures/crates_lockers/crates/secure.dm
+++ b/code/game/objects/structures/crates_lockers/crates/secure.dm
@@ -9,14 +9,14 @@
var/tamperproof = 0
damage_deflection = 25
-/obj/structure/closet/crate/secure/update_icon()
- ..()
+/obj/structure/closet/crate/secure/update_overlays()
+ . = ..()
if(broken)
- add_overlay("securecrateemag")
+ . += "securecrateemag"
else if(locked)
- add_overlay("securecrater")
+ . += "securecrater"
else
- add_overlay("securecrateg")
+ . += "securecrateg"
/obj/structure/closet/crate/secure/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
if(prob(tamperproof) && damage_amount >= DAMAGE_PRECISION)
diff --git a/code/game/objects/structures/divine.dm b/code/game/objects/structures/divine.dm
index b97485607d3..d81a6ac4a86 100644
--- a/code/game/objects/structures/divine.dm
+++ b/code/game/objects/structures/divine.dm
@@ -44,7 +44,7 @@
addtimer(CALLBACK(src, /atom/.proc/update_icon), time_between_uses)
-/obj/structure/healingfountain/update_icon()
+/obj/structure/healingfountain/update_icon_state()
if(last_process + time_between_uses > world.time)
icon_state = "fountain"
else
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index d3308b5e314..5791d9527ba 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -270,13 +270,13 @@
update_name()
update_icon()
-/obj/structure/door_assembly/update_icon()
- cut_overlays()
+/obj/structure/door_assembly/update_overlays()
+ . = ..()
if(!glass)
- add_overlay(get_airlock_overlay("fill_construction", icon))
- else if(glass)
- add_overlay(get_airlock_overlay("glass_construction", overlays_file))
- add_overlay(get_airlock_overlay("panel_c[state+1]", overlays_file))
+ . += get_airlock_overlay("fill_construction", icon)
+ else
+ . += get_airlock_overlay("glass_construction", overlays_file)
+ . += get_airlock_overlay("panel_c[state+1]", overlays_file)
/obj/structure/door_assembly/proc/update_name()
name = ""
diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm
index 106d05a77bb..9127be45801 100644
--- a/code/game/objects/structures/extinguisher.dm
+++ b/code/game/objects/structures/extinguisher.dm
@@ -114,11 +114,10 @@
opened = !opened
update_icon()
-/obj/structure/extinguisher_cabinet/update_icon()
+/obj/structure/extinguisher_cabinet/update_icon_state()
if(!opened)
icon_state = "extinguisher_closed"
- return
- if(stored_extinguisher)
+ else if(stored_extinguisher)
if(istype(stored_extinguisher, /obj/item/extinguisher/mini))
icon_state = "extinguisher_mini"
else
diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm
index 5a7cc0704f2..1f00462f45c 100644
--- a/code/game/objects/structures/fireaxe.dm
+++ b/code/game/objects/structures/fireaxe.dm
@@ -140,30 +140,30 @@
update_icon()
return
-/obj/structure/fireaxecabinet/update_icon()
- cut_overlays()
+/obj/structure/fireaxecabinet/update_overlays()
+ . = ..()
if(fireaxe)
- add_overlay("axe")
+ . += "axe"
if(!open)
var/hp_percent = obj_integrity/max_integrity * 100
if(broken)
- add_overlay("glass4")
+ . += "glass4"
else
switch(hp_percent)
if(-INFINITY to 40)
- add_overlay("glass3")
+ . += "glass3"
if(40 to 60)
- add_overlay("glass2")
+ . += "glass2"
if(60 to 80)
- add_overlay("glass1")
+ . += "glass1"
if(80 to INFINITY)
- add_overlay("glass")
+ . += "glass"
if(locked)
- add_overlay("locked")
+ . += "locked"
else
- add_overlay("unlocked")
+ . += "unlocked"
else
- add_overlay("glass_raised")
+ . += "glass_raised"
/obj/structure/fireaxecabinet/proc/toggle_lock(mob/user)
to_chat(user, "Resetting circuitry...")
diff --git a/code/game/objects/structures/fireplace.dm b/code/game/objects/structures/fireplace.dm
index 0366e9bf134..2803df4c786 100644
--- a/code/game/objects/structures/fireplace.dm
+++ b/code/game/objects/structures/fireplace.dm
@@ -69,21 +69,21 @@
else
. = ..()
-/obj/structure/fireplace/update_icon()
- cut_overlays()
+/obj/structure/fireplace/update_overlays()
+ . = ..()
if(lit)
switch(burn_time_remaining())
if(0 to 500)
- add_overlay("fireplace_fire0")
+ . += "fireplace_fire0"
if(500 to 1000)
- add_overlay("fireplace_fire1")
+ . += "fireplace_fire1"
if(1000 to 1500)
- add_overlay("fireplace_fire2")
+ . += "fireplace_fire2"
if(1500 to 2000)
- add_overlay("fireplace_fire3")
+ . += "fireplace_fire3"
if(2000 to MAXIMUM_BURN_TIMER)
- add_overlay("fireplace_fire4")
- add_overlay("fireplace_glow")
+ . += "fireplace_fire4"
+ . += "fireplace_glow"
/obj/structure/fireplace/proc/adjust_light()
if(!lit)
diff --git a/code/game/objects/structures/guncase.dm b/code/game/objects/structures/guncase.dm
index 73bbe5087a1..3960dbd7ecf 100644
--- a/code/game/objects/structures/guncase.dm
+++ b/code/game/objects/structures/guncase.dm
@@ -22,17 +22,17 @@
break
update_icon()
-/obj/structure/guncase/update_icon()
- cut_overlays()
+/obj/structure/guncase/update_overlays()
+ . = ..()
if(case_type && LAZYLEN(contents))
var/mutable_appearance/gun_overlay = mutable_appearance(icon, case_type)
for(var/i in 1 to contents.len)
gun_overlay.pixel_x = 3 * (i - 1)
- add_overlay(gun_overlay)
+ . += new /mutable_appearance(gun_overlay)
if(open)
- add_overlay("[icon_state]_open")
+ . += "[icon_state]_open"
else
- add_overlay("[icon_state]_door")
+ . += "[icon_state]_door"
/obj/structure/guncase/attackby(obj/item/I, mob/user, params)
if(iscyborg(user) || isalien(user))
diff --git a/code/game/objects/structures/headpike.dm b/code/game/objects/structures/headpike.dm
index 01071a3de72..3495af5d12b 100644
--- a/code/game/objects/structures/headpike.dm
+++ b/code/game/objects/structures/headpike.dm
@@ -27,14 +27,14 @@
. = ..()
pixel_x = rand(-8, 8)
-/obj/structure/headpike/update_icon()
- ..()
+/obj/structure/headpike/update_overlays()
+ . = ..()
var/obj/item/bodypart/head/H = locate() in contents
- var/mutable_appearance/MA = new()
if(H)
+ var/mutable_appearance/MA = new()
MA.copy_overlays(H)
MA.pixel_y = 12
- add_overlay(H)
+ . += H
/obj/structure/headpike/attack_hand(mob/user)
. = ..()
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index e322a863afc..26006d1cb7f 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -150,17 +150,17 @@
updateUsrDialog()
-/obj/structure/janitorialcart/update_icon()
- cut_overlays()
+/obj/structure/janitorialcart/update_overlays()
+ . = ..()
if(mybag)
- add_overlay("cart_garbage")
+ . += "cart_garbage"
if(mymop)
- add_overlay("cart_mop")
+ . += "cart_mop"
if(myspray)
- add_overlay("cart_spray")
+ . += "cart_spray"
if(myreplacer)
- add_overlay("cart_replacer")
+ . += "cart_replacer"
if(signs)
- add_overlay("cart_sign[signs]")
+ . += "cart_sign[signs]"
if(reagents.total_volume > 0)
- add_overlay("cart_water")
+ . += "cart_water"
diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm
index 74fabe5187d..9e572c4c57d 100644
--- a/code/game/objects/structures/ladders.dm
+++ b/code/game/objects/structures/ladders.dm
@@ -55,16 +55,13 @@
down.update_icon()
up = down = null
-/obj/structure/ladder/update_icon()
+/obj/structure/ladder/update_icon_state()
if(up && down)
icon_state = "ladder11"
-
else if(up)
icon_state = "ladder10"
-
else if(down)
icon_state = "ladder01"
-
else //wtf make your ladders properly assholes
icon_state = "ladder00"
diff --git a/code/game/objects/structures/life_candle.dm b/code/game/objects/structures/life_candle.dm
index 999d1d78394..3a0cb6bd6db 100644
--- a/code/game/objects/structures/life_candle.dm
+++ b/code/game/objects/structures/life_candle.dm
@@ -46,7 +46,7 @@
STOP_PROCESSING(SSobj, src)
set_light(0)
-/obj/structure/life_candle/update_icon()
+/obj/structure/life_candle/update_icon_state()
if(linked_minds.len)
icon_state = icon_state_active
else
diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm
index d66b557694a..5d81c8a30e1 100644
--- a/code/game/objects/structures/mineral_doors.dm
+++ b/code/game/objects/structures/mineral_doors.dm
@@ -119,7 +119,7 @@
update_icon()
isSwitchingStates = FALSE
-/obj/structure/mineral_door/update_icon()
+/obj/structure/mineral_door/update_icon_state()
icon_state = "[initial(icon_state)][door_opened ? "open":""]"
/obj/structure/mineral_door/attackby(obj/item/I, mob/user)
diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm
index 872c0efb3c4..a5f84b9bc14 100644
--- a/code/game/objects/structures/mop_bucket.dm
+++ b/code/game/objects/structures/mop_bucket.dm
@@ -24,7 +24,7 @@
. = ..()
update_icon()
-/obj/structure/mopbucket/update_icon()
- cut_overlays()
+/obj/structure/mopbucket/update_overlays()
+ . = ..()
if(reagents.total_volume > 0)
- add_overlay("mopbucket_water")
+ . += "mopbucket_water"
diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm
index a61d9693b51..566528ffc94 100644
--- a/code/game/objects/structures/safe.dm
+++ b/code/game/objects/structures/safe.dm
@@ -73,7 +73,7 @@ FLOOR SAFES
num = 0
return num
-/obj/structure/safe/update_icon()
+/obj/structure/safe/update_icon_state()
if(open)
icon_state = "[initial(icon_state)]-open"
else
diff --git a/code/game/objects/structures/shower.dm b/code/game/objects/structures/shower.dm
index 77f83963313..67298ec9b49 100644
--- a/code/game/objects/structures/shower.dm
+++ b/code/game/objects/structures/shower.dm
@@ -66,11 +66,10 @@
return TRUE
-/obj/machinery/shower/update_icon()
- cut_overlays()
-
+/obj/machinery/shower/update_overlays()
+ . = ..()
if(on)
- add_overlay(mutable_appearance('icons/obj/watercloset.dmi', "water", ABOVE_MOB_LAYER))
+ . += mutable_appearance('icons/obj/watercloset.dmi', "water", ABOVE_MOB_LAYER)
/obj/machinery/shower/proc/handle_mist()
// If there is no mist, and the shower was turned on (on a non-freezing temp): make mist in 5 seconds
diff --git a/code/game/objects/structures/stairs.dm b/code/game/objects/structures/stairs.dm
index 41e8bd65af7..4434e499b6f 100644
--- a/code/game/objects/structures/stairs.dm
+++ b/code/game/objects/structures/stairs.dm
@@ -66,7 +66,7 @@
return FALSE
return ..()
-/obj/structure/stairs/update_icon()
+/obj/structure/stairs/update_icon_state()
if(isTerminator())
icon_state = "stairs_t"
else
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index b0273928efb..cc76a9975e3 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -25,18 +25,18 @@
new /obj/item/tank/internals/plasma(src)
update_icon()
-/obj/structure/tank_dispenser/update_icon()
- cut_overlays()
+/obj/structure/tank_dispenser/update_overlays()
+ . = ..()
switch(oxygentanks)
if(1 to 3)
- add_overlay("oxygen-[oxygentanks]")
+ . += "oxygen-[oxygentanks]"
if(4 to TANK_DISPENSER_CAPACITY)
- add_overlay("oxygen-4")
+ . += "oxygen-4"
switch(plasmatanks)
if(1 to 4)
- add_overlay("plasma-[plasmatanks]")
+ . += "plasma-[plasmatanks]"
if(5 to TANK_DISPENSER_CAPACITY)
- add_overlay("plasma-5")
+ . += "plasma-5"
/obj/structure/tank_dispenser/attackby(obj/item/I, mob/user, params)
var/full
diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
index b7df666d94b..6f8bd2fcd6a 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
@@ -21,7 +21,7 @@
empty_pod()
return ..()
-/obj/structure/transit_tube_pod/update_icon()
+/obj/structure/transit_tube_pod/update_icon_state()
if(contents.len)
icon_state = occupied_icon_state
else
diff --git a/code/game/objects/structures/votingbox.dm b/code/game/objects/structures/votingbox.dm
index 4be7a5f0934..d3e4b67ae9e 100644
--- a/code/game/objects/structures/votingbox.dm
+++ b/code/game/objects/structures/votingbox.dm
@@ -202,8 +202,7 @@
user.put_in_hands(P)
to_chat(user,"[src] prints out the voting tally.")
-/obj/structure/votebox/update_icon()
- . = ..()
+/obj/structure/votebox/update_icon_state()
icon_state = "votebox_[voting_active ? "active" : "maint"]"
#undef VOTE_TEXT_LIMIT
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index a8a4e10f930..08a435634e9 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -47,7 +47,7 @@
setDir(ini_dir)
move_update_air(T)
-/obj/structure/windoor_assembly/update_icon()
+/obj/structure/windoor_assembly/update_icon_state()
icon_state = "[facing]_[secure ? "secure_" : ""]windoor_assembly[state]"
/obj/structure/windoor_assembly/CanAllowThrough(atom/movable/mover, turf/target)
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 1dedf1effe8..cb2c0d83539 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -307,7 +307,8 @@
queue_smooth_neighbors(src)
//merges adjacent full-tile windows into one
-/obj/structure/window/update_icon()
+/obj/structure/window/update_overlays()
+ . = ..()
if(!QDELETED(src))
if(!fulltile)
return
@@ -322,7 +323,7 @@
if(ratio > 75)
return
crack_overlay = mutable_appearance('icons/obj/structures.dmi', "damage[ratio]", -(layer+0.1))
- add_overlay(crack_overlay)
+ . += crack_overlay
/obj/structure/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
diff --git a/code/modules/NTNet/relays.dm b/code/modules/NTNet/relays.dm
index d478ca17910..83510caaefb 100644
--- a/code/modules/NTNet/relays.dm
+++ b/code/modules/NTNet/relays.dm
@@ -35,7 +35,7 @@
return FALSE
return TRUE
-/obj/machinery/ntnet_relay/update_icon()
+/obj/machinery/ntnet_relay/update_icon_state()
if(is_operational())
icon_state = "bus"
else
diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
index ba1c90bf781..0d1c50ed83c 100644
--- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm
+++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
@@ -423,8 +423,9 @@
Congratulations! You are now trained for invasive xenobiology research!"}
-/obj/item/paper/guides/antag/abductor/update_icon()
- return
+/obj/item/paper/guides/antag/abductor/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
/obj/item/paper/guides/antag/abductor/AltClick()
return //otherwise it would fold into a paperplane.
@@ -446,6 +447,10 @@ Congratulations! You are now trained for invasive xenobiology research!"}
w_class = WEIGHT_CLASS_NORMAL
actions_types = list(/datum/action/item_action/toggle_mode)
+/obj/item/absductor/baton/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+
/obj/item/abductor/baton/proc/toggle(mob/living/user=usr)
mode = (mode+1)%BATON_MODES
var/txt
@@ -462,7 +467,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
to_chat(usr, "You switch the baton to [txt] mode.")
update_icon()
-/obj/item/abductor/baton/update_icon()
+/obj/item/abductor/baton/update_icon_state()
switch(mode)
if(BATON_STUN)
icon_state = "wonderprodStun"
diff --git a/code/modules/antagonists/abductor/machinery/experiment.dm b/code/modules/antagonists/abductor/machinery/experiment.dm
index adb337a96d2..45f28fffbaf 100644
--- a/code/modules/antagonists/abductor/machinery/experiment.dm
+++ b/code/modules/antagonists/abductor/machinery/experiment.dm
@@ -223,7 +223,7 @@
return
-/obj/machinery/abductor/experiment/update_icon()
+/obj/machinery/abductor/experiment/update_icon_state()
if(state_open)
icon_state = "experiment-open"
else
diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm
index f31ee36f7c7..89b290d4994 100644
--- a/code/modules/antagonists/cult/cult_items.dm
+++ b/code/modules/antagonists/cult/cult_items.dm
@@ -355,7 +355,7 @@
max = 40
prefix = "darkened"
-/obj/item/sharpener/cult/update_icon()
+/obj/item/sharpener/cult/update_icon_state()
icon_state = "cult_sharpener[used ? "_used" : ""]"
/obj/item/clothing/suit/hooded/cultrobes/cult_shield
@@ -635,7 +635,7 @@
qdel(spear_act)
..()
-/obj/item/twohanded/cult_spear/update_icon()
+/obj/item/twohanded/cult_spear/update_icon_state()
icon_state = "bloodspear[wielded]"
/obj/item/twohanded/cult_spear/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm
index 4f3f49e04cd..8cb12cb897a 100644
--- a/code/modules/antagonists/slaughter/slaughter.dm
+++ b/code/modules/antagonists/slaughter/slaughter.dm
@@ -79,8 +79,9 @@
icon_state = "demon_heart-on"
decay_factor = 0
-/obj/item/organ/heart/demon/update_icon()
- return //always beating visually
+/obj/item/organ/heart/demon/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
/obj/item/organ/heart/demon/attack(mob/M, mob/living/carbon/user, obj/target)
if(M != user)
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index c292db19d2b..a027b703e1b 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -19,15 +19,17 @@
/obj/item/onetankbomb/examine(mob/user)
return bombtank.examine(user)
-/obj/item/onetankbomb/update_icon()
- cut_overlays()
+/obj/item/onetankbomb/update_icon_state()
if(bombtank)
icon = bombtank.icon
icon_state = bombtank.icon_state
+
+/obj/item/onetankbomb/update_overlays()
+ . = ..()
if(bombassembly)
- add_overlay(bombassembly.icon_state)
- copy_overlays(bombassembly)
- add_overlay("bomb_assembly")
+ . += bombassembly.icon_state
+ . += bombassembly.overlays
+ . += "bomb_assembly"
/obj/item/onetankbomb/wrench_act(mob/living/user, obj/item/I)
..()
diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm
index 8e2f5d5fedb..cb94c22b481 100644
--- a/code/modules/atmospherics/machinery/airalarm.dm
+++ b/code/modules/atmospherics/machinery/airalarm.dm
@@ -610,7 +610,7 @@
"set_internal_pressure" = 0
), signal_source)
-/obj/machinery/airalarm/update_icon()
+/obj/machinery/airalarm/update_icon_state()
if(panel_open)
switch(buildstage)
if(2)
diff --git a/code/modules/atmospherics/machinery/other/miner.dm b/code/modules/atmospherics/machinery/other/miner.dm
index caf1f08133a..a53984f1e06 100644
--- a/code/modules/atmospherics/machinery/other/miner.dm
+++ b/code/modules/atmospherics/machinery/other/miner.dm
@@ -108,14 +108,14 @@
return TRUE
return FALSE
-/obj/machinery/atmospherics/miner/update_icon()
- cut_overlays()
+/obj/machinery/atmospherics/miner/update_overlays()
+ . = ..()
if(broken)
- add_overlay("broken")
+ . += "broken"
else if(active)
var/mutable_appearance/on_overlay = mutable_appearance(icon, "on")
on_overlay.color = overlay_color
- add_overlay(on_overlay)
+ . += on_overlay
/obj/machinery/atmospherics/miner/process()
update_power()
diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm
index b1dd6cb9f6b..d21ce226be8 100644
--- a/code/modules/atmospherics/machinery/portable/canister.dm
+++ b/code/modules/atmospherics/machinery/portable/canister.dm
@@ -224,61 +224,25 @@
air_contents.gases[/datum/gas/oxygen][MOLES] = (O2STANDARD * maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
air_contents.gases[/datum/gas/nitrogen][MOLES] = (N2STANDARD * maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
-#define CANISTER_UPDATE_HOLDING (1<<0)
-#define CANISTER_UPDATE_CONNECTED (1<<1)
-#define CANISTER_UPDATE_EMPTY (1<<2)
-#define CANISTER_UPDATE_LOW (1<<3)
-#define CANISTER_UPDATE_MEDIUM (1<<4)
-#define CANISTER_UPDATE_FULL (1<<5)
-#define CANISTER_UPDATE_DANGER (1<<6)
-/obj/machinery/portable_atmospherics/canister/update_icon()
+/obj/machinery/portable_atmospherics/canister/update_icon_state()
if(stat & BROKEN)
- cut_overlays()
icon_state = "[icon_state]-1"
- return
-
- var/last_update = update
- update = 0
-
+
+/obj/machinery/portable_atmospherics/canister/update_overlays()
+ . = ..()
if(holding)
- update |= CANISTER_UPDATE_HOLDING
+ . += "can-open"
if(connected_port)
- update |= CANISTER_UPDATE_CONNECTED
+ . += "can-connector"
var/pressure = air_contents.return_pressure()
- if(pressure < 10)
- update |= CANISTER_UPDATE_EMPTY
- else if(pressure < 5 * ONE_ATMOSPHERE)
- update |= CANISTER_UPDATE_LOW
- else if(pressure < 10 * ONE_ATMOSPHERE)
- update |= CANISTER_UPDATE_MEDIUM
- else if(pressure < 40 * ONE_ATMOSPHERE)
- update |= CANISTER_UPDATE_FULL
- else
- update |= CANISTER_UPDATE_DANGER
-
- if(update == last_update)
- return
-
- cut_overlays()
- if(update & CANISTER_UPDATE_HOLDING)
- add_overlay("can-open")
- if(update & CANISTER_UPDATE_CONNECTED)
- add_overlay("can-connector")
- if(update & CANISTER_UPDATE_LOW)
- add_overlay("can-o0")
- else if(update & CANISTER_UPDATE_MEDIUM)
- add_overlay("can-o1")
- else if(update & CANISTER_UPDATE_FULL)
- add_overlay("can-o2")
- else if(update & CANISTER_UPDATE_DANGER)
- add_overlay("can-o3")
-#undef CANISTER_UPDATE_HOLDING
-#undef CANISTER_UPDATE_CONNECTED
-#undef CANISTER_UPDATE_EMPTY
-#undef CANISTER_UPDATE_LOW
-#undef CANISTER_UPDATE_MEDIUM
-#undef CANISTER_UPDATE_FULL
-#undef CANISTER_UPDATE_DANGER
+ if(pressure >= 40 * ONE_ATMOSPHERE)
+ . += "can-o3"
+ else if(pressure >= 10 * ONE_ATMOSPHERE)
+ . += "can-o2"
+ else if(pressure >= 5 * ONE_ATMOSPHERE)
+ . += "can-o1"
+ else if(pressure >= 10)
+ . += "can-o0"
/obj/machinery/portable_atmospherics/canister/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > temperature_resistance)
diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm
index 1d8b1ed9946..2828e288ad6 100644
--- a/code/modules/atmospherics/machinery/portable/pump.dm
+++ b/code/modules/atmospherics/machinery/portable/pump.dm
@@ -31,14 +31,15 @@
QDEL_NULL(pump)
return ..()
-/obj/machinery/portable_atmospherics/pump/update_icon()
+/obj/machinery/portable_atmospherics/pump/update_icon_state()
icon_state = "psiphon:[on]"
- cut_overlays()
+/obj/machinery/portable_atmospherics/pump/update_overlays()
+ . = ..()
if(holding)
- add_overlay("siphon-open")
+ . += "siphon-open"
if(connected_port)
- add_overlay("siphon-connector")
+ . += "siphon-connector"
/obj/machinery/portable_atmospherics/pump/process_atmos()
..()
diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm
index 2b51775e3ae..5f7fb1e083c 100644
--- a/code/modules/atmospherics/machinery/portable/scrubber.dm
+++ b/code/modules/atmospherics/machinery/portable/scrubber.dm
@@ -8,6 +8,7 @@
var/on = FALSE
var/volume_rate = 1000
var/overpressure_m = 80
+ var/use_overlays = TRUE
volume = 1000
var/list/scrubbing = list(/datum/gas/plasma, /datum/gas/carbon_dioxide, /datum/gas/nitrous_oxide, /datum/gas/bz, /datum/gas/nitryl, /datum/gas/tritium, /datum/gas/hypernoblium, /datum/gas/water_vapor)
@@ -18,14 +19,17 @@
air_update_turf()
return ..()
-/obj/machinery/portable_atmospherics/scrubber/update_icon()
+/obj/machinery/portable_atmospherics/scrubber/update_icon_state()
icon_state = "pscrubber:[on]"
- cut_overlays()
+/obj/machinery/portable_atmospherics/scrubber/update_overlays()
+ . = ..()
+ if(!use_overlays)
+ return
if(holding)
- add_overlay("scrubber-open")
+ . += "scrubber-open"
if(connected_port)
- add_overlay("scrubber-connector")
+ . += "scrubber-connector"
/obj/machinery/portable_atmospherics/scrubber/process_atmos()
..()
@@ -135,6 +139,7 @@
volume = 50000
var/movable = FALSE
+ use_overlays = FALSE
/obj/machinery/portable_atmospherics/scrubber/huge/movable
movable = TRUE
@@ -142,7 +147,7 @@
/obj/machinery/portable_atmospherics/scrubber/huge/movable/cargo
anchored = FALSE
-/obj/machinery/portable_atmospherics/scrubber/huge/update_icon()
+/obj/machinery/portable_atmospherics/scrubber/huge/update_icon_state()
icon_state = "scrubber:[on]"
/obj/machinery/portable_atmospherics/scrubber/huge/process_atmos()
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index bd9cd6027f5..d50abb85cad 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -53,11 +53,11 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
ready = TRUE
return ready
-/obj/machinery/gateway/update_icon()
+/obj/machinery/gateway/update_icon_state()
if(active)
icon_state = "on"
- return
- icon_state = "off"
+ else
+ icon_state = "off"
/obj/machinery/gateway/attack_hand(mob/user)
. = ..()
@@ -100,11 +100,11 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
var/obj/machinery/gateway/centeraway/awaygate = null
can_link = TRUE
-/obj/machinery/gateway/centerstation/update_icon()
+/obj/machinery/gateway/centerstation/update_icon_state()
if(active)
icon_state = "oncenter"
- return
- icon_state = "offcenter"
+ else
+ icon_state = "offcenter"
/obj/machinery/gateway/centerstation/process()
if((stat & (NOPOWER)) && use_power)
@@ -183,11 +183,11 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
stationgate = locate(/obj/machinery/gateway/centerstation)
-/obj/machinery/gateway/centeraway/update_icon()
+/obj/machinery/gateway/centeraway/update_icon_state()
if(active)
icon_state = "oncenter"
- return
- icon_state = "offcenter"
+ else
+ icon_state = "offcenter"
/obj/machinery/gateway/centeraway/toggleon(mob/user)
if(!detect())
diff --git a/code/modules/awaymissions/mission_code/Academy.dm b/code/modules/awaymissions/mission_code/Academy.dm
index cebfc1641cd..e69129b54dd 100644
--- a/code/modules/awaymissions/mission_code/Academy.dm
+++ b/code/modules/awaymissions/mission_code/Academy.dm
@@ -389,8 +389,9 @@
icon_state = "1"
color = rgb(0,0,255)
-/obj/structure/ladder/unbreakable/rune/update_icon()
- return
+/obj/structure/ladder/unbreakable/rune/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
/obj/structure/ladder/unbreakable/rune/show_fluff_message(up,mob/user)
user.visible_message("[user] activates \the [src].", "You activate \the [src].")
diff --git a/code/modules/awaymissions/pamphlet.dm b/code/modules/awaymissions/pamphlet.dm
index 94ebb919726..b76c5dfe585 100644
--- a/code/modules/awaymissions/pamphlet.dm
+++ b/code/modules/awaymissions/pamphlet.dm
@@ -35,5 +35,6 @@
environs."
//we don't want the silly text overlay!
-/obj/item/paper/pamphlet/update_icon()
- return
+/obj/item/paper/pamphlet/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
diff --git a/code/modules/buildmode/buttons.dm b/code/modules/buildmode/buttons.dm
index 908a8d2185e..6901a0e42e0 100644
--- a/code/modules/buildmode/buttons.dm
+++ b/code/modules/buildmode/buttons.dm
@@ -27,7 +27,7 @@
update_icon()
return 1
-/obj/screen/buildmode/mode/update_icon()
+/obj/screen/buildmode/mode/update_icon_state()
icon_state = bd.mode.get_button_iconstate()
/obj/screen/buildmode/help
@@ -44,9 +44,8 @@
screen_loc = "NORTH,WEST+2"
name = "Change Dir"
-/obj/screen/buildmode/bdir/update_icon()
+/obj/screen/buildmode/bdir/update_icon_state()
dir = bd.build_dir
- return
/obj/screen/buildmode/bdir/Click()
bd.toggle_dirswitch()
diff --git a/code/modules/cargo/supplypod.dm b/code/modules/cargo/supplypod.dm
index 88bc1fc0fd5..1603d54dd9e 100644
--- a/code/modules/cargo/supplypod.dm
+++ b/code/modules/cargo/supplypod.dm
@@ -79,15 +79,15 @@
. = ..()
setStyle(style, TRUE) //Upon initialization, give the supplypod an iconstate, name, and description based on the "style" variable. This system is important for the centcom_podlauncher to function correctly
-/obj/structure/closet/supplypod/update_icon()
- cut_overlays()
+/obj/structure/closet/supplypod/update_overlays()
+ . = ..()
if (style == STYLE_SEETHROUGH || style == STYLE_INVISIBLE) //If we're invisible, we dont bother adding any overlays
return
else
if (opened)
- add_overlay("[icon_state]_open")
+ . += "[icon_state]_open"
else
- add_overlay("[icon_state]_door")
+ . += "[icon_state]_door"
/obj/structure/closet/supplypod/proc/setStyle(chosenStyle, duringInit = FALSE) //Used to give the sprite an icon state, name, and description
if (!duringInit && style == chosenStyle) //Check if the input style is already the same as the pod's style. This happens in centcom_podlauncher, and as such we set the style to STYLE_CENTCOM.
diff --git a/code/modules/cargo/supplypod_beacon.dm b/code/modules/cargo/supplypod_beacon.dm
index 5da512cd822..2ae9d43dae3 100644
--- a/code/modules/cargo/supplypod_beacon.dm
+++ b/code/modules/cargo/supplypod_beacon.dm
@@ -31,14 +31,14 @@
ready = FALSE
update_icon()
-/obj/item/supplypod_beacon/update_icon()
- cut_overlays()
+/obj/item/supplypod_beacon/update_overlays()
+ . = ..()
if (launched)
- add_overlay("sp_green")
+ . += "sp_green"
else if (ready)
- add_overlay("sp_yellow")
+ . += "sp_yellow"
else if (linked)
- add_overlay("sp_orange")
+ . += "sp_orange"
/obj/item/supplypod_beacon/proc/endLaunch()
launched = FALSE
diff --git a/code/modules/clothing/ears/_ears.dm b/code/modules/clothing/ears/_ears.dm
index 72bb8ceac94..49954956000 100644
--- a/code/modules/clothing/ears/_ears.dm
+++ b/code/modules/clothing/ears/_ears.dm
@@ -55,7 +55,11 @@
. = ..()
update_icon()
-/obj/item/clothing/ears/headphones/update_icon()
+/obj/item/clothing/ears/headphones/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+
+/obj/item/clothing/ears/headphones/update_icon_state()
icon_state = "[initial(icon_state)]_[headphones_on? "on" : "off"]"
item_state = "[initial(item_state)]_[headphones_on? "on" : "off"]"
diff --git a/code/modules/clothing/glasses/engine_goggles.dm b/code/modules/clothing/glasses/engine_goggles.dm
index e5d4307fac4..a5cd6911b28 100644
--- a/code/modules/clothing/glasses/engine_goggles.dm
+++ b/code/modules/clothing/glasses/engine_goggles.dm
@@ -26,6 +26,10 @@
START_PROCESSING(SSobj, src)
update_icon()
+/obj/item/clothing/glasses/meson/engine/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+
/obj/item/clothing/glasses/meson/engine/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
@@ -115,18 +119,8 @@
pic = new('icons/turf/overlays.dmi', place, "redOverlay", AREA_LAYER)
flick_overlay(pic, list(user.client), 8)
-/obj/item/clothing/glasses/meson/engine/update_icon()
- icon_state = "trayson-[mode]"
- update_mob()
-
-/obj/item/clothing/glasses/meson/engine/proc/update_mob()
- item_state = icon_state
- if(isliving(loc))
- var/mob/living/user = loc
- if(user.get_item_by_slot(ITEM_SLOT_EYES) == src)
- user.update_inv_glasses()
- else
- user.update_inv_hands()
+/obj/item/clothing/glasses/meson/engine/update_icon_state()
+ icon_state = item_state = "trayson-[mode]"
/obj/item/clothing/glasses/meson/engine/tray //atmos techs have lived far too long without tray goggles while those damned engineers get their dual-purpose gogles all to themselves
name = "optical t-ray scanner"
diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm
index 700e421a5c4..69dbbcbd3a2 100644
--- a/code/modules/clothing/head/hardhat.dm
+++ b/code/modules/clothing/head/hardhat.dm
@@ -15,6 +15,10 @@
dog_fashion = /datum/dog_fashion/head
+/obj/item/clothing/head/hardhat/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+
/obj/item/clothing/head/hardhat/attack_self(mob/living/user)
toggle_helmet_light(user)
@@ -26,16 +30,8 @@
turn_off(user)
update_icon()
-/obj/item/clothing/head/hardhat/update_icon()
- icon_state = "hardhat[on]_[hat_type]"
- item_state = "hardhat[on]_[hat_type]"
- if(ishuman(loc))
- var/mob/living/carbon/human/H = loc
- H.update_inv_head()
- for(var/X in actions)
- var/datum/action/A = X
- A.UpdateButtonIcon(force = TRUE)
- ..()
+/obj/item/clothing/head/hardhat/update_icon_state()
+ icon_state = item_state = "hardhat[on]_[hat_type]"
/obj/item/clothing/head/hardhat/proc/turn_on(mob/user)
set_light(brightness_on)
@@ -139,11 +135,10 @@
if(!up)
. += mutable_appearance('icons/mob/clothing/head.dmi', "weldvisor")
-/obj/item/clothing/head/hardhat/weldhat/update_icon()
- cut_overlays()
+/obj/item/clothing/head/hardhat/weldhat/update_overlays()
+ . = ..()
if(!up)
- add_overlay("weldvisor")
- ..()
+ . += "weldvisor"
/obj/item/clothing/head/hardhat/weldhat/orange
icon_state = "hardhat0_orange"
diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm
index 3c27644dd2d..c917b3e2bc3 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -314,7 +314,11 @@
//LightToggle
-/obj/item/clothing/head/helmet/update_icon()
+/obj/item/clothing/head/helment/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+
+/obj/item/clothing/head/helmet/update_icon_state()
var/state = "[initial(icon_state)]"
if(attached_light)
if(attached_light.on)
@@ -324,10 +328,6 @@
icon_state = state
- if(ishuman(loc))
- var/mob/living/carbon/human/H = loc
- H.update_inv_head()
-
/obj/item/clothing/head/helmet/ui_action_click(mob/user, action)
if(istype(action, alight))
toggle_helmlight()
diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm
index 34a99af3e13..d456879f582 100644
--- a/code/modules/clothing/head/misc_special.dm
+++ b/code/modules/clothing/head/misc_special.dm
@@ -233,7 +233,7 @@
. = ..()
update_icon()
-/obj/item/clothing/head/wig/update_icon()
+/obj/item/clothing/head/wig/update_icon_state()
var/datum/sprite_accessory/S = GLOB.hairstyles_list[hairstyle]
if(!S)
icon = 'icons/obj/clothing/hats.dmi'
diff --git a/code/modules/clothing/shoes/bananashoes.dm b/code/modules/clothing/shoes/bananashoes.dm
index d918f68e978..4e6ed4ef28f 100644
--- a/code/modules/clothing/shoes/bananashoes.dm
+++ b/code/modules/clothing/shoes/bananashoes.dm
@@ -10,11 +10,15 @@
/obj/item/clothing/shoes/clown_shoes/banana_shoes/Initialize()
. = ..()
- AddComponent(/datum/component/material_container, list(/datum/material/bananium), 200000, TRUE, /obj/item/stack)
- AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 75)
if(always_noslip)
clothing_flags |= NOSLIP
+/obj/item/clothing/shoes/clown_shoes/banana_shoes/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+ AddComponent(/datum/component/material_container, list(/datum/material/bananium), 200000, TRUE, /obj/item/stack)
+ AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 75)
+
/obj/item/clothing/shoes/clown_shoes/banana_shoes/step_action()
. = ..()
var/datum/component/material_container/bananium = GetComponent(/datum/component/material_container)
@@ -55,12 +59,8 @@
else
to_chat(user, "You need bananium to turn the prototype shoes on!")
-/obj/item/clothing/shoes/clown_shoes/banana_shoes/update_icon()
+/obj/item/clothing/shoes/clown_shoes/banana_shoes/update_icon_state()
if(on)
icon_state = "clown_prototype_on"
else
icon_state = "clown_prototype_off"
- usr.update_inv_shoes()
- for(var/X in actions)
- var/datum/action/A = X
- A.UpdateButtonIcon()
diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm
index fe30fa19d6c..ca9c2e1a720 100644
--- a/code/modules/clothing/spacesuits/hardsuit.dm
+++ b/code/modules/clothing/spacesuits/hardsuit.dm
@@ -297,7 +297,7 @@
visor_flags_inv = HIDEMASK|HIDEEYES|HIDEFACE|HIDEFACIALHAIR
visor_flags = STOPSPRESSUREDAMAGE
-/obj/item/clothing/head/helmet/space/hardsuit/syndi/update_icon()
+/obj/item/clothing/head/helmet/space/hardsuit/syndi/update_icon_state()
icon_state = "hardsuit[on]-[hardsuit_type]"
/obj/item/clothing/head/helmet/space/hardsuit/syndi/Initialize()
diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm
index 26b985232b5..f4721267919 100644
--- a/code/modules/clothing/spacesuits/plasmamen.dm
+++ b/code/modules/clothing/spacesuits/plasmamen.dm
@@ -51,7 +51,7 @@
var/smile_color = "#FF0000"
var/visor_icon = "envisor"
var/smile_state = "envirohelm_smile"
- actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_welding_screen/plasmaman)
+ actions_types = list(/datum/action/item_action/toggle_helmet_light)
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
flags_cover = HEADCOVERSMOUTH|HEADCOVERSEYES | PEPPERPROOF
@@ -61,7 +61,6 @@
. = ..()
visor_toggling()
update_icon()
- cut_overlays()
/obj/item/clothing/head/helmet/space/plasmaman/AltClick(mob/user)
if(user.canUseTopic(src, BE_CLOSE))
@@ -85,11 +84,9 @@
else
cut_overlays()
-/obj/item/clothing/head/helmet/space/plasmaman/update_icon()
- cut_overlays()
- add_overlay(visor_icon)
- ..()
- actions_types = list(/datum/action/item_action/toggle_helmet_light)
+/obj/item/clothing/head/helmet/space/plasmaman/update_overlays()
+ . = ..()
+ . += visor_icon
/obj/item/clothing/head/helmet/space/plasmaman/attackby(obj/item/C, mob/living/user)
. = ..()
diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm
index 3d87603637a..11f6a778cf4 100644
--- a/code/modules/events/pirates.dm
+++ b/code/modules/events/pirates.dm
@@ -164,7 +164,7 @@
active = FALSE
STOP_PROCESSING(SSobj,src)
-/obj/machinery/shuttle_scrambler/update_icon()
+/obj/machinery/shuttle_scrambler/update_icon_state()
if(active)
icon_state = "dominator-blue"
else
diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
index fc1be1d9d83..77e644c6d4b 100644
--- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
@@ -21,9 +21,9 @@
isGlass = TRUE
foodtype = ALCOHOL
-/obj/item/reagent_containers/food/drinks/bottle/update_icon()
- ..()
- add_overlay("[initial(icon_state)]shine")
+/obj/item/reagent_containers/food/drinks/bottle/update_overlays()
+ . = ..()
+ . += "[initial(icon_state)]shine"
/obj/item/reagent_containers/food/drinks/bottle/small
name = "small glass bottle"
diff --git a/code/modules/food_and_drinks/food/customizables.dm b/code/modules/food_and_drinks/food/customizables.dm
index 0a9a5e1ca29..92f44f823a8 100644
--- a/code/modules/food_and_drinks/food/customizables.dm
+++ b/code/modules/food_and_drinks/food/customizables.dm
@@ -316,14 +316,16 @@
..()
update_icon()
-/obj/item/reagent_containers/glass/bowl/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/glass/bowl/update_icon_state()
+ if(!reagents || !reagents.total_volume)
+ icon_state = "bowl"
+
+/obj/item/reagent_containers/glass/bowl/update_overlays()
+ . = ..()
if(reagents && reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/obj/food/soupsalad.dmi', "fullbowl")
filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
- else
- icon_state = "bowl"
+ . += filling
#undef INGREDIENTS_FILL
#undef INGREDIENTS_SCATTER
diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
index 2744f122238..4473c82590e 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
@@ -38,18 +38,18 @@
if(M.rating >= 2)
. += "Gibber has been upgraded to process inorganic materials."
-/obj/machinery/gibber/update_icon()
- cut_overlays()
+/obj/machinery/gibber/update_overlays()
+ . = ..()
if (dirty)
- add_overlay("grbloody")
+ . +="grbloody"
if(stat & (NOPOWER|BROKEN))
return
if (!occupant)
- add_overlay("grjam")
+ . += "grjam"
else if (operating)
- add_overlay("gruse")
+ . += "gruse"
else
- add_overlay("gridle")
+ . += "gridle"
/obj/machinery/gibber/attack_paw(mob/user)
return attack_hand(user)
diff --git a/code/modules/food_and_drinks/kitchen_machinery/grill.dm b/code/modules/food_and_drinks/kitchen_machinery/grill.dm
index 4755c3c2528..170650be99e 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/grill.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/grill.dm
@@ -17,7 +17,7 @@
. = ..()
grill_loop = new(list(src), FALSE)
-/obj/machinery/grill/update_icon()
+/obj/machinery/grill/update_icon_state()
if(grilled_item)
icon_state = "grill"
else if(grill_fuel)
diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
index 4259cdf8515..9deb1d0ff12 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
@@ -87,7 +87,7 @@
"- Capacity: [max_n_of_items] items.\n"+\
"- Cook time reduced by [(efficiency - 1) * 25]%."
-/obj/machinery/microwave/update_icon()
+/obj/machinery/microwave/update_icon_state()
if(broken)
icon_state = "mwb"
else if(dirty_anim_playing)
diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
index 81d4187f603..b7dd49fb9a0 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
@@ -41,7 +41,7 @@
if(in_range(user, src) || isobserver(user))
. += "The status display reads: This unit can hold a maximum of [max_n_of_items] items."
-/obj/machinery/smartfridge/update_icon()
+/obj/machinery/smartfridge/update_icon_state()
if(!stat)
if (visible_contents)
switch(contents.len)
@@ -294,13 +294,12 @@
..()
update_icon()
-/obj/machinery/smartfridge/drying_rack/update_icon()
- ..()
- cut_overlays()
+/obj/machinery/smartfridge/drying_rack/update_overlays()
+ . = ..()
if(drying)
- add_overlay("drying_rack_drying")
+ . += "drying_rack_drying"
if(contents.len)
- add_overlay("drying_rack_filled")
+ . += "drying_rack_filled"
/obj/machinery/smartfridge/drying_rack/process()
..()
diff --git a/code/modules/games/cas.dm b/code/modules/games/cas.dm
index ac983bfc8ba..339e64c8771 100644
--- a/code/modules/games/cas.dm
+++ b/code/modules/games/cas.dm
@@ -95,7 +95,7 @@
qdel(SC)
update_icon()
-/obj/item/toy/cards/deck/cas/update_icon()
+/obj/item/toy/cards/deck/cas/update_icon_state()
if(cards.len < 26)
icon_state = "deck_[deckstyle]_low"
@@ -136,7 +136,7 @@
return
Flip()
-/obj/item/toy/cards/singlecard/cas/update_icon()
+/obj/item/toy/cards/singlecard/cas/update_icon_state()
if(flipped)
icon_state = "[card_face]_flipped"
else
diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm
index da780596802..7c481d7fec9 100644
--- a/code/modules/holodeck/items.dm
+++ b/code/modules/holodeck/items.dm
@@ -197,7 +197,7 @@
if(numbuttons == numready)
begin_event()
-/obj/machinery/readybutton/update_icon()
+/obj/machinery/readybutton/update_icon_state()
if(ready)
icon_state = "auth_on"
else
diff --git a/code/modules/hydroponics/beekeeping/honeycomb.dm b/code/modules/hydroponics/beekeeping/honeycomb.dm
index 3ff7a68d84e..c0ce6dfb6db 100644
--- a/code/modules/hydroponics/beekeeping/honeycomb.dm
+++ b/code/modules/hydroponics/beekeeping/honeycomb.dm
@@ -20,13 +20,13 @@
update_icon()
-/obj/item/reagent_containers/honeycomb/update_icon()
- cut_overlays()
- var/mutable_appearance/honey_overlay = mutable_appearance(icon, /datum/reagent/consumable/honey)
+/obj/item/reagent_containers/honeycomb/update_overlays()
+ . = ..()
+ var/mutable_appearance/honey_overlay = mutable_appearance(icon, "honey")
if(honey_color)
honey_overlay.icon_state = "greyscale_honey"
honey_overlay.color = honey_color
- add_overlay(honey_overlay)
+ . += honey_overlay
/obj/item/reagent_containers/honeycomb/proc/set_reagent(reagent)
diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm
index 16fef6b6d1b..ee99c14e100 100644
--- a/code/modules/hydroponics/biogenerator.dm
+++ b/code/modules/hydroponics/biogenerator.dm
@@ -60,7 +60,7 @@
/obj/machinery/biogenerator/on_reagent_change(changetype) //When the reagents change, change the icon as well.
update_icon()
-/obj/machinery/biogenerator/update_icon()
+/obj/machinery/biogenerator/update_icon_state()
if(panel_open)
icon_state = "biogen-empty-o"
else if(!src.beaker)
@@ -69,7 +69,6 @@
icon_state = "biogen-stand"
else
icon_state = "biogen-work"
- return
/obj/machinery/biogenerator/attackby(obj/item/O, mob/user, params)
if(user.a_intent == INTENT_HARM)
diff --git a/code/modules/hydroponics/fermenting_barrel.dm b/code/modules/hydroponics/fermenting_barrel.dm
index 0ed28a8be4b..2de01eb8544 100644
--- a/code/modules/hydroponics/fermenting_barrel.dm
+++ b/code/modules/hydroponics/fermenting_barrel.dm
@@ -65,7 +65,7 @@
to_chat(user, "You close [src], letting you draw from its tap.")
update_icon()
-/obj/structure/fermenting_barrel/update_icon()
+/obj/structure/fermenting_barrel/update_icon_state()
if(open)
icon_state = "barrel_open"
else
diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm
index 1e662d28e58..a1e2093e0df 100644
--- a/code/modules/hydroponics/gene_modder.dm
+++ b/code/modules/hydroponics/gene_modder.dm
@@ -53,17 +53,18 @@
min_wchance = 0
min_wrate = 0
-/obj/machinery/plantgenes/update_icon()
- ..()
- cut_overlays()
+/obj/machinery/plantgenes/update_icon_state()
if((stat & (BROKEN|NOPOWER)))
icon_state = "dnamod-off"
else
icon_state = "dnamod"
+
+/obj/machinery/plantgenes/update_overlays()
+ . = ..()
if(seed)
- add_overlay("dnamod-dna")
+ . += "dnamod-dna"
if(panel_open)
- add_overlay("dnamod-open")
+ . += "dnamod-open"
/obj/machinery/plantgenes/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, "dnamod", "dnamod", I))
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index 1897bbfda66..b00b2795049 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -139,13 +139,12 @@
qdel(src)
-/obj/structure/bookcase/update_icon()
+/obj/structure/bookcase/update_icon_state()
if(contents.len < 5)
icon_state = "book-[contents.len]"
else
icon_state = "book-5"
-
/obj/structure/bookcase/manuals/medical
name = "medical manuals bookcase"
diff --git a/code/modules/mining/equipment/explorer_gear.dm b/code/modules/mining/equipment/explorer_gear.dm
index 19314e9e8d8..e9f08a780ef 100644
--- a/code/modules/mining/equipment/explorer_gear.dm
+++ b/code/modules/mining/equipment/explorer_gear.dm
@@ -101,12 +101,11 @@
AddComponent(/datum/component/spraycan_paintable)
update_icon()
-/obj/item/clothing/head/helmet/space/hostile_environment/update_icon()
- ..()
- cut_overlays()
+/obj/item/clothing/head/helmet/space/hostile_environment/update_overlays()
+ . = ..()
var/mutable_appearance/glass_overlay = mutable_appearance(icon, "hostile_env_glass")
glass_overlay.appearance_flags = RESET_COLOR
- add_overlay(glass_overlay)
+ . += glass_overlay
/obj/item/clothing/head/helmet/space/hostile_environment/worn_overlays(isinhands)
. = ..()
diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm
index 9b3ee2757fd..52f7a1aabb6 100644
--- a/code/modules/mining/equipment/kinetic_crusher.dm
+++ b/code/modules/mining/equipment/kinetic_crusher.dm
@@ -141,19 +141,16 @@
else
set_light(0)
-/obj/item/twohanded/kinetic_crusher/update_icon()
- ..()
- cut_overlays()
- if(!charged)
- add_overlay("[icon_state]_uncharged")
- if(light_on)
- add_overlay("[icon_state]_lit")
- spawn(1)
- for(var/X in actions)
- var/datum/action/A = X
- A.UpdateButtonIcon()
+/obj/item/twohanded/kinetic_crusher/update_icon_state()
item_state = "crusher[wielded]"
+/obj/item/twohanded/kinetic_crusher/update_overlays()
+ . = ..()
+ if(!charged)
+ . += "[icon_state]_uncharged"
+ if(light_on)
+ . += "[icon_state]_lit"
+
//destablizing force
/obj/projectile/destabilizer
name = "destabilizing force"
diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm
index 5bb569042bf..7cc482e3f4b 100644
--- a/code/modules/mining/equipment/marker_beacons.dm
+++ b/code/modules/mining/equipment/marker_beacons.dm
@@ -40,7 +40,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, sortList(list(
. += "Use in-hand to place a [singular_name].\n"+\
"Alt-click to select a color. Current color is [picked_color]."
-/obj/item/stack/marker_beacon/update_icon()
+/obj/item/stack/marker_beacon/update_icon_state()
icon_state = "[initial(icon_state)][lowertext(picked_color)]"
/obj/item/stack/marker_beacon/attack_self(mob/user)
diff --git a/code/modules/mining/equipment/regenerative_core.dm b/code/modules/mining/equipment/regenerative_core.dm
index e069bfff8c3..e755393d1e3 100644
--- a/code/modules/mining/equipment/regenerative_core.dm
+++ b/code/modules/mining/equipment/regenerative_core.dm
@@ -122,14 +122,13 @@
. = ..()
update_icon()
-/obj/item/organ/regenerative_core/update_icon()
+/obj/item/organ/regenerative_core/update_icon_state()
icon_state = inert ? "legion_soul_inert" : "legion_soul"
- cut_overlays()
+
+/obj/item/organ/regenerative_core/update_overlays()
+ . = ..()
if(!inert && !preserved)
- add_overlay("legion_soul_crackle")
- for(var/X in actions)
- var/datum/action/A = X
- A.UpdateButtonIcon()
+ . += "legion_soul_crackle"
/obj/item/organ/regenerative_core/legion/go_inert()
..()
diff --git a/code/modules/mining/equipment/survival_pod.dm b/code/modules/mining/equipment/survival_pod.dm
index 324f1fd6468..13b247e121b 100644
--- a/code/modules/mining/equipment/survival_pod.dm
+++ b/code/modules/mining/equipment/survival_pod.dm
@@ -140,11 +140,10 @@
icon = 'icons/obj/lavaland/survival_pod.dmi'
icon_state = "sleeper"
-/obj/machinery/sleeper/survival_pod/update_icon()
- if(state_open)
- cut_overlays()
- else
- add_overlay("sleeper_cover")
+/obj/machinery/sleeper/survival_pod/update_overlays()
+ . = ..()
+ if(!state_open)
+ . += "sleeper_cover"
//Lifeform Stasis Unit
/obj/machinery/stasis/survival_pod
@@ -153,10 +152,11 @@
mattress_state = null
buckle_lying = 270
-/obj/machinery/stasis/survival_pod/play_power_sound()
- return
+/obj/machinery/stasis/survival_pod/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
-/obj/machinery/stasis/survival_pod/update_icon()
+/obj/machinery/stasis/survival_pod/play_power_sound()
return
//Computer
@@ -205,8 +205,9 @@
flags_1 = NODECONSTRUCT_1
var/empty = FALSE
-/obj/machinery/smartfridge/survival_pod/update_icon()
- return
+/obj/machinery/smartfridge/survival_pod/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
/obj/machinery/smartfridge/survival_pod/Initialize(mapload)
. = ..()
diff --git a/code/modules/mining/lavaland/ash_flora.dm b/code/modules/mining/lavaland/ash_flora.dm
index 7aefc4354fb..a3e5b0f1779 100644
--- a/code/modules/mining/lavaland/ash_flora.dm
+++ b/code/modules/mining/lavaland/ash_flora.dm
@@ -295,13 +295,15 @@
icon = 'icons/obj/lavaland/ash_flora.dmi'
icon_state = "mushroom_bowl"
-/obj/item/reagent_containers/glass/bowl/mushroom_bowl/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/glass/bowl/mushroom_bowl/update_overlays()
+ . = ..()
if(reagents && reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/obj/lavaland/ash_flora.dmi', "fullbowl")
filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
- else
+ . += filling
+
+/obj/item/reagent_containers/glass/bowl/mushroom_bowl/update_icon_state()
+ if(!reagents || !reagents.total_volume)
icon_state = "mushroom_bowl"
/obj/item/reagent_containers/glass/bowl/mushroom_bowl/attackby(obj/item/I,mob/user, params)
diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm
index 573f02b50f9..b0f3ff9593f 100644
--- a/code/modules/mining/lavaland/necropolis_chests.dm
+++ b/code/modules/mining/lavaland/necropolis_chests.dm
@@ -597,7 +597,7 @@
desc = "A flask with an almost-holy aura emitting from it. The label on the bottle says: 'erqo'hyy tvi'rf lbh jv'atf'."
list_reagents = list(/datum/reagent/flightpotion = 5)
-/obj/item/reagent_containers/glass/bottle/potion/update_icon()
+/obj/item/reagent_containers/glass/bottle/potion/update_icon_state()
if(reagents.total_volume)
icon_state = "potionflask"
else
@@ -1116,6 +1116,10 @@
var/teleporting = FALSE //if we ARE teleporting
var/friendly_fire_check = FALSE //if the blasts we make will consider our faction against the faction of hit targets
+/obj/item/hierophant_club/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+
/obj/item/hierophant_club/examine(mob/user)
. = ..()
. += "The[beacon ? " beacon is not currently":"re is a beacon"] attached."
@@ -1178,13 +1182,8 @@
chaser_speed = max(chaser_speed + health_percent, 0.5) //one tenth of a second faster for each missing 10% of health
blast_range -= round(health_percent * 10) //one additional range for each missing 10% of health
-/obj/item/hierophant_club/update_icon()
- icon_state = "hierophant_club[timer <= world.time ? "_ready":""][(beacon && !QDELETED(beacon)) ? "":"_beacon"]"
- item_state = icon_state
- if(ismob(loc))
- var/mob/M = loc
- M.update_inv_hands()
- M.update_inv_back()
+/obj/item/hierophant_club/update_icon_state()
+ icon_state = item_state = "hierophant_club[timer <= world.time ? "_ready":""][(beacon && !QDELETED(beacon)) ? "":"_beacon"]"
/obj/item/hierophant_club/proc/prepare_icon_update()
update_icon()
diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm
index 794d80291b8..cafc8b13379 100644
--- a/code/modules/mining/machine_redemption.dm
+++ b/code/modules/mining/machine_redemption.dm
@@ -352,9 +352,8 @@
do_sparks(5, TRUE, src)
..()
-/obj/machinery/mineral/ore_redemption/update_icon()
+/obj/machinery/mineral/ore_redemption/update_icon_state()
if(powered())
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]-off"
- return
diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm
index 4b311da18d4..8003d039757 100644
--- a/code/modules/mining/machine_vending.dm
+++ b/code/modules/mining/machine_vending.dm
@@ -71,7 +71,7 @@
src.equipment_path = path
src.cost = cost
-/obj/machinery/mineral/equipment_vendor/update_icon()
+/obj/machinery/mineral/equipment_vendor/update_icon_state()
if(powered())
icon_state = initial(icon_state)
else
diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm
index 396b5767412..d6460dc37c1 100644
--- a/code/modules/mining/ores_coins.dm
+++ b/code/modules/mining/ores_coins.dm
@@ -20,25 +20,24 @@
novariants = TRUE // Ore stacks handle their icon updates themselves to keep the illusion that there's more going
var/list/stack_overlays
-/obj/item/stack/ore/update_icon()
+/obj/item/stack/ore/update_overlays()
+ . = ..()
var/difference = min(ORESTACK_OVERLAYS_MAX, amount) - (LAZYLEN(stack_overlays)+1)
if(difference == 0)
return
else if(difference < 0 && LAZYLEN(stack_overlays)) //amount < stack_overlays, remove excess.
- cut_overlays()
if (LAZYLEN(stack_overlays)-difference <= 0)
- stack_overlays = null;
+ stack_overlays = null
else
stack_overlays.len += difference
else if(difference > 0) //amount > stack_overlays, add some.
- cut_overlays()
for(var/i in 1 to difference)
var/mutable_appearance/newore = mutable_appearance(icon, icon_state)
newore.pixel_x = rand(-8,8)
newore.pixel_y = rand(-8,8)
LAZYADD(stack_overlays, newore)
if (stack_overlays)
- add_overlay(stack_overlays)
+ . += stack_overlays
/obj/item/stack/ore/welder_act(mob/living/user, obj/item/I)
..()
diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm
index 0b97af81a55..d04062d9864 100644
--- a/code/modules/mob/living/brain/MMI.dm
+++ b/code/modules/mob/living/brain/MMI.dm
@@ -14,20 +14,20 @@
var/force_replace_ai_name = FALSE
var/overrides_aicore_laws = FALSE // Whether the laws on the MMI, if any, override possible pre-existing laws loaded on the AI core.
-/obj/item/mmi/update_icon()
+/obj/item/mmi/update_icon_state()
if(!brain)
icon_state = "mmi_off"
- return
- if(istype(brain, /obj/item/organ/brain/alien))
+ else if(istype(brain, /obj/item/organ/brain/alien))
icon_state = "mmi_brain_alien"
- braintype = "Xenoborg" //HISS....Beep.
else
icon_state = "mmi_brain"
- braintype = "Cyborg"
+
+/obj/item/mmi/update_overlays()
+ . = ..()
if(brainmob && brainmob.stat != DEAD)
- add_overlay("mmi_alive")
- else
- add_overlay("mmi_dead")
+ . += "mmi_alive"
+ else if(brain)
+ . += "mmi_dead"
/obj/item/mmi/Initialize()
. = ..()
@@ -75,6 +75,10 @@
name = "[initial(name)]: [brainmob.real_name]"
update_icon()
+ if(istype(brain, /obj/item/organ/brain/alien))
+ braintype = "Xenoborg" //HISS....Beep.
+ else
+ braintype = "Cyborg"
SSblackbox.record_feedback("amount", "mmis_filled", 1)
@@ -137,7 +141,10 @@
name = "[initial(name)]: [brainmob.real_name]"
update_icon()
- return
+ if(istype(brain, /obj/item/organ/brain/alien))
+ braintype = "Xenoborg" //HISS....Beep.
+ else
+ braintype = "Cyborg"
/obj/item/mmi/proc/replacement_ai_name()
return brainmob.name
diff --git a/code/modules/mob/living/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm
index e916917d84a..19ead35e094 100644
--- a/code/modules/mob/living/brain/posibrain.dm
+++ b/code/modules/mob/living/brain/posibrain.dm
@@ -169,11 +169,10 @@ GLOBAL_VAR(posibrain_notify_cooldown)
return
-/obj/item/mmi/posibrain/update_icon()
+/obj/item/mmi/posibrain/update_icon_state()
if(searching)
icon_state = "[initial(icon_state)]-searching"
- return
- if(brainmob && brainmob.key)
+ else if(brainmob && brainmob.key)
icon_state = "[initial(icon_state)]-occupied"
else
icon_state = initial(icon_state)
diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm
index b5cfba4fe74..17bf82f2202 100644
--- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm
@@ -99,6 +99,10 @@
decay_factor = 0
+/obj/item/organ/heart/nightmare/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
+
/obj/item/organ/heart/nightmare/attack(mob/M, mob/living/carbon/user, obj/target)
if(M != user)
return ..()
@@ -128,9 +132,6 @@
/obj/item/organ/heart/nightmare/Stop()
return 0
-/obj/item/organ/heart/nightmare/update_icon()
- return //always beating visually
-
/obj/item/organ/heart/nightmare/on_death()
if(!owner)
return
diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm
index e73f13e89d9..eea2a411d30 100644
--- a/code/modules/mob/living/simple_animal/guardian/guardian.dm
+++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm
@@ -629,8 +629,9 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
"}
-/obj/item/paper/guides/antag/guardian/update_icon()
- return
+/obj/item/paper/guides/antag/guardian/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
/obj/item/paper/guides/antag/guardian/wizard
name = "Guardian Guide"
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
index d9b2dc8af14..ca4dd5d591c 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
@@ -281,8 +281,9 @@ Difficulty: Very Hard
var/list/stored_items = list()
var/list/blacklist = list()
-/obj/machinery/smartfridge/black_box/update_icon()
- return
+/obj/machinery/smartfridge/black_box/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
/obj/machinery/smartfridge/black_box/accept_check(obj/item/O)
if(!istype(O))
diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm
index d15dc610c33..877bda84648 100644
--- a/code/modules/modular_computers/computers/item/computer.dm
+++ b/code/modules/modular_computers/computers/item/computer.dm
@@ -26,6 +26,7 @@
var/icon_state_unpowered = null // Icon state when the computer is turned off.
var/icon_state_powered = null // Icon state when the computer is turned on.
var/icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
+ var/display_overlays = TRUE // If FALSE, don't draw overlays on this device at all
var/max_hardware_size = 0 // Maximal hardware w_class. Tablets/PDAs have 1, laptops 2, consoles 4.
var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer.
@@ -210,20 +211,25 @@
. += get_modular_computer_parts_examine(user)
-/obj/item/modular_computer/update_icon()
- cut_overlays()
+/obj/item/modular_computer/update_icon_state()
if(!enabled)
icon_state = icon_state_unpowered
else
icon_state = icon_state_powered
+
+/obj/item/modular_computer/update_overlays()
+ . = ..()
+ if(!display_overlays)
+ return
+ if(enabled)
if(active_program)
- add_overlay(active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu)
+ . += active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu
else
- add_overlay(icon_state_menu)
+ . += icon_state_menu
if(obj_integrity <= integrity_failure * max_integrity)
- add_overlay("bsod")
- add_overlay("broken")
+ . += "bsod"
+ . += "broken"
// On-click handling. Turns on the computer if it's off and opens the GUI.
diff --git a/code/modules/modular_computers/computers/item/laptop.dm b/code/modules/modular_computers/computers/item/laptop.dm
index 11359b04eda..73cf9c62f48 100644
--- a/code/modules/modular_computers/computers/item/laptop.dm
+++ b/code/modules/modular_computers/computers/item/laptop.dm
@@ -7,6 +7,7 @@
icon_state_powered = "laptop"
icon_state_unpowered = "laptop-off"
icon_state_menu = "menu"
+ display_overlays = FALSE
hardware_flag = PROGRAM_LAPTOP
max_hardware_size = 2
@@ -32,7 +33,14 @@
if(start_open && !screen_on)
toggle_open()
-/obj/item/modular_computer/laptop/update_icon()
+/obj/item/modular_computer/laptop/update_icon_state()
+ if(!screen_on)
+ icon_state = icon_state_closed
+ else
+ . = ..()
+
+/obj/item/modular_computer/laptop/update_overlays()
+ . = ..()
if(screen_on)
..()
else
@@ -100,6 +108,7 @@
w_class = w_class_open
screen_on = !screen_on
+ display_overlays = screen_on
update_icon()
diff --git a/code/modules/modular_computers/computers/item/processor.dm b/code/modules/modular_computers/computers/item/processor.dm
index 3ced8641f92..c7d1107f3c3 100644
--- a/code/modules/modular_computers/computers/item/processor.dm
+++ b/code/modules/modular_computers/computers/item/processor.dm
@@ -36,14 +36,11 @@
integrity_failure = machinery_computer.integrity_failure
base_active_power_usage = machinery_computer.base_active_power_usage
base_idle_power_usage = machinery_computer.base_idle_power_usage
+ machinery_computer.RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, /atom/proc/update_icon) //when we update_icon, also update the computer
/obj/item/modular_computer/processor/relay_qdel()
qdel(machinery_computer)
-/obj/item/modular_computer/processor/update_icon()
- if(machinery_computer)
- return machinery_computer.update_icon()
-
// This thing is not meant to be used on it's own, get topic data from our machinery owner.
//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dexterity=FALSE, no_tk=FALSE)
// if(!machinery_computer)
diff --git a/code/modules/modular_computers/computers/item/tablet.dm b/code/modules/modular_computers/computers/item/tablet.dm
index 45a69aed9d3..a371e97ec6a 100644
--- a/code/modules/modular_computers/computers/item/tablet.dm
+++ b/code/modules/modular_computers/computers/item/tablet.dm
@@ -15,14 +15,11 @@
var/has_variants = TRUE
var/finish_color = null
-/obj/item/modular_computer/tablet/update_icon()
- ..()
- if (has_variants)
+/obj/item/modular_computer/tablet/update_icon_state()
+ if(has_variants)
if(!finish_color)
finish_color = pick("red","blue","brown","green","black")
- icon_state = "tablet-[finish_color]"
- icon_state_unpowered = "tablet-[finish_color]"
- icon_state_powered = "tablet-[finish_color]"
+ icon_state = icon_state_powered = icon_state_unpowered = "tablet-[finish_color]"
/obj/item/modular_computer/tablet/syndicate_contract_uplink
name = "contractor tablet"
diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm
index c3754df292e..6a773211024 100644
--- a/code/modules/paperwork/clipboard.dm
+++ b/code/modules/paperwork/clipboard.dm
@@ -25,17 +25,14 @@
QDEL_NULL(toppaper) //let movable/Destroy handle the rest
return ..()
-/obj/item/clipboard/update_icon()
- cut_overlays()
- var/list/dat = list()
+/obj/item/clipboard/update_overlays()
+ . = ..()
if(toppaper)
- dat += toppaper.icon_state
- dat += toppaper.overlays.Copy()
+ . += toppaper.icon_state
+ . += toppaper.overlays
if(haspen)
- dat += "clipboard_pen"
- dat += "clipboard_over"
- add_overlay(dat)
-
+ . += "clipboard_pen"
+ . += "clipboard_over"
/obj/item/clipboard/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/paper))
diff --git a/code/modules/paperwork/contract.dm b/code/modules/paperwork/contract.dm
index 05dbdb64099..a285bee3a14 100644
--- a/code/modules/paperwork/contract.dm
+++ b/code/modules/paperwork/contract.dm
@@ -7,13 +7,13 @@
var/datum/mind/target
item_flags = NOBLUDGEON
+/obj/item/paper/contract/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
+
/obj/item/paper/contract/proc/update_text()
return
-/obj/item/paper/contract/update_icon()
- return
-
-
/obj/item/paper/contract/employment
icon_state = "paper_words"
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index be26b588aa9..56a5df7a93e 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -28,10 +28,10 @@
icon_state = "folder_white"
-/obj/item/folder/update_icon()
- cut_overlays()
+/obj/item/folder/update_overlays()
+ . = ..()
if(contents.len)
- add_overlay("folder_paper")
+ . += "folder_paper"
/obj/item/folder/attackby(obj/item/W, mob/user, params)
diff --git a/code/modules/paperwork/paper_cutter.dm b/code/modules/paperwork/paper_cutter.dm
index ec82b7a3ab5..7f3816d1c12 100644
--- a/code/modules/paperwork/paper_cutter.dm
+++ b/code/modules/paperwork/paper_cutter.dm
@@ -34,12 +34,13 @@
return (BRUTELOSS)
-/obj/item/papercutter/update_icon()
- ..()
- cut_overlays()
+/obj/item/papercutter/update_icon_state()
icon_state = (storedcutter ? "[initial(icon_state)]-cutter" : "[initial(icon_state)]")
+
+/obj/item/papercutter/update_overlays()
+ . =..()
if(storedpaper)
- add_overlay("paper")
+ . += "paper"
/obj/item/papercutter/attackby(obj/item/P, mob/user, params)
diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm
index afb6a648c6c..330557347dd 100644
--- a/code/modules/paperwork/paperbin.dm
+++ b/code/modules/paperwork/paperbin.dm
@@ -125,14 +125,16 @@
. += "It doesn't contain anything."
-/obj/item/paper_bin/update_icon()
+/obj/item/paper_bin/update_icon_state()
if(total_paper < 1)
icon_state = "paper_bin0"
else
icon_state = "[initial(icon_state)]"
- cut_overlays()
+
+/obj/item/paper_bin/update_overlays()
+ . = ..()
if(bin_pen)
- add_overlay(mutable_appearance(bin_pen.icon, bin_pen.icon_state))
+ . += mutable_appearance(bin_pen.icon, bin_pen.icon_state)
/obj/item/paper_bin/construction
name = "construction paper bin"
diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm
index 4e9cd08eaef..4bd92bec0b7 100644
--- a/code/modules/paperwork/paperplane.dm
+++ b/code/modules/paperwork/paperplane.dm
@@ -61,12 +61,12 @@
sleep(10)
return (BRUTELOSS)
-/obj/item/paperplane/update_icon()
- cut_overlays()
+/obj/item/paperplane/update_overlays()
+ . = ..()
var/list/stamped = internalPaper.stamped
if(stamped)
for(var/S in stamped)
- add_overlay("paperplane_[S]")
+ . += "paperplane_[S]"
/obj/item/paperplane/attack_self(mob/user)
to_chat(user, "You unfold [src].")
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 3f225e70664..f7a1aa14463 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -193,9 +193,10 @@
sharpness = IS_SHARP
var/on = FALSE
-/obj/item/pen/edagger/Initialize()
+/obj/item/pen/edagger/ComponentInitialize()
. = ..()
AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg')
+ AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/pen/edagger/get_sharpness()
return on * sharpness
@@ -233,10 +234,9 @@
to_chat(user, "[src] is now active.")
update_icon()
-/obj/item/pen/edagger/update_icon()
+/obj/item/pen/edagger/update_icon_state()
if(on)
- icon_state = "edagger"
- item_state = "edagger"
+ icon_state = item_state = "edagger"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
else
diff --git a/code/modules/photography/photos/frame.dm b/code/modules/photography/photos/frame.dm
index df5d998b4ef..d5b2e192387 100644
--- a/code/modules/photography/photos/frame.dm
+++ b/code/modules/photography/photos/frame.dm
@@ -44,10 +44,10 @@
else
return ..()
-/obj/item/wallframe/picture/update_icon()
- cut_overlays()
+/obj/item/wallframe/picture/update_overlays()
+ . = ..()
if(displayed)
- add_overlay(image(displayed))
+ . += displayed
/obj/item/wallframe/picture/after_attach(obj/O)
..()
@@ -148,10 +148,10 @@
if(framed)
framed.show(user)
-/obj/structure/sign/picture_frame/update_icon()
- cut_overlays()
+/obj/structure/sign/picture_frame/update_overlays()
+ . = ..()
if(framed)
- add_overlay(image(framed))
+ . += framed
/obj/structure/sign/picture_frame/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
diff --git a/code/modules/photography/photos/photo.dm b/code/modules/photography/photos/photo.dm
index 67813f46594..c83e81946cc 100644
--- a/code/modules/photography/photos/photo.dm
+++ b/code/modules/photography/photos/photo.dm
@@ -32,7 +32,7 @@
if(setdesc && P.picture_desc)
desc = P.picture_desc
-/obj/item/photo/update_icon()
+/obj/item/photo/update_icon_state()
if(!istype(picture) || !picture.picture_image)
return
var/icon/I = picture.get_small_icon(initial(icon_state))
diff --git a/code/modules/plumbing/ducts.dm b/code/modules/plumbing/ducts.dm
index 1bad3a86d72..667145ec3ea 100644
--- a/code/modules/plumbing/ducts.dm
+++ b/code/modules/plumbing/ducts.dm
@@ -219,7 +219,7 @@ All the important duct code:
adjacents += D
return adjacents
-/obj/machinery/duct/update_icon() //setting connects isnt a parameter because sometimes we make more than one change, overwrite it completely or just add it to the bitfield
+/obj/machinery/duct/update_icon_state()
var/temp_icon = initial(icon_state)
for(var/D in GLOB.cardinals)
if(D & connects)
@@ -232,6 +232,7 @@ All the important duct code:
if(D == WEST)
temp_icon += "_w"
icon_state = temp_icon
+
///update the layer we are on
/obj/machinery/duct/proc/handle_layer()
var/offset
@@ -334,8 +335,9 @@ All the important duct code:
. = ..()
update_connects()
-/obj/machinery/duct/multilayered/update_icon()
- return
+/obj/machinery/duct/multilayered/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
/obj/machinery/duct/multilayered/wrench_act(mob/living/user, obj/item/I)
. = ..()
diff --git a/code/modules/plumbing/plumbers/acclimator.dm b/code/modules/plumbing/plumbers/acclimator.dm
index 4b8ec6e3094..6a0f8d52fb1 100644
--- a/code/modules/plumbing/plumbers/acclimator.dm
+++ b/code/modules/plumbing/plumbers/acclimator.dm
@@ -57,7 +57,7 @@
reagents.adjust_thermal_energy((target_temperature - reagents.chem_temp) * heater_coefficient * SPECIFIC_HEAT_DEFAULT * reagents.total_volume) //keep constant with chem heater
reagents.handle_reactions()
-/obj/machinery/plumbing/acclimator/update_icon()
+/obj/machinery/plumbing/acclimator/update_icon_state()
icon_state = initial(icon_state)
switch(acclimate_state)
if(COOLING)
diff --git a/code/modules/plumbing/plumbers/pumps.dm b/code/modules/plumbing/plumbers/pumps.dm
index 8b890673331..da10728b674 100644
--- a/code/modules/plumbing/plumbers/pumps.dm
+++ b/code/modules/plumbing/plumbers/pumps.dm
@@ -75,7 +75,7 @@
return
geyser.reagents.trans_to(src, pump_power)
-/obj/machinery/power/liquid_pump/update_icon()
+/obj/machinery/power/liquid_pump/update_icon_state()
if(powered)
icon_state = initial(icon_state) + "-on"
else if(panel_open)
diff --git a/code/modules/plumbing/plumbers/synthesizer.dm b/code/modules/plumbing/plumbers/synthesizer.dm
index b685f21384c..c4ab3447f6e 100644
--- a/code/modules/plumbing/plumbers/synthesizer.dm
+++ b/code/modules/plumbing/plumbers/synthesizer.dm
@@ -16,8 +16,6 @@
var/static/list/possible_amounts = list(0,1,2,3,4,5)
///The reagent we are producing. We are a typepath, but are also typecast because there's several occations where we need to use initial.
var/datum/reagent/reagent_id = null
- ///reagent overlay. its the colored pipe thingies. we track this because overlays.Cut() is bad
- var/image/r_overlay
///straight up copied from chem dispenser. Being a subtype would be extremely tedious and making it global would restrict potential subtypes using different dispensable_reagents
var/list/dispensable_reagents = list(
/datum/reagent/aluminium,
@@ -106,15 +104,11 @@
update_icon()
reagents.clear_reagents()
-/obj/machinery/plumbing/synthesizer/update_icon()
- if(!r_overlay)
- r_overlay = image(icon, "[icon_state]_overlay")
- else
- overlays -= r_overlay //we remove it because overlays are completely unnaffected by changing the object, you need to reapply it
-
+/obj/machinery/plumbing/synthesizer/update_overlays()
+ . = ..()
+ var/mutable_appearance/r_overlay = mutable_appearance(icon, "[icon_state]_overlay")
if(reagent_id)
r_overlay.color = initial(reagent_id.color)
else
r_overlay.color = "#FFFFFF"
-
- overlays += r_overlay
+ . += r_overlay
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index bfd5b825453..67e77ab776f 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -121,7 +121,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri
invisibility = i ? INVISIBILITY_MAXIMUM : 0
update_icon()
-/obj/structure/cable/update_icon()
+/obj/structure/cable/update_icon_state()
if(!linked_dirs)
icon_state = "[cable_layer]-noconnection"
else
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index 56eaa20d65b..6014d057fb6 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -54,16 +54,16 @@
else
return PROCESS_KILL
-/obj/item/stock_parts/cell/update_icon()
- cut_overlays()
+/obj/item/stock_parts/cell/update_overlays()
+ . = ..()
if(grown_battery)
- add_overlay(image('icons/obj/power.dmi',"grown_wires"))
+ . += mutable_appearance('icons/obj/power.dmi', "grown_wires")
if(charge < 0.01)
return
else if(charge/maxcharge >=0.995)
- add_overlay("cell-o2")
+ . += "cell-o2"
else
- add_overlay("cell-o1")
+ . += "cell-o1"
/obj/item/stock_parts/cell/proc/percent() // return % charge of cell
return 100*charge/maxcharge
@@ -309,9 +309,9 @@
maxcharge = 50000
ratingdesc = FALSE
-/obj/item/stock_parts/cell/infinite/abductor/update_icon()
- return
-
+/obj/item/stock_parts/cell/infinite/abductor/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
/obj/item/stock_parts/cell/potato
name = "potato battery"
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index 9e46fe92c24..377891971b0 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -30,19 +30,15 @@
SSair.atmos_machinery -= src
return ..()
-/obj/machinery/power/generator/update_icon()
-
- if(stat & (NOPOWER|BROKEN))
- cut_overlays()
- else
- cut_overlays()
-
+/obj/machinery/power/generator/update_overlays()
+ . = ..()
+ if(!(stat & (NOPOWER|BROKEN)))
var/L = min(round(lastgenlev/100000),11)
if(L != 0)
- add_overlay(image('icons/obj/power.dmi', "teg-op[L]"))
+ . += mutable_appearance('icons/obj/power.dmi', "teg-op[L]")
if(hot_circ && cold_circ)
- add_overlay("teg-oc[lastcirc]")
+ . += "teg-oc[lastcirc]"
#define GENRATE 800 // generator output coefficient from Q
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index da3315ba446..7c92a29caf2 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -44,8 +44,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
if(zap_flags & ZAP_MACHINE_EXPLOSIVE)
qdel(src)//like the singulo, tesla deletes it. stops it from exploding over and over
-/obj/machinery/gravity_generator/update_icon()
- ..()
+/obj/machinery/gravity_generator/update_icon_state()
icon_state = "[get_status()]_[sprite_number]"
/obj/machinery/gravity_generator/proc/get_status()
@@ -158,6 +157,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
part.main_part = src
parts += part
part.update_icon()
+ part.RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, /atom/proc/update_icon)
/obj/machinery/gravity_generator/main/proc/connected_parts()
return parts.len == 8
@@ -263,11 +263,6 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
return "fix[min(broken_state, 3)]"
return on || charging_state != POWER_IDLE ? "on" : "off"
-/obj/machinery/gravity_generator/main/update_icon()
- ..()
- for(var/obj/O in parts)
- O.update_icon()
-
// Set the charging state based on power/breaker.
/obj/machinery/gravity_generator/main/proc/set_power()
var/new_state = FALSE
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index 2f88da8837d..609e9f1206d 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -317,8 +317,7 @@
QDEL_NULL(cell)
return ..()
-/obj/machinery/light/update_icon()
- cut_overlays()
+/obj/machinery/light/update_icon_state()
switch(status) // set icon_states
if(LIGHT_OK)
var/area/A = get_area(src)
@@ -326,17 +325,19 @@
icon_state = "[base_state]_emergency"
else
icon_state = "[base_state]"
- if(on)
- var/mutable_appearance/glowybit = mutable_appearance(overlayicon, base_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE)
- glowybit.alpha = CLAMP(light_power*250, 30, 200)
- add_overlay(glowybit)
if(LIGHT_EMPTY)
icon_state = "[base_state]-empty"
if(LIGHT_BURNED)
icon_state = "[base_state]-burned"
if(LIGHT_BROKEN)
icon_state = "[base_state]-broken"
- return
+
+/obj/machinery/light/update_overlays()
+ . = ..()
+ if(on && status == LIGHT_OK)
+ var/mutable_appearance/glowybit = mutable_appearance(overlayicon, base_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE)
+ glowybit.alpha = CLAMP(light_power*250, 30, 200)
+ . += glowybit
// update the icon_state and luminosity of the light depending on its state
/obj/machinery/light/proc/update(trigger = TRUE)
diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm
index 6bf19868635..97e40f96400 100644
--- a/code/modules/power/port_gen.dm
+++ b/code/modules/power/port_gen.dm
@@ -58,7 +58,7 @@
update_icon()
soundloop.start()
-/obj/machinery/power/port_gen/update_icon()
+/obj/machinery/power/port_gen/update_icon_state()
icon_state = "[base_icon]_[active]"
/obj/machinery/power/port_gen/process()
diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm
index 906a44c6071..5058640e3aa 100644
--- a/code/modules/power/singularity/collector.dm
+++ b/code/modules/power/singularity/collector.dm
@@ -233,14 +233,14 @@
if(loaded_tank && active && pulse_strength > RAD_COLLECTOR_EFFICIENCY)
stored_energy += (pulse_strength-RAD_COLLECTOR_EFFICIENCY)*RAD_COLLECTOR_COEFFICIENT
-/obj/machinery/power/rad_collector/update_icon()
- cut_overlays()
+/obj/machinery/power/rad_collector/update_overlays()
+ . = ..()
if(loaded_tank)
- add_overlay("ptank")
+ . += "ptank"
if(stat & (NOPOWER|BROKEN))
return
if(active)
- add_overlay("on")
+ . += "on"
/obj/machinery/power/rad_collector/proc/toggle_power()
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index ea32eca6066..e88969d8d2a 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -118,7 +118,7 @@
QDEL_NULL(sparks)
return ..()
-/obj/machinery/power/emitter/update_icon()
+/obj/machinery/power/emitter/update_icon_state()
if(active && powernet)
icon_state = avail(active_power_usage) ? icon_state_on : icon_state_underpowered
else
diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm
index feaa5a02c13..c74fcc352ea 100644
--- a/code/modules/power/singularity/field_generator.dm
+++ b/code/modules/power/singularity/field_generator.dm
@@ -45,14 +45,14 @@ field_generator power level display
var/list/obj/machinery/field/generator/connected_gens
var/clean_up = 0
-/obj/machinery/field/generator/update_icon()
- cut_overlays()
+/obj/machinery/field/generator/update_overlays()
+ . = ..()
if(warming_up)
- add_overlay("+a[warming_up]")
+ . += "+a[warming_up]"
if(LAZYLEN(fields))
- add_overlay("+on")
+ . += "+on"
if(power_level)
- add_overlay("+p[power_level]")
+ . += "+p[power_level]"
/obj/machinery/field/generator/Initialize()
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index e8340a32cdc..aae15508625 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -125,7 +125,7 @@
investigate_log("was moved whilst active; it powered down.", INVESTIGATE_SINGULO)
-/obj/structure/particle_accelerator/update_icon()
+/obj/structure/particle_accelerator/update_icon_state()
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED,PA_CONSTRUCTION_UNWIRED)
icon_state="[reference]"
diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm
index 7c50efd5b5a..29ce04793af 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_control.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm
@@ -57,7 +57,7 @@
active = FALSE
connected_parts.Cut()
-/obj/machinery/particle_accelerator/control_box/update_icon()
+/obj/machinery/particle_accelerator/control_box/update_icon_state()
if(active)
icon_state = "control_boxp1"
else
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 8bf385aa8ef..0d298cae863 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -205,8 +205,8 @@
obj_break()
-/obj/machinery/power/smes/update_icon()
- cut_overlays()
+/obj/machinery/power/smes/update_overlays()
+ . = ..()
if(stat & BROKEN)
return
@@ -214,19 +214,18 @@
return
if(outputting)
- add_overlay("smes-op1")
+ . += "smes-op1"
else
- add_overlay("smes-op0")
+ . += "smes-op0"
if(inputting)
- add_overlay("smes-oc1")
- else
- if(input_attempt)
- add_overlay("smes-oc0")
+ . += "smes-oc1"
+ else if(input_attempt)
+ . += "smes-oc0"
var/clevel = chargedisplay()
if(clevel>0)
- add_overlay("smes-og[clevel]")
+ . += "smes-og[clevel]"
/obj/machinery/power/smes/proc/chargedisplay()
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 4745a0cb877..f81678a8756 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -351,10 +351,6 @@
SSblackbox.record_feedback("tally", "gun_fired", 1, type)
return TRUE
-/obj/item/gun/update_icon()
- ..()
-
-
/obj/item/gun/proc/reset_semicd()
semicd = FALSE
diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm
index f0ca2985f85..dab74c0031e 100644
--- a/code/modules/projectiles/guns/ballistic.dm
+++ b/code/modules/projectiles/guns/ballistic.dm
@@ -97,30 +97,29 @@
chamber_round()
update_icon()
-/obj/item/gun/ballistic/update_icon()
- if (QDELETED(src))
- return
- ..()
+/obj/item/gun/ballistic/update_icon_state()
if(current_skin)
icon_state = "[unique_reskin[current_skin]][sawn_off ? "_sawn" : ""]"
else
icon_state = "[initial(icon_state)][sawn_off ? "_sawn" : ""]"
- cut_overlays()
+
+/obj/item/gun/ballistic/update_overlays()
+ . = ..()
if (bolt_type == BOLT_TYPE_LOCKING)
- add_overlay("[icon_state]_bolt[bolt_locked ? "_locked" : ""]")
+ . += "[icon_state]_bolt[bolt_locked ? "_locked" : ""]"
if (bolt_type == BOLT_TYPE_OPEN && bolt_locked)
- add_overlay("[icon_state]_bolt")
+ . += "[icon_state]_bolt"
if (suppressed)
- add_overlay("[icon_state]_suppressor")
+ . += "[icon_state]_suppressor"
if(!chambered && empty_indicator)
- add_overlay("[icon_state]_empty")
+ . += "[icon_state]_empty"
if (magazine)
if (special_mags)
- add_overlay("[icon_state]_mag_[initial(magazine.icon_state)]")
+ . += "[icon_state]_mag_[initial(magazine.icon_state)]"
if (!magazine.ammo_count())
- add_overlay("[icon_state]_mag_empty")
+ . += "[icon_state]_mag_empty"
else
- add_overlay("[icon_state]_mag")
+ . += "[icon_state]_mag"
var/capacity_number = 0
switch(get_ammo() / magazine.max_ammo)
if(0.2 to 0.39)
@@ -134,7 +133,7 @@
if(1.0)
capacity_number = 100
if (capacity_number)
- add_overlay("[icon_state]_mag_[capacity_number]")
+ . += "[icon_state]_mag_[capacity_number]"
/obj/item/gun/ballistic/process_chamber(empty_chamber = TRUE, from_firing = TRUE, chamber_next_round = TRUE)
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index 85204db021e..d485ec85dd4 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -24,12 +24,12 @@
/obj/item/gun/ballistic/automatic/proto/unrestricted
pin = /obj/item/firing_pin
-/obj/item/gun/ballistic/automatic/update_icon()
- ..()
+/obj/item/gun/ballistic/automatic/update_overlays()
+ . = ..()
if(!select)
- add_overlay("[initial(icon_state)]_semi")
+ . += "[initial(icon_state)]_semi"
if(select == 1)
- add_overlay("[initial(icon_state)]_burst")
+ . += "[initial(icon_state)]_burst"
/obj/item/gun/ballistic/automatic/ui_action_click(mob/user, actiontype)
if(istype(actiontype, /datum/action/item_action/toggle_firemode))
@@ -147,16 +147,15 @@
else
..()
-/obj/item/gun/ballistic/automatic/m90/update_icon()
- ..()
+/obj/item/gun/ballistic/automatic/m90/update_overlays()
+ . = ..()
switch(select)
if(0)
- add_overlay("[initial(icon_state)]_semi")
+ . += "[initial(icon_state)]_semi"
if(1)
- add_overlay("[initial(icon_state)]_burst")
+ . += "[initial(icon_state)]_burst"
if(2)
- add_overlay("[initial(icon_state)]_gren")
- return
+ . += "[initial(icon_state)]_gren"
/obj/item/gun/ballistic/automatic/m90/burst_select()
var/mob/living/carbon/human/user = usr
@@ -246,9 +245,9 @@
update_icon()
-/obj/item/gun/ballistic/automatic/l6_saw/update_icon()
+/obj/item/gun/ballistic/automatic/l6_saw/update_overlays()
. = ..()
- add_overlay("l6_door_[cover_open ? "open" : "closed"]")
+ . += "l6_door_[cover_open ? "open" : "closed"]"
/obj/item/gun/ballistic/automatic/l6_saw/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params)
diff --git a/code/modules/projectiles/guns/ballistic/laser_gatling.dm b/code/modules/projectiles/guns/ballistic/laser_gatling.dm
index 72b7d834877..42930d4b59f 100644
--- a/code/modules/projectiles/guns/ballistic/laser_gatling.dm
+++ b/code/modules/projectiles/guns/ballistic/laser_gatling.dm
@@ -74,7 +74,7 @@
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
-/obj/item/minigunpack/update_icon()
+/obj/item/minigunpack/update_icon_state()
if(armed)
icon_state = "notholstered"
else
diff --git a/code/modules/projectiles/guns/ballistic/rifle.dm b/code/modules/projectiles/guns/ballistic/rifle.dm
index d1ab4ff75e1..47c86cfca6d 100644
--- a/code/modules/projectiles/guns/ballistic/rifle.dm
+++ b/code/modules/projectiles/guns/ballistic/rifle.dm
@@ -15,9 +15,9 @@
bolt_drop_sound = 'sound/weapons/gun/rifle/bolt_in.ogg'
tac_reloads = FALSE
-obj/item/gun/ballistic/rifle/update_icon()
- ..()
- add_overlay("[icon_state]_bolt[bolt_locked ? "_locked" : ""]")
+obj/item/gun/ballistic/rifle/update_overlays()
+ . = ..()
+ . += "[icon_state]_bolt[bolt_locked ? "_locked" : ""]"
obj/item/gun/ballistic/rifle/rack(mob/user = null)
if (bolt_locked == FALSE)
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index f257d14710e..55d7a6fa4c3 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -212,11 +212,13 @@
else
to_chat(user, "You need at least ten lengths of cable if you want to make a sling!")
-/obj/item/gun/ballistic/shotgun/doublebarrel/improvised/update_icon()
- ..()
+/obj/item/gun/ballistic/shotgun/doublebarrel/improvised/update_icon_state()
+ item_state = "ishotgunsling"
+
+/obj/item/gun/ballistic/shotgun/doublebarrel/improvised/update_overlays()
+ . = ..()
if(slung)
- add_overlay("ishotgunsling")
- item_state = "ishotgunsling"
+ . += "ishotgunsling"
/obj/item/gun/ballistic/shotgun/doublebarrel/improvised/sawoff(mob/user)
. = ..()
diff --git a/code/modules/projectiles/guns/ballistic/toy.dm b/code/modules/projectiles/guns/ballistic/toy.dm
index f830a3528be..895d6368431 100644
--- a/code/modules/projectiles/guns/ballistic/toy.dm
+++ b/code/modules/projectiles/guns/ballistic/toy.dm
@@ -13,9 +13,9 @@
item_flags = NONE
casing_ejector = FALSE
-/obj/item/gun/ballistic/automatic/toy/update_icon()
+/obj/item/gun/ballistic/automatic/toy/update_overlays()
. = ..()
- add_overlay("[icon_state]_toy")
+ . += "[icon_state]_toy"
/obj/item/gun/ballistic/automatic/toy/unrestricted
pin = /obj/item/firing_pin
@@ -58,9 +58,9 @@
can_suppress = FALSE
pb_knockback = 0
-/obj/item/gun/ballistic/shotgun/toy/update_icon()
+/obj/item/gun/ballistic/shotgun/toy/update_overlays()
. = ..()
- add_overlay("[icon_state]_toy")
+ . += "[icon_state]_toy"
/obj/item/gun/ballistic/shotgun/toy/process_chamber(empty_chamber = 0)
..()
@@ -97,9 +97,9 @@
/obj/item/gun/ballistic/automatic/c20r/toy/unrestricted/riot
mag_type = /obj/item/ammo_box/magazine/toy/smgm45/riot
-/obj/item/gun/ballistic/automatic/c20r/toy/update_icon()
+/obj/item/gun/ballistic/automatic/c20r/toy/update_overlays()
. = ..()
- add_overlay("[icon_state]_toy")
+ . += "[icon_state]_toy"
/obj/item/gun/ballistic/automatic/l6_saw/toy //This is the syndicate variant with syndicate firing pin and riot darts.
name = "donksoft LMG"
@@ -118,6 +118,6 @@
/obj/item/gun/ballistic/automatic/l6_saw/toy/unrestricted/riot
mag_type = /obj/item/ammo_box/magazine/toy/m762/riot
-/obj/item/gun/ballistic/automatic/l6_saw/toy/update_icon()
+/obj/item/gun/ballistic/automatic/l6_saw/toy/update_overlays()
. = ..()
- add_overlay("[icon_state]_toy")
+ . += "[icon_state]_toy"
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 946d6e6538f..570e7566f8a 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -14,7 +14,6 @@
var/charge_sections = 4
ammo_x_offset = 2
var/shaded_charge = FALSE //if this gun uses a stateful charge bar for more detail
- var/old_ratio = 0 // stores the gun's previous ammo "ratio" to see if it needs an updated icon
var/selfcharge = 0
var/charge_tick = 0
var/charge_delay = 4
@@ -46,6 +45,10 @@
START_PROCESSING(SSobj, src)
update_icon()
+/obj/item/gun/energy/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+
/obj/item/gun/energy/proc/update_ammo_types()
var/obj/item/ammo_casing/energy/shot
for (var/i = 1, i <= ammo_type.len, i++)
@@ -65,7 +68,7 @@
/obj/item/gun/energy/handle_atom_del(atom/A)
if(A == cell)
cell = null
- update_icon(FALSE, TRUE)
+ update_icon()
return ..()
/obj/item/gun/energy/process()
@@ -77,7 +80,7 @@
cell.give(100)
if(!chambered) //if empty chamber we try to charge a new shot
recharge_newshot(TRUE)
- update_icon(FALSE, TRUE)
+ update_icon()
/obj/item/gun/energy/attack_self(mob/living/user as mob)
if(ammo_type.len > 1)
@@ -133,50 +136,47 @@
to_chat(user, "[src] is now set to [shot.select_name].")
chambered = null
recharge_newshot(TRUE)
- update_icon(TRUE)
+ update_icon()
return
-/obj/item/gun/energy/update_icon(force_update, force_itemstate_update)
- if(QDELETED(src))
+/obj/item/gun/energy/update_icon_state()
+ if(initial(item_state))
return
- ..()
+ var/ratio = get_charge_ratio()
+ var/new_item_state = ""
+ new_item_state = initial(icon_state)
+ if(modifystate)
+ var/obj/item/ammo_casing/energy/shot = ammo_type[select]
+ new_item_state += "[shot.select_name]"
+ new_item_state += "[ratio]"
+ item_state = new_item_state
+
+/obj/item/gun/energy/update_overlays()
+ . = ..()
if(!automatic_charge_overlays)
return
- var/ratio = can_shoot() ? CEILING(CLAMP(cell.charge / cell.maxcharge, 0, 1) * charge_sections, 1) : 0
- // Sets the ratio to 0 if the gun doesn't have enough charge to fire, or if it's power cell is removed.
- // TG issues #5361 & #47908
- if(ratio == old_ratio && !force_update)
- return
- old_ratio = ratio
- cut_overlays()
- var/iconState = "[icon_state]_charge"
- var/itemState = null
- if(!initial(item_state))
- itemState = icon_state
- if (modifystate)
+ var/overlay_icon_state = "[icon_state]_charge"
+ var/ratio = get_charge_ratio()
+ if(modifystate)
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
- add_overlay("[icon_state]_[shot.select_name]")
- iconState += "_[shot.select_name]"
- if(itemState)
- itemState += "[shot.select_name]"
+ overlay_icon_state += "_[shot.select_name]"
+ . += "[icon_state]_[shot.select_name]"
if(ratio == 0)
- add_overlay("[icon_state]_empty")
+ . += "[icon_state]_empty"
else
if(!shaded_charge)
- var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
+ var/mutable_appearance/charge_overlay = mutable_appearance(icon, overlay_icon_state)
for(var/i = ratio, i >= 1, i--)
charge_overlay.pixel_x = ammo_x_offset * (i - 1)
charge_overlay.pixel_y = ammo_y_offset * (i - 1)
- add_overlay(charge_overlay)
+ . += new /mutable_appearance(charge_overlay)
else
- add_overlay("[icon_state]_charge[ratio]")
- if(itemState)
- itemState += "[ratio]"
- item_state = itemState
- if(force_itemstate_update && ismob(loc)) //used if the weapon is selfcharging, otherwise the icons won't update till the item is either fired or reequipped.
- var/mob/M = loc
- if(M.is_holding(src))
- M.update_inv_hands()
+ . += "[icon_state]_charge[ratio]"
+
+///Used by update_icon_state() and update_overlays()
+/obj/item/gun/energy/proc/get_charge_ratio()
+ return can_shoot() ? CEILING(CLAMP(cell.charge / cell.maxcharge, 0, 1) * charge_sections, 1) : 0
+ // Sets the ratio to 0 if the gun doesn't have enough charge to fire, or if its power cell is removed.
/obj/item/gun/energy/suicide_act(mob/living/user)
if (istype(user) && can_shoot() && can_trigger_gun(user) && user.get_bodypart(BODY_ZONE_HEAD))
diff --git a/code/modules/projectiles/guns/energy/dueling.dm b/code/modules/projectiles/guns/energy/dueling.dm
index 8a518284eb7..0255525e13d 100644
--- a/code/modules/projectiles/guns/energy/dueling.dm
+++ b/code/modules/projectiles/guns/energy/dueling.dm
@@ -175,12 +175,11 @@
to_chat(user,"You switch [src] setting to [setting] mode.")
update_icon()
-/obj/item/gun/energy/dueling/update_icon(force_update)
+/obj/item/gun/energy/dueling/update_overlays()
. = ..()
if(setting_overlay)
- cut_overlay(setting_overlay)
setting_overlay.icon_state = setting_iconstate()
- add_overlay(setting_overlay)
+ . += setting_overlay
/obj/item/gun/energy/dueling/Destroy()
. = ..()
@@ -323,8 +322,7 @@
STR.max_items = 2
STR.set_holdable(list(/obj/item/gun/energy/dueling))
-/obj/item/storage/lockbox/dueling/update_icon()
- cut_overlays()
+/obj/item/storage/lockbox/dueling/update_icon_state()
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(locked)
icon_state = "medalbox+l"
diff --git a/code/modules/projectiles/guns/energy/energy_gun.dm b/code/modules/projectiles/guns/energy/energy_gun.dm
index e6afba54033..0d027308603 100644
--- a/code/modules/projectiles/guns/energy/energy_gun.dm
+++ b/code/modules/projectiles/guns/energy/energy_gun.dm
@@ -133,15 +133,15 @@
return
fail_chance = min(fail_chance + round(15/severity), 100)
-/obj/item/gun/energy/e_gun/nuclear/update_icon()
- ..()
+/obj/item/gun/energy/e_gun/nuclear/update_overlays()
+ . = ..()
if(reactor_overloaded)
- add_overlay("[icon_state]_fail_3")
+ . += "[icon_state]_fail_3"
else
switch(fail_tick)
if(0)
- add_overlay("[icon_state]_fail_0")
+ . += "[icon_state]_fail_0"
if(1 to 150)
- add_overlay("[icon_state]_fail_1")
+ . += "[icon_state]_fail_1"
if(151 to INFINITY)
- add_overlay("[icon_state]_fail_2")
+ . += "[icon_state]_fail_2"
diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
index cf8219d6164..2554ad83580 100644
--- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
+++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
@@ -148,12 +148,10 @@
update_icon()
overheat = FALSE
-/obj/item/gun/energy/kinetic_accelerator/update_icon()
- ..()
+/obj/item/gun/energy/kinetic_accelerator/update_overlays()
+ . = ..()
if(!can_shoot())
- add_overlay("[icon_state]_empty")
- else
- cut_overlays()
+ . += "[icon_state]_empty"
//Casing
/obj/item/ammo_casing/energy/kinetic
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index d19678115ea..caab66ade82 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -33,11 +33,11 @@
pin = null
ammo_x_offset = 1
-/obj/item/gun/energy/decloner/update_icon()
- ..()
+/obj/item/gun/energy/decloner/update_overlays()
+ . = ..()
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
if(!QDELETED(cell) && (cell.charge > shot.e_cost))
- add_overlay("decloner_spin")
+ . += "decloner_spin"
/obj/item/gun/energy/decloner/unrestricted
pin = /obj/item/firing_pin
@@ -137,9 +137,10 @@
var/light_intensity = 1
var/charge_weld = 25 //amount of charge used up to start action (multiplied by amount) and per progress_flash_divisor ticks of welding
-/obj/item/gun/energy/plasmacutter/Initialize()
+/obj/item/gun/energy/plasmacutter/ComponentInitialize()
. = ..()
AddComponent(/datum/component/butchering, 25, 105, 0, 'sound/weapons/plasma_cutter.ogg')
+ AddElement(/datum/element/update_icon_blocker)
/obj/item/gun/energy/plasmacutter/examine(mob/user)
. = ..()
@@ -204,10 +205,6 @@
else
. = ..(amount=1)
-
-/obj/item/gun/energy/plasmacutter/update_icon()
- return
-
/obj/item/gun/energy/plasmacutter/adv
name = "advanced plasma cutter"
icon_state = "adv_plasmacutter"
@@ -225,9 +222,8 @@
var/obj/effect/portal/p_orange
var/atmos_link = FALSE
-/obj/item/gun/energy/wormhole_projector/update_icon()
- icon_state = "[initial(icon_state)][select]"
- item_state = icon_state
+/obj/item/gun/energy/wormhole_projector/update_icon_state()
+ icon_state = item_state = "[initial(icon_state)][select]"
/obj/item/gun/energy/wormhole_projector/update_ammo_types()
. = ..()
@@ -295,8 +291,9 @@
can_charge = FALSE
use_cyborg_cell = TRUE
-/obj/item/gun/energy/printer/update_icon()
- return
+/obj/item/gun/energy/printer/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
/obj/item/gun/energy/printer/emp_act()
return
diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm
index a110c9800b5..f078f11bbd4 100644
--- a/code/modules/projectiles/guns/magic.dm
+++ b/code/modules/projectiles/guns/magic.dm
@@ -75,8 +75,6 @@
recharge_newshot()
return 1
-/obj/item/gun/magic/update_icon()
- return
/obj/item/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
to_chat(user, "The [name] whizzles quietly.")
diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm
index 6d045d2f4e5..67fa34b51c7 100644
--- a/code/modules/projectiles/guns/magic/wand.dm
+++ b/code/modules/projectiles/guns/magic/wand.dm
@@ -21,7 +21,7 @@
. = ..()
. += "Has [charges] charge\s remaining."
-/obj/item/gun/magic/wand/update_icon()
+/obj/item/gun/magic/wand/update_icon_state()
icon_state = "[initial(icon_state)][charges ? "" : "-drained"]"
/obj/item/gun/magic/wand/attack(atom/target, mob/living/user)
diff --git a/code/modules/projectiles/guns/misc/blastcannon.dm b/code/modules/projectiles/guns/misc/blastcannon.dm
index a88d87cf9d3..65a1f7b6545 100644
--- a/code/modules/projectiles/guns/misc/blastcannon.dm
+++ b/code/modules/projectiles/guns/misc/blastcannon.dm
@@ -41,18 +41,16 @@
user.put_in_hands(bomb)
user.visible_message("[user] detaches [bomb] from [src].")
bomb = null
+ name = initial(name)
+ desc = initial(desc)
update_icon()
return ..()
-/obj/item/gun/blastcannon/update_icon()
+/obj/item/gun/blastcannon/update_icon_state()
if(bomb)
icon_state = icon_state_loaded
- name = "blast cannon"
- desc = "A makeshift device used to concentrate a bomb's blast energy to a narrow wave."
else
icon_state = initial(icon_state)
- name = initial(name)
- desc = initial(desc)
/obj/item/gun/blastcannon/attackby(obj/O, mob/user)
if(istype(O, /obj/item/transfer_valve))
@@ -65,6 +63,8 @@
return FALSE
user.visible_message("[user] attaches [T] to [src]!")
bomb = T
+ name = "blast cannon"
+ desc = "A makeshift device used to concentrate a bomb's blast energy to a narrow wave."
update_icon()
return TRUE
return ..()
@@ -108,6 +108,8 @@
BW.hugbox = hugbox
BW.preparePixelProjectile(target, get_turf(src), params, 0)
BW.fire()
+ name = initial(name)
+ desc = initial(desc)
/obj/projectile/blastwave
name = "blast wave"
diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
index 5014113efe7..36585354c46 100644
--- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
@@ -129,16 +129,17 @@
if(working_state)
flick(working_state,src)
-/obj/machinery/chem_dispenser/update_icon()
- cut_overlays()
+/obj/machinery/chem_dispenser/update_icon_state()
icon_state = "[(nopower_state && !powered()) ? nopower_state : initial(icon_state)]"
+
+/obj/machinery/chem_dispenser/update_overlays()
+ . = ..()
if(has_panel_overlay && panel_open)
- add_overlay(mutable_appearance(icon, "[initial(icon_state)]_panel-o"))
+ . += mutable_appearance(icon, "[initial(icon_state)]_panel-o")
if(beaker)
beaker_overlay = display_beaker()
- add_overlay(beaker_overlay)
-
+ . += beaker_overlay
/obj/machinery/chem_dispenser/emag_act(mob/user)
diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm
index 1543a78c785..cfbcf6f8378 100644
--- a/code/modules/reagents/chemistry/machinery/chem_heater.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm
@@ -25,7 +25,7 @@
beaker = null
update_icon()
-/obj/machinery/chem_heater/update_icon()
+/obj/machinery/chem_heater/update_icon_state()
if(beaker)
icon_state = "mixer1b"
else
diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm
index 5c619380ace..7a35d3038f1 100644
--- a/code/modules/reagents/chemistry/machinery/chem_master.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_master.dm
@@ -66,15 +66,17 @@
else if(A == bottle)
bottle = null
-/obj/machinery/chem_master/update_icon()
- cut_overlays()
- if (stat & BROKEN)
- add_overlay("waitlight")
+/obj/machinery/chem_master/update_icon_state()
if(beaker)
icon_state = "mixer1"
else
icon_state = "mixer0"
+/obj/machinery/chem_master/update_overlays()
+ . = ..()
+ if(stat & BROKEN)
+ . += "waitlight"
+
/obj/machinery/chem_master/blob_act(obj/structure/blob/B)
if (prob(50))
qdel(src)
diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm
index a0dc3ca8dd3..f6d5b277360 100644
--- a/code/modules/reagents/chemistry/machinery/pandemic.dm
+++ b/code/modules/reagents/chemistry/machinery/pandemic.dm
@@ -128,16 +128,16 @@
update_icon()
playsound(src, 'sound/machines/ping.ogg', 30, TRUE)
-/obj/machinery/computer/pandemic/update_icon()
+/obj/machinery/computer/pandemic/update_icon_state()
if(stat & BROKEN)
icon_state = (beaker ? "mixer1_b" : "mixer0_b")
- return
-
- icon_state = "mixer[(beaker) ? "1" : "0"][powered() ? "" : "_nopower"]"
- if(wait)
- add_overlay("waitlight")
else
- cut_overlays()
+ icon_state = "mixer[(beaker) ? "1" : "0"][powered() ? "" : "_nopower"]"
+
+/obj/machinery/computer/pandemic/update_overlays()
+ . = ..()
+ if(wait)
+ . += "waitlight"
/obj/machinery/computer/pandemic/proc/eject_beaker()
if(beaker)
diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
index b0e43aec46e..e31b485bb43 100644
--- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
+++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
@@ -95,7 +95,7 @@
AM.forceMove(drop_location())
holdingitems = list()
-/obj/machinery/reagentgrinder/update_icon()
+/obj/machinery/reagentgrinder/update_icon_state()
if(beaker)
icon_state = "juicer1"
else
diff --git a/code/modules/reagents/chemistry/machinery/smoke_machine.dm b/code/modules/reagents/chemistry/machinery/smoke_machine.dm
index e8603d5a6d0..ae2fc49c858 100644
--- a/code/modules/reagents/chemistry/machinery/smoke_machine.dm
+++ b/code/modules/reagents/chemistry/machinery/smoke_machine.dm
@@ -38,7 +38,7 @@
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
reagents.maximum_volume += REAGENTS_BASE_VOLUME * B.rating
-/obj/machinery/smoke_machine/update_icon()
+/obj/machinery/smoke_machine/update_icon_state()
if((!is_operational()) || (!on) || (reagents.total_volume == 0))
if (panel_open)
icon_state = "smoke0-o"
@@ -46,7 +46,6 @@
icon_state = "smoke0"
else
icon_state = "smoke1"
- return ..()
/obj/machinery/smoke_machine/RefreshParts()
var/new_volume = REAGENTS_BASE_VOLUME
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index 59624a4d46a..82adab0f227 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -127,12 +127,10 @@
/obj/item/reagent_containers/on_reagent_change(changetype)
update_icon()
-/obj/item/reagent_containers/update_icon(dont_fill=FALSE)
- if(!fill_icon_thresholds || dont_fill)
- return ..()
-
- cut_overlays()
-
+/obj/item/reagent_containers/update_overlays()
+ . = ..()
+ if(!fill_icon_thresholds)
+ return
if(reagents.total_volume)
var/fill_name = fill_icon_state? fill_icon_state : icon_state
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[fill_name][fill_icon_thresholds[1]]")
@@ -145,5 +143,4 @@
filling.icon_state = "[fill_name][fill_icon_thresholds[i]]"
filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
- . = ..()
+ . += filling
diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm
index 4b79b60941a..ac94621690a 100644
--- a/code/modules/reagents/reagent_containers/dropper.dm
+++ b/code/modules/reagents/reagent_containers/dropper.dm
@@ -82,10 +82,9 @@
update_icon()
-/obj/item/reagent_containers/dropper/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/dropper/update_overlays()
+ . = ..()
if(reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "dropper")
filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
- . = ..(TRUE)
+ . += filling
diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm
index 707ae9a5471..c7bb7534ade 100755
--- a/code/modules/reagents/reagent_containers/glass.dm
+++ b/code/modules/reagents/reagent_containers/glass.dm
@@ -144,16 +144,12 @@
name = "x-large beaker"
desc = "An extra-large beaker. Can hold up to 120 units."
icon_state = "beakerwhite"
+ fill_icon_state = "beakerlarge"
custom_materials = list(/datum/material/glass=2500, /datum/material/plastic=3000)
volume = 120
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,20,25,30,60,120)
-/obj/item/reagent_containers/glass/beaker/plastic/update_icon()
- icon_state = "beakerlarge" // hack to lets us reuse the large beaker reagent fill states
- ..()
- icon_state = "beakerwhite"
-
/obj/item/reagent_containers/glass/beaker/meta
name = "metamaterial beaker"
desc = "A large beaker. Can hold up to 180 units."
diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm
index 04c6bc3d48f..77a487f9c30 100644
--- a/code/modules/reagents/reagent_containers/hypospray.dm
+++ b/code/modules/reagents/reagent_containers/hypospray.dm
@@ -78,7 +78,7 @@
volume = 100
list_reagents = list(/datum/reagent/medicine/adminordrazine/quantum_heal = 80, /datum/reagent/medicine/synaptizine = 20)
-/obj/item/reagent_containers/hypospray/combat/nanites/update_icon()
+/obj/item/reagent_containers/hypospray/combat/nanites/update_icon_state()
if(reagents.total_volume > 0)
icon_state = initial(icon_state)
else
@@ -126,7 +126,7 @@
if(user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
inject(user, user)
-/obj/item/reagent_containers/hypospray/medipen/update_icon()
+/obj/item/reagent_containers/hypospray/medipen/update_icon_state()
if(reagents.total_volume > 0)
icon_state = initial(icon_state)
else
@@ -205,7 +205,7 @@
amount_per_transfer_from_this = 10
list_reagents = list(/datum/reagent/vaccine/fungal_tb = 20)
-/obj/item/reagent_containers/hypospray/medipen/tuberculosiscure/update_icon()
+/obj/item/reagent_containers/hypospray/medipen/tuberculosiscure/update_icon_state()
if(reagents.total_volume > 30)
icon_state = initial(icon_state)
else if (reagents.total_volume > 0)
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index 2b48b33f947..e444d7f2784 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -22,6 +22,10 @@
mode = SYRINGE_INJECT
update_icon()
+/obj/item/reagent_containers/syringe/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
+
/obj/item/reagent_containers/syringe/on_reagent_change(changetype)
update_icon()
@@ -151,29 +155,33 @@
mode = SYRINGE_DRAW
update_icon()
-
-/obj/item/reagent_containers/syringe/update_icon()
- cut_overlays()
- var/rounded_vol
- if(reagents && reagents.total_volume)
- rounded_vol = CLAMP(round((reagents.total_volume / volume * 15),5), 1, 15)
- var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]")
- filling_overlay.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling_overlay)
- else
- rounded_vol = 0
+/obj/item/reagent_containers/syringe/update_icon_state()
+ var/rounded_vol = get_rounded_vol()
icon_state = "[rounded_vol]"
item_state = "syringe_[rounded_vol]"
+
+/obj/item/reagent_containers/syringe/update_overlays()
+ . = ..()
+ var/rounded_vol = get_rounded_vol()
+ if(reagents && reagents.total_volume)
+ var/mutable_appearance/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]")
+ filling_overlay.color = mix_color_from_reagents(reagents.reagent_list)
+ . += filling_overlay
if(ismob(loc))
- var/mob/M = loc
var/injoverlay
switch(mode)
if (SYRINGE_DRAW)
injoverlay = "draw"
if (SYRINGE_INJECT)
injoverlay = "inject"
- add_overlay(injoverlay)
- M.update_inv_hands()
+ . += injoverlay
+
+///Used by update_icon() and update_overlays()
+/obj/item/reagent_containers/syringe/proc/get_rounded_vol()
+ if(reagents && reagents.total_volume)
+ return CLAMP(round((reagents.total_volume / volume * 15),5), 1, 15)
+ else
+ return 0
/obj/item/reagent_containers/syringe/epinephrine
name = "syringe (epinephrine)"
diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm
index df6a3e411ff..8ff4d51a937 100644
--- a/code/modules/recycling/conveyor2.dm
+++ b/code/modules/recycling/conveyor2.dm
@@ -110,7 +110,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
movedir = backwards
update()
-/obj/machinery/conveyor/update_icon()
+/obj/machinery/conveyor/update_icon_state()
if(stat & BROKEN)
icon_state = "conveyor-broken"
else
@@ -263,7 +263,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
// update the icon depending on the position
-/obj/machinery/conveyor_switch/update_icon()
+/obj/machinery/conveyor_switch/update_icon_state()
if(position<0)
if(invert_icon)
icon_state = "switch-fwd"
diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm
index 12d7d11f44d..e2ecc129344 100644
--- a/code/modules/recycling/disposal/bin.dm
+++ b/code/modules/recycling/disposal/bin.dm
@@ -178,10 +178,6 @@
AM.pipe_eject(0)
update_icon()
-// update the icon & overlays to reflect mode & status
-/obj/machinery/disposal/update_icon()
- return
-
/obj/machinery/disposal/proc/flush()
flushing = TRUE
flushAnimation()
@@ -349,16 +345,14 @@
pressure_charging = TRUE
update_icon()
-/obj/machinery/disposal/bin/update_icon()
- cut_overlays()
+/obj/machinery/disposal/bin/update_overlays()
+ . = ..()
if(stat & BROKEN)
- pressure_charging = FALSE
- flush = FALSE
return
//flush handle
if(flush)
- add_overlay("dispover-handle")
+ . += "dispover-handle"
//only handle is shown if no power
if(stat & NOPOWER || panel_open)
@@ -366,13 +360,13 @@
//check for items in disposal - occupied light
if(contents.len > 0)
- add_overlay("dispover-full")
+ . += "dispover-full"
//charging and ready light
if(pressure_charging)
- add_overlay("dispover-charge")
+ . += "dispover-charge"
else if(full_pressure)
- add_overlay("dispover-ready")
+ . += "dispover-ready"
/obj/machinery/disposal/bin/proc/do_flush()
set waitfor = FALSE
diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm
index c3b37d7459a..c17e8a31fb8 100644
--- a/code/modules/research/destructive_analyzer.dm
+++ b/code/modules/research/destructive_analyzer.dm
@@ -51,7 +51,7 @@ Note: Must be placed within 3 tiles of the R&D Console
update_icon()
reset_busy()
-/obj/machinery/rnd/destructive_analyzer/update_icon()
+/obj/machinery/rnd/destructive_analyzer/update_icon_state()
if(loaded_item)
icon_state = "d_analyzer_l"
else
diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm
index 655ae98255d..5ba1e6a707e 100644
--- a/code/modules/research/experimentor.dm
+++ b/code/modules/research/experimentor.dm
@@ -541,7 +541,7 @@
update_icon()
recentlyExperimented = FALSE
-/obj/machinery/rnd/experimentor/update_icon()
+/obj/machinery/rnd/experimentor/update_icon_state()
icon_state = "h_lathe"
/obj/machinery/rnd/experimentor/proc/warn_admins(user, ReactionName)
diff --git a/code/modules/research/nanites/nanite_chamber.dm b/code/modules/research/nanites/nanite_chamber.dm
index b69ccb4ee1c..4a980a04365 100644
--- a/code/modules/research/nanites/nanite_chamber.dm
+++ b/code/modules/research/nanites/nanite_chamber.dm
@@ -104,30 +104,30 @@
return
SEND_SIGNAL(occupant, COMSIG_NANITE_DELETE)
-/obj/machinery/nanite_chamber/update_icon()
- cut_overlays()
-
- if((stat & MAINT) || panel_open)
- add_overlay("maint")
-
- else if(!(stat & (NOPOWER|BROKEN)))
- if(busy || locked)
- add_overlay("red")
- if(locked)
- add_overlay("bolted")
- else
- add_overlay("green")
-
+/obj/machinery/nanite_chamber/update_icon_state()
//running and someone in there
if(occupant)
if(busy)
icon_state = busy_icon_state
else
- icon_state = initial(icon_state)+ "_occupied"
- return
+ icon_state = initial(icon_state) + "_occupied"
+ else
+ //running
+ icon_state = initial(icon_state) + (state_open ? "_open" : "")
- //running
- icon_state = initial(icon_state)+ (state_open ? "_open" : "")
+/obj/machinery/nanite_chamber/update_overlays()
+ . = ..()
+
+ if((stat & MAINT) || panel_open)
+ . += "maint"
+
+ else if(!(stat & (NOPOWER|BROKEN)))
+ if(busy || locked)
+ . += "red"
+ if(locked)
+ . += "bolted"
+ else
+ . += "green"
/obj/machinery/nanite_chamber/proc/toggle_open(mob/user)
if(panel_open)
diff --git a/code/modules/research/nanites/nanite_remote.dm b/code/modules/research/nanites/nanite_remote.dm
index db4373e9307..71aecc8f2cd 100644
--- a/code/modules/research/nanites/nanite_remote.dm
+++ b/code/modules/research/nanites/nanite_remote.dm
@@ -46,13 +46,12 @@
locked = FALSE
update_icon()
-/obj/item/nanite_remote/update_icon()
+/obj/item/nanite_remote/update_overlays()
. = ..()
- cut_overlays()
if(obj_flags & EMAGGED)
- add_overlay("nanite_remote_emagged")
+ . += "nanite_remote_emagged"
if(locked)
- add_overlay("nanite_remote_locked")
+ . += "nanite_remote_locked"
/obj/item/nanite_remote/afterattack(atom/target, mob/user, etc)
switch(mode)
diff --git a/code/modules/research/nanites/public_chamber.dm b/code/modules/research/nanites/public_chamber.dm
index 3659e9629ca..602402abcfa 100644
--- a/code/modules/research/nanites/public_chamber.dm
+++ b/code/modules/research/nanites/public_chamber.dm
@@ -85,32 +85,29 @@
occupant.investigate_log("had their nanite cloud ID changed into [cloud_id] by [key_name(attacker)] using [src] at [AREACOORD(src)].", INVESTIGATE_NANITES)
SEND_SIGNAL(occupant, COMSIG_NANITE_SET_CLOUD, cloud_id)
-/obj/machinery/public_nanite_chamber/update_icon()
- cut_overlays()
-
- if((stat & MAINT) || panel_open)
- add_overlay("maint")
-
- else if(!(stat & (NOPOWER|BROKEN)))
- if(busy || locked)
- add_overlay("red")
- if(locked)
- add_overlay("bolted")
- else
- add_overlay("green")
-
-
-
+/obj/machinery/public_nanite_chamber/update_icon_state()
//running and someone in there
if(occupant)
if(busy)
icon_state = busy_icon_state
else
icon_state = initial(icon_state)+ "_occupied"
- return
+ else
+ //running
+ icon_state = initial(icon_state)+ (state_open ? "_open" : "")
- //running
- icon_state = initial(icon_state)+ (state_open ? "_open" : "")
+/obj/machinery/public_nanite_chamber/update_overlays()
+ . = ..()
+ if((stat & MAINT) || panel_open)
+ . += "maint"
+
+ else if(!(stat & (NOPOWER|BROKEN)))
+ if(busy || locked)
+ . += "red"
+ if(locked)
+ . += "bolted"
+ else
+ . += "green"
/obj/machinery/public_nanite_chamber/proc/toggle_open(mob/user)
if(panel_open)
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index 86d6b73042d..f619479d3ac 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -38,14 +38,13 @@
tot_rating += SP.rating
heat_gen /= max(1, tot_rating)
-/obj/machinery/rnd/server/update_icon()
- if (stat & EMPED || stat & NOPOWER)
+/obj/machinery/rnd/server/update_icon_state()
+ if(stat & EMPED || stat & NOPOWER)
icon_state = "RD-server-off"
- return
- if (research_disabled)
+ else if(research_disabled)
icon_state = "RD-server-halt"
- return
- icon_state = "RD-server-on"
+ else
+ icon_state = "RD-server-on"
/obj/machinery/rnd/server/power_change()
. = ..()
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index c55c2282f0c..b5076ec071b 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -455,9 +455,10 @@
light_color = LIGHT_COLOR_BLUE
density = FALSE
-/obj/machinery/computer/shuttle/pod/update_icon()
- return
-
+/obj/machinery/computer/shuttle/pod/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_blocker)
+
/obj/machinery/computer/shuttle/pod/emag_act(mob/user)
if(obj_flags & EMAGGED)
return
diff --git a/code/modules/shuttle/spaceship_navigation_beacon.dm b/code/modules/shuttle/spaceship_navigation_beacon.dm
index ec064b01dd9..7a32a302e98 100644
--- a/code/modules/shuttle/spaceship_navigation_beacon.dm
+++ b/code/modules/shuttle/spaceship_navigation_beacon.dm
@@ -29,7 +29,7 @@ obj/machinery/spaceship_navigation_beacon/emp_act()
return ..()
// update the icon_state
-/obj/machinery/spaceship_navigation_beacon/update_icon()
+/obj/machinery/spaceship_navigation_beacon/update_icon_state()
if(powered())
icon_state = "core"
else
diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm
index 80862fdc928..90ac6ac5d54 100644
--- a/code/modules/shuttle/special.dm
+++ b/code/modules/shuttle/special.dm
@@ -21,7 +21,7 @@
desc = "Oh no, not again."
update_icon()
-/obj/machinery/power/emitter/energycannon/magical/update_icon()
+/obj/machinery/power/emitter/energycannon/magical/update_icon_state()
if(active)
icon_state = icon_state_on
else
diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm
index a0bdd93971a..7828065aeb7 100644
--- a/code/modules/station_goals/shield.dm
+++ b/code/modules/station_goals/shield.dm
@@ -121,7 +121,7 @@
anchored = FALSE
update_icon()
-/obj/machinery/satellite/update_icon()
+/obj/machinery/satellite/update_icon_state()
icon_state = active ? "sat_active" : "sat_inactive"
/obj/machinery/satellite/multitool_act(mob/living/user, obj/item/I)
diff --git a/code/modules/surgery/organs/augments_chest.dm b/code/modules/surgery/organs/augments_chest.dm
index 69d4c8ffc2e..2519a72a2e1 100644
--- a/code/modules/surgery/organs/augments_chest.dm
+++ b/code/modules/surgery/organs/augments_chest.dm
@@ -164,14 +164,11 @@
on = FALSE
update_icon()
-/obj/item/organ/cyberimp/chest/thrusters/update_icon()
+/obj/item/organ/cyberimp/chest/thrusters/update_icon_state()
if(on)
icon_state = "imp_jetpack-on"
else
icon_state = "imp_jetpack"
- for(var/X in actions)
- var/datum/action/A = X
- A.UpdateButtonIcon()
/obj/item/organ/cyberimp/chest/thrusters/proc/move_react()
allow_thrust(0.01)
diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm
index 0f7dfc217a3..f9a1436d840 100644
--- a/code/modules/surgery/organs/heart.dm
+++ b/code/modules/surgery/organs/heart.dm
@@ -21,7 +21,7 @@
var/failed = FALSE //to prevent constantly running failing code
var/operated = FALSE //whether the heart's been operated on to fix some of its damages
-/obj/item/organ/heart/update_icon()
+/obj/item/organ/heart/update_icon_state()
if(beating)
icon_state = "[icon_base]-on"
else
diff --git a/code/modules/vehicles/pimpin_ride.dm b/code/modules/vehicles/pimpin_ride.dm
index e753e357751..f7d459945b9 100644
--- a/code/modules/vehicles/pimpin_ride.dm
+++ b/code/modules/vehicles/pimpin_ride.dm
@@ -59,12 +59,12 @@
else
return ..()
-/obj/vehicle/ridden/janicart/update_icon()
- cut_overlays()
+/obj/vehicle/ridden/janicart/update_overlays()
+ . = ..()
if(mybag)
- add_overlay("cart_garbage")
+ . += "cart_garbage"
if(floorbuffer)
- add_overlay("cart_buffer")
+ . += "cart_buffer"
/obj/vehicle/ridden/janicart/attack_hand(mob/user)
. = ..()
diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm
index a0fd63dee4c..8b3c0caad9d 100644
--- a/code/modules/vending/_vending.dm
+++ b/code/modules/vending/_vending.dm
@@ -230,15 +230,13 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
else
..()
-/obj/machinery/vending/update_icon()
+/obj/machinery/vending/update_icon_state()
if(stat & BROKEN)
icon_state = "[initial(icon_state)]-broken"
+ else if(powered())
+ icon_state = initial(icon_state)
else
- if(powered())
- icon_state = initial(icon_state)
- else
- icon_state = "[initial(icon_state)]-off"
-
+ icon_state = "[initial(icon_state)]-off"
/obj/machinery/vending/obj_break(damage_flag)
. = ..()