@@ -89,10 +86,10 @@
if(ishuman(usr))
if(!usr.put_in_hands(O))
O.forceMove(get_turf(src))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/guncase/handle_atom_del(atom/A)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/guncase/contents_explosion(severity, target)
for(var/thing in contents)
diff --git a/code/game/objects/structures/headpike.dm b/code/game/objects/structures/headpike.dm
index 258ef6579213..7aeaefa09634 100644
--- a/code/game/objects/structures/headpike.dm
+++ b/code/game/objects/structures/headpike.dm
@@ -20,7 +20,7 @@
victim = locate(/obj/item/bodypart/head) in parts_list
name = "[victim.name] on a spear"
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/headpike/glass/CheckParts(list/parts_list)
spear = locate(/obj/item/twohanded/spear) in parts_list
@@ -38,14 +38,15 @@
. = ..()
pixel_x = rand(-8, 8)
-/obj/structure/headpike/update_icon()
- ..()
+/obj/structure/headpike/update_overlays()
+ . = ..()
var/obj/item/bodypart/head/H = locate() in contents
+ if(!H)
+ return
var/mutable_appearance/MA = new()
- if(H)
- MA.copy_overlays(H)
- MA.pixel_y = 12
- add_overlay(H)
+ MA.copy_overlays(H)
+ MA.pixel_y = 12
+ . += MA
/obj/structure/headpike/attack_hand(mob/user)
. = ..()
diff --git a/code/game/objects/structures/holosign.dm b/code/game/objects/structures/holosign.dm
index 250248ba2bf7..a35ec2363d06 100644
--- a/code/game/objects/structures/holosign.dm
+++ b/code/game/objects/structures/holosign.dm
@@ -227,14 +227,15 @@
/obj/structure/holosign/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
playsound(loc, 'sound/weapons/egloves.ogg', 80, 1)
-/obj/structure/holobed/update_icon()
+/obj/structure/holobed/update_icon_state()
+ . = ..()
icon_state = "[initial(icon_state)][stasis ? "" : "_off"]"
/obj/structure/holobed/AltClick(mob/living/user)
if(user.a_intent == INTENT_HELP)
stasis = !stasis
handle_stasis(occupant)
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_warning("You [stasis ? "activate" : "deactivate"] the stasis field."))
/obj/structure/holobed/Exited(atom/movable/AM, atom/newloc)
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index 37bb885f2d59..1a3387d984cb 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -64,28 +64,28 @@
if(!myspray)
put_in_cart(I, user)
myspray=I
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/paint/paint_remover))
if(!myremover)
put_in_cart(I, user)
myremover=I
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/melee/flyswatter))
if(!myswatter)
put_in_cart(I, user)
myswatter=I
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/flashlight))
if(!mylight)
put_in_cart(I, user)
mylight=I
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/lightreplacer))
@@ -104,7 +104,7 @@
if(signs < max_signs)
put_in_cart(I, user)
signs++
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("[src] can't hold any more signs!"))
else if(mybag)
@@ -208,7 +208,7 @@
else
return
- update_icon()
+ update_appearance(UPDATE_ICON)
/*
check_menu: Checks if we are allowed to interact with a radial menu
@@ -223,26 +223,25 @@
return FALSE
return TRUE
-/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(myremover)
- add_overlay("cart_remover")
+ . += "cart_remover"
if(myswatter)
- add_overlay("cart_swatter")
+ . += "cart_swatter"
if(mylight)
- add_overlay("cart_light")
+ . += "cart_light"
if(signs)
- add_overlay("cart_sign[signs]")
+ . += "cart_sign[signs]"
if(reagents.total_volume > 0)
- add_overlay("cart_water")
+ . += "cart_water"
if(mybroom)
- add_overlay("cart_broom")
-
+ . += "cart_broom"
diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm
index e894818d15bc..dc6068ac6514 100644
--- a/code/game/objects/structures/ladders.dm
+++ b/code/game/objects/structures/ladders.dm
@@ -13,11 +13,11 @@
if (up)
src.up = up
up.down = src
- up.update_icon()
+ up.update_appearance(UPDATE_ICON)
if (down)
src.down = down
down.up = src
- down.update_icon()
+ down.update_appearance(UPDATE_ICON)
return INITIALIZE_HINT_LATELOAD
/obj/structure/ladder/Destroy(force)
@@ -36,36 +36,34 @@
if (L)
down = L
L.up = src // Don't waste effort looping the other way
- L.update_icon()
+ L.update_appearance(UPDATE_ICON)
if (!up)
L = locate() in SSmapping.get_turf_above(T)
if (L)
up = L
L.down = src // Don't waste effort looping the other way
- L.update_icon()
+ L.update_appearance(UPDATE_ICON)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/ladder/proc/disconnect()
if(up && up.down == src)
up.down = null
- up.update_icon()
+ up.update_appearance(UPDATE_ICON)
if(down && down.up == src)
down.up = null
- down.update_icon()
+ down.update_appearance(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
+ else //wtf make your ladders properly assholes
icon_state = "ladder00"
/obj/structure/ladder/singularity_pull()
@@ -160,7 +158,7 @@
/obj/structure/ladder/unbreakable/LateInitialize()
// Override the parent to find ladders based on being height-linked
if (!id || (up && down))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
for (var/O in GLOB.ladders)
@@ -170,17 +168,17 @@
if (!down && L.height == height - 1)
down = L
L.up = src
- L.update_icon()
+ L.update_appearance(UPDATE_ICON)
if (up)
break // break if both our connections are filled
else if (!up && L.height == height + 1)
up = L
L.down = src
- L.update_icon()
+ L.update_appearance(UPDATE_ICON)
if (down)
break // break if both our connections are filled
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/ladder/unbreakable/binary
name = "mysterious ladder"
diff --git a/code/game/objects/structures/life_candle.dm b/code/game/objects/structures/life_candle.dm
index 3b91e7e76d21..64f9770d18ee 100644
--- a/code/game/objects/structures/life_candle.dm
+++ b/code/game/objects/structures/life_candle.dm
@@ -37,7 +37,7 @@
user.visible_message(span_notice("[user] touches [src]. It seems to respond to [user.p_their()] presence!"), span_warning("You create a connection between you and [src]."))
linked_minds |= user.mind
- update_icon()
+ update_appearance(UPDATE_ICON)
float(linked_minds.len)
if(linked_minds.len)
START_PROCESSING(SSobj, src)
@@ -46,7 +46,8 @@
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 3dbc37c7fb3b..67204afc2eeb 100644
--- a/code/game/objects/structures/mineral_doors.dm
+++ b/code/game/objects/structures/mineral_doors.dm
@@ -95,7 +95,7 @@
door_opened = TRUE
layer = OPEN_DOOR_LAYER
air_update_turf(1)
- update_icon()
+ update_appearance(UPDATE_ICON)
isSwitchingStates = FALSE
if(close_delay != -1)
@@ -116,10 +116,11 @@
door_opened = FALSE
layer = initial(layer)
air_update_turf(1)
- update_icon()
+ update_appearance(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 300cc049d6c4..6ba389ed11e7 100644
--- a/code/game/objects/structures/mop_bucket.dm
+++ b/code/game/objects/structures/mop_bucket.dm
@@ -19,29 +19,29 @@
if(!user.transferItemToLoc(M, src))
return
ourmop = M
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You put [M] into [src]."))
else
reagents.trans_to(M, 5, transfered_by = user)
to_chat(user, span_notice("You wet [M] in [src]."))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
- update_icon()
+ update_appearance(UPDATE_ICON)
else
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/mopbucket/attack_hand(mob/user)
if(ourmop)
user.put_in_hands(ourmop)
to_chat(user, span_notice("You take [ourmop] from [src]."))
ourmop = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return
return ..()
-/obj/structure/mopbucket/update_icon()
- cut_overlays()
+/obj/structure/mopbucket/update_overlays()
+ . = ..()
if(reagents.total_volume > 0)
- add_overlay("mopbucket_water")
+ . += "mopbucket_water"
if(ourmop)
- add_overlay("mopbucket_mop")
+ . += "mopbucket_mop"
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index f02d14fe7fe4..045bb3fbc9ff 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -29,6 +29,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
var/breakout_time = 600
/obj/structure/bodycontainer/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
. = ..()
GLOB.bodycontainers += src
recursive_organ_check(src)
@@ -43,10 +44,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
/obj/structure/bodycontainer/on_log(login)
..()
- update_icon()
-
-/obj/structure/bodycontainer/update_icon()
- return
+ update_appearance(UPDATE_ICON)
/obj/structure/bodycontainer/relaymove(mob/user)
if(user.stat || !isturf(loc))
@@ -130,7 +128,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
for(var/atom/movable/AM in src)
AM.forceMove(T)
recursive_organ_check(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bodycontainer/proc/close()
playsound(src, 'sound/effects/roll.ogg', 5, 1)
@@ -140,7 +138,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
if(ismob(AM) && !isliving(AM))
continue
AM.forceMove(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bodycontainer/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
@@ -159,6 +157,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
/obj/structure/bodycontainer/morgue/Initialize(mapload)
. = ..()
+ RemoveElement(/datum/element/update_icon_blocker)
connected = new/obj/structure/tray/m_tray(src)
connected.connected = src
@@ -173,7 +172,8 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
beeper = !beeper
to_chat(user, span_notice("You turn the speaker function [beeper ? "on" : "off"]."))
-/obj/structure/bodycontainer/morgue/update_icon()
+/obj/structure/bodycontainer/morgue/update_icon_state()
+ . = ..()
if (!connected || connected.loc != src) // Open or tray is gone.
icon_state = "morgue0"
else
@@ -229,23 +229,22 @@ GLOBAL_LIST_EMPTY(crematoriums)
/obj/structure/bodycontainer/crematorium/Initialize(mapload)
. = ..()
+ RemoveElement(/datum/element/update_icon_blocker)
connected = new /obj/structure/tray/c_tray(src)
connected.connected = src
-/obj/structure/bodycontainer/crematorium/update_icon()
+/obj/structure/bodycontainer/crematorium/update_icon_state()
+ . = ..()
if(!connected || connected.loc != src)
icon_state = "crema0"
- else
-
- if(src.contents.len > 1)
- src.icon_state = "crema2"
- else
- src.icon_state = "crema1"
-
- if(locked)
- src.icon_state = "crema_active"
-
- return
+ return
+ if(locked)
+ icon_state = "crema_active"
+ return
+ if(contents.len > 1)
+ icon_state = "crema2"
+ return
+ icon_state = "crema1"
/obj/structure/bodycontainer/crematorium/proc/cremate(mob/user)
if(locked)
@@ -260,7 +259,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
else
audible_message(span_italics("You hear a roar as the crematorium fires up."))
locked = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
cremate_timer = addtimer(CALLBACK(src, PROC_REF(finish_cremate), user), (breakout_time + cremate_time ), TIMER_STOPPABLE)
@@ -271,7 +270,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) //you horrible people
deltimer(cremate_timer)
cremate_timer = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bodycontainer/crematorium/proc/finish_cremate(mob/user)
var/list/conts = get_all_contents() - src - connected
@@ -327,7 +326,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
if(!QDELETED(src))
locked = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) //you horrible people
/obj/structure/bodycontainer/crematorium/creamatorium
@@ -362,7 +361,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
/obj/structure/tray/Destroy()
if(connected)
connected.connected = null
- connected.update_icon()
+ connected.update_appearance(UPDATE_ICON)
connected = null
return ..()
diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm
index 8913505ecbf4..132df55d8472 100644
--- a/code/game/objects/structures/safe.dm
+++ b/code/game/objects/structures/safe.dm
@@ -56,7 +56,8 @@ FLOOR SAFES
space += I.w_class
I.forceMove(src)
-/obj/structure/safe/update_icon()
+/obj/structure/safe/update_icon_state()
+ . = ..()
if(open)
icon_state = "[initial(icon_state)]-open"
else
@@ -147,7 +148,7 @@ FLOOR SAFES
return
to_chat(user, span_notice("You [open ? "close" : "open"] [src]."))
open = !open
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
if("turnright")
if(open)
diff --git a/code/game/objects/structures/shower.dm b/code/game/objects/structures/shower.dm
index 5f691e267775..e40e4ccbb9cd 100644
--- a/code/game/objects/structures/shower.dm
+++ b/code/game/objects/structures/shower.dm
@@ -29,7 +29,7 @@
/obj/machinery/shower/interact(mob/M)
on = !on
- update_icon()
+ update_appearance(UPDATE_ICON)
handle_mist()
add_fingerprint(M)
if(on)
@@ -69,11 +69,10 @@
. = ..()
. += span_notice("You can
alt-click to change the temperature.")
-/obj/machinery/shower/update_icon()
+/obj/machinery/shower/update_overlays()
. = ..()
- cut_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/signs/signs_interactive.dm b/code/game/objects/structures/signs/signs_interactive.dm
index 589f1e251033..2d7b63f40534 100644
--- a/code/game/objects/structures/signs/signs_interactive.dm
+++ b/code/game/objects/structures/signs/signs_interactive.dm
@@ -18,20 +18,20 @@ GLOBAL_LIST_EMPTY(map_delamination_counters)
/obj/structure/sign/delamination_counter/proc/update_count(new_count)
since_last = min(new_count, 99)
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/structure/sign/delamination_counter/update_icon()
- cut_overlays()
+/obj/structure/sign/delamination_counter/update_overlays()
+ . = ..()
var/ones = since_last % 10
var/mutable_appearance/ones_overlay = mutable_appearance('icons/obj/decals.dmi', "days_[ones]")
ones_overlay.pixel_x = 4
- add_overlay(ones_overlay)
+ . += ones_overlay
var/tens = (since_last / 10) % 10
var/mutable_appearance/tens_overlay = mutable_appearance('icons/obj/decals.dmi', "days_[tens]")
tens_overlay.pixel_x = -5
- add_overlay(tens_overlay)
+ . += tens_overlay
/obj/structure/sign/delamination_counter/examine(mob/user)
. = ..()
diff --git a/code/game/objects/structures/stairs.dm b/code/game/objects/structures/stairs.dm
index 40e2517985d8..94f420f3facd 100644
--- a/code/game/objects/structures/stairs.dm
+++ b/code/game/objects/structures/stairs.dm
@@ -34,12 +34,12 @@
update_surrounding()
/obj/structure/stairs/proc/update_surrounding()
- update_icon()
+ update_appearance(UPDATE_ICON)
for(var/i in GLOB.cardinals)
var/turf/T = get_step(get_turf(src), i)
var/obj/structure/stairs/S = locate() in T
if(S)
- S.update_icon()
+ S.update_appearance(UPDATE_ICON)
/obj/structure/stairs/Uncross(atom/movable/AM, atom/newloc)
if(!newloc || !AM)
@@ -54,7 +54,8 @@
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/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index e8e0eee656b0..69a258c05d18 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -76,7 +76,8 @@
/obj/structure/table/proc/deconstruction_hints(mob/user)
return span_notice("The top is
screwed on, but the main
bolts are also visible.")
-/obj/structure/table/update_icon()
+/obj/structure/table/update_icon(updates=ALL)
+ . = ..()
if(smooth)
queue_smooth(src)
queue_smooth_neighbors(src)
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index d2b91fa512e7..0f7c71213efb 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -23,20 +23,20 @@
new /obj/item/tank/internals/oxygen(src)
for(var/i in 1 to plasmatanks)
new /obj/item/tank/internals/plasma(src)
- update_icon()
+ update_appearance(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/attack_ai(mob/user)
. = ..()
@@ -69,7 +69,7 @@
if(!user.transferItemToLoc(I, src))
return
to_chat(user, span_notice("You put [I] in [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/tank_dispenser/ui_state(mob/user)
return GLOB.physical_state
@@ -109,7 +109,7 @@
usr.put_in_hands(tank)
oxygentanks--
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm
index 55a4f827e09a..96b932d81924 100644
--- a/code/game/objects/structures/transit_tubes/station.dm
+++ b/code/game/objects/structures/transit_tubes/station.dm
@@ -38,7 +38,7 @@
for(var/obj/structure/transit_tube_pod/pod in loc)
if(!pod.moving && !pod.cargo)
AM.forceMove(pod)
- pod.update_icon()
+ pod.update_appearance(UPDATE_ICON)
return
@@ -152,7 +152,7 @@
continue
S.forceMove(pod)
playsound(src, 'sound/mecha/mechturn.ogg', 25 ,1)
- pod.update_icon()
+ pod.update_appearance(UPDATE_ICON)
sleep(SleepTime)
if(open_status == STATION_TUBE_CLOSED && pod && pod.loc == loc)
pod.follow_tube()
diff --git a/code/game/objects/structures/transit_tubes/transit_tube_cargo_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_cargo_pod.dm
index 363e07b906eb..27c0a7b53171 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_cargo_pod.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_cargo_pod.dm
@@ -4,7 +4,8 @@
cargo = TRUE
name = "transit tube cargo pod"
-/obj/structure/transit_tube_pod/cargo/update_icon()
+/obj/structure/transit_tube_pod/cargo/update_icon_state()
+ . = ..()
if(contents.len)
icon_state = "pod_cargo_occupied"
else
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 99e985c417c3..843b93e57cc0 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
@@ -19,7 +19,8 @@
empty_pod()
return ..()
-/obj/structure/transit_tube_pod/update_icon()
+/obj/structure/transit_tube_pod/update_icon_state()
+ . = ..()
if(contents.len)
icon_state = "pod_occupied"
else
@@ -88,7 +89,7 @@
location = get_turf(src)
for(var/atom/movable/M in contents)
M.forceMove(location)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/transit_tube_pod/Process_Spacemove()
if(moving) //No drifting while moving in the tubes
@@ -176,7 +177,7 @@
if(direction == turn(station.boarding_dir,180))
if(station.open_status == STATION_TUBE_OPEN)
mob.forceMove(loc)
- update_icon()
+ update_appearance(UPDATE_ICON)
else
station.open_animation()
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index d1c3f214b08d..d722f58b6d44 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -14,7 +14,7 @@
/obj/structure/toilet/Initialize(mapload)
. = ..()
open = round(rand(0, 1))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/toilet/attack_hand(mob/living/user)
@@ -67,13 +67,13 @@
w_items -= I.w_class
else
open = !open
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/structure/toilet/update_icon()
+/obj/structure/toilet/update_icon_state()
+ . = ..()
icon_state = "toilet[open][cistern]"
-
/obj/structure/toilet/attackby(obj/item/I, mob/living/user, params)
if(I.tool_behaviour == TOOL_CROWBAR)
to_chat(user, span_notice("You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]..."))
@@ -81,7 +81,7 @@
if(I.use_tool(src, user, 30))
user.visible_message("[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!", span_notice("You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!"), span_italics("You hear grinding porcelain."))
cistern = !cistern
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(cistern)
if(user.a_intent != INTENT_HARM)
@@ -392,9 +392,10 @@
/obj/structure/curtain/proc/toggle()
open = !open
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/structure/curtain/update_icon()
+/obj/structure/curtain/update_icon_state()
+ . = ..()
if(!open)
icon_state = "closed"
layer = WALL_OBJ_LAYER
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index f96d2a764bc1..5f5c415a1589 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -47,7 +47,8 @@
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)
@@ -309,7 +310,7 @@
return ..()
//Update to reflect changes(if applicable)
- update_icon()
+ update_appearance(UPDATE_ICON)
@@ -339,7 +340,7 @@
/obj/structure/windoor_assembly/proc/after_rotation(mob/user)
ini_dir = dir
- update_icon()
+ update_appearance(UPDATE_ICON)
//Flips the windoor assembly, determines whather the door opens to the left or the right
/obj/structure/windoor_assembly/verb/flip()
@@ -361,5 +362,5 @@
facing = "l"
to_chat(usr, span_notice("The windoor will now slide to the left."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index bb4b9e57fb90..87df7bada3b3 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -326,12 +326,13 @@
//This proc is used to update the icons of nearby windows.
/obj/structure/window/proc/update_nearby_icons()
- update_icon()
+ update_appearance(UPDATE_ICON)
if(smooth)
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
@@ -346,7 +347,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)
@@ -807,7 +808,7 @@
/obj/structure/window/reinforced/clockwork/ratvar_act()
if(GLOB.ratvar_awakens)
obj_integrity = max_integrity
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/window/reinforced/clockwork/narsie_act()
take_damage(rand(25, 75), BRUTE)
@@ -873,7 +874,7 @@
/obj/structure/window/paperframe/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/window/paperframe/examine(mob/user)
. = ..()
@@ -899,19 +900,32 @@
playsound(src, hitsound, 50, 1)
if(!QDELETED(src))
user.visible_message(span_danger("[user] tears a hole in [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/structure/window/paperframe/update_icon()
+/obj/structure/window/paperframe/update_overlays()
+ . = ..()
if(obj_integrity < max_integrity)
cut_overlay(paper)
- add_overlay(torn)
+ . += torn
set_opacity(FALSE)
else
cut_overlay(torn)
- add_overlay(paper)
+ . += paper
set_opacity(TRUE)
queue_smooth(src)
+/obj/structure/window/paperframe/update_appearance(updates)
+ . = ..()
+ set_opacity(obj_integrity >= max_integrity)
+
+/obj/structure/window/paperframe/update_icon(updates=ALL)
+ . = ..()
+ if((updates & UPDATE_SMOOTHING) && (smooth & (SMOOTH_TRUE)))
+ queue_smooth(src)
+
+/obj/structure/window/paperframe/update_overlays()
+ . = ..()
+ . += (obj_integrity < max_integrity) ? torn : paper
/obj/structure/window/paperframe/attackby(obj/item/W, mob/user)
if(W.is_hot())
@@ -926,10 +940,10 @@
qdel(W)
user.visible_message("[user] patches some of the holes in \the [src].")
if(obj_integrity == max_integrity)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
@@ -950,16 +964,16 @@
/obj/structure/cloth_curtain/proc/toggle()
open = !open
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/structure/cloth_curtain/update_icon()
+/obj/structure/cloth_curtain/update_icon(updates=ALL)
+ . = ..()
if(!open)
icon_state = "curtain_closed"
layer = WALL_OBJ_LAYER
density = TRUE
open = FALSE
opacity = TRUE
-
else
icon_state = "curtain_open"
layer = SIGN_LAYER
diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm
index 8a361f3306a9..c7e25756775c 100644
--- a/code/game/turfs/open.dm
+++ b/code/game/turfs/open.dm
@@ -317,7 +317,7 @@
/turf/open/floor/grass/fairy/Initialize(mapload)
. = ..()
icon_state = "fairygrass[rand(1,4)]"
- update_icon()
+ update_appearance(UPDATE_ICON)
/turf/open/indestructible/boss //you put stone tiles on this and use it as a base
name = "necropolis floor"
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index 64fe6c622ee7..a54d1a2e43f7 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -115,9 +115,9 @@
/turf/open/floor/blob_act(obj/structure/blob/B)
return
-/turf/open/floor/update_icon()
+/turf/open/floor/update_icon(updates=ALL)
+ . = ..()
update_visuals()
- return 1
/turf/open/floor/attack_paw(mob/user)
return attack_hand(user)
@@ -164,7 +164,7 @@
W.icon_regular_floor = old_icon
W.icon_state_regular_floor = old_icon_state
W.setDir(old_dir)
- W.update_icon()
+ W.update_appearance(UPDATE_ICON)
return W
/turf/open/floor/attackby(obj/item/C, mob/user, params)
@@ -285,7 +285,7 @@
new_window.req_one_access = the_rcd.airlock_electronics.one_access
new_window.unres_sides = the_rcd.airlock_electronics.unres_sides
new_window.autoclose = TRUE
- new_window.update_icon()
+ new_window.update_appearance(UPDATE_ICON)
return TRUE
to_chat(user, span_notice("You build an airlock."))
var/obj/machinery/door/airlock/new_airlock = new the_rcd.airlock_type(src)
@@ -304,7 +304,7 @@
if(new_airlock.electronics.unres_sides)
new_airlock.unres_sides = new_airlock.electronics.unres_sides
new_airlock.autoclose = TRUE
- new_airlock.update_icon()
+ new_airlock.update_appearance(UPDATE_ICON)
return TRUE
if(RCD_DECONSTRUCT)
diff --git a/code/game/turfs/simulated/floor/fancy_floor.dm b/code/game/turfs/simulated/floor/fancy_floor.dm
index 3ae163c2e448..fc32106cff7d 100644
--- a/code/game/turfs/simulated/floor/fancy_floor.dm
+++ b/code/game/turfs/simulated/floor/fancy_floor.dm
@@ -197,7 +197,7 @@
. = ..()
if(src.type == /turf/open/floor/grass) //don't want grass subtypes getting the icon state,
icon_state = "grass[rand(1,4)]"
- update_icon()
+ update_appearance(UPDATE_ICON)
/turf/open/floor/grass/attackby(obj/item/C, mob/user, params)
if((C.tool_behaviour == TOOL_SHOVEL) && params)
@@ -293,10 +293,11 @@
/turf/open/floor/carpet/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/turf/open/floor/carpet/update_icon()
- if(!..())
+/turf/open/floor/carpet/update_icon(updates=ALL)
+ . = ..()
+ if(!.)
return 0
if(!broken && !burnt)
if(smooth)
@@ -402,11 +403,11 @@
/turf/open/floor/carpet/break_tile()
broken = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/turf/open/floor/carpet/burn_tile()
burnt = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/turf/open/floor/carpet/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
return FALSE
diff --git a/code/game/turfs/simulated/floor/light_floor.dm b/code/game/turfs/simulated/floor/light_floor.dm
index 75b94e76ea9c..12e4fcbc5d57 100644
--- a/code/game/turfs/simulated/floor/light_floor.dm
+++ b/code/game/turfs/simulated/floor/light_floor.dm
@@ -34,7 +34,7 @@
/turf/open/floor/light/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
if(!length(lighttile_designs))
populate_lighttile_designs()
@@ -43,8 +43,8 @@
light_range = 0
update_light()
-/turf/open/floor/light/update_icon()
- ..()
+/turf/open/floor/light/update_icon(updates=ALL)
+ . = ..()
if(on)
switch(state)
if(0)
@@ -79,7 +79,7 @@
if(!choice)
return FALSE
currentcolor = choice
- update_icon()
+ update_appearance(UPDATE_ICON)
/turf/open/floor/light/attack_ai(mob/user)
if(!can_modify_colour)
@@ -88,7 +88,7 @@
if(!choice)
return FALSE
currentcolor = choice
- update_icon()
+ update_appearance(UPDATE_ICON)
return attack_hand(user)
/turf/open/floor/light/attackby(obj/item/C, mob/user, params)
@@ -98,7 +98,7 @@
if(state && user.temporarilyRemoveItemFromInventory(C))
qdel(C)
state = 0 //fixing it by bashing it with a light bulb, fun eh?
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You replace the light bulb."))
else
to_chat(user, span_notice("The light bulb seems fine, no need to replace it."))
diff --git a/code/game/turfs/simulated/floor/mineral_floor.dm b/code/game/turfs/simulated/floor/mineral_floor.dm
index d575fdfb7347..503b36b3dc14 100644
--- a/code/game/turfs/simulated/floor/mineral_floor.dm
+++ b/code/game/turfs/simulated/floor/mineral_floor.dm
@@ -23,11 +23,12 @@
icons = typelist("icons", icons)
-/turf/open/floor/mineral/update_icon()
- if(!..())
- return 0
+/turf/open/floor/mineral/update_icon_state()
+ . = ..()
+ if(!.)
+ return
if(!broken && !burnt)
- if( !(icon_state in icons) )
+ if(!(icon_state in icons))
icon_state = initial(icon_state)
//PLASMA
diff --git a/code/game/turfs/simulated/floor/misc_floor.dm b/code/game/turfs/simulated/floor/misc_floor.dm
index 69254b140a13..b3b4ee14f990 100644
--- a/code/game/turfs/simulated/floor/misc_floor.dm
+++ b/code/game/turfs/simulated/floor/misc_floor.dm
@@ -20,14 +20,15 @@
/turf/open/floor/circuit/Initialize(mapload)
SSmapping.nuke_tiles += src
- update_icon()
+ update_appearance(UPDATE_ICON)
. = ..()
/turf/open/floor/circuit/Destroy()
SSmapping.nuke_tiles -= src
return ..()
-/turf/open/floor/circuit/update_icon()
+/turf/open/floor/circuit/update_icon(updates=ALL)
+ . = ..()
if(on)
if(LAZYLEN(SSmapping.nuke_threats))
icon_state = "rcircuitanim"
diff --git a/code/game/turfs/simulated/floor/plasteel_floor.dm b/code/game/turfs/simulated/floor/plasteel_floor.dm
index e3150da9027d..5cdcbb103786 100644
--- a/code/game/turfs/simulated/floor/plasteel_floor.dm
+++ b/code/game/turfs/simulated/floor/plasteel_floor.dm
@@ -13,8 +13,9 @@
new /obj/effect/glowing_rune(src)
ChangeTurf(/turf/open/floor/plating/rust)
-/turf/open/floor/plasteel/update_icon()
- if(!..())
+/turf/open/floor/plasteel/update_icon(updates=ALL)
+ . = ..()
+ if(!.)
return 0
if(!broken && !burnt)
icon = icon_regular_floor
diff --git a/code/game/turfs/simulated/floor/plating.dm b/code/game/turfs/simulated/floor/plating.dm
index a4907cbc81de..5fdd9fa14468 100644
--- a/code/game/turfs/simulated/floor/plating.dm
+++ b/code/game/turfs/simulated/floor/plating.dm
@@ -44,8 +44,9 @@
else
icon_plating = initial(icon_state)
-/turf/open/floor/plating/update_icon()
- if(!..())
+/turf/open/floor/plating/update_icon_state()
+ . = ..()
+ if(!.)
return
if(!broken && !burnt)
icon_state = icon_plating //Because asteroids are 'platings' too.
diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm
index e092293e435a..0bdf3d8c713f 100644
--- a/code/game/turfs/simulated/minerals.dm
+++ b/code/game/turfs/simulated/minerals.dm
@@ -93,15 +93,16 @@
if(hardness <= 0)
gets_drilled(user,triggered_by_explosion)
else
- update_icon()
+ update_appearance(UPDATE_ICON)
-/turf/closed/mineral/update_icon()
+/turf/closed/mineral/update_overlays()
+ . = ..()
if(hardness != initial(hardness))
var/mutable_appearance/cracks = mutable_appearance('icons/turf/mining.dmi',"rock_cracks",ON_EDGED_TURF_LAYER)
var/matrix/M = new
M.Translate(4,4)
cracks.transform = M
- add_overlay(cracks)
+ . += cracks
/turf/closed/mineral/attack_animal(mob/living/simple_animal/user)
diff --git a/code/game/turfs/simulated/wall/reinf_walls.dm b/code/game/turfs/simulated/wall/reinf_walls.dm
index 5b87b9094dfd..a410cde0af7e 100644
--- a/code/game/turfs/simulated/wall/reinf_walls.dm
+++ b/code/game/turfs/simulated/wall/reinf_walls.dm
@@ -55,7 +55,7 @@
if(W.tool_behaviour == TOOL_WIRECUTTER)
W.play_tool_sound(src, 100)
d_state = SUPPORT_LINES
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You cut the outer grille."))
return 1
@@ -66,14 +66,14 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_LINES)
return 1
d_state = COVER
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You unsecure the support lines."))
return 1
else if(W.tool_behaviour == TOOL_WIRECUTTER)
W.play_tool_sound(src, 100)
d_state = INTACT
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You repair the outer grille."))
return 1
@@ -86,7 +86,7 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != COVER)
return 1
d_state = CUT_COVER
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You press firmly on the cover, dislodging it."))
return 1
@@ -96,7 +96,7 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != COVER)
return 1
d_state = SUPPORT_LINES
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("The support lines have been secured."))
return 1
@@ -107,7 +107,7 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != CUT_COVER)
return 1
d_state = ANCHOR_BOLTS
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You pry off the cover."))
return 1
@@ -119,7 +119,7 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != CUT_COVER)
return TRUE
d_state = COVER
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("The metal cover has been welded securely to the frame."))
return 1
@@ -130,7 +130,7 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != ANCHOR_BOLTS)
return 1
d_state = SUPPORT_RODS
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You remove the bolts anchoring the support rods."))
return 1
@@ -140,7 +140,7 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != ANCHOR_BOLTS)
return 1
d_state = CUT_COVER
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("The metal cover has been pried back into place."))
return 1
@@ -153,7 +153,7 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_RODS)
return 1
d_state = SHEATH
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You slice through the support rods."))
return 1
@@ -164,7 +164,7 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_RODS)
return 1
d_state = ANCHOR_BOLTS
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You tighten the bolts anchoring the support rods."))
return 1
@@ -186,12 +186,13 @@
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SHEATH)
return TRUE
d_state = SUPPORT_RODS
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You weld the support rods back together."))
return 1
return 0
-/turf/closed/wall/r_wall/update_icon()
+/turf/closed/wall/r_wall/update_icon(updates=ALL)
+ . = ..()
if(d_state != INTACT)
smooth = SMOOTH_FALSE
clear_smooth_overlays()
diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm
index fbd722e33640..39d0c255272a 100644
--- a/code/game/turfs/space/transit.dm
+++ b/code/game/turfs/space/transit.dm
@@ -8,7 +8,7 @@
/turf/open/space/transit/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
RegisterSignal(src, COMSIG_TURF_RESERVATION_RELEASED, PROC_REF(launch_contents))
/turf/open/space/transit/Destroy()
@@ -67,7 +67,8 @@
/turf/open/space/transit/east
dir = EAST
-/turf/open/space/transit/update_icon()
+/turf/open/space/transit/update_icon_state()
+ . = ..()
icon_state = "speedspace_ns_[get_transit_state(src)]"
transform = turn(matrix(), get_transit_angle(src))
diff --git a/code/modules/NTNet/relays.dm b/code/modules/NTNet/relays.dm
index edaf2ed31fe9..777ea33d6d4c 100644
--- a/code/modules/NTNet/relays.dm
+++ b/code/modules/NTNet/relays.dm
@@ -32,11 +32,14 @@
return FALSE
return TRUE
-/obj/machinery/ntnet_relay/update_icon()
- cut_overlays()
+/obj/machinery/ntnet_relay/update_overlays()
+ . = ..()
if(is_operational())
var/mutable_appearance/on_overlay = mutable_appearance(icon, "[initial(icon_state)]_on")
- add_overlay(on_overlay)
+ . += on_overlay
+
+/obj/machinery/ntnet_relay/update_icon_state()
+ . = ..()
if(panel_open)
icon_state = "[initial(icon_state)]_o"
else
@@ -49,7 +52,7 @@
else
use_power = IDLE_POWER_USE
- update_icon()
+ update_appearance(UPDATE_ICON)
if(dos_overload > 0)
dos_overload = max(0, dos_overload - dos_dissipate * delta_time)
@@ -57,12 +60,12 @@
// If DoS traffic exceeded capacity, crash.
if((dos_overload > dos_capacity) && !dos_failure)
dos_failure = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
SSnetworks.station_network.add_log("Quantum relay switched from normal operation mode to overload recovery mode.")
// If the DoS buffer reaches 0 again, restart.
if((dos_overload == 0) && dos_failure)
dos_failure = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
SSnetworks.station_network.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
..()
@@ -89,13 +92,13 @@
if("restart")
dos_overload = 0
dos_failure = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
SSnetworks.station_network.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
return TRUE
if("toggle")
enabled = !enabled
SSnetworks.station_network.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].")
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/ntnet_relay/Initialize(mapload)
diff --git a/code/modules/VR/vr_sleeper.dm b/code/modules/VR/vr_sleeper.dm
index 154cbd61fd30..8b5a342b8abd 100644
--- a/code/modules/VR/vr_sleeper.dm
+++ b/code/modules/VR/vr_sleeper.dm
@@ -22,7 +22,7 @@
sparks = new /datum/effect_system/spark_spread()
sparks.set_up(2,0)
sparks.attach(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/vr_sleeper/attackby(obj/item/I, mob/user, params)
if(!state_open && !occupant)
@@ -61,7 +61,8 @@
sparks.start()
addtimer(CALLBACK(src, PROC_REF(emagNotify)), 150)
-/obj/machinery/vr_sleeper/update_icon()
+/obj/machinery/vr_sleeper/update_icon_state()
+ . = ..()
icon_state = "[initial(icon_state)][state_open ? "-open" : ""]"
/obj/machinery/vr_sleeper/open_machine()
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 1e05e75f80c2..d02738d80ecd 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -457,7 +457,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
var/obj/item/storage/wallet/W = worn
W.front_id = id
id.forceMove(W)
- W.update_icon()
+ W.update_appearance(UPDATE_ICON)
else
H.equip_to_slot(id,ITEM_SLOT_ID)
else if(isanimal(M))
@@ -848,7 +848,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
F.anchored = TRUE
F.warming_up = 3
F.start_fields()
- F.update_icon()
+ F.update_appearance(UPDATE_ICON)
spawn(30)
for(var/obj/machinery/the_singularitygen/G in GLOB.machines)
diff --git a/code/modules/admin/verbs/manipulate_organs.dm b/code/modules/admin/verbs/manipulate_organs.dm
index 92eacb7af34b..5d2c9bf6563d 100644
--- a/code/modules/admin/verbs/manipulate_organs.dm
+++ b/code/modules/admin/verbs/manipulate_organs.dm
@@ -71,4 +71,4 @@
var/obj/item/implantcase/case = new(get_turf(C))
case.imp = I
I.forceMove(case)
- case.update_icon()
+ case.update_appearance(UPDATE_ICON)
diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
index 567636e03180..45b84db7b344 100644
--- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm
+++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
@@ -405,8 +405,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/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/paper/guides/antag/abductor/AltClick()
return //otherwise it would fold into a paperplane.
@@ -442,9 +443,10 @@ Congratulations! You are now trained for invasive xenobiology research!"}
txt = "probing"
to_chat(usr, span_notice("You switch the baton to [txt] mode."))
- update_icon()
+ update_appearance(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/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm
index 8891c111d5b9..fe1e488dfc13 100644
--- a/code/modules/antagonists/abductor/equipment/gland.dm
+++ b/code/modules/antagonists/abductor/equipment/gland.dm
@@ -51,8 +51,9 @@
else
holder.icon_state = "hudgland_spent"
-/obj/item/organ/heart/gland/update_icon()
- return // stop it from switching to the non existent heart_on sprite
+/obj/item/organ/heart/gland/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/organ/heart/gland/proc/mind_control(command, mob/living/user)
if(!ownerCheck() || !mind_control_uses || active_mind_control)
diff --git a/code/modules/antagonists/abductor/machinery/experiment.dm b/code/modules/antagonists/abductor/machinery/experiment.dm
index af79d3d5e118..9c29c3516d5b 100644
--- a/code/modules/antagonists/abductor/machinery/experiment.dm
+++ b/code/modules/antagonists/abductor/machinery/experiment.dm
@@ -183,7 +183,8 @@
SSjob.SendToLateJoin(H, FALSE)
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/blob/blobstrains/_blobstrain.dm b/code/modules/antagonists/blob/blobstrains/_blobstrain.dm
index fb81ebac4274..3698fdeafc78 100644
--- a/code/modules/antagonists/blob/blobstrains/_blobstrain.dm
+++ b/code/modules/antagonists/blob/blobstrains/_blobstrain.dm
@@ -31,7 +31,7 @@ GLOBAL_LIST_INIT(valid_blobstrains, subtypesof(/datum/blobstrain) - list(/datum/
point_rate = point_rate * overmind.basemodifier
for(var/BL in GLOB.blobs)
var/obj/structure/blob/B = BL
- B.update_icon()
+ B.update_appearance(UPDATE_ICON)
for(var/BLO in overmind.blob_mobs)
var/mob/living/simple_animal/hostile/blob/BM = BLO
BM.update_icons() //If it's getting a new strain, tell it what it does!
diff --git a/code/modules/antagonists/blob/blobstrains/replicating_foam.dm b/code/modules/antagonists/blob/blobstrains/replicating_foam.dm
index 73ffff293882..3a089efc6474 100644
--- a/code/modules/antagonists/blob/blobstrains/replicating_foam.dm
+++ b/code/modules/antagonists/blob/blobstrains/replicating_foam.dm
@@ -17,7 +17,7 @@
var/obj/structure/blob/newB = B.expand(null, null, 0)
if(newB)
newB.obj_integrity = B.obj_integrity - damage
- newB.update_icon()
+ newB.update_appearance(UPDATE_ICON)
return ..()
diff --git a/code/modules/antagonists/blob/overmind.dm b/code/modules/antagonists/blob/overmind.dm
index eb3d55cdad08..2d00eb9ab763 100644
--- a/code/modules/antagonists/blob/overmind.dm
+++ b/code/modules/antagonists/blob/overmind.dm
@@ -59,7 +59,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
set_strain(BS)
color = blobstrain.complementary_color
if(blob_core)
- blob_core.update_icon()
+ blob_core.update_appearance(UPDATE_ICON)
SSshuttle.registerHostileEnvironment(src)
announcement_time = world.time + 6000
. = ..()
@@ -180,7 +180,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
var/obj/structure/blob/B = BL
if(B && B.overmind == src)
B.overmind = null
- B.update_icon() //reset anything that was ours
+ B.update_appearance(UPDATE_ICON) //reset anything that was ours
for(var/BLO in blob_mobs)
var/mob/living/simple_animal/hostile/blob/BM = BLO
if(BM)
diff --git a/code/modules/antagonists/blob/powers.dm b/code/modules/antagonists/blob/powers.dm
index 2aa7516c5faf..214cb9dcd6c7 100644
--- a/code/modules/antagonists/blob/powers.dm
+++ b/code/modules/antagonists/blob/powers.dm
@@ -51,7 +51,7 @@
core.overmind = src
blobs_legit += src
blob_core = core
- core.update_icon()
+ core.update_appearance(UPDATE_ICON)
update_health_hud()
placed = 1
return 1
@@ -173,7 +173,7 @@
if(LAZYLEN(candidates)) //if we got at least one candidate, they're a blobbernaut now.
B.max_integrity = initial(B.max_integrity) * 0.25 //factories that produced a blobbernaut have much lower health
B.obj_integrity = min(B.obj_integrity, B.max_integrity)
- B.update_icon()
+ B.update_appearance(UPDATE_ICON)
B.visible_message(span_warning("
The blobbernaut [pick("rips", "tears", "shreds")] its way out of the factory blob!"))
playsound(B.loc, 'sound/effects/splat.ogg', 50, 1)
var/mob/living/simple_animal/hostile/blob/blobbernaut/blobber = new /mob/living/simple_animal/hostile/blob/blobbernaut(get_turf(B))
diff --git a/code/modules/antagonists/blob/structures/_blob.dm b/code/modules/antagonists/blob/structures/_blob.dm
index 554636fbf095..f6cd06afe898 100644
--- a/code/modules/antagonists/blob/structures/_blob.dm
+++ b/code/modules/antagonists/blob/structures/_blob.dm
@@ -29,7 +29,7 @@
overmind.blobs_legit += src
GLOB.blobs += src //Keep track of the blob in the normal list either way
setDir(pick(GLOB.cardinals))
- update_icon()
+ update_appearance(UPDATE_ICON)
if(atmosblock)
air_update_turf(1)
ConsumeTile()
@@ -82,7 +82,8 @@
var/atom/movable/mover = caller
. = . || (mover.pass_flags & PASSBLOB)
-/obj/structure/blob/update_icon() //Updates color based on overmind color if we have an overmind.
+/obj/structure/blob/update_icon(updates=ALL) //Updates color based on overmind color if we have an overmind.
+ . = ..()
if(overmind)
add_atom_colour(overmind.blobstrain.color, FIXED_COLOUR_PRIORITY)
else
@@ -103,7 +104,7 @@
var/obj/structure/blob/B = L
if(!B.overmind && !istype(B, /obj/structure/blob/core) && prob(30))
B.overmind = pulsing_overmind //reclaim unclaimed, non-core blobs.
- B.update_icon()
+ B.update_appearance(UPDATE_ICON)
var/distance = get_dist(get_turf(src), get_turf(B))
var/expand_probablity = max(20 - distance * 8, 1)
if(B.Adjacent(src))
@@ -127,7 +128,7 @@
if(heal_timestamp <= world.time)
obj_integrity = min(max_integrity, obj_integrity+health_regen)
heal_timestamp = world.time + 20
- update_icon()
+ update_appearance(UPDATE_ICON)
pulse_timestamp = world.time + 10
return 1 //we did it, we were pulsed!
return 0 //oh no we failed
@@ -185,7 +186,7 @@
if(T.Enter(B,src)) //NOW we can attempt to move into the tile
B.density = initial(B.density)
B.forceMove(T)
- B.update_icon()
+ B.update_appearance(UPDATE_ICON)
if(B.overmind && expand_reaction)
B.overmind.blobstrain.expand_reaction(src, B, T, controller)
return B
@@ -289,7 +290,7 @@
/obj/structure/blob/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = TRUE, attack_dir, armour_penetration = 0)
. = ..()
if(. && obj_integrity > 0)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/blob/obj_destruction(damage_flag)
if(overmind)
@@ -301,7 +302,7 @@
CRASH("change_to(): invalid type for blob")
var/obj/structure/blob/B = new type(src.loc, controller)
B.creation_action()
- B.update_icon()
+ B.update_appearance(UPDATE_ICON)
B.setDir(dir)
qdel(src)
return B
@@ -344,8 +345,8 @@
return "Currently weak to brute damage."
return "N/A"
-/obj/structure/blob/normal/update_icon()
- ..()
+/obj/structure/blob/normal/update_appearance(updates=ALL)
+ . = ..()
if(obj_integrity <= 15)
icon_state = "blob_damaged"
name = "fragile blob"
diff --git a/code/modules/antagonists/blob/structures/core.dm b/code/modules/antagonists/blob/structures/core.dm
index 9f53d7e1cea3..1c87f7bf2558 100644
--- a/code/modules/antagonists/blob/structures/core.dm
+++ b/code/modules/antagonists/blob/structures/core.dm
@@ -15,24 +15,24 @@
GLOB.blob_cores += src
START_PROCESSING(SSobj, src)
GLOB.poi_list |= src
- update_icon() //so it atleast appears
+ update_appearance(UPDATE_ICON) //so it atleast appears
if(!placed && !overmind)
return INITIALIZE_HINT_QDEL
if(overmind)
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/structure/blob/core/scannerreport()
return "Directs the blob's expansion, gradually expands, and sustains nearby blob spores and blobbernauts."
-/obj/structure/blob/core/update_icon()
- cut_overlays()
+/obj/structure/blob/core/update_overlays()
+ . = ..()
color = null
var/mutable_appearance/blob_overlay = mutable_appearance('icons/mob/blob.dmi', "blob")
if(overmind)
blob_overlay.color = overmind.blobstrain.color
- add_overlay(blob_overlay)
- add_overlay(mutable_appearance('icons/mob/blob.dmi', "blob_core_overlay"))
+ . += blob_overlay
+ . += mutable_appearance('icons/mob/blob.dmi', "blob_core_overlay")
/obj/structure/blob/core/Destroy()
GLOB.blob_cores -= src
diff --git a/code/modules/antagonists/blob/structures/node.dm b/code/modules/antagonists/blob/structures/node.dm
index f9c3b48eb84b..1d7c6113800c 100644
--- a/code/modules/antagonists/blob/structures/node.dm
+++ b/code/modules/antagonists/blob/structures/node.dm
@@ -18,14 +18,14 @@
/obj/structure/blob/node/scannerreport()
return "Gradually expands and sustains nearby blob spores and blobbernauts."
-/obj/structure/blob/node/update_icon()
- cut_overlays()
+/obj/structure/blob/node/update_overlays()
+ . = ..()
color = null
var/mutable_appearance/blob_overlay = mutable_appearance('icons/mob/blob.dmi', "blob")
if(overmind)
blob_overlay.color = overmind.blobstrain.color
- add_overlay(blob_overlay)
- add_overlay(mutable_appearance('icons/mob/blob.dmi', "blob_node_overlay"))
+ . += blob_overlay
+ . += mutable_appearance('icons/mob/blob.dmi', "blob_node_overlay")
/obj/structure/blob/node/Destroy()
GLOB.blob_nodes -= src
diff --git a/code/modules/antagonists/blob/structures/shield.dm b/code/modules/antagonists/blob/structures/shield.dm
index 0a21174326c4..72af84d66556 100644
--- a/code/modules/antagonists/blob/structures/shield.dm
+++ b/code/modules/antagonists/blob/structures/shield.dm
@@ -19,8 +19,8 @@
/obj/structure/blob/shield/core
point_return = 0
-/obj/structure/blob/shield/update_icon()
- ..()
+/obj/structure/blob/shield/update_appearance(updates=ALL)
+ . = ..()
if(obj_integrity < max_integrity * 0.5)
icon_state = "[initial(icon_state)]_damaged"
name = "weakened [initial(name)]"
diff --git a/code/modules/antagonists/bloodsuckers/powers/targeted/lasombra.dm b/code/modules/antagonists/bloodsuckers/powers/targeted/lasombra.dm
index 450049b3ed12..5e5d7ab1fc40 100644
--- a/code/modules/antagonists/bloodsuckers/powers/targeted/lasombra.dm
+++ b/code/modules/antagonists/bloodsuckers/powers/targeted/lasombra.dm
@@ -78,7 +78,7 @@
if(istype(O, /obj/item/pda))
var/obj/item/pda/PDA = O
PDA.set_light_on(FALSE)
- PDA.update_icon()
+ PDA.update_appearance(UPDATE_ICON)
O.visible_message(span_danger("The light in [PDA] shorts out!"))
else
O.visible_message(span_danger("[O] is disintegrated by [src]!"))
diff --git a/code/modules/antagonists/bloodsuckers/structures/bloodsucker_coffin.dm b/code/modules/antagonists/bloodsuckers/structures/bloodsucker_coffin.dm
index fe9b83f2c7d6..029e73b6dd11 100644
--- a/code/modules/antagonists/bloodsuckers/structures/bloodsucker_coffin.dm
+++ b/code/modules/antagonists/bloodsuckers/structures/bloodsucker_coffin.dm
@@ -162,7 +162,7 @@
if(user == resident)
if(welded)
welded = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
locked = FALSE
return TRUE
playsound(get_turf(src), 'sound/machines/door_locked.ogg', 20, 1)
diff --git a/code/modules/antagonists/bloodsuckers/structures/bloodsucker_crypt.dm b/code/modules/antagonists/bloodsuckers/structures/bloodsucker_crypt.dm
index c639c21c7b33..dc97c45bdeb4 100644
--- a/code/modules/antagonists/bloodsuckers/structures/bloodsucker_crypt.dm
+++ b/code/modules/antagonists/bloodsuckers/structures/bloodsucker_crypt.dm
@@ -316,7 +316,7 @@
return
icon_state = initial(icon_state) + (awoken ? "_idle" : "_awaken")
- update_icon()
+ update_appearance(UPDATE_ICON)
var/rankspent
switch(bloodsuckerdatum.clanprogress)
if(0)
@@ -395,15 +395,15 @@
. = ..()
anchored = FALSE
-/obj/structure/bloodsucker/moldingstone/update_icon()
- cut_overlays()
+/obj/structure/bloodsucker/moldingstone/update_overlays()
+ . = ..()
switch(metal)
if(1 to 5)
- add_overlay("metal")
+ . += "metal"
if(6 to 20)
- add_overlay("metal_2")
+ . += "metal_2"
if(21 to 50)
- add_overlay("metal_3")
+ . += "metal_3"
/obj/structure/bloodsucker/moldingstone/attackby(obj/item/I, mob/user, params)
if(!anchored)
@@ -427,7 +427,7 @@
balloon_alert(user, "added [metal] metal")
if(istype(I, /obj/item/bloodsucker/chisel))
start_sculpiting(user)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bloodsucker/moldingstone/proc/start_sculpiting(mob/living/artist)
if(metal < 10)
@@ -440,7 +440,7 @@
if(!do_after(artist, 10 SECONDS, src))
artist.balloon_alert(artist, "ruined!")
metal -= rand(5, 10)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
artist.balloon_alert(artist, "done, a masterpiece!")
@@ -464,7 +464,7 @@
new /obj/item/stack/sheet/metal(get_turf(user), count)
else
to_chat(user, span_warning("There's no metal to retrieve in [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
#undef METALLIMIT
/obj/structure/bloodsucker/bloodstatue
@@ -710,7 +710,7 @@
playsound(loc, 'sound/effects/pop_expl.ogg', 25, 1)
density = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
// Set up Torture stuff now
convert_progress = 3
@@ -746,7 +746,7 @@
visible_message(span_danger("[buckled_mob][buckled_mob.stat == DEAD ? "'s corpse" : ""] slides off of the rack."))
density = FALSE
buckled_mob.Paralyze(2 SECONDS)
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/structure/bloodsucker/vassalrack/attack_hand(mob/user, list/modifiers)
@@ -807,20 +807,20 @@
smallmeat++
meat_amount = bigmeat + intermeat + mediummeat + smallmeat
qdel(I)
- update_icon()
+ update_appearance(UPDATE_ICON)
#undef MEATLIMIT
-/obj/structure/bloodsucker/vassalrack/update_icon()
- cut_overlays()
+/obj/structure/bloodsucker/vassalrack/update_overlays()
+ . = ..()
if(bigmeat)
- add_overlay("bigmeat_[bigmeat]")
+ . += "bigmeat_[bigmeat]"
if(intermeat)
- add_overlay("mediummeat_[intermeat]")
- add_overlay("smallmeat_[intermeat]")
+ . += "mediummeat_[intermeat]"
+ . += "smallmeat_[intermeat]"
if(mediummeat)
- add_overlay("mediummeat_[mediummeat + intermeat]")
+ . += "mediummeat_[mediummeat + intermeat]"
if(smallmeat)
- add_overlay("smallmeat_[smallmeat + intermeat]")
+ . += "smallmeat_[smallmeat + intermeat]"
/obj/structure/bloodsucker/vassalrack/CtrlClick(mob/user)
if(!anchored)
@@ -849,7 +849,7 @@
else
to_chat(user, span_warning("There's no meat to retrieve in [src]"))
meat_amount = bigmeat + intermeat + mediummeat + smallmeat
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Step One: Tick Down Conversion from 3 to 0
@@ -1149,7 +1149,7 @@
if(bigmeat && meatlost == 4)
bigmeat--
meatlost -= 4
- update_icon()
+ update_appearance(UPDATE_ICON)
meat_amount = bigmeat + intermeat + mediummeat + smallmeat
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1183,9 +1183,9 @@
STOP_PROCESSING(SSobj, src)
return ..()
-/obj/structure/bloodsucker/candelabrum/update_icon()
+/obj/structure/bloodsucker/candelabrum/update_icon_state()
+ . = ..()
icon_state = "candelabrum[lit ? "_lit" : ""]"
- return ..()
/obj/structure/bloodsucker/candelabrum/examine(mob/user)
. = ..()
@@ -1208,7 +1208,7 @@
else
set_light(0)
STOP_PROCESSING(SSobj, src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bloodsucker/candelabrum/process()
if(!lit)
@@ -1284,7 +1284,7 @@
if(!buckle_mob(target))
return
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bloodsucker/candelabrum/proc/remove_loyalties(mob/living/target, mob/living/user)
// Find Mindshield implant & destroy, takes a good while.
@@ -1296,7 +1296,7 @@
/obj/structure/bloodsucker/candelabrum/unbuckle_mob(mob/living/buckled_mob, force = FALSE, can_fall = TRUE)
. = ..()
src.visible_message(span_danger("[buckled_mob][buckled_mob.stat==DEAD?"'s corpse":""] slides off of the candelabrum."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/// Blood Throne - Allows Bloodsuckers to remotely speak with their Vassals. - Code (Mostly) stolen from comfy chairs (armrests) and chairs (layers)
/* broken currently
diff --git a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm
index 400a1f0cba1a..04e4265543d7 100644
--- a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm
+++ b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm
@@ -181,7 +181,7 @@
/obj/effect/clockwork/sigil/transmission/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/effect/clockwork/sigil/transmission/ex_act(severity)
if(severity == 3)
@@ -242,7 +242,8 @@
return FALSE
return TRUE
-/obj/effect/clockwork/sigil/transmission/update_icon()
+/obj/effect/clockwork/sigil/transmission/update_icon(updates=ALL)
+ . = ..()
var/power_charge = get_clockwork_power()
if(GLOB.ratvar_awakens)
alpha = 255
diff --git a/code/modules/antagonists/clockcult/clock_helpers/clock_powerdrain.dm b/code/modules/antagonists/clockcult/clock_helpers/clock_powerdrain.dm
index 5ada97e2fd2b..9049148c6098 100644
--- a/code/modules/antagonists/clockcult/clock_helpers/clock_powerdrain.dm
+++ b/code/modules/antagonists/clockcult/clock_helpers/clock_powerdrain.dm
@@ -21,7 +21,7 @@
shorted = 1
visible_message(span_warning("The [name]'s screen blurs with static."))
update()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/smes/power_drain(clockcult_user)
if(charge)
@@ -32,13 +32,13 @@
icon_state = "[initial(icon_state)]-o"
do_sparks(10, FALSE, src)
visible_message(span_warning("[src]'s panel flies open with a flurry of sparks!"))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stock_parts/cell/power_drain(clockcult_user)
if(charge)
. = min(charge, MIN_CLOCKCULT_POWER*3)
charge = use(.)
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/silicon/robot/power_drain(clockcult_user)
if((!clockcult_user || !is_servant_of_ratvar(src)) && cell && cell.charge)
diff --git a/code/modules/antagonists/clockcult/clock_helpers/power_helpers.dm b/code/modules/antagonists/clockcult/clock_helpers/power_helpers.dm
index 7542c93ca2a2..1f59ddc1c2cb 100644
--- a/code/modules/antagonists/clockcult/clock_helpers/power_helpers.dm
+++ b/code/modules/antagonists/clockcult/clock_helpers/power_helpers.dm
@@ -12,7 +12,7 @@
else
current_power = GLOB.clockwork_power = clamp(GLOB.clockwork_power + amount, 0, MAX_CLOCKWORK_POWER)
for(var/obj/effect/clockwork/sigil/transmission/T in GLOB.all_clockwork_objects)
- T.update_icon()
+ T.update_appearance(UPDATE_ICON)
var/unlock_message
if(current_power >= SCRIPT_UNLOCK_THRESHOLD && !GLOB.script_scripture_unlocked)
GLOB.script_scripture_unlocked = TRUE
diff --git a/code/modules/antagonists/clockcult/clock_structures/ark_of_the_clockwork_justicar.dm b/code/modules/antagonists/clockcult/clock_structures/ark_of_the_clockwork_justicar.dm
index c8bd3197f499..f061da06af46 100644
--- a/code/modules/antagonists/clockcult/clock_structures/ark_of_the_clockwork_justicar.dm
+++ b/code/modules/antagonists/clockcult/clock_structures/ark_of_the_clockwork_justicar.dm
@@ -296,7 +296,7 @@
if(!O.pulledby && !iseffect(O) && O.density)
if(!step_away(O, src, 2) || get_dist(O, src) < 2)
O.take_damage(50, BURN, BOMB)
- O.update_icon()
+ O.update_appearance(UPDATE_ICON)
for(var/V in GLOB.player_list)
var/mob/M = V
var/turf/T = get_turf(M)
diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm
index 74c0b5bd29c7..1ae73e4be031 100644
--- a/code/modules/antagonists/cult/cult_items.dm
+++ b/code/modules/antagonists/cult/cult_items.dm
@@ -384,7 +384,8 @@
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
@@ -690,7 +691,8 @@ GLOBAL_VAR_INIT(curselimit, 0)
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/cult/cult_structures.dm b/code/modules/antagonists/cult/cult_structures.dm
index 563d18451814..7727d52ce3ff 100644
--- a/code/modules/antagonists/cult/cult_structures.dm
+++ b/code/modules/antagonists/cult/cult_structures.dm
@@ -306,13 +306,14 @@
/obj/structure/destructible/cult/pillar/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = TRUE, attack_dir, armour_penetration = 0)
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/destructible/cult/pillar/Destroy()
new /obj/effect/decal/cleanable/ash(loc)
..()
-/obj/structure/destructible/cult/pillar/update_icon()
+/obj/structure/destructible/cult/pillar/update_icon_state()
+ . = ..()
icon_state = "pillar[alt ? "alt": ""]2"
if (obj_integrity < max_integrity/3)
icon_state = "pillar[alt ? "alt": ""]0"
@@ -398,7 +399,7 @@
M.playsound_local(src, 'sound/effects/explosionfar.ogg', 50, 1)
shake_camera(M, 1, 1)
for (var/obj/structure/destructible/cult/pillar/P in pillars)
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
/obj/structure/destructible/cult/bloodstone/proc/summon()
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF //should stop the stone from being destroyed by damage
@@ -408,7 +409,7 @@
/obj/structure/destructible/cult/bloodstone/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = TRUE, attack_dir, armour_penetration = 0)
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/destructible/cult/bloodstone/ex_act(severity)
switch(severity)
@@ -470,16 +471,19 @@
else
T.narsie_act(TRUE, TRUE)
-/obj/structure/destructible/cult/bloodstone/update_icon()
+/obj/structure/destructible/cult/bloodstone/update_icon_state()
+ . = ..()
icon_state = "bloodstone-[current_fullness]"
- cut_overlays()
+
+/obj/structure/destructible/cult/bloodstone/update_overlays()
+ . = ..()
var/image/I_base = image('icons/obj/cult_64x64.dmi',"bloodstone-base")
I_base.appearance_flags |= RESET_COLOR//we don't want the stone to pulse
overlays += I_base
if (obj_integrity <= max_integrity/3)
- add_overlay("bloodstone_damage2")
+ . += "bloodstone_damage2"
else if (obj_integrity <= 2*max_integrity/3)
- add_overlay("bloodstone_damage1")
+ . += "bloodstone_damage1"
set_light(3+current_fullness, 2+current_fullness)
/obj/structure/destructible/cult/bloodstone/proc/set_animate()
@@ -500,7 +504,7 @@
animate(color = list(1.25,0.12,0,0,0,1.25,0.12,0,0.12,0,1.25,0,0,0,0,1,0,0,0,0), time = 0.1 SECONDS)
animate(color = list(1.125,0.06,0,0,0,1.125,0.06,0,0.06,0,1.125,0,0,0,0,1,0,0,0,0), time = 0.1 SECONDS)
set_light(20, 20)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/destructible/cult/bloodstone/conceal() //lol
return
diff --git a/code/modules/antagonists/eldritch_cult/eldritch_book.dm b/code/modules/antagonists/eldritch_cult/eldritch_book.dm
index 75f4bb92702a..041b056a6533 100644
--- a/code/modules/antagonists/eldritch_cult/eldritch_book.dm
+++ b/code/modules/antagonists/eldritch_cult/eldritch_book.dm
@@ -155,7 +155,7 @@
if(cultie.gain_knowledge(EK))
return TRUE
- update_icon() // Not applicable to all objects.
+ update_appearance(UPDATE_ICON) // Not applicable to all objects.
/obj/item/forbidden_book/ui_close(mob/user)
flick("book_closing",src)
diff --git a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm
index 5a93e1632aa0..1650f38ac392 100644
--- a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm
+++ b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm
@@ -759,7 +759,7 @@
pixel_y = rand(-6,6)
pixel_x = rand(-6,6)
icon_state = "small_rune_[rand(12)]"
- update_icon()
+ update_appearance(UPDATE_ICON)
// Shoots out in a wave-like, what rust heretics themselves get
/datum/action/cooldown/spell/cone/staggered/entropic_plume
diff --git a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
index 6477ecc6b202..45f4b503ab52 100644
--- a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
+++ b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
@@ -39,7 +39,7 @@
GLOB.nuke_list += src
core = new /obj/item/nuke_core(src)
STOP_PROCESSING(SSobj, core)
- update_icon()
+ update_appearance(UPDATE_ICON)
GLOB.poi_list |= src
previous_level = get_security_level()
@@ -111,7 +111,7 @@
if(I.use_tool(src, user, 60, volume=100))
deconstruction_state = NUKESTATE_UNSCREWED
to_chat(user, span_notice("You remove the screws from [src]'s front panel."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(NUKESTATE_PANEL_REMOVED)
@@ -122,7 +122,7 @@
if(I.use_tool(src, user, 80, volume=100, amount=1))
to_chat(user, span_notice("You cut [src]'s inner plate."))
deconstruction_state = NUKESTATE_WELDED
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(NUKESTATE_CORE_EXPOSED)
if(istype(I, /obj/item/nuke_core_container))
@@ -132,7 +132,7 @@
if(core_box.load(core, user))
to_chat(user, span_notice("You load the plutonium core into [core_box]."))
deconstruction_state = NUKESTATE_CORE_REMOVED
- update_icon()
+ update_appearance(UPDATE_ICON)
core = null
else
to_chat(user, span_warning("You fail to load the plutonium core into [core_box]. [core_box] has already been used!"))
@@ -146,7 +146,7 @@
to_chat(user, span_notice("You repair [src]'s inner metal plate. The radiation is contained."))
deconstruction_state = NUKESTATE_PANEL_REMOVED
STOP_PROCESSING(SSobj, core)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
. = ..()
@@ -158,14 +158,14 @@
if(tool.use_tool(src, user, 30, volume=100))
to_chat(user, span_notice("You remove [src]'s front panel."))
deconstruction_state = NUKESTATE_PANEL_REMOVED
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
if(NUKESTATE_WELDED)
to_chat(user, span_notice("You start prying off [src]'s inner plate..."))
if(tool.use_tool(src, user, 30, volume=100))
to_chat(user, span_notice("You pry off [src]'s inner plate. You can see the core's green glow!"))
deconstruction_state = NUKESTATE_CORE_EXPOSED
- update_icon()
+ update_appearance(UPDATE_ICON)
START_PROCESSING(SSobj, core)
return TRUE
@@ -179,26 +179,28 @@
else
return NUKE_OFF_UNLOCKED
-/obj/machinery/nuclearbomb/update_icon()
- if(deconstruction_state == NUKESTATE_INTACT)
- switch(get_nuke_state())
- if(NUKE_OFF_LOCKED, NUKE_OFF_UNLOCKED)
- icon_state = "nuclearbomb_base"
- update_icon_interior()
- update_icon_lights()
- if(NUKE_ON_TIMING)
- cut_overlays()
- icon_state = "nuclearbomb_timing"
- if(NUKE_ON_EXPLODING)
- cut_overlays()
- icon_state = "nuclearbomb_exploding"
- else
+/obj/machinery/nuclearbomb/update_icon_state()
+ if(deconstruction_state != NUKESTATE_INTACT)
icon_state = "nuclearbomb_base"
- update_icon_interior()
- update_icon_lights()
+ return ..()
+
+ switch(get_nuke_state())
+ if(NUKE_OFF_LOCKED, NUKE_OFF_UNLOCKED)
+ icon_state = "nuclearbomb_base"
+ if(NUKE_ON_TIMING)
+ icon_state = "nuclearbomb_timing"
+ if(NUKE_ON_EXPLODING)
+ icon_state = "nuclearbomb_exploding"
+
+ return ..()
+
+/obj/machinery/nuclearbomb/update_overlays()
+ . = ..()
-/obj/machinery/nuclearbomb/proc/update_icon_interior()
+ if(lights)
+ cut_overlay(lights)
cut_overlay(interior)
+
switch(deconstruction_state)
if(NUKESTATE_UNSCREWED)
interior = "panel-unscrewed"
@@ -212,11 +214,7 @@
interior = "core-removed"
if(NUKESTATE_INTACT)
return
- add_overlay(interior)
-/obj/machinery/nuclearbomb/proc/update_icon_lights()
- if(lights)
- cut_overlay(lights)
switch(get_nuke_state())
if(NUKE_OFF_LOCKED)
lights = ""
@@ -227,7 +225,9 @@
lights = "lights-timing"
if(NUKE_ON_EXPLODING)
lights = "lights-exploding"
+
add_overlay(lights)
+ add_overlay(interior)
/obj/machinery/nuclearbomb/process()
if(timing && !exploding)
@@ -408,7 +408,7 @@
timing = FALSE
detonation_timer = null
countdown.stop()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/nuclearbomb/proc/set_active()
if(safety)
@@ -429,7 +429,7 @@
S.switch_mode_to(initial(S.mode))
S.alert = FALSE
countdown.stop()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/nuclearbomb/proc/get_time_left()
if(timing)
@@ -456,7 +456,7 @@
exploding = TRUE
yes_code = FALSE
safety = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
sound_to_playing_players('sound/machines/alarm.ogg')
if(SSticker && SSticker.mode)
SSticker.roundend_check_paused = TRUE
@@ -563,7 +563,7 @@
S.switch_mode_to(initial(S.mode))
S.alert = FALSE
countdown.stop()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/nuclearbomb/beer/proc/fizzbuzz()
var/datum/reagents/R = new/datum/reagents(1000)
diff --git a/code/modules/antagonists/revolution/revolution.dm b/code/modules/antagonists/revolution/revolution.dm
index db98952a19b8..a1ea599bf96b 100644
--- a/code/modules/antagonists/revolution/revolution.dm
+++ b/code/modules/antagonists/revolution/revolution.dm
@@ -142,7 +142,7 @@
to_chat(admin, span_danger("Repairing flash failed!"))
else
flash.burnt_out = FALSE
- flash.update_icon()
+ flash.update_appearance(UPDATE_ICON)
/datum/antagonist/rev/head/proc/admin_demote(datum/mind/target,mob/user)
message_admins("[key_name_admin(user)] has demoted [key_name_admin(owner)] from head revolutionary.")
diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm
index 5493f5eefb60..367412be4cdd 100644
--- a/code/modules/antagonists/slaughter/slaughter.dm
+++ b/code/modules/antagonists/slaughter/slaughter.dm
@@ -75,8 +75,9 @@
icon = 'icons/obj/surgery.dmi'
icon_state = "demon_heart-on"
-/obj/item/organ/heart/demon/update_icon()
- return //always beating visually
+/obj/item/organ/heart/demon/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/organ/heart/demon/attack(mob/M, mob/living/carbon/user, obj/target)
if(M != user)
diff --git a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm
index abea49d42908..d9b6d332bd86 100644
--- a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm
+++ b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm
@@ -654,7 +654,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/AI_Module))
if(!is_station_level(F.z))
continue
F.obj_flags |= EMAGGED
- F.update_icon()
+ F.update_appearance(UPDATE_ICON)
to_chat(owner, span_notice("All thermal sensors on the station have been disabled. Fire alerts will no longer be recognized."))
owner.playsound_local(owner, 'sound/machines/terminal_off.ogg', 50, 0)
diff --git a/code/modules/antagonists/zombie/abilities/spit.dm b/code/modules/antagonists/zombie/abilities/spit.dm
index 809bf1767c5b..51a49364c0b8 100644
--- a/code/modules/antagonists/zombie/abilities/spit.dm
+++ b/code/modules/antagonists/zombie/abilities/spit.dm
@@ -12,7 +12,8 @@
else
add_ranged_ability(user, span_notice("You open your neurotoxin reserves.
Left-click to fire at a target!"), TRUE)
-/obj/effect/proc_holder/zombie/spit/update_icon()
+/obj/effect/proc_holder/zombie/spit/update_icon(updates=ALL)
+ . = ..()
action.button_icon_state = "alien_neurotoxin_[active]"
action.build_all_button_icons()
diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm
index 2e2cbf8168ff..72577bfb542b 100644
--- a/code/modules/assembly/assembly.dm
+++ b/code/modules/assembly/assembly.dm
@@ -11,7 +11,7 @@
throw_range = 7
var/is_position_sensitive = FALSE //set to true if the device has different icons for each position.
- //This will prevent things such as visible lasers from facing the incorrect direction when transformed by assembly_holder's update_icon()
+ //This will prevent things such as visible lasers from facing the incorrect direction when transformed by assembly_holder's update_appearance(UPDATE_ICON)
var/secured = TRUE
var/list/attached_overlays = null
var/obj/item/assembly_holder/holder = null
@@ -82,7 +82,7 @@
/obj/item/assembly/proc/toggle_secure()
secured = !secured
- update_icon()
+ update_appearance(UPDATE_ICON)
return secured
diff --git a/code/modules/assembly/doorcontrol.dm b/code/modules/assembly/doorcontrol.dm
index 8eff567fcb1a..22399760526a 100644
--- a/code/modules/assembly/doorcontrol.dm
+++ b/code/modules/assembly/doorcontrol.dm
@@ -65,7 +65,7 @@
if(specialfunctions & BOLTS)
if(!D.wires.is_cut(WIRE_BOLTS) && D.hasPower())
D.locked = !D.locked
- D.update_icon()
+ D.update_appearance(UPDATE_ICON)
if(specialfunctions & SHOCK)
if(D.secondsElectrified)
D.set_electrified(MACHINE_ELECTRIFIED_PERMANENT, usr)
diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm
index 1fae39be6571..045045811f27 100644
--- a/code/modules/assembly/flash.dm
+++ b/code/modules/assembly/flash.dm
@@ -15,6 +15,8 @@
light_power = FLASH_LIGHT_POWER
light_on = FALSE
fryable = TRUE
+ /// Whether we currently have the flashing overlay.
+ var/flashing = FALSE
///flicked when we flash
var/flashing_overlay = "flash-f"
///Number of times the flash has been used.
@@ -45,19 +47,25 @@
attack(user,user)
return FIRELOSS
-/obj/item/assembly/flash/update_icon(flash = FALSE)
- cut_overlays()
- attached_overlays = list()
+/obj/item/assembly/flash/update_icon(updates=ALL, flash = FALSE)
+ flashing = flash
+ . = ..()
if(burnt_out)
- add_overlay("flashburnt")
- attached_overlays += "flashburnt"
item_state = "flashburnt"
if(flash)
- add_overlay(flashing_overlay)
- attached_overlays += flashing_overlay
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom/, update_icon)), 5)
if(holder)
- holder.update_icon()
+ holder.update_icon(updates)
+
+/obj/item/assembly/flash/update_overlays()
+ . = ..()
+ attached_overlays = list()
+ if(burnt_out)
+ . += "flashburnt"
+ attached_overlays += "flashburnt"
+ if(flashing)
+ . += flashing_overlay
+ attached_overlays += flashing_overlay
/obj/item/assembly/flash/proc/clown_check(mob/living/carbon/human/user)
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
@@ -68,7 +76,7 @@
/obj/item/assembly/flash/proc/burn_out() //Made so you can override it if you want to have an invincible flash from R&D or something.
if(!burnt_out)
burnt_out = TRUE
- update_icon()
+ update_icon(ALL, FALSE)
if(ismob(loc))
var/mob/M = loc
M.visible_message(span_danger("[src] burns out!"),span_userdanger("[src] burns out!"))
@@ -120,7 +128,7 @@
addtimer(CALLBACK(src, PROC_REF(flash_end)), FLASH_LIGHT_DURATION, TIMER_OVERRIDE|TIMER_UNIQUE)
times_used++
flash_recharge()
- update_icon(TRUE)
+ update_icon(ALL, flash = TRUE)
if(user && !clown_check(user))
return FALSE
return TRUE
@@ -173,7 +181,7 @@
var/mob/living/silicon/robot/R = M
if(!R.sensor_protection)
log_combat(user, R, "flashed", src)
- update_icon(1)
+ update_icon(ALL, flash = TRUE)
R.Paralyze(rand(80,120))
R.set_confusion_if_lower(5 SECONDS * CONFUSION_STACK_MAX_MULTIPLIER)
R.flash_act(affect_silicon = 1)
@@ -294,7 +302,7 @@
addtimer(CALLBACK(src, PROC_REF(flash_end)), FLASH_LIGHT_DURATION, TIMER_OVERRIDE|TIMER_UNIQUE)
addtimer(CALLBACK(src, PROC_REF(cooldown)), flashcd)
playsound(src, 'sound/weapons/flash.ogg', 100, TRUE)
- update_icon(1)
+ update_icon(ALL, flash = TRUE)
return TRUE
diff --git a/code/modules/assembly/health.dm b/code/modules/assembly/health.dm
index 69f90681a7ca..4e02aa6ec716 100644
--- a/code/modules/assembly/health.dm
+++ b/code/modules/assembly/health.dm
@@ -27,7 +27,7 @@
else
scanning = FALSE
STOP_PROCESSING(SSobj, src)
- update_icon()
+ update_appearance(UPDATE_ICON)
return secured
/obj/item/assembly/health/AltClick(mob/living/user)
diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm
index 3c983852d139..834443155c56 100644
--- a/code/modules/assembly/holder.dm
+++ b/code/modules/assembly/holder.dm
@@ -23,7 +23,7 @@
attach(A,user)
attach(A2,user)
name = "[A.name]-[A2.name] assembly"
- update_icon()
+ update_appearance(UPDATE_ICON)
SSblackbox.record_feedback("tally", "assembly_made", 1, "[initial(A.name)]-[initial(A2.name)]")
/obj/item/assembly_holder/proc/attach(obj/item/assembly/A, mob/user)
@@ -40,31 +40,31 @@
a_right = A
A.holder_movement()
-/obj/item/assembly_holder/update_icon()
- cut_overlays()
+/obj/item/assembly_holder/update_overlays()
+ . = ..()
if(a_left)
- add_overlay("[a_left.icon_state]_left")
+ . += "[a_left.icon_state]_left"
for(var/O in a_left.attached_overlays)
// yogs start - signaller colors
if(istext(O))
- add_overlay("[O]_l")
+ . += "[O]_l"
else
var/mutable_appearance/A = new(O)
A.icon_state = "[A.icon_state]_l"
- add_overlay(A)
+ . += A
// yogs end
if(a_right)
if(a_right.is_position_sensitive)
- add_overlay("[a_right.icon_state]_right")
+ . += "[a_right.icon_state]_right"
for(var/O in a_right.attached_overlays)
// yogs start - signaller colors
if(istext(O))
- add_overlay("[O]_r")
+ . += "[O]_r"
else
var/mutable_appearance/A = new(O)
A.icon_state = "[A.icon_state]_r"
- add_overlay(A)
+ . += A
// yogs end
else
var/mutable_appearance/right = mutable_appearance(icon, "[a_right.icon_state]_left")
@@ -78,10 +78,10 @@
A.icon_state = "[A.icon_state]_l"
right.add_overlay(A)
// yogs end
- add_overlay(right)
+ . += right
if(master)
- master.update_icon()
+ master.update_appearance(UPDATE_ICON)
/obj/item/assembly_holder/Crossed(atom/movable/AM as mob|obj)
. = ..()
diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm
index 82c6fd03c3e5..77ce1dd11cc8 100644
--- a/code/modules/assembly/infrared.dm
+++ b/code/modules/assembly/infrared.dm
@@ -36,7 +36,7 @@
return FALSE //Cooldown check
on = !on
refreshBeam()
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/item/assembly/infra/toggle_secure()
@@ -47,23 +47,24 @@
else
QDEL_LIST(beams)
STOP_PROCESSING(SSobj, src)
- update_icon()
+ update_appearance(UPDATE_ICON)
return secured
-/obj/item/assembly/infra/update_icon()
- cut_overlays()
+/obj/item/assembly/infra/update_icon(updates=ALL)
+ . = ..()
+ if(holder)
+ holder.update_icon(updates)
+
+/obj/item/assembly/infra/update_overlays()
+ . = ..()
attached_overlays = list()
if(on)
- add_overlay("infrared_on")
+ . += "infrared_on"
attached_overlays += "infrared_on"
if(visible && secured)
- add_overlay("infrared_visible")
+ . += "infrared_visible"
attached_overlays += "infrared_visible"
- if(holder)
- holder.update_icon()
- return
-
/obj/item/assembly/infra/dropped()
. = ..()
if(holder)
@@ -204,7 +205,7 @@
visible = !visible
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
refreshBeam()
/***************************IBeam*********************************/
diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm
index 6266ccaf3595..cd2eb6972683 100644
--- a/code/modules/assembly/mousetrap.dm
+++ b/code/modules/assembly/mousetrap.dm
@@ -22,16 +22,20 @@
if((HAS_TRAIT(user, TRAIT_DUMB) || HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
to_chat(user, span_warning("Your hand slips, setting off the trigger!"))
pulse(FALSE)
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(src, 'sound/weapons/handcuffs.ogg', 30, TRUE, -3)
-/obj/item/assembly/mousetrap/update_icon()
+/obj/item/assembly/mousetrap/update_icon(updates=ALL)
+ . = ..()
+ if(holder)
+ holder.update_icon(updates)
+
+/obj/item/assembly/mousetrap/update_icon_state()
+ . = ..()
if(armed)
icon_state = "mousetraparmed"
else
icon_state = "mousetrap"
- if(holder)
- holder.update_icon()
/obj/item/assembly/mousetrap/proc/triggered(mob/target, type = "feet")
if(!armed)
@@ -42,7 +46,7 @@
if(HAS_TRAIT(H, TRAIT_PIERCEIMMUNE))
playsound(src, 'sound/effects/snap.ogg', 50, TRUE)
armed = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
pulse(FALSE)
return FALSE
switch(type)
@@ -69,7 +73,7 @@
M.splat()
playsound(src, 'sound/effects/snap.ogg', 50, TRUE)
armed = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
pulse(FALSE)
@@ -87,7 +91,7 @@
return
to_chat(user, span_notice("You disarm [src]."))
armed = !armed
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(src, 'sound/weapons/handcuffs.ogg', 30, TRUE, -3)
diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm
index ae7b26bef1da..99210ec08aee 100644
--- a/code/modules/assembly/proximity.dm
+++ b/code/modules/assembly/proximity.dm
@@ -29,7 +29,7 @@
timing = !timing
else
scanning = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/item/assembly/prox_sensor/on_detach()
@@ -50,7 +50,7 @@
else
START_PROCESSING(SSobj, src)
proximity_monitor.SetHost(loc,src)
- update_icon()
+ update_appearance(UPDATE_ICON)
return secured
/obj/item/assembly/prox_sensor/HasProximity(atom/movable/AM as mob|obj)
@@ -84,7 +84,7 @@
return FALSE
scanning = scan
proximity_monitor.SetRange(scanning ? sensitivity : 0)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/assembly/prox_sensor/proc/sensitivity_change(value)
var/sense = min(max(sensitivity + value, 0), 5)
@@ -92,18 +92,20 @@
if(scanning && proximity_monitor.SetRange(sense))
sense()
-/obj/item/assembly/prox_sensor/update_icon()
- cut_overlays()
+/obj/item/assembly/prox_sensor/update_icon(updates=ALL)
+ . = ..()
+ if(holder)
+ holder.update_icon(updates)
+
+/obj/item/assembly/prox_sensor/update_overlays()
+ . = ..()
attached_overlays = list()
if(timing)
- add_overlay("prox_timing")
+ . += "prox_timing"
attached_overlays += "prox_timing"
if(scanning)
- add_overlay("prox_scanning")
+ . += "prox_scanning"
attached_overlays += "prox_scanning"
- if(holder)
- holder.update_icon()
- return
/obj/item/assembly/prox_sensor/ui_status(mob/user)
if(is_secured(user))
@@ -140,7 +142,7 @@
. = TRUE
if("time")
timing = !timing
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("input")
var/value = text2num(params["adjust"])
diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm
index e73bcd810fcd..cab02fe48b7c 100644
--- a/code/modules/assembly/signaler.dm
+++ b/code/modules/assembly/signaler.dm
@@ -32,7 +32,7 @@
/obj/item/assembly/signaler/Initialize(mapload)
. = ..()
set_frequency(frequency)
-
+ update_appearance(UPDATE_ICON)
/obj/item/assembly/signaler/Destroy()
SSradio.remove_object(src,frequency)
@@ -44,10 +44,10 @@
signal()
return TRUE
-/obj/item/assembly/signaler/update_icon()
+/obj/item/assembly/signaler/update_icon(updates=ALL)
+ . = ..()
if(holder)
- holder.update_icon()
- return
+ holder.update_icon(updates)
/obj/item/assembly/signaler/ui_status(mob/user)
if(is_secured(user))
@@ -104,9 +104,9 @@
else
idx++
label_color = label_colors[idx]
- update_icon()
+ update_appearance(UPDATE_ICON)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/assembly/signaler/attackby(obj/item/W, mob/user, params)
if(issignaler(W))
@@ -116,7 +116,7 @@
set_frequency(signaler2.frequency)
// yogs start - signaller colors
label_color = signaler2.label_color
- update_icon()
+ update_appearance(UPDATE_ICON)
// yogs end
to_chat(user, "You transfer the frequency and code of \the [signaler2.name] to \the [name]")
..()
diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm
index 0861f88d4eb9..5a81ad77623f 100644
--- a/code/modules/assembly/timer.dm
+++ b/code/modules/assembly/timer.dm
@@ -37,7 +37,7 @@
if(!..())
return FALSE//Cooldown check
timing = !timing
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
@@ -48,7 +48,7 @@
else
timing = FALSE
STOP_PROCESSING(SSobj, src)
- update_icon()
+ update_appearance(UPDATE_ICON)
return secured
@@ -63,7 +63,7 @@
LM.playsound_local(get_turf(src), 'sound/machines/triple_beep.ogg', ASSEMBLY_BEEP_VOLUME, TRUE)
if(loop)
timing = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/assembly/timer/process(delta_time)
@@ -75,15 +75,17 @@
timer_end()
time = saved_time
+/obj/item/assembly/timer/update_icon(updates=ALL)
+ . = ..()
+ if(holder)
+ holder.update_icon(updates)
-/obj/item/assembly/timer/update_icon()
- cut_overlays()
+/obj/item/assembly/timer/update_overlays()
+ . = ..()
attached_overlays = list()
if(timing)
- add_overlay("timer_timing")
+ . += "timer_timing"
attached_overlays += "timer_timing"
- if(holder)
- holder.update_icon()
/obj/item/assembly/timer/ui_status(mob/user)
if(is_secured(user))
@@ -115,7 +117,7 @@
timing = !timing
if(timing && istype(holder, /obj/item/transfer_valve))
log_bomber(usr, "activated a", src, "attachment on [holder]")
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("repeat")
loop = !loop
diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm
index 985ed07f7d91..991907fbd814 100644
--- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm
+++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm
@@ -49,7 +49,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
reaction_results = new
/datum/gas_mixture/vv_edit_var(var_name, var_value)
- if(var_name == "_extools_pointer_gasmixture")
+ if(var_name == NAMEOF(src, _extools_pointer_gasmixture))
return FALSE // please no. segfaults bad.
return ..()
/*
diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm
index 048ea17f5407..bb8793b623d6 100644
--- a/code/modules/atmospherics/machinery/airalarm.dm
+++ b/code/modules/atmospherics/machinery/airalarm.dm
@@ -237,7 +237,7 @@
if(name == initial(name))
name = "[get_area_name(src)] Air Alarm"
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/airalarm/Destroy()
SSradio.remove_object(src, frequency)
@@ -459,7 +459,7 @@
if(A.atmosalert(0, src))
post_alert(0)
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/airalarm/proc/reset(wire)
@@ -467,7 +467,7 @@
if(WIRE_POWER)
if(!wires.is_cut(WIRE_POWER))
shorted = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
if(WIRE_AI)
if(!wires.is_cut(WIRE_AI))
aidisabled = FALSE
@@ -631,7 +631,8 @@
"set_internal_pressure" = 0
), signal_source)
-/obj/machinery/airalarm/update_icon()
+/obj/machinery/airalarm/update_icon_state()
+ . = ..()
if(panel_open)
switch(buildstage)
if(2)
@@ -725,7 +726,7 @@
if(A.atmosalert(new_area_danger_level,src)) //if area was in normal state or if area was in alert state
post_alert(new_area_danger_level)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/airalarm/attackby(obj/item/W, mob/user, params)
switch(buildstage)
@@ -735,13 +736,13 @@
to_chat(user, span_notice("You cut the final wires."))
new /obj/item/stack/cable_coil(loc, 5)
buildstage = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else if(W.tool_behaviour == TOOL_SCREWDRIVER) // Opening that Air Alarm up.
W.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, span_notice("The wires have been [panel_open ? "exposed" : "unexposed"]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else if(W.GetID())// trying to unlock the interface with an ID card
togglelock(user)
@@ -760,7 +761,7 @@
new /obj/item/electronics/airalarm( src.loc )
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
buildstage = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(istype(W, /obj/item/stack/cable_coil))
@@ -781,14 +782,14 @@
shorted = 0
post_alert(0)
buildstage = 2
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(0)
if(istype(W, /obj/item/electronics/airalarm))
if(user.temporarilyRemoveItemFromInventory(W))
to_chat(user, span_notice("You insert the circuit."))
buildstage = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
qdel(W)
return
@@ -799,7 +800,7 @@
user.visible_message(span_notice("[user] fabricates a circuit and places it into [src]."), \
span_notice("You adapt an air alarm circuit and slot it into the assembly."))
buildstage = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(W.tool_behaviour == TOOL_WRENCH)
@@ -829,7 +830,7 @@
user.visible_message(span_notice("[user] fabricates a circuit and places it into [src]."), \
span_notice("You adapt an air alarm circuit and slot it into the assembly."))
buildstage = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
return FALSE
diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm
index ce6d38b8a42d..0bc46b3f7045 100644
--- a/code/modules/atmospherics/machinery/atmosmachinery.dm
+++ b/code/modules/atmospherics/machinery/atmosmachinery.dm
@@ -117,15 +117,15 @@ GLOBAL_LIST_EMPTY(pipeimages)
if(can_be_node(target, i))
nodes[i] = target
break
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/proc/setPipingLayer(new_layer)
piping_layer = (pipe_flags & PIPING_DEFAULT_LAYER_ONLY) ? PIPING_LAYER_DEFAULT : new_layer
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/atmospherics/update_icon()
+/obj/machinery/atmospherics/update_icon(updates=ALL)
+ . = ..()
layer = initial(layer) + piping_layer / 1000
- return ..()
/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target, iteration)
return connection_check(target, piping_layer)
@@ -175,7 +175,7 @@ GLOBAL_LIST_EMPTY(pipeimages)
var/obj/machinery/atmospherics/pipe/P = reference
P.destroy_network()
nodes[nodes.Find(reference)] = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pipe)) //lets you autodrop
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm b/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm
index 861f457062fd..5e1428559345 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm
@@ -14,7 +14,7 @@
initialize_directions = EAST|WEST
/obj/machinery/atmospherics/components/binary/hide(intact)
- update_icon()
+ update_appearance(UPDATE_ICON)
..()
/obj/machinery/atmospherics/components/binary/getNodeConnects()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm
index e4510f592166..9c9a7203f343 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm
@@ -36,7 +36,7 @@
/obj/machinery/atmospherics/components/binary/circulator/Initialize(mapload)
. = ..()
component_parts = list(new /obj/item/circuitboard/machine/circulator)
- update_icon()
+ update_appearance(UPDATE_ICON)
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS )
/obj/machinery/atmospherics/components/binary/circulator/Destroy()
@@ -79,8 +79,8 @@
..()
update_icon_nopipes()
-/obj/machinery/atmospherics/components/binary/circulator/update_icon()
- cut_overlays()
+/obj/machinery/atmospherics/components/binary/circulator/update_overlays()
+ . = ..()
if(anchored)
for(var/direction in GLOB.cardinals)
@@ -92,9 +92,7 @@
if(node)
cap = getpipeimage(icon, "cap", direction, node.pipe_color, piping_layer = piping_layer)
- add_overlay(cap)
-
- return ..()
+ . += cap
/obj/machinery/atmospherics/components/binary/circulator/update_icon_nopipes()
cut_overlays()
@@ -185,7 +183,7 @@
node2.addMember(src)
SSair.add_to_rebuild_queue(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
@@ -254,7 +252,7 @@
generator.cold_circ = null
else
generator.hot_circ = null
- generator.update_icon()
+ generator.update_appearance(UPDATE_ICON)
generator = null
/obj/machinery/atmospherics/components/binary/circulator/setPipingLayer(new_layer)
@@ -278,5 +276,5 @@
/obj/machinery/atmospherics/components/binary/circulator/obj_break(damage_flag)
if(generator)
generator.kill_circs()
- generator.update_icon()
+ generator.update_appearance(UPDATE_ICON)
..()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm
index 9181b33d5709..607797d55d5a 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm
@@ -175,7 +175,7 @@
return //do not update_icon
spawn(2)
broadcast_status()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/dp_vent_pump/high_volume
name = "large dual-port air vent"
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
index cc951ab2977e..01ec68fa1c20 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
@@ -33,7 +33,7 @@ Passive gate is similar to the regular pump except:
var/msg = "was turned [on ? "on" : "off"] by [key_name(user)]"
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/passive_gate/AltClick(mob/user)
@@ -43,7 +43,7 @@ Passive gate is similar to the regular pump except:
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
balloon_alert(user, "pressure output set to [target_pressure] kPa")
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
@@ -148,7 +148,7 @@ Passive gate is similar to the regular pump except:
var/msg = "was set to [target_pressure] kPa by [key_name(usr)]"
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/passive_gate/atmosinit()
..()
@@ -179,7 +179,7 @@ Passive gate is similar to the regular pump except:
return
broadcast_status()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/passive_gate/can_unwrench(mob/user)
. = ..()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm
index 92a3873e6980..7d3c7949b7d7 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm
@@ -24,7 +24,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/pressure_valve/AltClick(mob/user)
@@ -32,7 +32,7 @@
target_pressure = MAX_OUTPUT_PRESSURE
investigate_log("was set to [target_pressure] kPa by [key_name(user)]", INVESTIGATE_ATMOS)
balloon_alert(user, "pressure output set to [target_pressure] kPa")
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/pressure_valve/Destroy()
@@ -117,7 +117,7 @@
if(.)
target_pressure = clamp(pressure, 0, ONE_ATMOSPHERE*100)
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/pressure_valve/atmosinit()
. = ..()
@@ -147,7 +147,7 @@
return
broadcast_status()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/pressure_valve/can_unwrench(mob/user)
. = ..()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
index ef25ea72f46e..76f2b98782d7 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
@@ -30,7 +30,7 @@
/obj/machinery/atmospherics/components/binary/pump/CtrlClick(mob/user)
if(can_interact(user))
on = !on
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/pump/AltClick(mob/user)
@@ -40,7 +40,7 @@
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - makes supermatter invest useful
balloon_alert(user, "pressure output set to [target_pressure] kPa")
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/pump/Destroy()
@@ -137,7 +137,7 @@
var/msg = "was set to [target_pressure] kPa by [key_name(usr)]"
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - makes supermatter invest useful
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/pump/atmosinit()
..()
@@ -168,7 +168,7 @@
return
broadcast_status()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/pump/can_unwrench(mob/user)
. = ..()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/temperature_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/temperature_gate.dm
index 88ccb2a6adc0..72b17e5a29c6 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/temperature_gate.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/temperature_gate.dm
@@ -23,7 +23,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/temperature_gate/AltClick(mob/user)
@@ -31,7 +31,7 @@
target_temperature = max_temperature
investigate_log("was set to [target_temperature] K by [key_name(user)]", INVESTIGATE_ATMOS)
balloon_alert(user, "target temperature set to [target_temperature] K")
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
@@ -109,7 +109,7 @@
if(.)
target_temperature = clamp(minimum_temperature, temperature, max_temperature)
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/temperature_gate/can_unwrench(mob/user)
. = ..()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm
index 579fea954138..3a489e3821af 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm
@@ -18,7 +18,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/temperature_pump/AltClick(mob/user)
@@ -26,7 +26,7 @@
heat_transfer_rate = max_heat_transfer_rate
investigate_log("was set to [heat_transfer_rate]% by [key_name(user)]", INVESTIGATE_ATMOS)
balloon_alert(user, "transfer rate set to [heat_transfer_rate]%")
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/temperature_pump/update_icon_nopipes()
@@ -94,4 +94,4 @@
if(.)
heat_transfer_rate = clamp(rate, 0, max_heat_transfer_rate)
investigate_log("was set to [heat_transfer_rate]% by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
index 04ca2b623e24..9092deda1252 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
@@ -34,7 +34,7 @@
var/msg = "was turned [on ? "on" : "off"] by [key_name(usr)]"
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/volume_pump/AltClick(mob/user)
@@ -44,7 +44,7 @@
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
balloon_alert(user, "volume output set to [transfer_rate] L/s")
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/binary/volume_pump/Destroy()
@@ -158,7 +158,7 @@
var/msg = "was set to [transfer_rate] L/s by [key_name(usr)]"
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/volume_pump/receive_signal(datum/signal/signal)
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
@@ -185,7 +185,7 @@
return //do not update_icon
broadcast_status()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/binary/volume_pump/can_unwrench(mob/user)
. = ..()
diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm
index edb0f39239ab..2f213ce0464a 100644
--- a/code/modules/atmospherics/machinery/components/components_base.dm
+++ b/code/modules/atmospherics/machinery/components/components_base.dm
@@ -24,7 +24,8 @@
/obj/machinery/atmospherics/components/proc/update_icon_nopipes()
return
-/obj/machinery/atmospherics/components/update_icon()
+/obj/machinery/atmospherics/components/update_icon(updates=ALL)
+ . = ..()
update_icon_nopipes()
underlays.Cut()
@@ -32,7 +33,7 @@
plane = showpipe ? GAME_PLANE : FLOOR_PLANE
if(!showpipe)
- return ..()
+ return
var/connected = 0 //Direction bitset
@@ -49,7 +50,6 @@
if(!shift_underlay_only)
PIPING_LAYER_SHIFT(src, piping_layer)
- return ..()
/obj/machinery/atmospherics/components/proc/get_pipe_underlay(state, dir, color = null)
if(color)
diff --git a/code/modules/atmospherics/machinery/components/fusion/hfr_parts.dm b/code/modules/atmospherics/machinery/components/fusion/hfr_parts.dm
index 3c60597ff47e..ce247b40dc3e 100644
--- a/code/modules/atmospherics/machinery/components/fusion/hfr_parts.dm
+++ b/code/modules/atmospherics/machinery/components/fusion/hfr_parts.dm
@@ -52,7 +52,7 @@
if(tool.use_tool(src, user, 10 SECONDS, volume=30, amount=5))
balloon_alert(user, "repaired")
cracked = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
update_overlays()
/obj/machinery/atmospherics/components/unary/hypertorus/default_change_direction_wrench(mob/user, obj/item/I)
@@ -72,7 +72,7 @@
node.addMember(src)
SSair.add_to_rebuild_queue(src)
-/obj/machinery/atmospherics/components/unary/hypertorus/update_icon()
+/obj/machinery/atmospherics/components/unary/hypertorus/update_icon_state()
. = ..()
if(panel_open)
icon_state = icon_state_open
@@ -81,7 +81,8 @@
else
icon_state = icon_state_off
-/obj/machinery/atmospherics/components/unary/hypertorus/proc/update_overlays()
+/obj/machinery/atmospherics/components/unary/hypertorus/update_overlays()
+ . = ..()
if(!cracked)
return
@@ -153,7 +154,8 @@
return
return ..()
-/obj/machinery/hypertorus/update_icon()
+/obj/machinery/hypertorus/update_icon_state()
+ . = ..()
if(panel_open)
icon_state = icon_state_open
else if(active)
diff --git a/code/modules/atmospherics/machinery/components/fusion/hfr_procs.dm b/code/modules/atmospherics/machinery/components/fusion/hfr_procs.dm
index c74e4f4f6f87..70469590ed12 100644
--- a/code/modules/atmospherics/machinery/components/fusion/hfr_procs.dm
+++ b/code/modules/atmospherics/machinery/components/fusion/hfr_procs.dm
@@ -89,22 +89,22 @@
return
to_chat(user, span_notice("You link all parts toghether."))
active = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
linked_interface.active = TRUE
- linked_interface.update_icon()
+ linked_interface.update_appearance(UPDATE_ICON)
RegisterSignal(linked_interface, COMSIG_PARENT_QDELETING, PROC_REF(unregister_signals))
linked_input.active = TRUE
- linked_input.update_icon()
+ linked_input.update_appearance(UPDATE_ICON)
RegisterSignal(linked_input, COMSIG_PARENT_QDELETING, PROC_REF(unregister_signals))
linked_output.active = TRUE
- linked_output.update_icon()
+ linked_output.update_appearance(UPDATE_ICON)
RegisterSignal(linked_output, COMSIG_PARENT_QDELETING, PROC_REF(unregister_signals))
linked_moderator.active = TRUE
- linked_moderator.update_icon()
+ linked_moderator.update_appearance(UPDATE_ICON)
RegisterSignal(linked_moderator, COMSIG_PARENT_QDELETING, PROC_REF(unregister_signals))
for(var/obj/machinery/hypertorus/corner/corner in corners)
corner.active = TRUE
- corner.update_icon()
+ corner.update_appearance(UPDATE_ICON)
RegisterSignal(corner, COMSIG_PARENT_QDELETING, PROC_REF(unregister_signals))
soundloop = new(list(src), TRUE)
soundloop.volume = 5
@@ -138,27 +138,27 @@
if(!active)
return
active = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
if(linked_interface)
linked_interface.active = FALSE
- linked_interface.update_icon()
+ linked_interface.update_appearance(UPDATE_ICON)
linked_interface = null
if(linked_input)
linked_input.active = FALSE
- linked_input.update_icon()
+ linked_input.update_appearance(UPDATE_ICON)
linked_input = null
if(linked_output)
linked_output.active = FALSE
- linked_output.update_icon()
+ linked_output.update_appearance(UPDATE_ICON)
linked_output = null
if(linked_moderator)
linked_moderator.active = FALSE
- linked_moderator.update_icon()
+ linked_moderator.update_appearance(UPDATE_ICON)
linked_moderator = null
if(corners.len)
for(var/obj/machinery/hypertorus/corner/corner in corners)
corner.active = FALSE
- corner.update_icon()
+ corner.update_appearance(UPDATE_ICON)
corners = list()
QDEL_NULL(soundloop)
@@ -592,7 +592,7 @@
/obj/machinery/atmospherics/components/unary/hypertorus/core/proc/create_crack()
var/obj/machinery/atmospherics/components/unary/hypertorus/part = pick(machine_parts)
part.cracked = TRUE
- part.update_icon()
+ part.update_appearance(UPDATE_ICON)
part.update_overlays()
return part
diff --git a/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm b/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm
index ec56fa1788a7..6c50495de769 100644
--- a/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm
+++ b/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm
@@ -15,7 +15,7 @@
circuit = /obj/item/circuitboard/machine/crystallizer
pipe_flags = PIPING_ONE_PER_TURF| PIPING_DEFAULT_LAYER_ONLY
- ///Base icon state for the machine to be used in update_icon()
+ ///Base icon state for the machine to be used in update_appearance(UPDATE_ICON)
var/base_icon = "crystallizer"
///Internal Gas mix used for processing the gases that have been put in
var/datum/gas_mixture/internal
@@ -79,12 +79,14 @@
SSair.add_to_rebuild_queue(src)
return TRUE
-/obj/machinery/atmospherics/components/binary/crystallizer/proc/update_overlays()
+/obj/machinery/atmospherics/components/binary/crystallizer/update_overlays()
+ . = ..()
cut_overlays()
- add_overlay(getpipeimage(icon, "pipe", dir, COLOR_LIME, piping_layer))
- add_overlay(getpipeimage(icon, "pipe", turn(dir, 180), COLOR_RED, piping_layer))
+ . += getpipeimage(icon, "pipe", dir, COLOR_LIME, piping_layer)
+ . += getpipeimage(icon, "pipe", turn(dir, 180), COLOR_RED, piping_layer)
-/obj/machinery/atmospherics/components/binary/crystallizer/proc/update_icon_state()
+/obj/machinery/atmospherics/components/binary/crystallizer/update_icon_state()
+ . = ..()
if(panel_open)
icon_state = "[base_icon]-open"
else if(on)
@@ -92,17 +94,12 @@
else
icon_state = "[base_icon]-off"
-/obj/machinery/atmospherics/components/binary/crystallizer/update_icon()
- . = ..()
- update_icon_state()
- update_overlays()
-
/obj/machinery/atmospherics/components/binary/crystallizer/AltClick(mob/user)
if(!can_interact(user))
return
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
///Checks if the gases in the input are the ones needed by the recipe
/obj/machinery/atmospherics/components/binary/crystallizer/proc/check_gas_requirements()
@@ -341,7 +338,7 @@
var/_gas_input = params["gas_input"]
gas_input = clamp(_gas_input, 0, max_gas_input)
investigate_log("was set to [gas_input] by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
#undef MIN_PROGRESS_AMOUNT
#undef MIN_DEVIATION_RATE
diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
index 4794b303f08e..077d38c368b5 100644
--- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
+++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
@@ -21,7 +21,7 @@
var/msg = "was turned [on ? "on" : "off"] by [key_name(usr)]"
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/trinary/filter/AltClick(mob/user)
@@ -31,7 +31,7 @@
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
balloon_alert(user, "volume output set to [transfer_rate] L/s")
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/trinary/filter/proc/set_frequency(new_frequency)
@@ -44,8 +44,8 @@
SSradio.remove_object(src,frequency)
return ..()
-/obj/machinery/atmospherics/components/trinary/filter/update_icon()
- cut_overlays()
+/obj/machinery/atmospherics/components/trinary/filter/update_overlays()
+ . = ..()
for(var/direction in GLOB.cardinals)
if(!(direction & initialize_directions))
continue
@@ -57,9 +57,7 @@
else
cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer, trinary = TRUE)
- add_overlay(cap)
-
- return ..()
+ . += cap
/obj/machinery/atmospherics/components/trinary/filter/update_icon_nopipes()
var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational()
@@ -194,7 +192,7 @@
investigate_log(msg, INVESTIGATE_ATMOS)
investigate_log(msg, INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/trinary/filter/can_unwrench(mob/user)
. = ..()
diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
index e1b4960217e9..8863b9431f49 100644
--- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
+++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
@@ -20,7 +20,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/trinary/mixer/AltClick(mob/user)
@@ -28,11 +28,11 @@
target_pressure = MAX_OUTPUT_PRESSURE
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
balloon_alert(user, "pressure output on set to [target_pressure] kPa")
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
-/obj/machinery/atmospherics/components/trinary/mixer/update_icon()
- cut_overlays()
+/obj/machinery/atmospherics/components/trinary/mixer/update_overlays()
+ . = ..()
for(var/direction in GLOB.cardinals)
if(!(direction & initialize_directions))
continue
@@ -44,9 +44,7 @@
else
cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer, trinary = TRUE)
- add_overlay(cap)
-
- return ..()
+ . += cap
/obj/machinery/atmospherics/components/trinary/mixer/update_icon_nopipes()
var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational()
@@ -173,7 +171,7 @@
adjust_node1_value(100 - value)
investigate_log("was set to [node2_concentration] % on node 2 by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/trinary/mixer/proc/adjust_node1_value(newValue)
node1_concentration = newValue / 100
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
index 19a3c017abca..6a83acd81b7c 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
@@ -1,5 +1,47 @@
-#define CRYOMOBS 'icons/obj/cryo_mobs.dmi'
+///Max temperature allowed inside the cryotube, should break before reaching this heat
+#define MAX_TEMPERATURE 4000
+/// This is a visual helper that shows the occupant inside the cryo cell.
+/atom/movable/visual/cryo_occupant
+ icon = 'icons/obj/cryogenics.dmi'
+ // Must be tall, otherwise the filter will consider this as a 32x32 tile
+ // and will crop the head off.
+ icon_state = "mask_bg"
+ layer = ABOVE_WINDOW_LAYER + 0.01
+ mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+ pixel_y = 22
+ appearance_flags = KEEP_TOGETHER
+
+/atom/movable/visual/cryo_occupant/Initialize(mapload)
+ . = ..()
+ // Alpha masking
+ // It will follow this as the animation goes, but that's no problem as the "mask" icon state
+ // already accounts for this.
+ add_filter("alpha_mask", 1, list("type" = "alpha", "icon" = icon('icons/obj/cryogenics.dmi', "mask"), "y" = -22))
+
+/atom/movable/visual/cryo_occupant/proc/on_occupant_enter(mob/living/occupant)
+ occupant.setDir(SOUTH)
+ vis_contents += occupant
+ pixel_y = 22
+ ADD_TRAIT(occupant, TRAIT_IMMOBILIZED, CRYO_TRAIT)
+ ADD_TRAIT(occupant, TRAIT_FORCED_STANDING, CRYO_TRAIT)
+ occupant.set_resting(FALSE, silent = TRUE)
+
+/atom/movable/visual/cryo_occupant/proc/on_occupant_exit(mob/living/occupant)
+ vis_contents -= occupant
+ REMOVE_TRAIT(occupant, TRAIT_IMMOBILIZED, CRYO_TRAIT)
+ REMOVE_TRAIT(occupant, TRAIT_FORCED_STANDING, CRYO_TRAIT)
+ if(occupant.resting || HAS_TRAIT(occupant, TRAIT_FLOORED))
+ occupant.set_resting(TRUE, silent = TRUE)
+
+/atom/movable/visual/cryo_occupant/proc/on_toggle_on()
+ animate(src, pixel_y = 24, time = 20, loop = -1)
+ animate(pixel_y = 22, time = 20)
+
+/atom/movable/visual/cryo_occupant/proc/on_toggle_off()
+ animate(src)
+
+/// Cryo cell
/obj/machinery/atmospherics/components/unary/cryo_cell
name = "cryo cell"
icon = 'icons/obj/cryogenics.dmi'
@@ -13,6 +55,8 @@
pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY
occupant_typecache = list(/mob/living/carbon, /mob/living/simple_animal)
+ showpipe = FALSE
+
var/autoeject = TRUE
var/volume = 100
@@ -29,7 +73,8 @@
var/radio_key = /obj/item/encryptionkey/headset_med
var/radio_channel = RADIO_CHANNEL_MEDICAL
- var/running_anim = FALSE
+ /// Visual content - Occupant
+ var/atom/movable/visual/cryo_occupant/occupant_vis
var/escape_in_progress = FALSE
var/message_cooldown
@@ -43,6 +88,8 @@
/obj/machinery/atmospherics/components/unary/cryo_cell/Initialize(mapload)
. = ..()
initialize_directions = dir
+ if(is_operational())
+ begin_processing()
radio = new(src)
radio.keyslot = new radio_key
@@ -50,11 +97,15 @@
radio.canhear_range = 0
radio.recalculateChannels()
+ occupant_vis = new(null)
+ vis_contents += occupant_vis
+
/obj/machinery/atmospherics/components/unary/cryo_cell/Exited(atom/movable/AM, atom/newloc)
- var/oldoccupant = occupant
+ var/mob/living/oldoccupant = occupant
. = ..() // Parent proc takes care of removing occupant if necessary
- if (AM == oldoccupant)
- update_icon()
+ if (oldoccupant && istype(oldoccupant) && AM == oldoccupant)
+ occupant_vis.on_occupant_exit(oldoccupant)
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/unary/cryo_cell/on_construction()
..(dir, dir)
@@ -73,11 +124,24 @@
/obj/machinery/atmospherics/components/unary/cryo_cell/examine(mob/user) //this is leaving out everything but efficiency since they follow the same idea of "better beaker, better results"
. = ..()
if(in_range(user, src) || isobserver(user))
- . += "
The status display reads: Efficiency at [efficiency*100]%."
+ . += "The status display reads: Efficiency at [efficiency*100]%."
/obj/machinery/atmospherics/components/unary/cryo_cell/Destroy()
+ vis_contents.Cut()
+
+ QDEL_NULL(occupant_vis)
QDEL_NULL(radio)
QDEL_NULL(beaker)
+ ///Take the turf the cryotube is on
+ var/turf/T = get_turf(src)
+ if(T)
+ ///Take the air composition of the turf
+ var/datum/gas_mixture/env = T.return_air()
+ ///Take the air composition inside the cryotube
+ var/datum/gas_mixture/air1 = airs[1]
+ env.merge(air1)
+ T.air_update_turf()
+
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/contents_explosion(severity, target)
@@ -102,109 +166,60 @@
beaker.forceMove(drop_location())
beaker = null
-/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon()
- cut_overlays()
+/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon(updates=ALL)
+ . = ..()
+ plane = initial(plane)
- if(panel_open)
- add_overlay("pod-panel")
+/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon_state()
+ . = ..()
+ icon_state = (state_open) ? "pod-open" : (on && is_operational()) ? "pod-on" : "pod-off"
+
+GLOBAL_VAR_INIT(cryo_overlay_cover_on, mutable_appearance('icons/obj/cryogenics.dmi', "cover-on", layer = ABOVE_WINDOW_LAYER + 0.02))
+GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics.dmi', "cover-off", layer = ABOVE_WINDOW_LAYER + 0.02))
+/obj/machinery/atmospherics/components/unary/cryo_cell/update_overlays()
+ . = ..()
+ if(panel_open)
+ . += "pod-panel"
if(state_open)
- icon_state = "pod-open"
return
-
- if(occupant)
- var/image/occupant_overlay
-
- if(ismonkey(occupant)) // Monkey
- occupant_overlay = image(CRYOMOBS, "monkey")
- else if(isalienadult(occupant))
- if(isalienroyal(occupant)) // Queen and prae
- occupant_overlay = image(CRYOMOBS, "alienq")
- else if(isalienhunter(occupant)) // Hunter
- occupant_overlay = image(CRYOMOBS, "alienh")
- else if(isaliensentinel(occupant)) // Sentinel
- occupant_overlay = image(CRYOMOBS, "aliens")
- else // Drone or other
- occupant_overlay = image(CRYOMOBS, "aliend")
-
- else if(ishuman(occupant) || islarva(occupant) || (isanimal(occupant) && !ismegafauna(occupant))) // Mobs that are smaller than cryotube
- occupant_overlay = image(occupant.icon, occupant.icon_state)
- occupant_overlay.copy_overlays(occupant)
-
- else
- occupant_overlay = image(CRYOMOBS, "generic")
-
- occupant_overlay.dir = SOUTH
- occupant_overlay.pixel_y = 22
-
- if(on && !running_anim && is_operational())
- icon_state = "pod-on"
- running_anim = TRUE
- run_anim(TRUE, occupant_overlay)
- else
- icon_state = "pod-off"
- add_overlay(occupant_overlay)
- add_overlay("cover-off")
-
- else if(on && is_operational())
- icon_state = "pod-on"
- add_overlay("cover-on")
+ if(on && is_operational())
+ . += GLOB.cryo_overlay_cover_on
else
- icon_state = "pod-off"
- add_overlay("cover-off")
+ . += GLOB.cryo_overlay_cover_off
-/obj/machinery/atmospherics/components/unary/cryo_cell/proc/run_anim(anim_up, image/occupant_overlay)
- if(!on || !occupant || !is_operational())
- running_anim = FALSE
+/obj/machinery/atmospherics/components/unary/cryo_cell/proc/set_on(new_value)
+ if(on == new_value)
return
- cut_overlays()
- if(occupant_overlay.pixel_y != 23) // Same effect as occupant_overlay.pixel_y == 22 || occupant_overlay.pixel_y == 24
- anim_up = occupant_overlay.pixel_y == 22 // Same effect as if(occupant_overlay.pixel_y == 22) anim_up = TRUE ; if(occupant_overlay.pixel_y == 24) anim_up = FALSE
- if(anim_up)
- occupant_overlay.pixel_y++
+ . = on
+ on = new_value
+ if(on)
+ occupant_vis.on_toggle_on()
else
- occupant_overlay.pixel_y--
- add_overlay(occupant_overlay)
- add_overlay("cover-on")
- addtimer(CALLBACK(src, PROC_REF(run_anim), anim_up, occupant_overlay), 7, TIMER_UNIQUE)
+ occupant_vis.on_toggle_off()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/atmospherics/components/unary/cryo_cell/nap_violation(mob/violator)
- open_machine()
/obj/machinery/atmospherics/components/unary/cryo_cell/process(delta_time)
..()
- if(state_open)
- reagent_transfer = 0
- return
if(!on)
return
- if(!is_operational())
- on = FALSE
- update_icon()
- return
if(!occupant)
return
var/mob/living/mob_occupant = occupant
- if(!check_nap_violations())
- return
+ if(mob_occupant.on_fire)
+ mob_occupant.extinguish_mob()
if(mob_occupant.stat == DEAD) // We don't bother with dead people.
return
- /// Individuals with the MEDICALIGNORE trait will stop the cryo from functioning and display a unique warning unless there is clone damage on the body which cryo happens to be able to heal even with MEDICALIGNORE (oversight probably but one of the one ways to heal their clone damage atm). - Hopek
- if(HAS_TRAIT(mob_occupant,TRAIT_MEDICALIGNORE) && !(mob_occupant.getCloneLoss() + mob_occupant.getToxLoss() + mob_occupant.getOxyLoss()))
- src.visible_message(span_warning("[src] is unable to treat [mob_occupant] as they cannot be treated with conventional medicine."))
- playsound(src,'sound/machines/cryo_warning_ignore.ogg',60,1)
- on = FALSE
- sleep(0.2 SECONDS)// here for timing. Shuts off right at climax of the effect before falloff.
- update_icon()
- return
-
- var/robotic_limb_damage = 0 // brute and burn damage to robotic limbs
var/mob/living/carbon/C
if(iscarbon(mob_occupant))
C = mob_occupant
+
+ var/robotic_limb_damage = 0 // brute and burn damage to robotic limbs
+ if(iscarbon(mob_occupant))
for(var/obj/item/bodypart/limb in C.get_damaged_bodyparts(TRUE, TRUE, FALSE, BODYPART_ROBOTIC))
robotic_limb_damage += limb.get_damage(stamina=FALSE)
@@ -222,12 +237,9 @@
treating_wounds = has_cryo_wound
if(!treating_wounds)
- on = FALSE
- update_icon()
+ set_on(FALSE)
playsound(src, 'sound/machines/cryo_warning.ogg', volume) // Bug the doctors.
var/msg = "Patient fully restored."
- if(robotic_limb_damage)
- msg += " Remaining damage is to mechanical limbs."
if(autoeject) // Eject if configured.
msg += " Auto ejecting patient now."
open_machine()
@@ -254,13 +266,10 @@
reagent_transfer += 0.5 * delta_time
if(reagent_transfer >= 10 * efficiency) // Throttle reagent transfer (higher efficiency will transfer the same amount but consume less from the beaker).
reagent_transfer = 0
- if(air1.get_moles(/datum/gas/healium) > 1) //healium check, if theres enough we get some extra healing from our favorite pink gas.
- var/existing = mob_occupant.reagents.get_reagent_amount(/datum/reagent/healium)
- mob_occupant.reagents.add_reagent(/datum/reagent/healium, 1 - existing)
- air1.set_moles(/datum/gas/healium, max(0, air1.get_moles(/datum/gas/healium) - 0.1 / efficiency))
+
return 1
-/obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos()
+/obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos(delta_time)
..()
if(!on)
@@ -269,8 +278,7 @@
var/datum/gas_mixture/air1 = airs[1]
if(!nodes[1] || !airs[1] || (air1.get_moles(/datum/gas/oxygen) < 5 && air1.get_moles(/datum/gas/pluoxium) < 5)) // Turn off if the machine won't work.
- on = FALSE
- update_icon()
+ set_on(FALSE)
return
if(occupant)
@@ -295,40 +303,44 @@
else
air1.set_moles(/datum/gas/oxygen, max(0,air1.get_moles(/datum/gas/oxygen) - 0.5 / efficiency)) // Magically consume gas? Why not, we run on cryo magic.
+ if(air1.return_temperature() > 2000)
+ take_damage(clamp((air1.return_temperature())/200, 10, 20), BURN)
+
/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/user)
if(message_cooldown <= world.time)
message_cooldown = world.time + 50
- to_chat(user, span_warning("[src]'s door won't budge!"))
+ to_chat(user, "[src]'s door won't budge!")
/obj/machinery/atmospherics/components/unary/cryo_cell/open_machine(drop = FALSE)
if(!state_open && !panel_open)
- on = FALSE
- ..()
+ set_on(FALSE)
for(var/mob/M in contents) //only drop mobs
M.forceMove(get_turf(src))
- if(isliving(M))
- var/mob/living/L = M
- L.update_mobility()
occupant = null
- update_icon()
+ flick("pod-open-anim", src)
+ reagent_transfer = efficiency * 10 - 5 // wait before injecting the next occupant
+ ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/close_machine(mob/living/carbon/user)
treating_wounds = FALSE
if((isnull(user) || istype(user)) && state_open && !panel_open)
+ flick("pod-close-anim", src)
..(user)
+ if(isliving(occupant))
+ occupant_vis.on_occupant_enter(occupant)
return occupant
/obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
- user.visible_message(span_notice("You see [user] kicking against the glass of [src]!"), \
- span_notice("You struggle inside [src], kicking the release with your foot... (this will take about [DisplayTimeText(breakout_time)].)"), \
- span_italics("You hear a thump from [src]."))
- if(do_after(user, breakout_time, src))
+ user.visible_message("You see [user] kicking against the glass of [src]!", \
+ "You struggle inside [src], kicking the release with your foot... (this will take about [DisplayTimeText(breakout_time)].)", \
+ "You hear a thump from [src].")
+ if(do_after(user, breakout_time, target = src))
if(!user || user.stat != CONSCIOUS || user.loc != src )
return
- user.visible_message(span_warning("[user] successfully broke out of [src]!"), \
- span_notice("You successfully break out of [src]!"))
+ user.visible_message("[user] successfully broke out of [src]!", \
+ "You successfully break out of [src]!")
open_machine()
/obj/machinery/atmospherics/components/unary/cryo_cell/examine(mob/user)
@@ -349,21 +361,21 @@
if(L.incapacitated())
close_machine(target)
else
- user.visible_message("[user] starts shoving [target] inside [src].", span_notice("You start shoving [target] inside [src]."))
- if (do_after(user, 2.5 SECONDS, target))
+ user.visible_message("[user] starts shoving [target] inside [src].", "You start shoving [target] inside [src].")
+ if (do_after(user, 25, target=target))
close_machine(target)
/obj/machinery/atmospherics/components/unary/cryo_cell/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers/glass))
. = 1 //no afterattack
if(beaker)
- to_chat(user, span_warning("A beaker is already loaded into [src]!"))
+ to_chat(user, "A beaker is already loaded into [src]!")
return
if(!user.transferItemToLoc(I, src))
return
beaker = I
- user.visible_message("[user] places [I] in [src].", \
- span_notice("You place [I] in [src]."))
+ user.visible_message("[user] places [I] in [src].", \
+ "You place [I] in [src].")
var/reagentlist = pretty_string_from_reagent_list(I.reagents.reagent_list)
log_game("[key_name(user)] added an [I] to cryo containing [reagentlist]")
return
@@ -371,17 +383,18 @@
|| default_change_direction_wrench(user, I) \
|| default_pry_open(I) \
|| default_deconstruction_crowbar(I))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
- to_chat(user, "You can't access the maintenance panel while the pod is " \
- + (on ? "active" : (occupant ? "full" : "open")) + ".")
+ to_chat(user, "You can't access the maintenance panel while the pod is " \
+ + (on ? "active" : (occupant ? "full" : "open")) + "!")
return
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_state(mob/user)
return GLOB.notcontained_state
+
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
@@ -439,14 +452,15 @@
return data
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_act(action, params)
- if(..())
+ . = ..()
+ if(.)
return
switch(action)
if("power")
if(on)
- on = FALSE
+ set_on(FALSE)
else if(!state_open)
- on = TRUE
+ set_on(TRUE)
. = TRUE
if("door")
if(state_open)
@@ -462,22 +476,30 @@
beaker.forceMove(drop_location())
if(Adjacent(usr) && !issilicon(usr))
usr.put_in_hands(beaker)
- log_game("[key_name(usr)] removed an [beaker] to cryo containing [beaker.reagents.reagent_list]") // yogs -- Adds logging for when the beaker's removed from cryo
beaker = null
. = TRUE
- update_icon()
+
+/obj/machinery/atmospherics/components/unary/cryo_cell/CtrlClick(mob/user)
+ if(can_interact(user) && !state_open)
+ set_on(!on)
+ return ..()
+
+/obj/machinery/atmospherics/components/unary/cryo_cell/AltClick(mob/user)
+ if(can_interact(user))
+ if(state_open)
+ close_machine()
+ else
+ open_machine()
+ return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/update_remote_sight(mob/living/user)
return // we don't see the pipe network while inside cryo.
-/obj/machinery/atmospherics/components/unary/cryo_cell/get_remote_view_fullscreens(mob/user)
- user.overlay_fullscreen("remote_view", /atom/movable/screen/fullscreen/impaired, 1)
-
/obj/machinery/atmospherics/components/unary/cryo_cell/can_crawl_through()
return // can't ventcrawl in or out of cryo.
/obj/machinery/atmospherics/components/unary/cryo_cell/can_see_pipes()
- return 0 // you can't see the pipe network when inside a cryo cell.
+ return FALSE // you can't see the pipe network when inside a cryo cell.
/obj/machinery/atmospherics/components/unary/cryo_cell/return_temperature()
var/datum/gas_mixture/G = airs[1]
@@ -502,26 +524,4 @@
node.addMember(src)
SSair.add_to_rebuild_queue(src)
-/obj/machinery/atmospherics/components/unary/cryo_cell/CtrlClick(mob/user)
- if(!user.canUseTopic(src, !issilicon(user)))
- return
- if(user == occupant && !issilicon(user))
- return
- if(on)
- on = FALSE
- else if(!state_open)
- on = TRUE
- update_icon()
-
-/obj/machinery/atmospherics/components/unary/cryo_cell/AltClick(mob/user)
- if(!user.canUseTopic(src, !issilicon(user)))
- return
- if(user == occupant && !issilicon(user))
- return
- if(state_open)
- close_machine()
- else
- open_machine()
- update_icon()
-
-#undef CRYOMOBS
+#undef MAX_TEMPERATURE
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/heat_exchanger.dm b/code/modules/atmospherics/machinery/components/unary_devices/heat_exchanger.dm
index 3cfca0993886..1ca74980ddd4 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/heat_exchanger.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/heat_exchanger.dm
@@ -23,7 +23,8 @@
piping_layer = 4
icon_state = "he_map-4"
-/obj/machinery/atmospherics/components/unary/heat_exchanger/update_icon()
+/obj/machinery/atmospherics/components/unary/heat_exchanger/update_icon(updates=ALL)
+ . = ..()
if(nodes[1])
icon_state = "he1"
var/obj/machinery/atmospherics/node = nodes[1]
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
index f48524d90e3e..368e9274af67 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
@@ -28,7 +28,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/unary/outlet_injector/AltClick(mob/user)
@@ -36,7 +36,7 @@
volume_rate = MAX_TRANSFER_RATE
investigate_log("was set to [volume_rate] L/s by [key_name(usr)]", INVESTIGATE_ATMOS)
balloon_alert(user, "volume output set to [volume_rate] L/s")
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/unary/outlet_injector/Destroy()
@@ -145,7 +145,7 @@
spawn(2)
broadcast_status()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/unary/outlet_injector/ui_interact(mob/user, datum/tgui/ui)
@@ -185,7 +185,7 @@
if(.)
volume_rate = clamp(rate, 0, MAX_TRANSFER_RATE)
investigate_log("was set to [volume_rate] L/s by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
broadcast_status()
/obj/machinery/atmospherics/components/unary/outlet_injector/can_unwrench(mob/user)
@@ -199,7 +199,7 @@
return
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
// mapping
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
index 2e6050c9adfa..9a6d2231040b 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
@@ -30,7 +30,7 @@
. = ..()
initialize_directions = dir
RefreshParts()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/unary/thermomachine/proc/swap_function()
cooling = !cooling
@@ -44,7 +44,7 @@
icon_state_open = "heater-o"
target_temperature = T20C
RefreshParts()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/unary/thermomachine/on_construction()
var/obj/item/circuitboard/machine/thermomachine/board = circuit
@@ -71,9 +71,8 @@
calculated_laser_rating += laser.rating
max_temperature = T20C + (base_heating * calculated_laser_rating) //573.15K with T1 stock parts
-/obj/machinery/atmospherics/components/unary/thermomachine/update_icon()
- cut_overlays()
-
+/obj/machinery/atmospherics/components/unary/thermomachine/update_icon_state()
+ . = ..()
if(panel_open)
icon_state = icon_state_open
else if(on && is_operational())
@@ -81,7 +80,9 @@
else
icon_state = icon_state_off
- add_overlay(getpipeimage(icon, "pipe", dir, , piping_layer))
+/obj/machinery/atmospherics/components/unary/thermomachine/update_overlays()
+ . = ..()
+ . += getpipeimage(icon, "pipe", dir, , piping_layer)
/obj/machinery/atmospherics/components/unary/thermomachine/AltClick(mob/living/user)
if(!can_interact(user))
@@ -111,7 +112,7 @@
if(can_interact(user))
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/atmospherics/components/unary/thermomachine/process_atmos()
@@ -224,7 +225,7 @@
target_temperature = clamp(target, min_temperature, max_temperature)
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/unary/thermomachine/freezer
name = "Thermomachine"
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm b/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm
index e095517775f1..db73b2ea8a45 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm
@@ -18,10 +18,10 @@
/obj/machinery/atmospherics/components/unary/on_construction()
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/unary/hide(intact)
- update_icon()
+ update_appearance(UPDATE_ICON)
..(intact)
/obj/machinery/atmospherics/components/unary/proc/assign_uid_vents()
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
index c61b24eabb59..986accee0521 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
@@ -119,7 +119,7 @@
space_shutoff_ticks--
if(space_shutoff_ticks <= 1 && !on)
on = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
if(!nodes[1])
on = FALSE
if(!on || welded)
@@ -137,7 +137,7 @@
last_moles_added = 0
on = FALSE
space_shutoff_ticks = 20 // shut off for about 20 seconds before trying again.
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(pump_direction & RELEASING) // internal -> external
@@ -302,7 +302,7 @@
// log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
broadcast_status()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/components/unary/vent_pump/welder_act(mob/living/user, obj/item/I)
if(!I.tool_start_check(user, amount=0))
@@ -315,7 +315,7 @@
else
user.visible_message("[user] unwelded the vent.", span_notice("You unweld the vent."), span_italics("You hear welding."))
welded = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
investigate_log("was [welded ? "welded shut" : "unwelded"] by [key_name(user)]", INVESTIGATE_ATMOS)
@@ -345,7 +345,7 @@
return
user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the vent", "You hear loud scraping noises.")
welded = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
playsound(loc, 'sound/weapons/bladeslice.ogg', 100, 1)
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
index 672fa9af62c9..2729cb4f456a 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
@@ -243,7 +243,7 @@
return //do not update_icon
broadcast_status()
- update_icon()
+ update_appearance(UPDATE_ICON)
return
/obj/machinery/atmospherics/components/unary/vent_scrubber/power_change()
@@ -261,7 +261,7 @@
else
user.visible_message("[user] unwelds the scrubber.", "You unweld the scrubber.", "You hear welding.")
welded = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
investigate_log("was [welded ? "welded shut" : "unwelded"] by [key_name(user)]", INVESTIGATE_ATMOS)
@@ -287,7 +287,7 @@
return
user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the scrubber.", "You hear loud scraping noises.")
welded = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
playsound(loc, 'sound/weapons/bladeslice.ogg', 100, 1)
diff --git a/code/modules/atmospherics/machinery/other/miner.dm b/code/modules/atmospherics/machinery/other/miner.dm
index b6a6290539d9..2a6a583ab6de 100644
--- a/code/modules/atmospherics/machinery/other/miner.dm
+++ b/code/modules/atmospherics/machinery/other/miner.dm
@@ -71,12 +71,12 @@
/obj/machinery/atmospherics/miner/proc/set_active(setting)
if(active != setting)
active = setting
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/miner/proc/set_broken(setting)
if(broken != setting)
broken = setting
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/miner/proc/update_power()
if(!active)
@@ -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(delta_time)
update_power()
diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/junction.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/junction.dm
index 10b8fff66ae3..90f2cc47bf89 100644
--- a/code/modules/atmospherics/machinery/pipes/heat_exchange/junction.dm
+++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/junction.dm
@@ -30,7 +30,8 @@
return ..(target, given_layer, FALSE) //we want a normal pipe instead
return ..(target, given_layer, TRUE)
-/obj/machinery/atmospherics/pipe/heat_exchanging/junction/update_icon()
+/obj/machinery/atmospherics/pipe/heat_exchanging/junction/update_icon(updates=ALL)
+ . = ..()
icon_state = "pipe[nodes[1] ? "1" : "0"][nodes[2] ? "1" : "0"]-[piping_layer]"
update_layer()
update_alpha()
diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm
index ab63bddb6a14..a2d057a2f360 100644
--- a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm
+++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm
@@ -26,16 +26,16 @@
initialize_directions = NORTH|SOUTH|EAST|WEST
initialize_directions &= ~dir
-/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/update_icon()
- cut_overlays()
+/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/update_overlays()
+ . = ..()
PIPING_LAYER_DOUBLE_SHIFT(center, piping_layer)
- add_overlay(center)
+ . += center
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
- add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) )
+ . += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
update_layer()
update_alpha()
diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold4w.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold4w.dm
index fddd9ea8b079..a47421f1a1f2 100644
--- a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold4w.dm
+++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold4w.dm
@@ -24,16 +24,16 @@
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/SetInitDirections()
initialize_directions = initial(initialize_directions)
-/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/update_icon()
- cut_overlays()
+/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/update_overlays()
+ . = ..()
PIPING_LAYER_DOUBLE_SHIFT(center, piping_layer)
- add_overlay(center)
+ . += center
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
- add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) )
+ . += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
update_layer()
update_alpha()
diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm
index fd013e11bd36..f3f472efb7e1 100644
--- a/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm
+++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm
@@ -24,7 +24,8 @@
if(EAST, WEST)
initialize_directions = EAST|WEST
-/obj/machinery/atmospherics/pipe/heat_exchanging/simple/update_icon()
+/obj/machinery/atmospherics/pipe/heat_exchanging/simple/update_icon(updates=ALL)
+ . = ..()
icon_state = "pipe[nodes[1] ? "1" : "0"][nodes[2] ? "1" : "0"]-[piping_layer]"
update_layer()
update_alpha()
diff --git a/code/modules/atmospherics/machinery/pipes/layermanifold.dm b/code/modules/atmospherics/machinery/pipes/layermanifold.dm
index 40eeb619ba4f..e0af1acdaeda 100644
--- a/code/modules/atmospherics/machinery/pipes/layermanifold.dm
+++ b/code/modules/atmospherics/machinery/pipes/layermanifold.dm
@@ -42,8 +42,8 @@
/obj/machinery/atmospherics/pipe/layer_manifold/proc/get_all_connected_nodes()
return front_nodes + back_nodes + nodes
-/obj/machinery/atmospherics/pipe/layer_manifold/update_icon() //HEAVILY WIP FOR UPDATE ICONS!!
- cut_overlays()
+/obj/machinery/atmospherics/pipe/layer_manifold/update_icon(updates=ALL) //HEAVILY WIP FOR UPDATE ICONS!!
+ . = ..()
layer = initial(layer) + (PIPING_LAYER_MAX * PIPING_LAYER_LCHANGE) //This is above everything else.
for(var/node in front_nodes)
@@ -99,7 +99,7 @@
new_nodes += foundfront
if(foundback && !QDELETED(foundback))
new_nodes += foundback
- update_icon()
+ update_appearance(UPDATE_ICON)
return new_nodes
/obj/machinery/atmospherics/pipe/layer_manifold/atmosinit()
@@ -128,7 +128,7 @@
if(reference in back_nodes)
var/i = back_nodes.Find(reference)
back_nodes[i] = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/pipe/layer_manifold/relaymove(mob/living/user, dir)
if(initialize_directions & dir)
diff --git a/code/modules/atmospherics/machinery/pipes/manifold.dm b/code/modules/atmospherics/machinery/pipes/manifold.dm
index e051cf04f92f..5d9ed0976564 100644
--- a/code/modules/atmospherics/machinery/pipes/manifold.dm
+++ b/code/modules/atmospherics/machinery/pipes/manifold.dm
@@ -22,7 +22,7 @@
var/mutable_appearance/center
-/* We use New() instead of Initialize(mapload) because these values are used in update_icon()
+/* We use New() instead of Initialize(mapload) because these values are used in update_appearance(UPDATE_ICON)
* in the mapping subsystem init before Initialize(mapload) is called in the atoms subsystem init.
* This is true for the other manifolds (the 4 ways and the heat exchanges) too.
*/
@@ -35,17 +35,17 @@
initialize_directions = NORTH|SOUTH|EAST|WEST
initialize_directions &= ~dir
-/obj/machinery/atmospherics/pipe/manifold/update_icon()
- cut_overlays()
+/obj/machinery/atmospherics/pipe/manifold/update_overlays()
+ . = ..()
if(!center)
center = mutable_appearance(icon, "manifold_center")
PIPING_LAYER_DOUBLE_SHIFT(center, piping_layer)
- add_overlay(center)
+ . += center
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
- add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) )
+ . += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
update_layer()
update_alpha()
diff --git a/code/modules/atmospherics/machinery/pipes/manifold4w.dm b/code/modules/atmospherics/machinery/pipes/manifold4w.dm
index 75aa68046046..4a88990fa1c8 100644
--- a/code/modules/atmospherics/machinery/pipes/manifold4w.dm
+++ b/code/modules/atmospherics/machinery/pipes/manifold4w.dm
@@ -29,17 +29,17 @@
/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections()
initialize_directions = initial(initialize_directions)
-/obj/machinery/atmospherics/pipe/manifold4w/update_icon()
- cut_overlays()
+/obj/machinery/atmospherics/pipe/manifold4w/update_overlays()
+ . = ..()
if(!center)
center = mutable_appearance(icon, "manifold_center")
PIPING_LAYER_DOUBLE_SHIFT(center, piping_layer)
- add_overlay(center)
+ . += center
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
- add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) )
+ . += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
update_layer()
update_alpha()
diff --git a/code/modules/atmospherics/machinery/pipes/pipes.dm b/code/modules/atmospherics/machinery/pipes/pipes.dm
index 2d9dfc0b4a13..bf36ad6a1740 100644
--- a/code/modules/atmospherics/machinery/pipes/pipes.dm
+++ b/code/modules/atmospherics/machinery/pipes/pipes.dm
@@ -45,7 +45,7 @@
/obj/machinery/atmospherics/pipe/hide(i)
if(level == 1 && isturf(loc))
invisibility = i ? INVISIBILITY_MAXIMUM : 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/pipe/proc/releaseAirToTurf()
if(air_temporary)
@@ -98,7 +98,7 @@
qdel(meter)
. = ..()
-/obj/machinery/atmospherics/pipe/update_icon()
+/obj/machinery/atmospherics/pipe/update_icon(updates=ALL)
. = ..()
update_alpha()
@@ -109,7 +109,7 @@
for(var/i in 1 to device_type)
if(nodes[i])
var/obj/machinery/atmospherics/N = nodes[i]
- N.update_icon()
+ N.update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/pipe/return_pipenets()
. = list(parent)
diff --git a/code/modules/atmospherics/machinery/pipes/simple.dm b/code/modules/atmospherics/machinery/pipes/simple.dm
index 00d24cebda5e..3ac2daf18e06 100644
--- a/code/modules/atmospherics/machinery/pipes/simple.dm
+++ b/code/modules/atmospherics/machinery/pipes/simple.dm
@@ -32,7 +32,8 @@
if(EAST, WEST)
initialize_directions = EAST|WEST
-/obj/machinery/atmospherics/pipe/simple/update_icon()
+/obj/machinery/atmospherics/pipe/simple/update_icon(updates=ALL)
+ . = ..()
icon_state = "pipe[nodes[1] ? "1" : "0"][nodes[2] ? "1" : "0"]-[piping_layer]"
update_layer()
update_alpha()
diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm
index 632d2a6ed27c..4b56e08552e7 100644
--- a/code/modules/atmospherics/machinery/portable/canister.dm
+++ b/code/modules/atmospherics/machinery/portable/canister.dm
@@ -37,7 +37,6 @@
var/restricted = FALSE
req_access = list()
- var/update = 0
//list of canister types for relabeling
var/static/list/label2types = list(
"generic" = /obj/machinery/portable_atmospherics/canister/generic,
@@ -236,7 +235,7 @@
timing = !timing
if(timing)
valve_timer = world.time + (timer_set * 10)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/portable_atmospherics/canister/proto
name = "prototype canister"
@@ -274,7 +273,7 @@
/obj/machinery/portable_atmospherics/canister/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/portable_atmospherics/canister/Destroy()
qdel(pump)
@@ -293,137 +292,52 @@
air_contents.set_moles(/datum/gas/oxygen, (O2STANDARD * maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature()))
air_contents.set_moles(/datum/gas/nitrogen, (N2STANDARD * maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature()))
-#define CANISTER_UPDATE_HOLDING (1<<0)
-#define CANISTER_UPDATE_CONNECTED (1<<1)
-#define CANISTER_UPDATE_OPEN (1<<2)
-#define CANISTER_UPDATE_EMPTY (1<<3)
-#define CANISTER_UPDATE_PRESSURE_0 (1<<4)
-#define CANISTER_UPDATE_PRESSURE_1 (1<<5)
-#define CANISTER_UPDATE_PRESSURE_2 (1<<6)
-#define CANISTER_UPDATE_PRESSURE_3 (1<<7)
-#define CANISTER_UPDATE_PRESSURE_4 (1<<8)
-#define CANISTER_UPDATE_PRESSURE_5 (1<<9)
-#define CANISTER_UPDATE_FULL (1<<10)
-#define CANISTER_UPDATE_FUSION (1<<11)
-#define CANISTER_LIGHT_RANGE 0.4
-#define CANISTER_LIGHT_POWER 0.5
-
-/obj/machinery/portable_atmospherics/canister/update_icon()
+/obj/machinery/portable_atmospherics/canister/update_icon_state()
if(stat & BROKEN)
- cut_overlays()
- SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
- if(!findtext(icon_state,"-1")) //A wise man once said, if it's already broke, don't break it more.
- icon_state = "[icon_state]-1"
- return
-
- var/last_update = update
- update = 0
+ icon_state = "[initial(icon_state)]-1"
+ return ..()
+/obj/machinery/portable_atmospherics/canister/update_overlays()
+ . = ..()
+ if(stat & BROKEN)
+ return
+ if(valve_open)
+ . += "can-open"
if(holding)
- update |= CANISTER_UPDATE_HOLDING
+ . += "can-tank"
if(connected_port)
- update |= CANISTER_UPDATE_CONNECTED
- if(valve_open)
- update |= CANISTER_UPDATE_OPEN
- if(!air_contents)
- update |= CANISTER_UPDATE_EMPTY
- else
- var/pressure = air_contents.return_pressure()
- if(pressure < 10)
- update |= CANISTER_UPDATE_EMPTY
- else if(pressure < ONE_ATMOSPHERE)
- update |= CANISTER_UPDATE_PRESSURE_0
- else if(pressure < 5 * ONE_ATMOSPHERE)
- update |= CANISTER_UPDATE_PRESSURE_1
- else if(pressure < 10 * ONE_ATMOSPHERE)
- update |= CANISTER_UPDATE_PRESSURE_2
- else if(pressure < 20 * ONE_ATMOSPHERE)
- update |= CANISTER_UPDATE_PRESSURE_3
- else if(pressure < 30 * ONE_ATMOSPHERE)
- update |= CANISTER_UPDATE_PRESSURE_4
- else if(pressure < 40 * ONE_ATMOSPHERE) //pressure pump max
- update |= CANISTER_UPDATE_PRESSURE_5
- else if(pressure < 9100) //volume pump max
- update |= CANISTER_UPDATE_FULL
+ . += "can-connector"
+
+ var/light_state = get_pressure_state(air_contents?.return_pressure())
+ if(light_state) //happens when pressure is below 10kpa which means no light
+ . += mutable_appearance(icon, light_state)
+
+///return the icon_state component for the canister's indicator light based on its current pressure reading
+/obj/machinery/portable_atmospherics/canister/proc/get_pressure_state(air_pressure)
+ if(air_pressure < 10)
+ return null
+ switch(air_pressure)
+ if((9100) to INFINITY)
+ return "can-oF"
+ if((40 * ONE_ATMOSPHERE) to (9100)) //volume pump max
+ return "can-o6"
+ if((30 * ONE_ATMOSPHERE) to (40 * ONE_ATMOSPHERE))
+ return "can-o5"
+ if((20 * ONE_ATMOSPHERE) to (30 * ONE_ATMOSPHERE))
+ return "can-o4"
+ if((10 * ONE_ATMOSPHERE) to (20 * ONE_ATMOSPHERE))
+ return "can-o3"
+ if((5 * ONE_ATMOSPHERE) to (10 * ONE_ATMOSPHERE))
+ return "can-o2"
+ if((10) to (5 * ONE_ATMOSPHERE))
+ return "can-o1"
else
- update |= CANISTER_UPDATE_FUSION
-
- if(update == last_update)
- return
-
- cut_overlays()
- SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
-
- if(update & CANISTER_UPDATE_OPEN)
- add_overlay("can-open")
- if(update & CANISTER_UPDATE_HOLDING)
- add_overlay("can-tank")
- if(update & CANISTER_UPDATE_CONNECTED)
- add_overlay("can-connector")
-
- if(update & CANISTER_UPDATE_PRESSURE_0)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o0", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o0", layer, EMISSIVE_PLANE, dir)
- set_light_on(TRUE)
- set_light_range_power_color(CANISTER_LIGHT_RANGE, CANISTER_LIGHT_POWER, COLOR_RED_LIGHT)
- else if(update & CANISTER_UPDATE_PRESSURE_1)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o1", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o1", layer, EMISSIVE_PLANE, dir)
- set_light_on(TRUE)
- set_light_range_power_color(CANISTER_LIGHT_RANGE, CANISTER_LIGHT_POWER, COLOR_RED_LIGHT)
- else if(update & CANISTER_UPDATE_PRESSURE_2)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o2", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o2", layer, EMISSIVE_PLANE, dir)
- set_light_on(TRUE)
- set_light_range_power_color(CANISTER_LIGHT_RANGE, CANISTER_LIGHT_POWER, COLOR_ORANGE)
- else if(update & CANISTER_UPDATE_PRESSURE_3)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o3", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o3", layer, EMISSIVE_PLANE, dir)
- set_light_on(TRUE)
- set_light_range_power_color(CANISTER_LIGHT_RANGE, CANISTER_LIGHT_POWER, COLOR_ORANGE)
- else if(update & CANISTER_UPDATE_PRESSURE_4)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o4", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o4", layer, EMISSIVE_PLANE, dir)
- set_light_on(TRUE)
- set_light_range_power_color(CANISTER_LIGHT_RANGE, CANISTER_LIGHT_POWER, COLOR_YELLOW)
- else if(update & CANISTER_UPDATE_PRESSURE_5)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o5", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o5", layer, EMISSIVE_PLANE, dir)
- set_light_on(TRUE)
- set_light_range_power_color(CANISTER_LIGHT_RANGE, CANISTER_LIGHT_POWER, COLOR_LIME)
- else if(update & CANISTER_UPDATE_FULL)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o6", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "can-o6", layer, EMISSIVE_PLANE, dir)
- set_light_on(TRUE)
- set_light_range_power_color(CANISTER_LIGHT_RANGE, CANISTER_LIGHT_POWER, COLOR_GREEN)
- else if(update & CANISTER_UPDATE_FUSION)
- SSvis_overlays.add_vis_overlay(src, icon, "can-oF", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "can-oF", layer, EMISSIVE_PLANE, dir)
- set_light_on(TRUE)
- set_light_range_power_color(2, 2, COLOR_WHITE)
- else
- set_light_on(FALSE)
-
-#undef CANISTER_UPDATE_HOLDING
-#undef CANISTER_UPDATE_CONNECTED
-#undef CANISTER_UPDATE_OPEN
-#undef CANISTER_UPDATE_EMPTY
-#undef CANISTER_UPDATE_PRESSURE_0
-#undef CANISTER_UPDATE_PRESSURE_1
-#undef CANISTER_UPDATE_PRESSURE_2
-#undef CANISTER_UPDATE_PRESSURE_3
-#undef CANISTER_UPDATE_PRESSURE_4
-#undef CANISTER_UPDATE_PRESSURE_5
-#undef CANISTER_UPDATE_FULL
-#undef CANISTER_UPDATE_FUSION
-#undef CANISTER_LIGHT_RANGE
-#undef CANISTER_LIGHT_POWER
+ return "can-o0"
/obj/machinery/portable_atmospherics/canister/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > temperature_resistance)
take_damage(5, BURN, 0)
-
/obj/machinery/portable_atmospherics/canister/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(stat & BROKEN))
@@ -476,7 +390,7 @@
if(.)
if(close_valve)
valve_open = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
investigate_log("Valve was closed by [key_name(user)].
", INVESTIGATE_ATMOS)
else if(valve_open && holding)
investigate_log("[key_name(user)] started a transfer into [holding].
", INVESTIGATE_ATMOS)
@@ -501,7 +415,7 @@
pump.airs[1] = null
pump.airs[2] = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/portable_atmospherics/canister/ui_state(mob/user)
return GLOB.physical_state
@@ -647,7 +561,7 @@
investigate_log("[key_name(usr)] removed the [holding], leaving the valve open and transferring into the [span_boldannounce("air")].", INVESTIGATE_ATMOS)
replace_tank(usr, FALSE)
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/portable_atmospherics/canister/examine(mob/dead/observer/user)
if(istype(user))
diff --git a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
index 6651e9376774..53764eb0bc1a 100644
--- a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
+++ b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
@@ -70,7 +70,7 @@
anchored = TRUE //Prevent movement
pixel_x = new_port.pixel_x
pixel_y = new_port.pixel_y
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/portable_atmospherics/Move()
@@ -86,7 +86,7 @@
connected_port = null
pixel_x = 0
pixel_y = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/portable_atmospherics/AltClick(mob/living/user)
@@ -111,7 +111,7 @@
holding = new_tank
else
holding = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/portable_atmospherics/attackby(obj/item/W, mob/user, params)
@@ -122,7 +122,7 @@
return
to_chat(user, span_notice("[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"]."))
replace_tank(user, FALSE, T)
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(W.tool_behaviour == TOOL_WRENCH)
if(!(stat & BROKEN))
if(connected_port)
@@ -132,7 +132,7 @@
"[user] disconnects [src].", \
span_notice("You unfasten [src] from the port."), \
span_italics("You hear a ratchet."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate(/obj/machinery/atmospherics/components/unary/portables_connector) in loc
@@ -147,7 +147,7 @@
"[user] connects [src].", \
span_notice("You fasten [src] to the port."), \
span_italics("You hear a ratchet."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else
return ..()
diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm
index c5558ef62a09..b2224cf9cad8 100644
--- a/code/modules/atmospherics/machinery/portable/pump.dm
+++ b/code/modules/atmospherics/machinery/portable/pump.dm
@@ -29,14 +29,17 @@
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()
..()
@@ -67,7 +70,7 @@
if(prob(100 / severity))
direction = PUMP_OUT
pump.target_pressure = rand(0, 100 * ONE_ATMOSPHERE)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/portable_atmospherics/pump/replace_tank(mob/living/user, close_valve)
. = ..()
@@ -75,7 +78,7 @@
if(close_valve)
if(on)
on = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(on && holding && direction == PUMP_OUT)
investigate_log("[key_name(user)] started a transfer into [holding].
", INVESTIGATE_ATMOS)
@@ -153,10 +156,10 @@
if(holding)
replace_tank(usr, FALSE)
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/portable_atmospherics/pump/CtrlShiftClick(mob/user)
if(!user.canUseTopic(src, BE_CLOSE))
return
on = !on
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm
index 6d9e143dbfcc..f0d132d6fe71 100644
--- a/code/modules/atmospherics/machinery/portable/scrubber.dm
+++ b/code/modules/atmospherics/machinery/portable/scrubber.dm
@@ -36,14 +36,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(holding)
- add_overlay("scrubber-open")
+ . += "scrubber-open"
if(connected_port)
- add_overlay("scrubber-connector")
+ . += "scrubber-connector"
/obj/machinery/portable_atmospherics/scrubber/process_atmos()
..()
@@ -79,7 +82,7 @@
if(is_operational())
if(prob(50 / severity))
on = !on
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
@@ -113,7 +116,7 @@
if(close_valve)
if(on)
on = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(on && holding)
investigate_log("[key_name(user)] started a transfer into [holding].
", INVESTIGATE_ATMOS)
@@ -131,7 +134,7 @@
if("toggle_filter")
scrubbing ^= gas_id2path(params["val"])
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/portable_atmospherics/scrubber/huge
name = "huge air scrubber"
@@ -149,13 +152,14 @@
/obj/machinery/portable_atmospherics/scrubber/huge/movable
movable = TRUE
-/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()
if((!anchored && !movable) || !is_operational())
on = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
use_power = on ? ACTIVE_POWER_USE : IDLE_POWER_USE
if(!on)
return
@@ -176,4 +180,4 @@
if(!user.canUseTopic(src, BE_CLOSE))
return
on = !on
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index c183a67a633d..30b91578560f 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -16,7 +16,7 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
/obj/machinery/gateway/Initialize(mapload)
randomspawns = GLOB.awaydestinations
- update_icon()
+ update_appearance(UPDATE_ICON)
if(!istype(src, /obj/machinery/gateway/centerstation) && !istype(src, /obj/machinery/gateway/centeraway))
switch(dir)
if(SOUTH,SOUTHEAST,SOUTHWEST)
@@ -26,9 +26,9 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
/obj/machinery/gateway/proc/toggleoff()
for(var/obj/machinery/gateway/G in linked)
G.active = 0
- G.update_icon()
+ G.update_appearance(UPDATE_ICON)
active = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/gateway/proc/detect()
if(!can_link)
@@ -53,7 +53,8 @@ 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
@@ -80,7 +81,7 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
. = ..()
if(!GLOB.the_gateway)
GLOB.the_gateway = src
- update_icon()
+ update_appearance(UPDATE_ICON)
wait = world.time + CONFIG_GET(number/gateway_delay) //+ thirty minutes default
awaygate = locate(/obj/machinery/gateway/centeraway)
@@ -100,7 +101,8 @@ 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
@@ -129,9 +131,9 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
for(var/obj/machinery/gateway/G in linked)
G.active = 1
- G.update_icon()
+ G.update_appearance(UPDATE_ICON)
active = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
//okay, here's the good teleporting stuff
/obj/machinery/gateway/centerstation/Bumped(atom/movable/AM)
@@ -179,11 +181,12 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
/obj/machinery/gateway/centeraway/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
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
@@ -198,9 +201,9 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
for(var/obj/machinery/gateway/G in linked)
G.active = 1
- G.update_icon()
+ G.update_appearance(UPDATE_ICON)
active = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/gateway/centeraway/proc/check_exile_implant(mob/living/L)
for(var/obj/item/implant/exile/E in L.implants)//Checking that there is an exile implant
@@ -250,4 +253,4 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
/obj/item/paper/fluff/gateway
info = "Congratulations,
Your station has been selected to carry out the Gateway Project.
The equipment will be shipped to you at the start of the next quarter.
You are to prepare a secure location to house the equipment as outlined in the attached documents.
--Nanotrasen Bluespace Research"
- name = "Confidential Correspondence, Pg 1"
\ No newline at end of file
+ name = "Confidential Correspondence, Pg 1"
diff --git a/code/modules/awaymissions/mission_code/Academy.dm b/code/modules/awaymissions/mission_code/Academy.dm
index b6e9e8ca6ba2..4cd2f39cf900 100644
--- a/code/modules/awaymissions/mission_code/Academy.dm
+++ b/code/modules/awaymissions/mission_code/Academy.dm
@@ -413,8 +413,9 @@
icon_state = "1"
color = rgb(0,0,255)
-/obj/structure/ladder/unbreakable/rune/update_icon()
- return
+/obj/structure/ladder/unbreakable/rune/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/structure/ladder/unbreakable/rune/show_fluff_message(up,mob/user)
user.visible_message("[user] activates \the [src].",span_notice("You activate \the [src]."))
diff --git a/code/modules/awaymissions/pamphlet.dm b/code/modules/awaymissions/pamphlet.dm
index 7cbbde096d6e..b28f517ea93b 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/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
diff --git a/code/modules/buildmode/buildmode.dm b/code/modules/buildmode/buildmode.dm
index a65843e618e0..fc223419f786 100644
--- a/code/modules/buildmode/buildmode.dm
+++ b/code/modules/buildmode/buildmode.dm
@@ -134,12 +134,12 @@
close_switchstates()
mode = new newmode(src)
mode.enter_mode(src)
- modebutton.update_icon()
+ modebutton.update_appearance(UPDATE_ICON)
/datum/buildmode/proc/change_dir(newdir)
build_dir = newdir
close_dirswitch()
- dirbutton.update_icon()
+ dirbutton.update_appearance(UPDATE_ICON)
return 1
/datum/buildmode/proc/InterceptClickOn(mob/user, params, atom/object)
diff --git a/code/modules/buildmode/buttons.dm b/code/modules/buildmode/buttons.dm
index a60f105f8321..8468962b9c38 100644
--- a/code/modules/buildmode/buttons.dm
+++ b/code/modules/buildmode/buttons.dm
@@ -24,10 +24,11 @@
bd.toggle_modeswitch()
else if(pa.Find("right"))
bd.mode.change_settings(usr.client)
- update_icon()
+ update_appearance(UPDATE_ICON)
return 1
-/atom/movable/screen/buildmode/mode/update_icon()
+/atom/movable/screen/buildmode/mode/update_icon_state()
+ . = ..()
if(bd && bd.mode)
icon_state = bd.mode.get_button_iconstate()
else
@@ -47,13 +48,13 @@
screen_loc = "NORTH,WEST+2"
name = "Change Dir"
-/atom/movable/screen/buildmode/bdir/update_icon()
+/atom/movable/screen/buildmode/bdir/update_icon(updates=ALL)
+ . = ..()
dir = bd.build_dir
- return
/atom/movable/screen/buildmode/bdir/Click()
bd.toggle_dirswitch()
- update_icon()
+ update_appearance(UPDATE_ICON)
return 1
// used to switch between modes
diff --git a/code/modules/cargo/bounties/assistant.dm b/code/modules/cargo/bounties/assistant.dm
index 4462ce93d07e..080eaaea724a 100644
--- a/code/modules/cargo/bounties/assistant.dm
+++ b/code/modules/cargo/bounties/assistant.dm
@@ -143,7 +143,7 @@
name = "Shady Jim's"
description = "There's an irate officer at CentCom demanding that he receive a box of Shady Jim's cigarettes. Please ship one. He's starting to make threats."
reward = 500
- wanted_types = list(/obj/item/storage/box/fancy/cigarettes/cigpack_shadyjims)
+ wanted_types = list(/obj/item/storage/fancy/cigarettes/cigpack_shadyjims)
/datum/bounty/item/assistant/potted_plants
name = "Potted Plants"
diff --git a/code/modules/cargo/bounty_console.dm b/code/modules/cargo/bounty_console.dm
index 1059bb18e716..fc6891985393 100644
--- a/code/modules/cargo/bounty_console.dm
+++ b/code/modules/cargo/bounty_console.dm
@@ -23,7 +23,7 @@
/obj/item/paper/bounty_printout/Initialize(mapload)
. = ..()
info = "Nanotrasen Cargo Bounties
"
- update_icon()
+ update_appearance(UPDATE_ICON)
for(var/datum/bounty/B in GLOB.bounties_list)
if(B.claimed)
continue
diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm
index 40bf5def556a..cb49bc4a1135 100644
--- a/code/modules/cargo/centcom_podlauncher.dm
+++ b/code/modules/cargo/centcom_podlauncher.dm
@@ -714,7 +714,7 @@
if (isnull(target_turf))
return
var/obj/structure/closet/supplypod/centcompod/toLaunch = DuplicateObject(temp_pod) //Duplicate the temp_pod (which we have been varediting or configuring with the UI) and store the result
- toLaunch.update_icon()//we update_icon() here so that the door doesnt "flicker on" right after it lands
+ toLaunch.update_appearance(UPDATE_ICON)//we update_appearance(UPDATE_ICON) here so that the door doesnt "flicker on" right after it lands
var/shippingLane = GLOB.areas_by_type[/area/centcom/supplypod/podStorage]
toLaunch.forceMove(shippingLane)
if (launchClone) //We arent launching the actual items from the bay, rather we are creating clones and launching those
diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm
index c9d22a586f26..a0d8c22af791 100644
--- a/code/modules/cargo/expressconsole.dm
+++ b/code/modules/cargo/expressconsole.dm
@@ -192,7 +192,7 @@
. = TRUE
message_admins("[ADMIN_LOOKUPFLW(usr)] has ordered a [SO.pack.name] pod at location [ADMIN_VERBOSEJMP(LZ)]")
investigate_log("Order #[SO.id] ([SO.pack.name], placed by [key_name(SO.orderer_ckey)]), paid by [D.account_holder] has shipped.", INVESTIGATE_CARGO)
- update_icon()
+ update_appearance(UPDATE_ICON)
else
if(SO.pack.get_cost() * (0.72*MAX_EMAG_ROCKETS) <= points_to_check) // bulk discount :^)
landingzone = GLOB.areas_by_type[pick(GLOB.the_station_areas)] //override default landing zone
@@ -212,7 +212,7 @@
new /obj/effect/DPtarget(LZ, podType, SO)
amountordered++
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
CHECK_TICK
message_admins("[ADMIN_LOOKUPFLW(usr)] has ordered a [SO.pack.name] pod x[amountordered] at location [ADMIN_VERBOSEJMP(LZ)]")
investigate_log("Order #[SO.id] ([SO.pack.name] x[amountordered], placed by [key_name(SO.orderer_ckey)]), paid by [D.account_holder] has shipped.", INVESTIGATE_CARGO)
diff --git a/code/modules/cargo/gondolapod.dm b/code/modules/cargo/gondolapod.dm
index 7ae9c3426c5e..adc2988f5594 100644
--- a/code/modules/cargo/gondolapod.dm
+++ b/code/modules/cargo/gondolapod.dm
@@ -29,7 +29,8 @@
name = linked_pod.name
. = ..()
-/mob/living/simple_animal/pet/gondola/gondolapod/update_icon()
+/mob/living/simple_animal/pet/gondola/gondolapod/update_icon_state()
+ . = ..()
if(opened)
icon_state = "gondolapod_open"
else
@@ -60,12 +61,12 @@
/mob/living/simple_animal/pet/gondola/gondolapod/setOpened()
opened = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, setClosed)), 50)
/mob/living/simple_animal/pet/gondola/gondolapod/setClosed()
opened = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/pet/gondola/gondolapod/death()
qdel(linked_pod) //Will cause the open() proc for the linked supplypod to be called with the "broken" parameter set to true, meaning that it will dump its contents on death
diff --git a/code/modules/cargo/order.dm b/code/modules/cargo/order.dm
index ca7883ffb2bf..330295e2a226 100644
--- a/code/modules/cargo/order.dm
+++ b/code/modules/cargo/order.dm
@@ -54,7 +54,7 @@
P.info += "Rank: [orderer_rank]
"
P.info += "Comment: [reason]
"
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
return P
/datum/supply_order/proc/generateManifest(obj/structure/closet/crate/C, owner, packname) //generates-the-manifests.
@@ -92,10 +92,10 @@
while(--lost >= 0)
qdel(pick(C.contents))
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
P.forceMove(C)
C.manifest = P
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
return P
diff --git a/code/modules/cargo/packs.dm b/code/modules/cargo/packs.dm
index 85d8e5566b6f..32d40865f650 100644
--- a/code/modules/cargo/packs.dm
+++ b/code/modules/cargo/packs.dm
@@ -2181,7 +2181,7 @@
/obj/item/reagent_containers/food/condiment/saltshaker,
/obj/item/reagent_containers/food/condiment/peppermill,
/obj/item/reagent_containers/food/condiment/cinnamon, // Yogs -- Adds cinnamon shakers to this crate
- /obj/item/storage/box/fancy/egg_box,
+ /obj/item/storage/fancy/egg_box,
/obj/item/reagent_containers/food/condiment/enzyme,
/obj/item/reagent_containers/food/condiment/sugar,
/obj/item/reagent_containers/food/snacks/meat/slab/monkey,
@@ -2605,8 +2605,8 @@
/obj/item/toy/cards/deck/syndicate,
/obj/item/reagent_containers/food/drinks/bottle/absinthe,
/obj/item/clothing/under/syndicate/tacticool,
- /obj/item/storage/box/fancy/cigarettes/cigpack_syndicate,
- /obj/item/storage/box/fancy/cigarettes/cigpack_shadyjims,
+ /obj/item/storage/fancy/cigarettes/cigpack_syndicate,
+ /obj/item/storage/fancy/cigarettes/cigpack_shadyjims,
/obj/item/clothing/mask/gas/syndicate,
/obj/item/clothing/neck/necklace/dope,
/obj/item/vending_refill/donksoft)
diff --git a/code/modules/cargo/supplypod.dm b/code/modules/cargo/supplypod.dm
index f7c55fc15716..5b2f619a0f2f 100644
--- a/code/modules/cargo/supplypod.dm
+++ b/code/modules/cargo/supplypod.dm
@@ -58,8 +58,6 @@
var/list/reverse_option_list = list("Mobs"=FALSE,"Objects"=FALSE,"Anchored"=FALSE,"Underfloor"=FALSE,"Wallmounted"=FALSE,"Floors"=FALSE,"Walls"=FALSE, "Mecha"=FALSE)
var/list/turfs_in_cargo = list()
- var/list/managed_overlays
-
/obj/structure/closet/supplypod/bluespacepod
style = STYLE_BLUESPACE
bluespace = TRUE
@@ -109,7 +107,7 @@
door = "[base]_door"
else
door = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/closet/supplypod/proc/SetReverseIcon()
fin_mask = "bottomfin"
@@ -117,7 +115,7 @@
icon_state = GLOB.podstyles[style][POD_BASE] + "_reverse"
pixel_x = initial(pixel_x)
transform = matrix()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/closet/supplypod/proc/backToNonReverseIcon()
fin_mask = initial(fin_mask)
@@ -125,19 +123,10 @@
icon_state = GLOB.podstyles[style][POD_BASE]
pixel_x = initial(pixel_x)
transform = matrix()
- update_icon()
-
-/obj/structure/closet/supplypod/update_icon()
- var/list/new_overlays = update_overlays()
- if(managed_overlays)
- cut_overlay(managed_overlays)
- managed_overlays = null
- if(length(new_overlays))
- managed_overlays = new_overlays
- add_overlay(new_overlays)
-
-/obj/structure/closet/supplypod/proc/update_overlays()
- . = list()
+ update_appearance(UPDATE_ICON)
+
+/obj/structure/closet/supplypod/update_overlays()
+ . = ..()
if(style == STYLE_INVISIBLE)
return
@@ -420,17 +409,17 @@
/obj/structure/closet/supplypod/setOpened() //Proc exists here, as well as in any atom that can assume the role of a "holder" of a supplypod. Check the open_pod() proc for more details
opened = TRUE
density = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/closet/supplypod/extractionpod/setOpened()
opened = TRUE
density = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/closet/supplypod/setClosed() //Ditto
opened = FALSE
density = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/closet/supplypod/proc/tryMakeRubble(turf/T) //Ditto
if (rubble_type == RUBBLE_NONE)
@@ -443,7 +432,7 @@
return
rubble = new /obj/effect/supplypod_rubble(T)
rubble.setStyle(rubble_type, src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/closet/supplypod/Moved()
deleteRubble()
@@ -452,7 +441,7 @@
/obj/structure/closet/supplypod/proc/deleteRubble()
rubble?.fadeAway()
rubble = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/closet/supplypod/proc/addGlow()
if (GLOB.podstyles[style][POD_SHAPE] != POD_SHAPE_NORML)
@@ -599,7 +588,7 @@
/obj/effect/DPtarget/proc/beginLaunch(effectCircle) //Begin the animation for the pod falling. The effectCircle param determines whether the pod gets to come in from any descent angle
pod.addGlow()
- pod.update_icon()
+ pod.update_appearance(UPDATE_ICON)
if (pod.style != STYLE_INVISIBLE)
pod.add_filter("motionblur",1,list("type"="motion_blur", "x"=0, "y"=3))
pod.forceMove(drop_location())
diff --git a/code/modules/cargo/supplypod_beacon.dm b/code/modules/cargo/supplypod_beacon.dm
index a8464a573325..51df38fca249 100644
--- a/code/modules/cargo/supplypod_beacon.dm
+++ b/code/modules/cargo/supplypod_beacon.dm
@@ -29,16 +29,16 @@
playsound(src,'sound/machines/synth_no.ogg',50,0)
if (SP_UNREADY)
ready = FALSE
- update_icon()
+ update_appearance(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/client/preferences/ghost.dm b/code/modules/client/preferences/ghost.dm
index 648feea31e49..544346d34058 100644
--- a/code/modules/client/preferences/ghost.dm
+++ b/code/modules/client/preferences/ghost.dm
@@ -16,7 +16,7 @@
return
ghost.ghost_accs = value
- ghost.update_icon()
+ ghost.update_appearance(UPDATE_ICON)
/datum/preference/choiced/ghost_accessories/deserialize(input, datum/preferences/preferences)
// Old ghost preferences used to be 1/50/100.
@@ -90,7 +90,7 @@
if (!is_donator(client))
return
- ghost.update_icon(value)
+ ghost.update_icon(ALL, value)
/datum/preference/choiced/ghost_form/compile_constant_data()
var/list/data = ..()
diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm
index 58a604f5ffe3..9ce10ac5e6e3 100644
--- a/code/modules/clothing/chameleon.dm
+++ b/code/modules/clothing/chameleon.dm
@@ -241,7 +241,7 @@
var/obj/item/clothing/head/helmet/helmet = initial(HS.helmettype)
I.head_piece.initial_state = initial(helmet.icon_state)
update_item(helmet, I.head_piece)
- I.head_piece.update_icon()
+ I.head_piece.update_appearance(UPDATE_ICON)
qdel(helmet)
//YOGS END
target.icon = initial(picked_item.icon)
diff --git a/code/modules/clothing/ears/_ears.dm b/code/modules/clothing/ears/_ears.dm
index 98ea902107de..fb4da9b676de 100644
--- a/code/modules/clothing/ears/_ears.dm
+++ b/code/modules/clothing/ears/_ears.dm
@@ -35,15 +35,16 @@
/obj/item/clothing/ears/headphones/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/clothing/ears/headphones/update_icon()
+/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"]"
/obj/item/clothing/ears/headphones/proc/toggle(owner)
headphones_on = !headphones_on
- update_icon()
+ update_appearance(UPDATE_ICON)
var/mob/living/carbon/human/H = owner
if(istype(H))
H.update_inv_ears()
diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm
index 5cf0c4407f9f..1967027f554d 100644
--- a/code/modules/clothing/glasses/_glasses.dm
+++ b/code/modules/clothing/glasses/_glasses.dm
@@ -337,15 +337,19 @@
var/colored_before = FALSE
/obj/item/clothing/glasses/blindfold/white/equipped(mob/living/carbon/human/user, slot)
- if(ishuman(user) && slot == ITEM_SLOT_EYES)
- update_icon(user)
+ if(ishuman(user) && slot & ITEM_SLOT_EYES)
+ update_appearance(UPDATE_ICON)
user.update_inv_glasses() //Color might have been changed by update_icon.
- ..()
+ return ..()
-/obj/item/clothing/glasses/blindfold/white/update_icon(mob/living/carbon/human/user)
- if(ishuman(user) && !colored_before)
- add_atom_colour("#[user.eye_color]", FIXED_COLOUR_PRIORITY)
+/obj/item/clothing/glasses/blindfold/white/update_icon(updates=ALL)
+ if(!ishuman(loc))
+ return ..()
+ var/mob/living/carbon/human/loc_human = loc
+ if(!colored_before)
+ add_atom_colour("#[loc_human.eye_color]", FIXED_COLOUR_PRIORITY)
colored_before = TRUE
+ return ..()
/obj/item/clothing/glasses/blindfold/white/worn_overlays(isinhands = FALSE, file2use)
. = list()
diff --git a/code/modules/clothing/glasses/engine_goggles.dm b/code/modules/clothing/glasses/engine_goggles.dm
index bd0d1dba3c7e..1f39b7aeed4c 100644
--- a/code/modules/clothing/glasses/engine_goggles.dm
+++ b/code/modules/clothing/glasses/engine_goggles.dm
@@ -24,7 +24,7 @@
/obj/item/clothing/glasses/meson/engine/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/clothing/glasses/meson/engine/Destroy()
STOP_PROCESSING(SSobj, src)
@@ -50,7 +50,7 @@
if(H.glasses == src)
H.update_sight()
- update_icon()
+ update_appearance(UPDATE_ICON)
for(var/X in actions)
var/datum/action/A = X
A.build_all_button_icons()
@@ -114,7 +114,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()
+/obj/item/clothing/glasses/meson/engine/update_icon_state()
+ . = ..()
icon_state = "trayson-[mode]"
update_mob()
diff --git a/code/modules/clothing/head/_head.dm b/code/modules/clothing/head/_head.dm
index 31b2ded62e4a..eb43544d3797 100644
--- a/code/modules/clothing/head/_head.dm
+++ b/code/modules/clothing/head/_head.dm
@@ -18,7 +18,7 @@
H.update_hair()
/obj/item/clothing/head/worn_overlays(isinhands = FALSE)
- . = list()
+ . = ..()
if(!isinhands)
if(damaged_clothes)
. += mutable_appearance('icons/effects/item_damage.dmi', "damagedhelmet")
diff --git a/code/modules/clothing/head/collectable.dm b/code/modules/clothing/head/collectable.dm
index 48297c5499e0..ce4fb1278211 100644
--- a/code/modules/clothing/head/collectable.dm
+++ b/code/modules/clothing/head/collectable.dm
@@ -105,13 +105,16 @@
/obj/item/clothing/head/collectable/kitty/equipped(mob/living/carbon/human/user, slot)
if(ishuman(user) && slot == ITEM_SLOT_HEAD)
- update_icon(user)
+ update_appearance(UPDATE_ICON)
user.update_inv_head() //Color might have been changed by update_icon.
..()
-/obj/item/clothing/head/collectable/kitty/update_icon(mob/living/carbon/human/user)
- if(ishuman(user))
- add_atom_colour("#[user.hair_color]", FIXED_COLOUR_PRIORITY)
+/obj/item/clothing/head/collectable/kitty/update_icon(updates=ALL)
+ . = ..()
+ if(!ishuman(loc))
+ return
+ var/mob/living/carbon/human/loc_human = loc
+ add_atom_colour("#[loc_human.hair_color]", FIXED_COLOUR_PRIORITY)
/obj/item/clothing/head/collectable/rabbitears
name = "collectable rabbit ears"
diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm
index 09dce2c10e8e..8cc94e149024 100644
--- a/code/modules/clothing/head/hardhat.dm
+++ b/code/modules/clothing/head/hardhat.dm
@@ -31,9 +31,10 @@
turn_on(user)
else
turn_off(user)
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/clothing/head/hardhat/update_icon()
+/obj/item/clothing/head/hardhat/update_icon_state()
+ . = ..()
icon_state = "hardhat[on]_[hat_type]"
item_state = "hardhat[on]_[hat_type]"
if(ishuman(loc))
@@ -41,7 +42,6 @@
H.update_inv_head()
for(var/datum/action/A as anything in actions)
A.build_all_button_icons(force = TRUE)
- ..()
/obj/item/clothing/head/hardhat/proc/turn_on(mob/user)
set_light_on(TRUE)
@@ -128,7 +128,7 @@
/obj/item/clothing/head/hardhat/weldhat/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/clothing/head/hardhat/weldhat/attack_self(mob/living/user)
toggle_helmet_light(user)
@@ -147,7 +147,7 @@
/obj/item/clothing/head/hardhat/weldhat/proc/toggle_welding_screen(mob/living/user)
if(weldingvisortoggle(user))
playsound(src, 'sound/mecha/mechmove03.ogg', 50, 1) //Visors don't just come from nothing
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/clothing/head/hardhat/weldhat/worn_overlays(isinhands)
. = ..()
@@ -156,11 +156,10 @@
if(!up)
. += mutable_appearance(mob_overlay_icon, "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 015fa6c1949e..a7e0c64a943f 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -46,7 +46,7 @@
if(A == attached_light)
set_attached_light(null)
update_helmlight()
- update_icon()
+ update_appearance(UPDATE_ICON)
QDEL_NULL(alight)
qdel(A)
return ..()
@@ -368,7 +368,8 @@
//LightToggle
-/obj/item/clothing/head/helmet/update_icon()
+/obj/item/clothing/head/helmet/update_icon_state()
+ . = ..()
var/state = "[initial(icon_state)]"
if(attached_light)
if(attached_light.on)
@@ -396,7 +397,7 @@
return
to_chat(user, span_notice("You click [S] into place on [src]."))
set_attached_light(S)
- update_icon()
+ update_appearance(UPDATE_ICON)
update_helmlight()
alight = new(src)
if(loc == user)
@@ -416,7 +417,7 @@
var/obj/item/flashlight/removed_light = set_attached_light(null)
update_helmlight()
removed_light.update_brightness(user)
- update_icon()
+ update_appearance(UPDATE_ICON)
user.update_inv_head()
QDEL_NULL(alight)
return TRUE
@@ -441,7 +442,7 @@
/obj/item/clothing/head/helmet/proc/update_helmlight()
if(attached_light)
- update_icon()
+ update_appearance(UPDATE_ICON)
for(var/X in actions)
var/datum/action/A = X
A.build_all_button_icons()
diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm
index 33b94dd71cbe..2a5b877123ee 100644
--- a/code/modules/clothing/head/misc_special.dm
+++ b/code/modules/clothing/head/misc_special.dm
@@ -134,7 +134,7 @@
/obj/item/clothing/head/kitty/equipped(mob/living/carbon/human/user, slot)
if(ishuman(user) && slot == ITEM_SLOT_HEAD)
- update_icon(user)
+ update_appearance(UPDATE_ICON)
user.update_inv_head() //Color might have been changed by update_icon.
var/datum/language_holder/LH = user.get_language_holder()
if(!LH.has_language(/datum/language/felinid) || !LH.can_speak_language(/datum/language/felinid))
@@ -148,11 +148,13 @@
if(LH.has_language(/datum/language/felinid) || LH.can_speak_language(/datum/language/felinid)) //sanity
to_chat(user, "You lose the keenness in your ears.")
LH.remove_language(/datum/language/felinid,TRUE,TRUE,LANGUAGE_CATEARS)
-
-/obj/item/clothing/head/kitty/update_icon(mob/living/carbon/human/user)
- if(ishuman(user))
- add_atom_colour("#[user.hair_color]", FIXED_COLOUR_PRIORITY)
+/obj/item/clothing/head/kitty/update_icon(updates=ALL)
+ . = ..()
+ if(!ishuman(loc))
+ return
+ var/mob/living/carbon/human/loc_human = loc
+ add_atom_colour("#[loc_human.hair_color]", FIXED_COLOUR_PRIORITY)
/obj/item/clothing/head/kitty/genuine
desc = "A pair of kitty ears. A tag on the inside says \"Hand made from real cats.\""
@@ -207,19 +209,25 @@
/obj/item/clothing/head/wig/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/clothing/head/wig/update_icon()
- cut_overlays()
+/obj/item/clothing/head/wig/update_icon_state()
+ . = ..()
icon_state = ""
var/datum/sprite_accessory/S = GLOB.hair_styles_list[hair_style]
+ if(S)
+ return
+ icon_state = "pwig"
+
+/obj/item/clothing/head/wig/update_overlays()
+ . = ..()
+ var/datum/sprite_accessory/S = GLOB.hair_styles_list[hair_style]
if(!S)
- icon_state = "pwig"
- else
- var/mutable_appearance/M = mutable_appearance(S.icon,S.icon_state)
- M.appearance_flags |= RESET_COLOR
- M.color = hair_color
- add_overlay(M)
+ return
+ var/mutable_appearance/M = mutable_appearance(S.icon,S.icon_state)
+ M.appearance_flags |= RESET_COLOR
+ M.color = hair_color
+ . += M
/obj/item/clothing/head/wig/worn_overlays(isinhands = FALSE, file2use)
. = list()
@@ -241,7 +249,7 @@
user.visible_message(span_notice("[user] changes \the [src]'s hairstyle to [new_style]."), span_notice("You change \the [src]'s hairstyle to [new_style]."))
if(adjustablecolor)
hair_color = input(usr,"","Choose Color",hair_color) as color|null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/clothing/head/wig/random/Initialize(mapload)
@@ -264,7 +272,7 @@
. = ..()
if(ishuman(user) && slot == ITEM_SLOT_HEAD)
hair_color = "#[user.hair_color]"
- update_icon()
+ update_appearance(UPDATE_ICON)
user.update_inv_head()
/obj/item/clothing/head/bronze
diff --git a/code/modules/clothing/masks/_masks.dm b/code/modules/clothing/masks/_masks.dm
index 50910d7d8d15..105ca46b8ac4 100644
--- a/code/modules/clothing/masks/_masks.dm
+++ b/code/modules/clothing/masks/_masks.dm
@@ -45,13 +45,19 @@
var/mob/M = loc
M.update_inv_wear_mask()
+/obj/item/clothing/mask/update_icon_state()
+ . = ..()
+ if(mask_adjusted)
+ icon_state = initial(icon_state) + "_up"
+ else
+ icon_state = initial(icon_state)
+
//Proc that moves gas/breath masks out of the way, disabling them and allowing pill/food consumption
/obj/item/clothing/mask/proc/adjustmask(mob/living/carbon/user)
if(user && user.incapacitated())
return
mask_adjusted = !mask_adjusted
if(!mask_adjusted)
- icon_state = initial(icon_state)
gas_transfer_coefficient = initial(gas_transfer_coefficient)
clothing_flags |= visor_flags
flags_inv |= visor_flags_inv
@@ -59,7 +65,6 @@
to_chat(user, span_notice("You push \the [src] back into place."))
slot_flags = initial(slot_flags)
else
- icon_state = initial(icon_state) + "_up"
to_chat(user, span_notice("You push \the [src] out of the way."))
gas_transfer_coefficient = null
clothing_flags &= ~visor_flags
@@ -67,6 +72,7 @@
flags_cover &= ~visor_flags_cover
if(adjusted_flags)
slot_flags = adjusted_flags
+ update_appearance(UPDATE_ICON)
if(!istype(user))
return
// Update the mob if it's wearing the mask.
diff --git a/code/modules/clothing/masks/hailer.dm b/code/modules/clothing/masks/hailer.dm
index 652e27ba308f..13460c6433a3 100644
--- a/code/modules/clothing/masks/hailer.dm
+++ b/code/modules/clothing/masks/hailer.dm
@@ -34,7 +34,7 @@
'sound/voice/cpdeath/die4.ogg',
)
///List of all lines that can be said by the sechailer, with their respective sound file.
- var/list/sechailer_voicelines = list(
+ var/static/list/sechailer_voicelines = list(
"Affirmative" = 'sound/voice/cpvoicelines/affirmative.ogg',
"Copy" = 'sound/voice/cpvoicelines/copy.ogg',
"Alright, you can go" = 'sound/voice/cpvoicelines/allrightyoucango.ogg',
diff --git a/code/modules/clothing/neck/bodycamera.dm b/code/modules/clothing/neck/bodycamera.dm
index a73749e00491..3cd85f30beb1 100644
--- a/code/modules/clothing/neck/bodycamera.dm
+++ b/code/modules/clothing/neck/bodycamera.dm
@@ -26,7 +26,7 @@
bodcam.network = list("ss13")
bodcam.internal_light = FALSE
bodcam.status = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/clothing/neck/bodycam/attack_self(mob/user)
if(!setup)
@@ -39,7 +39,7 @@
bodcam.status = TRUE
to_chat(user, span_notice("You turn on the body camera."))
getMobhook(user)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/clothing/neck/bodycam/AltClick(mob/user)
if(preset)
@@ -52,10 +52,10 @@
bodcam.network[1] = temp
setup = TRUE
bodcam.status = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/clothing/neck/bodycam/update_icon()
- ..()
+/obj/item/clothing/neck/bodycam/update_icon_state()
+ . = ..()
var/suffix = "off"
if(bodcam.status)
suffix = "on"
@@ -92,7 +92,7 @@
Disconnect()
bodcam.c_tag = null
bodcam.network[1] = null //requires a reset
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/clothing/neck/bodycam/Destroy()
Disconnect()
diff --git a/code/modules/clothing/outfits/occupying.dm b/code/modules/clothing/outfits/occupying.dm
index 2370855f22f7..ef8804a3df3b 100644
--- a/code/modules/clothing/outfits/occupying.dm
+++ b/code/modules/clothing/outfits/occupying.dm
@@ -74,7 +74,7 @@
back = /obj/item/melee/baton/cattleprod/tactical
head = /obj/item/clothing/head/helmet/sec/occupying
l_pocket = /obj/item/reagent_containers/food/drinks/beer
- r_pocket = /obj/item/storage/box/fancy/cigarettes
+ r_pocket = /obj/item/storage/fancy/cigarettes
id = /obj/item/card/id/ert/occupying
implants = list(/obj/item/implant/mindshield)
diff --git a/code/modules/clothing/shoes/bananashoes.dm b/code/modules/clothing/shoes/bananashoes.dm
index 064b1dc748fc..e083a186bc28 100644
--- a/code/modules/clothing/shoes/bananashoes.dm
+++ b/code/modules/clothing/shoes/bananashoes.dm
@@ -23,7 +23,7 @@
on = !on
if(!always_noslip)
clothing_flags &= ~NOSLIP
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(loc, span_warning("You ran out of bananium!"))
else
new /obj/item/grown/bananapeel/specialpeel(get_step(src,turn(usr.dir, 180))) //honk
@@ -45,7 +45,7 @@
var/datum/component/material_container/bananium = GetComponent(/datum/component/material_container)
if(bananium.get_material_amount(/datum/material/bananium))
on = !on
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You [on ? "activate" : "deactivate"] the prototype shoes."))
if(!always_noslip)
if(on)
@@ -55,7 +55,8 @@
else
to_chat(user, span_warning("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
diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm
index e918b1c4b2d4..0771eb245110 100644
--- a/code/modules/clothing/spacesuits/hardsuit.dm
+++ b/code/modules/clothing/spacesuits/hardsuit.dm
@@ -357,7 +357,8 @@
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(mapload)
@@ -388,7 +389,7 @@
flags_cover &= ~(HEADCOVERSEYES | HEADCOVERSMOUTH)
flags_inv &= ~visor_flags_inv
cold_protection &= ~HEAD
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1)
toggle_hardsuit_mode(user)
user.update_inv_head()
@@ -415,7 +416,7 @@
linkedsuit.cold_protection &= ~(CHEST | GROIN | LEGS | FEET | ARMS | HANDS)
linkedsuit.icon_state = "hardsuit[on]-[hardsuit_type]"
- linkedsuit.update_icon()
+ linkedsuit.update_appearance(UPDATE_ICON)
user.update_inv_wear_suit()
user.update_inv_w_uniform()
diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm
index 30ba60f29546..0425502cbf0e 100644
--- a/code/modules/clothing/spacesuits/plasmamen.dm
+++ b/code/modules/clothing/spacesuits/plasmamen.dm
@@ -47,12 +47,13 @@
light_system = MOVABLE_LIGHT
light_range = 4
light_on = FALSE
- var/helmet_on = FALSE
actions_types = list(/datum/action/item_action/toggle_helmet_light)
flash_protect = 0
- var/mutable_appearance/helmet_mob_overlay
- var/saved_style = null //our helmet style to apply overlay
- var/pref_alteration = TRUE ///set to true if the item will be modified by player's "plasmaman helmet style pref"
+ var/helmet_on = FALSE
+ ///Boolean on whether the item will be modified by player's "plasmaman helmet style pref"
+ var/pref_alteration = TRUE
+ ///The saved preference style on the helmet.
+ var/helmet_pref_style
/obj/item/clothing/head/helmet/space/plasmaman/attack_self(mob/user)
toggle_helmet_light(user)
@@ -61,7 +62,7 @@
helmet_on = !helmet_on
icon_state = "[initial(icon_state)][helmet_on ? "-light":""]"
item_state = icon_state
- update_icon(user)
+ update_appearance(UPDATE_ICON)
set_light_on(helmet_on)
@@ -71,35 +72,43 @@
if(!ishuman(user))
return
var/style = user.dna?.features["plasmaman_helmet"]
- user.cut_overlay(helmet_mob_overlay)
- if(style && (style in GLOB.plasmaman_helmet_list))
- if(style == "None")
- return
- saved_style = "enviro[GLOB.plasmaman_helmet_list[style]]"
- add_overlay(mutable_appearance('icons/obj/clothing/hats.dmi', saved_style))
- helmet_mob_overlay = mutable_appearance('icons/mob/clothing/head/head.dmi', saved_style)
- update_icon(user)
-
-/obj/item/clothing/head/helmet/space/plasmaman/update_icon(mob/living/carbon/human/user)
- if(!user)
+ if(!style || (style == "None") || !(style in GLOB.plasmaman_helmet_list))
return
- user.cut_overlay(helmet_mob_overlay)
- if(saved_style)
- user.add_overlay(helmet_mob_overlay)
- user.update_inv_head()
+ helmet_pref_style = "enviro[GLOB.plasmaman_helmet_list[style]]"
+ update_appearance(UPDATE_ICON)
+
+/obj/item/clothing/head/helmet/space/plasmaman/update_icon(updates=ALL)
+ . = ..()
+ if(!ismob(loc))
+ return
+ var/mob/loc_mob = loc
+ loc_mob.update_inv_head()
for(var/datum/action/A as anything in actions)
A.build_all_button_icons()
-/obj/item/clothing/head/helmet/space/plasmaman/equipped(mob/living/user, slot)
+/obj/item/clothing/head/helmet/space/plasmaman/worn_overlays(isinhands = FALSE)
. = ..()
- if(slot != ITEM_SLOT_HEAD)
- user.cut_overlay(helmet_mob_overlay)
+ if(isinhands)
return
- update_icon(user)
+ if(helmet_pref_style)
+ var/mutable_appearance/helmet_mob_overlay = mutable_appearance('icons/mob/clothing/head/head.dmi', helmet_pref_style)
+ . += helmet_mob_overlay
-/obj/item/clothing/head/helmet/space/plasmaman/dropped(mob/living/user)
- user.cut_overlay(helmet_mob_overlay)
+/obj/item/clothing/head/helmet/space/plasmaman/update_overlays()
. = ..()
+ if(!ismob(loc))
+ return
+ if(helmet_pref_style)
+ var/mutable_appearance/helmet_overlay = mutable_appearance('icons/obj/clothing/hats.dmi', helmet_pref_style)
+ . += helmet_overlay
+
+/obj/item/clothing/head/helmet/space/plasmaman/equipped(mob/living/user, slot)
+ . = ..()
+ update_appearance(UPDATE_ICON)
+
+/obj/item/clothing/head/helmet/space/plasmaman/dropped(mob/living/user)
+ update_appearance(UPDATE_ICON)
+ return ..()
/obj/item/clothing/head/helmet/space/plasmaman/security
name = "security envirosuit helmet"
diff --git a/code/modules/clothing/suits/chaplainsuits.dm b/code/modules/clothing/suits/chaplainsuits.dm
index 24fa4ed3b42b..3548cea0c382 100644
--- a/code/modules/clothing/suits/chaplainsuits.dm
+++ b/code/modules/clothing/suits/chaplainsuits.dm
@@ -1,10 +1,10 @@
//Chaplain Suit Subtypes
//If any new staple chaplain items get added, put them in these lists
/obj/item/clothing/suit/chaplainsuit
- allowed = list(/obj/item/storage/book/bible, /obj/item/nullrod, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/box/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant)
+ allowed = list(/obj/item/storage/book/bible, /obj/item/nullrod, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant)
/obj/item/clothing/suit/hooded/chaplainsuit
- allowed = list(/obj/item/storage/book/bible, /obj/item/nullrod, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/box/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant)
+ allowed = list(/obj/item/storage/book/bible, /obj/item/nullrod, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant)
//Suits
/obj/item/clothing/suit/chaplainsuit/holidaypriest
diff --git a/code/modules/clothing/suits/jobs.dm b/code/modules/clothing/suits/jobs.dm
index 4db872de4d04..40f43834bcb6 100644
--- a/code/modules/clothing/suits/jobs.dm
+++ b/code/modules/clothing/suits/jobs.dm
@@ -20,7 +20,7 @@
item_state = "bio_suit"
body_parts_covered = CHEST|GROIN|LEGS|ARMS
flags_inv = HIDEJUMPSUIT
- allowed = list(/obj/item/disk, /obj/item/stamp, /obj/item/reagent_containers/food/drinks/flask, /obj/item/melee, /obj/item/storage/lockbox/medal, /obj/item/assembly/flash/handheld, /obj/item/storage/box/matches, /obj/item/lighter, /obj/item/clothing/mask/cigarette, /obj/item/storage/box/fancy/cigarettes, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant)
+ allowed = list(/obj/item/disk, /obj/item/stamp, /obj/item/reagent_containers/food/drinks/flask, /obj/item/melee, /obj/item/storage/lockbox/medal, /obj/item/assembly/flash/handheld, /obj/item/storage/box/matches, /obj/item/lighter, /obj/item/clothing/mask/cigarette, /obj/item/storage/fancy/cigarettes, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant)
//Chef
/obj/item/clothing/suit/toggle/chef
@@ -68,7 +68,7 @@
/obj/item/clothing/suit/det_suit/civilian/Initialize(mapload)
. = ..()
//Same permissions as the leather jacket/leather overcoat, because you know, trench coat
- allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/revolver, /obj/item/gun/ballistic/revolver/detective, /obj/item/radio)
+ allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/revolver, /obj/item/gun/ballistic/revolver/detective, /obj/item/radio)
/obj/item/clothing/suit/det_suit/civilian/grey
name = "grey trenchcoat"
diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm
index 762ab684f9a0..fb4e94c5b823 100644
--- a/code/modules/clothing/suits/miscellaneous.dm
+++ b/code/modules/clothing/suits/miscellaneous.dm
@@ -87,7 +87,7 @@
icon_state = "judge"
item_state = "judge"
body_parts_covered = CHEST|GROIN|LEGS|ARMS
- allowed = list(/obj/item/storage/box/fancy/cigarettes, /obj/item/stack/spacecash)
+ allowed = list(/obj/item/storage/fancy/cigarettes, /obj/item/stack/spacecash)
flags_inv = HIDEJUMPSUIT
/obj/item/clothing/suit/buns
@@ -136,7 +136,7 @@
item_state = "imperium_monk"
body_parts_covered = CHEST|GROIN|LEGS|ARMS
flags_inv = HIDESHOES|HIDEJUMPSUIT
- allowed = list(/obj/item/storage/book/bible, /obj/item/nullrod, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/box/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen)
+ allowed = list(/obj/item/storage/book/bible, /obj/item/nullrod, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen)
/obj/item/clothing/suit/chickensuit
@@ -428,7 +428,7 @@
desc = "Aviators not included."
icon_state = "bomberjacket"
item_state = "brownjsuit"
- allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter, /obj/item/radio)
+ allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter, /obj/item/radio)
body_parts_covered = CHEST|GROIN|ARMS
cold_protection = CHEST|GROIN|ARMS
min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT
@@ -440,7 +440,7 @@
item_state = "hostrench"
resistance_flags = NONE
max_heat_protection_temperature = ARMOR_MAX_TEMP_PROTECT
- allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/revolver, /obj/item/gun/ballistic/revolver/detective, /obj/item/radio)
+ allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/revolver, /obj/item/gun/ballistic/revolver/detective, /obj/item/radio)
/obj/item/clothing/suit/jacket/leather/overcoat
name = "leather overcoat"
@@ -470,7 +470,7 @@
desc = "A canvas jacket styled after classical American military garb. Feels sturdy, yet comfortable."
icon_state = "militaryjacket"
item_state = "militaryjacket"
- allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/revolver, /obj/item/radio)
+ allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/revolver, /obj/item/radio)
/obj/item/clothing/suit/jacket/letterman
name = "letterman jacket"
@@ -558,7 +558,7 @@
cold_protection = CHEST|GROIN|ARMS
min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT
armor = list(MELEE = 0, BULLET = 0, LASER = 0,ENERGY = 0, BOMB = 0, BIO = 10, RAD = 0, FIRE = 0, ACID = 0)
- allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter)
+ allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter)
/obj/item/clothing/head/hooded/winterhood
name = "winter hood"
@@ -658,7 +658,7 @@
name = "science winter coat"
icon_state = "coatscience"
item_state = "coatscience"
- allowed = list(/obj/item/analyzer, /obj/item/multitool/tricorder, /obj/item/stack/medical, /obj/item/dnainjector, /obj/item/reagent_containers/dropper, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/autoinjector, /obj/item/healthanalyzer, /obj/item/flashlight/pen, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/pill, /obj/item/storage/pill_bottle, /obj/item/paper, /obj/item/melee/classic_baton/telescopic, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant)
+ allowed = list(/obj/item/analyzer, /obj/item/multitool/tricorder, /obj/item/stack/medical, /obj/item/dnainjector, /obj/item/reagent_containers/dropper, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/autoinjector, /obj/item/healthanalyzer, /obj/item/flashlight/pen, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/pill, /obj/item/storage/pill_bottle, /obj/item/paper, /obj/item/melee/classic_baton/telescopic, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant)
armor = list(MELEE = 0, BULLET = 0, LASER = 0,ENERGY = 0, BOMB = 10, BIO = 0, RAD = 0, FIRE = 0, ACID = 0)
hoodtype = /obj/item/clothing/head/hooded/winterhood/science
@@ -689,7 +689,7 @@
icon_state = "coatengineer"
item_state = "coatengineer"
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 20, FIRE = 30, ACID = 45)
- allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/t_scanner, /obj/item/construction/rcd, /obj/item/pipe_dispenser, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter, /obj/item/extinguisher/mini)
+ allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/t_scanner, /obj/item/construction/rcd, /obj/item/pipe_dispenser, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter, /obj/item/extinguisher/mini)
hoodtype = /obj/item/clothing/head/hooded/winterhood/engineering
/obj/item/clothing/head/hooded/winterhood/engineering
@@ -728,7 +728,7 @@
name = "hydroponics winter coat"
icon_state = "coathydro"
item_state = "coathydro"
- allowed = list(/obj/item/reagent_containers/spray/plantbgone, /obj/item/plant_analyzer, /obj/item/seeds, /obj/item/reagent_containers/glass/bottle, /obj/item/cultivator, /obj/item/reagent_containers/spray/pestspray, /obj/item/hatchet, /obj/item/storage/bag/plants, /obj/item/toy, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter)
+ allowed = list(/obj/item/reagent_containers/spray/plantbgone, /obj/item/plant_analyzer, /obj/item/seeds, /obj/item/reagent_containers/glass/bottle, /obj/item/cultivator, /obj/item/reagent_containers/spray/pestspray, /obj/item/hatchet, /obj/item/storage/bag/plants, /obj/item/toy, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/storage/fancy/cigarettes, /obj/item/lighter)
hoodtype = /obj/item/clothing/head/hooded/winterhood/hydro
/obj/item/clothing/head/hooded/winterhood/hydro
@@ -747,7 +747,7 @@
name = "mining winter coat"
icon_state = "coatminer"
item_state = "coatminer"
- allowed = list(/obj/item/pickaxe, /obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter)
+ allowed = list(/obj/item/pickaxe, /obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter)
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 0, ACID = 0)
hoodtype = /obj/item/clothing/head/hooded/winterhood/miner
diff --git a/code/modules/detectivework/scanner.dm b/code/modules/detectivework/scanner.dm
index 5200b8744533..ce806464ec2a 100644
--- a/code/modules/detectivework/scanner.dm
+++ b/code/modules/detectivework/scanner.dm
@@ -137,7 +137,7 @@
P.info = text("Forensic Record - (FR-[])
", frNum)
P.info += jointext(log, "
")
P.info += "
Notes:
"
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
if(ismob(loc))
var/mob/M = loc
diff --git a/code/modules/events/holiday/vday.dm b/code/modules/events/holiday/vday.dm
index 4481de9b7d76..6e3649a80208 100644
--- a/code/modules/events/holiday/vday.dm
+++ b/code/modules/events/holiday/vday.dm
@@ -19,7 +19,7 @@
H.put_in_hands(new /obj/item/valentine)
var/obj/item/storage/backpack/b = locate() in H.contents
new /obj/item/reagent_containers/food/snacks/candyheart(b)
- new /obj/item/storage/box/fancy/heart_box(b)
+ new /obj/item/storage/fancy/heart_box(b)
var/list/valentines = list()
for(var/mob/living/M in GLOB.player_list)
diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm
index 4fa101792923..077c1c192479 100644
--- a/code/modules/events/pirates.dm
+++ b/code/modules/events/pirates.dm
@@ -137,7 +137,7 @@
. = ..()
gps = new/obj/item/gps/internal/pirate(src)
gps.tracking = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/shuttle_scrambler/process()
if(active)
@@ -168,7 +168,7 @@
if(active || !user.canUseTopic(src, BE_CLOSE))
return
toggle_on(user)
- update_icon()
+ update_appearance(UPDATE_ICON)
send_notification()
else
dump_loot(user)
@@ -195,7 +195,8 @@
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/events/prison_break.dm b/code/modules/events/prison_break.dm
index a581d6c659ea..28b1f2d0d176 100644
--- a/code/modules/events/prison_break.dm
+++ b/code/modules/events/prison_break.dm
@@ -49,7 +49,7 @@
if(istype(O, /obj/structure/closet/secure_closet))
var/obj/structure/closet/secure_closet/temp = O
temp.locked = FALSE
- temp.update_icon()
+ temp.update_appearance(UPDATE_ICON)
else if(istype(O, /obj/machinery/door/airlock))
var/obj/machinery/door/airlock/temp = O
//Skip doors in critical positions, such as the SM chamber, and skip doors the AI can't control since it's a virus
diff --git a/code/modules/events/shuttle_loan.dm b/code/modules/events/shuttle_loan.dm
index 328a3bba45fe..a03c131d4ed8 100644
--- a/code/modules/events/shuttle_loan.dm
+++ b/code/modules/events/shuttle_loan.dm
@@ -271,7 +271,7 @@
setAnchored(TRUE)
timer_set = rand(480, 600) //once the supply shuttle docks (after 5 minutes travel time), players have between 3-5 minutes to defuse the bomb
activate()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/paper/fluff/cargo/bomb
name = "hastly scribbled note"
diff --git a/code/modules/events/stray_cargo.dm b/code/modules/events/stray_cargo.dm
index 0666ca9bd206..bd0e32ace46b 100644
--- a/code/modules/events/stray_cargo.dm
+++ b/code/modules/events/stray_cargo.dm
@@ -52,7 +52,7 @@
var/datum/supply_pack/SP = new pack_type
var/obj/structure/closet/crate/crate = SP.generate(null)
crate.locked = FALSE //Unlock secure crates
- crate.update_icon()
+ crate.update_appearance(UPDATE_ICON)
var/obj/structure/closet/supplypod/pod = make_pod()
new /obj/effect/DPtarget(LZ, pod, crate)
diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm
index 54362e8c863a..bdd8e592c1c8 100644
--- a/code/modules/flufftext/Hallucination.dm
+++ b/code/modules/flufftext/Hallucination.dm
@@ -115,7 +115,8 @@ GLOBAL_LIST_INIT(hallucination_list, list(
if(target.client)
target.client.images |= current_image
-/obj/effect/hallucination/simple/update_icon(new_state,new_icon,new_px=0,new_py=0)
+/obj/effect/hallucination/simple/update_icon(updates=ALL, new_state, new_icon, new_px=0, new_py=0)
+ . = ..()
image_state = new_state
if(new_icon)
image_icon = new_icon
@@ -217,7 +218,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
name = "alien hunter ([rand(1, 1000)])"
/obj/effect/hallucination/simple/xeno/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
- update_icon("alienh_pounce")
+ update_icon(new_state = "alienh_pounce")
if(hit_atom == target && target.stat!=DEAD)
target.Paralyze(100)
target.visible_message(span_danger("[target] flails around wildly."),"[name] pounces on you!")
@@ -239,10 +240,10 @@ GLOBAL_LIST_INIT(hallucination_list, list(
feedback_details += "Vent Coords: [pump.x],[pump.y],[pump.z]"
xeno = new(pump.loc,target)
sleep(1 SECONDS)
- xeno.update_icon("alienh_leap",'icons/mob/alienleap.dmi',-32,-32)
+ xeno.update_icon(new_state = "alienh_leap", new_icon = 'icons/mob/alienleap.dmi', new_px = -32, new_py = -32)
xeno.throw_at(target,7,1, xeno, FALSE, TRUE)
sleep(1 SECONDS)
- xeno.update_icon("alienh_leap",'icons/mob/alienleap.dmi',-32,-32)
+ xeno.update_icon(new_state = "alienh_leap", new_icon = 'icons/mob/alienleap.dmi', new_px = -32, new_py = -32)
xeno.throw_at(pump,7,1, xeno, FALSE, TRUE)
sleep(1 SECONDS)
var/xeno_name = xeno.name
diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
index 0a0d75ec7aaf..b76deccada55 100644
--- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
@@ -23,10 +23,10 @@
age_restricted = TRUE
/obj/item/reagent_containers/food/drinks/bottle/on_reagent_change(changetype)
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/reagent_containers/food/drinks/bottle/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/food/drinks/bottle/update_overlays()
+ . = ..()
if(reagents.total_volume)
var/fill_name = icon_state
@@ -40,9 +40,9 @@
filling.icon_state = "[fill_name][fill_icon_thresholds[i]]"
filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
+ . += filling
- add_overlay("[initial(icon_state)]shine")
+ . += "[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 799324b0f0ca..8b0557367eee 100644
--- a/code/modules/food_and_drinks/food/customizables.dm
+++ b/code/modules/food_and_drinks/food/customizables.dm
@@ -53,14 +53,14 @@
mix_filling_color(S)
S.reagents.trans_to(src,min(S.reagents.total_volume, 15), transfered_by = user) //limit of 15, we don't want our custom food to be completely filled by just one ingredient with large reagent volume.
foodtype |= S.foodtype
- update_overlays(S)
to_chat(user, span_notice("You add the [I.name] to the [name]."))
- update_name(S)
+ update_snack_overlays(S)
+ update_snack_name(S)
else
. = ..()
-/obj/item/reagent_containers/food/snacks/customizable/proc/update_name(obj/item/reagent_containers/food/snacks/S)
+/obj/item/reagent_containers/food/snacks/customizable/proc/update_snack_name(obj/item/reagent_containers/food/snacks/S)
for(var/obj/item/I in ingredients)
if(!istype(S, I.type))
customname = "custom"
@@ -102,7 +102,8 @@
rgbcolor[4] = (customcolor[4]+ingcolor[4])/2
filling_color = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3], rgbcolor[4])
-/obj/item/reagent_containers/food/snacks/customizable/update_overlays(obj/item/reagent_containers/food/snacks/S)
+/obj/item/reagent_containers/food/snacks/customizable/update_snack_overlays(obj/item/reagent_containers/food/snacks/S)
+ . = ..()
var/mutable_appearance/filling = mutable_appearance(icon, "[initial(icon_state)]_filling")
if(S.filling_color == "#FFFFFF")
filling.color = pick("#FF0000","#0000FF","#008000","#FFFF00")
@@ -138,12 +139,11 @@
/obj/item/reagent_containers/food/snacks/customizable/initialize_slice(obj/item/reagent_containers/food/snacks/slice, reagents_per_slice)
..()
slice.filling_color = filling_color
- slice.update_overlays(src)
+ slice.update_snack_overlays(src)
/obj/item/reagent_containers/food/snacks/customizable/Destroy()
- for(var/ingredient in ingredients)
- qdel(ingredient)
+ QDEL_NULL(ingredients)
return ..()
@@ -347,15 +347,18 @@
/obj/item/reagent_containers/glass/bowl/on_reagent_change(changetype)
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/reagent_containers/glass/bowl/update_icon()
- cut_overlays()
+/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
+ . += filling
+
+/obj/item/reagent_containers/glass/bowl/update_icon_state()
+ . = ..()
+ if(!reagents || !reagents.total_volume)
icon_state = "bowl"
#undef INGREDIENTS_FILL
diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm
index 206d735ad958..6e7bce38d3ff 100644
--- a/code/modules/food_and_drinks/food/snacks.dm
+++ b/code/modules/food_and_drinks/food/snacks.dm
@@ -257,7 +257,7 @@ All foods are distributed among various categories. Use common sense.
trash = null
return
-/obj/item/reagent_containers/food/snacks/proc/update_overlays(obj/item/reagent_containers/food/snacks/S)
+/obj/item/reagent_containers/food/snacks/proc/update_snack_overlays(obj/item/reagent_containers/food/snacks/S)
cut_overlays()
var/mutable_appearance/filling = mutable_appearance(icon, "[initial(icon_state)]_filling")
if(S.filling_color == "#FFFFFF")
diff --git a/code/modules/food_and_drinks/food/snacks_pastry.dm b/code/modules/food_and_drinks/food/snacks_pastry.dm
index 254025024908..85b3f53dacdc 100644
--- a/code/modules/food_and_drinks/food/snacks_pastry.dm
+++ b/code/modules/food_and_drinks/food/snacks_pastry.dm
@@ -672,15 +672,22 @@
/obj/item/reagent_containers/food/snacks/pancakes/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
+
+/obj/item/reagent_containers/food/snacks/pancakes/update_name()
+ name = contents.len ? "stack of pancakes" : initial(name)
+ return ..()
+
+/obj/item/reagent_containers/food/snacks/pancakes/update_icon(updates = ALL)
+ if(!(updates & UPDATE_OVERLAYS))
+ return ..()
+
+ updates &= ~UPDATE_OVERLAYS
+ . = ..() // Don't update overlays. We're doing that here
-/obj/item/reagent_containers/food/snacks/pancakes/update_icon()
- if(contents.len)
- name = "stack of pancakes"
- else
- name = initial(name)
if(contents.len < LAZYLEN(overlays))
- overlays-=overlays[overlays.len]
+ overlays -= overlays[overlays.len]
+ . |= UPDATE_OVERLAYS
/obj/item/reagent_containers/food/snacks/pancakes/examine(mob/user)
var/ingredients_listed = ""
@@ -708,7 +715,7 @@
bitecount = originalBites
/obj/item/reagent_containers/food/snacks/pancakes/attackby(obj/item/I, mob/living/user, params)
- if(istype(I, /obj/item/reagent_containers/food/snacks/pancakes/))
+ if(istype(I, /obj/item/reagent_containers/food/snacks/pancakes))
var/obj/item/reagent_containers/food/snacks/pancakes/P = I
if((contents.len >= PANCAKE_MAX_STACK) || ((P.contents.len + contents.len) > PANCAKE_MAX_STACK) || (reagents.total_volume >= volume))
to_chat(user, span_warning("You can't add that many pancakes to [src]!"))
@@ -733,18 +740,11 @@
return O.attackby(I, user, params)
..()
-/obj/item/reagent_containers/food/snacks/pancakes/update_overlays(obj/item/reagent_containers/food/snacks/P)
- var/mutable_appearance/pancake = mutable_appearance(icon, "[P.item_state]_[rand(1,3)]")
- pancake.pixel_x = rand(-1,1)
- pancake.pixel_y = 3 * contents.len - 1
- add_overlay(pancake)
- update_icon()
-
/obj/item/reagent_containers/food/snacks/pancakes/attack(mob/M, mob/user, def_zone, stacked = TRUE)
if(user.a_intent == INTENT_HARM || !contents.len || !stacked)
return ..()
var/obj/item/O = contents[contents.len]
. = O.attack(M, user, def_zone, FALSE)
- update_icon()
+ update_appearance(UPDATE_ICON)
#undef PANCAKE_MAX_STACK
diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
index 756db185425b..c1e1ae5f61f9 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)
@@ -99,7 +99,7 @@
user.visible_message(span_danger("[user] stuffs [C] into the gibber!"))
C.forceMove(src)
occupant = C
- update_icon()
+ update_appearance(UPDATE_ICON)
else
startgibbing(user)
@@ -133,7 +133,7 @@
/obj/machinery/gibber/proc/go_out()
dropContents()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/gibber/proc/startgibbing(mob/user)
if(src.operating)
@@ -145,7 +145,7 @@
visible_message(span_italics("You hear a loud squelchy grinding sound."))
playsound(src.loc, 'sound/machines/juicer.ogg', 50, 1)
operating = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
var/offset = prob(50) ? -2 : 2
animate(src, pixel_x = pixel_x + offset, time = 0.02 SECONDS, loop = 200) //start shaking
@@ -221,7 +221,7 @@
pixel_x = initial(pixel_x) //return to its spot after shaking
operating = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
//auto-gibs anything that bumps into it
/obj/machinery/gibber/autogibber
diff --git a/code/modules/food_and_drinks/kitchen_machinery/griddle.dm b/code/modules/food_and_drinks/kitchen_machinery/griddle.dm
index 56065b62c0c0..d0997899ad18 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/griddle.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/griddle.dm
@@ -32,7 +32,7 @@
return
if(!on && default_deconstruction_screwdriver(user, icon_state, icon_state, I))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(griddled_objects.len >= max_items)
@@ -49,7 +49,7 @@
I.pixel_y = clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/8), world.icon_size/4)
to_chat(user, "You place [I] on [src].")
AddToGrill(I, user)
- update_icon()
+ update_appearance(UPDATE_ICON)
else
return ..()
@@ -62,7 +62,7 @@
begin_processing()
else
end_processing()
- update_icon()
+ update_appearance(UPDATE_ICON)
update_grill_audio()
@@ -106,7 +106,7 @@
if(prob(10))
visible_message("[griddled_item] doesn't seem to be doing too great on the [src]!")
-/obj/machinery/griddle/update_icon()
+/obj/machinery/griddle/update_icon_state()
. = ..()
if(panel_open)
icon_state = "griddle[variant]_o"
diff --git a/code/modules/food_and_drinks/kitchen_machinery/grill.dm b/code/modules/food_and_drinks/kitchen_machinery/grill.dm
index ce0259a5c6c0..33cec170c196 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/grill.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/grill.dm
@@ -20,7 +20,8 @@
. = ..()
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 > 0)
@@ -38,7 +39,7 @@
else
grill_fuel += (50 * stackamount)
S.use(stackamount)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(I.resistance_flags & INDESTRUCTIBLE)
to_chat(user, span_warning("You don't feel it would be wise to grill [I]..."))
@@ -59,7 +60,7 @@
RegisterSignal(grilled_item, COMSIG_GRILL_COMPLETED, PROC_REF(GrillCompleted))
grilled_item.foodtype |= GRILLED
to_chat(user, span_notice("You put the [grilled_item] on [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
grill_loop.start()
return
else
@@ -67,13 +68,13 @@
grill_fuel += (20 * (I.reagents.get_reagent_amount(/datum/reagent/consumable/monkey_energy)))
to_chat(user, span_notice("You pour the Monkey Energy in [src]."))
I.reagents.remove_reagent(/datum/reagent/consumable/monkey_energy, I.reagents.get_reagent_amount(/datum/reagent/consumable/monkey_energy))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
..()
/obj/machinery/grill/process(delta_time)
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
if(grill_fuel <= 0)
return
else
@@ -124,7 +125,7 @@
if(grilled_item)
to_chat(user, span_notice("You take out [grilled_item] from [src]."))
grilled_item.forceMove(drop_location())
- update_icon()
+ update_appearance(UPDATE_ICON)
return
return ..()
diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
index c32488db9083..26eaa4c74366 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
@@ -87,7 +87,8 @@
"- Capacity: [max_n_of_items] items.\n"+\
span_notice("- 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)
@@ -109,7 +110,7 @@
if(dirty < 100)
if(default_deconstruction_screwdriver(user, icon_state, icon_state, O) || default_unfasten_wrench(user, O))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(panel_open && is_wire_tool(O))
@@ -127,7 +128,7 @@
if(O.use_tool(src, user, 20))
user.visible_message("[user] fixes \the [src].", span_notice("You fix \the [src]."))
broken = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
return FALSE //to use some fuel
else
to_chat(user, span_warning("It's broken!"))
@@ -141,7 +142,7 @@
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
user.visible_message("[user] has cleaned \the [src].", span_notice("You clean \the [src]."))
dirty = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("You need more space cleaner!"))
return TRUE
@@ -152,7 +153,7 @@
if(do_after(user, P.cleanspeed, src))
user.visible_message("[user] has cleaned \the [src].", span_notice("You clean \the [src]."))
dirty = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
if(dirty == 100) // The microwave is all dirty so can't be used!
@@ -258,7 +259,7 @@
set_light(1.5)
soundloop.start()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/microwave/proc/spark()
visible_message(span_warning("Sparks fly around [src]!"))
@@ -282,7 +283,7 @@
turn_on()
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
dirty_anim_playing = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
loop(MICROWAVE_MUCK, 4)
/obj/machinery/microwave/proc/loop(type, time, wait = max(12 - 2 * efficiency, 2)) // standard wait is 10
@@ -349,7 +350,7 @@
/obj/machinery/microwave/proc/after_finish_loop()
set_light(0)
soundloop.stop()
- update_icon()
+ update_appearance(UPDATE_ICON)
#undef MICROWAVE_NORMAL
#undef MICROWAVE_MUCK
diff --git a/code/modules/food_and_drinks/kitchen_machinery/oven.dm b/code/modules/food_and_drinks/kitchen_machinery/oven.dm
index 471abd866cc4..319c402f3226 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/oven.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/oven.dm
@@ -42,8 +42,8 @@
QDEL_NULL(particles)
. = ..()
-/obj/machinery/oven/update_icon()
- update_overlays()
+/obj/machinery/oven/update_icon_state()
+ . = ..()
if(panel_open)
icon_state = "oven_o"
return ..()
@@ -51,17 +51,16 @@
icon_state = "oven_on"
else
icon_state = "oven_off"
- return ..()
-/obj/machinery/oven/proc/update_overlays()
- cut_overlays()
+/obj/machinery/oven/update_overlays()
+ . = ..()
var/mutable_appearance/door_overlay
if(open)
door_overlay = mutable_appearance(icon, "oven_lid_open")
door_overlay.pixel_y = OVEN_LID_Y_OFFSET
else
door_overlay = mutable_appearance(icon, "oven_lid_closed")
- add_overlay(door_overlay);
+ . += door_overlay
/obj/machinery/oven/process(delta_time)
..()
@@ -87,7 +86,7 @@
if(prob(10))
visible_message(span_danger("You smell a burnt smell coming from [src]!"))
set_smoke_state(worst_cooked_food_state)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/oven/attackby(obj/item/I, mob/user, params)
@@ -110,7 +109,7 @@
RegisterSignal(used_tray, COMSIG_MOVABLE_MOVED, PROC_REF(ItemMoved))
update_baking_audio()
- update_icon()
+ update_appearance(UPDATE_ICON)
///Called when the tray is moved out of the oven in some way
/obj/machinery/oven/proc/ItemMoved(obj/item/oven_tray, atom/OldLoc, Dir, Forced)
@@ -144,7 +143,7 @@
if(used_tray)
begin_processing()
used_tray.vis_flags |= VIS_HIDE
- update_icon()
+ update_appearance(UPDATE_ICON)
update_baking_audio()
return TRUE
@@ -178,7 +177,7 @@
to_chat(user,span_notice("The access panel won't budge with a tray inside!"))
return TRUE
panel_open = !panel_open
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
index f85e1aff0663..bf9da2bf7bd9 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
@@ -146,10 +146,11 @@
/obj/machinery/smartfridge/obj_break(damage_flag)
if(!(stat & BROKEN))
stat |= BROKEN
- update_icon()
+ update_appearance(UPDATE_ICON)
..(damage_flag)
-/obj/machinery/smartfridge/update_icon()
+/obj/machinery/smartfridge/update_icon_state()
+ . = ..()
var/startstate = initial(icon_state)
if(stat & BROKEN)
icon_state = "[startstate]-broken"
@@ -230,7 +231,7 @@
if(accept_check(O))
load(O)
user.visible_message("[user] has added \the [O] to \the [src].", span_notice("You add \the [O] to \the [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
updateUsrDialog()
if(contents.len >= max_n_of_items)
indicate_full()
@@ -245,7 +246,7 @@
if(accept_check(G))
load(G)
loaded++
- update_icon()
+ update_appearance(UPDATE_ICON)
updateUsrDialog()
if(loaded)
@@ -272,7 +273,7 @@
load(organ)
OS.clear_organ()
user.visible_message("[user] has added \the [organ] to \the [src].", span_notice("You add \the [organ] to \the [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
updateUsrDialog()
if(contents.len >= max_n_of_items)
indicate_full()
@@ -377,7 +378,7 @@
if(O.name == params["name"])
dispense(O, usr)
break
- update_icon()
+ update_appearance(UPDATE_ICON)
cut_overlay(full_indicator_state)
animate_dispenser()
return TRUE
@@ -390,7 +391,7 @@
dispense(O, usr)
desired--
- update_icon()
+ update_appearance(UPDATE_ICON)
cut_overlay(full_indicator_state)
animate_dispenser()
return TRUE
@@ -454,7 +455,7 @@
/obj/machinery/smartfridge/drying_rack/ui_act(action, params)
. = ..()
if(.)
- update_icon() // This is to handle a case where the last item is taken out manually instead of through drying pop-out
+ update_appearance(UPDATE_ICON) // This is to handle a case where the last item is taken out manually instead of through drying pop-out
return
switch(action)
if("Dry")
@@ -474,22 +475,21 @@
/obj/machinery/smartfridge/drying_rack/load() //For updating the filled overlay
..()
- update_icon()
+ update_appearance(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()
..()
if(drying)
if(rack_dry())//no need to update unless something got dried
SStgui.update_uis(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/smartfridge/drying_rack/accept_check(obj/item/O)
if(istype(O, /obj/item/reagent_containers/food/snacks/))
@@ -507,7 +507,7 @@
else
drying = TRUE
use_power = ACTIVE_POWER_USE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/smartfridge/drying_rack/proc/rack_dry()
for(var/obj/item/reagent_containers/food/snacks/S in src)
diff --git a/code/modules/food_and_drinks/pizzabox.dm b/code/modules/food_and_drinks/pizzabox.dm
index 15d995943de2..5c701880fac8 100644
--- a/code/modules/food_and_drinks/pizzabox.dm
+++ b/code/modules/food_and_drinks/pizzabox.dm
@@ -31,15 +31,15 @@
/obj/item/pizzabox/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/pizzabox/Destroy()
unprocess()
return ..()
-/obj/item/pizzabox/update_icon()
- // Description
+/obj/item/pizzabox/update_desc(updates=ALL)
+ . = ..()
desc = initial(desc)
if(open)
if(pizza)
@@ -57,34 +57,41 @@
if(box.boxtag != "")
desc = "[desc] The [boxes.len ? "top box" : "box"]'s tag reads: [box.boxtag]"
- // Icon/Overlays
- cut_overlays()
- if(open)
+/obj/item/pizzabox/update_icon_state()
+ . = ..()
+ if(!open)
+ icon_state = "pizzabox"
+ return
+ if(pizza)
+ icon_state = "pizzabox_messy"
+ else if(bomb)
+ bomb.icon_state = "pizzabomb_[bomb_active ? "active" : "inactive"]"
+ else
icon_state = "pizzabox_open"
+
+/obj/item/pizzabox/update_overlays()
+ . = ..()
+ if(open)
if(pizza)
- icon_state = "pizzabox_messy"
var/mutable_appearance/pizza_overlay = mutable_appearance(pizza.icon, pizza.icon_state)
pizza_overlay.pixel_y = -3
- add_overlay(pizza_overlay)
+ . += pizza_overlay
if(bomb)
- bomb.icon_state = "pizzabomb_[bomb_active ? "active" : "inactive"]"
var/mutable_appearance/bomb_overlay = mutable_appearance(bomb.icon, bomb.icon_state)
bomb_overlay.pixel_y = 5
- add_overlay(bomb_overlay)
+ . += bomb_overlay
else
- icon_state = "pizzabox"
var/current_offset = 3
- for(var/V in boxes)
- var/obj/item/pizzabox/P = V
+ for(var/obj/item/pizzabox/P as anything in boxes)
var/mutable_appearance/box_overlay = mutable_appearance(P.icon, P.icon_state)
box_overlay.pixel_y = current_offset
- add_overlay(box_overlay)
+ . += box_overlay
current_offset += 3
var/obj/item/pizzabox/box = boxes.len ? boxes[boxes.len] : src
if(box.boxtag != "")
var/mutable_appearance/tag_overlay = mutable_appearance(icon, "pizzabox_tag")
tag_overlay.pixel_y = boxes.len * 3
- add_overlay(tag_overlay)
+ . += tag_overlay
/obj/item/pizzabox/worn_overlays(isinhands, icon_file)
. = list()
@@ -104,7 +111,7 @@
audible_message(span_warning("[icon2html(src, hearers(src))] *beep*"))
bomb_active = TRUE
START_PROCESSING(SSobj, src)
- update_icon()
+ update_appearance(UPDATE_ICON)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/pizzabox/attack_hand(mob/user)
@@ -115,13 +122,13 @@
user.put_in_hands(pizza)
to_chat(user, span_notice("You take [pizza] out of [src]."))
pizza = null
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(bomb)
if(wires.is_all_cut() && bomb_defused)
user.put_in_hands(bomb)
to_chat(user, span_notice("You carefully remove the [bomb] from [src]."))
bomb = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else
bomb_timer = input(user, "Set the [bomb] timer from [BOMB_TIMER_MIN] to [BOMB_TIMER_MAX].", bomb, bomb_timer) as num|null
@@ -136,14 +143,14 @@
bomb.adminlog = "The [bomb.name] in [src.name] that [key_name(user)] activated has detonated!"
to_chat(user, span_warning("You trap [src] with [bomb]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(boxes.len)
var/obj/item/pizzabox/topbox = boxes[boxes.len]
boxes -= topbox
user.put_in_hands(topbox)
to_chat(user, span_notice("You remove the topmost [name] from the stack."))
- topbox.update_icon()
- update_icon()
+ topbox.update_appearance(UPDATE_ICON)
+ update_appearance(UPDATE_ICON)
user.regenerate_icons()
/obj/item/pizzabox/attackby(obj/item/I, mob/user, params)
@@ -158,8 +165,8 @@
boxes += add
newbox.boxes.Cut()
to_chat(user, span_notice("You put [newbox] on top of [src]!"))
- newbox.update_icon()
- update_icon()
+ newbox.update_appearance(UPDATE_ICON)
+ update_appearance(UPDATE_ICON)
user.regenerate_icons()
if(boxes.len >= 5)
if(prob(10 * boxes.len))
@@ -179,7 +186,7 @@
return
pizza = I
to_chat(user, span_notice("You put [I] in [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else if(istype(I, /obj/item/bombcore/miniature/pizza))
if(open && !bomb)
@@ -188,7 +195,7 @@
wires = new /datum/wires/explosive/pizza(src)
bomb = I
to_chat(user, span_notice("You put [I] in [src]. Sneeki breeki..."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else if(bomb)
to_chat(user, span_notice("[src] already has a bomb in it!"))
@@ -202,7 +209,7 @@
if(!user.canUseTopic(src, BE_CLOSE))
return
to_chat(user, span_notice("You write with [I] on [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else if(is_wire_tool(I))
if(wires && bomb)
@@ -252,9 +259,9 @@
fall_dir = pick(GLOB.alldirs)
step(P.pizza, fall_dir)
P.pizza = null
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
boxes -= P
- update_icon()
+ update_appearance(UPDATE_ICON)
if(isliving(loc))
var/mob/living/L = loc
L.regenerate_icons()
@@ -263,7 +270,7 @@
STOP_PROCESSING(SSobj, src)
qdel(wires)
wires = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/pizzabox/bomb/Initialize(mapload)
. = ..()
diff --git a/code/modules/food_and_drinks/plate.dm b/code/modules/food_and_drinks/plate.dm
index 5140cd543efb..5741018c6e2b 100644
--- a/code/modules/food_and_drinks/plate.dm
+++ b/code/modules/food_and_drinks/plate.dm
@@ -31,7 +31,7 @@
I.pixel_y = clamp(text2num(click_params["icon-y"]) - 16, -placement_offset, max_height_offset)
to_chat(user, span_notice("You place [I] on [src]."))
AddToPlate(I, user)
- update_icon()
+ update_appearance(UPDATE_ICON)
else
return ..()
diff --git a/code/modules/games/cas.dm b/code/modules/games/cas.dm
index 9c53e54cc252..339b69433c67 100644
--- a/code/modules/games/cas.dm
+++ b/code/modules/games/cas.dm
@@ -78,7 +78,7 @@
H.pickup(user)
user.put_in_hands(H)
user.visible_message("[user] draws a card from the deck.", span_notice("You draw a card from the deck."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/toy/cards/deck/cas/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/toy/cards/singlecard/cas))
@@ -93,9 +93,10 @@
cards += RC
user.visible_message("[user] adds a card to the bottom of the deck.",span_notice("You add the card to the bottom of the deck."))
qdel(SC)
- update_icon()
+ update_appearance(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"
@@ -129,14 +130,15 @@
else if(flipped)
name = buffertext
flipped = !flipped
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/toy/cards/singlecard/cas/AltClick(mob/living/user)
if(!ishuman(user) || !user.canUseTopic(src, BE_CLOSE))
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/goals/station_goals/bsa.dm b/code/modules/goals/station_goals/bsa.dm
index 11149fb38997..887252463c37 100644
--- a/code/modules/goals/station_goals/bsa.dm
+++ b/code/modules/goals/station_goals/bsa.dm
@@ -255,7 +255,7 @@
if("recalibrate")
calibrate(usr)
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/computer/bsa_control/proc/calibrate(mob/user)
if(!GLOB.bsa_unlock)
diff --git a/code/modules/goals/station_goals/shield.dm b/code/modules/goals/station_goals/shield.dm
index f981ad6066a1..bbdc0c018aaa 100644
--- a/code/modules/goals/station_goals/shield.dm
+++ b/code/modules/goals/station_goals/shield.dm
@@ -116,9 +116,10 @@
else
animate(src, pixel_y = 0, time = 1 SECONDS)
anchored = FALSE
- update_icon()
+ update_appearance(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/holodeck/area_copy.dm b/code/modules/holodeck/area_copy.dm
index 87d2981dd78c..d0ecd28c9f9f 100644
--- a/code/modules/holodeck/area_copy.dm
+++ b/code/modules/holodeck/area_copy.dm
@@ -37,7 +37,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars, list(
var/obj/item/I = O
I.damtype = STAMINA // thou shalt not
- N.update_icon()
+ N.update_appearance(UPDATE_ICON)
if(ismachinery(O))
var/obj/machinery/M = O
M.power_change()
diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm
index 27220da6be7c..c2fbe0a7d693 100644
--- a/code/modules/holodeck/items.dm
+++ b/code/modules/holodeck/items.dm
@@ -187,7 +187,7 @@
ready = !ready
- update_icon()
+ update_appearance(UPDATE_ICON)
var/numbuttons = 0
var/numready = 0
@@ -199,7 +199,8 @@
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/holodeck/turfs.dm b/code/modules/holodeck/turfs.dm
index 94588436d409..1ac4884134ef 100644
--- a/code/modules/holodeck/turfs.dm
+++ b/code/modules/holodeck/turfs.dm
@@ -34,7 +34,7 @@
. = ..()
if(src.type == /turf/open/floor/holofloor/grass) //don't want grass subtypes getting the icon state,
icon_state = "grass[rand(1,4)]"
- update_icon()
+ update_appearance(UPDATE_ICON)
/turf/open/floor/holofloor/beach
gender = PLURAL
@@ -119,9 +119,10 @@
. = ..()
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom/, update_icon)), 1)
-/turf/open/floor/holofloor/carpet/update_icon()
- if(!..())
- return 0
+/turf/open/floor/holofloor/carpet/update_icon(updates=ALL)
+ . = ..()
+ if(!.)
+ return FALSE
if(intact)
queue_smooth(src)
diff --git a/code/modules/hydroponics/beekeeping/honeycomb.dm b/code/modules/hydroponics/beekeeping/honeycomb.dm
index 1cf097c98ed6..7ed0c265abe1 100644
--- a/code/modules/hydroponics/beekeeping/honeycomb.dm
+++ b/code/modules/hydroponics/beekeeping/honeycomb.dm
@@ -17,16 +17,16 @@
. = ..()
pixel_x = rand(8,-8)
pixel_y = rand(8,-8)
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/reagent_containers/honeycomb/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/honeycomb/update_overlays()
+ . = ..()
var/mutable_appearance/honey_overlay = mutable_appearance(icon, /datum/reagent/consumable/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)
@@ -37,4 +37,4 @@
reagents.add_reagent(R.type,5)
else
honey_color = ""
- update_icon()
\ No newline at end of file
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm
index eb2625ad9658..09784f69b812 100644
--- a/code/modules/hydroponics/biogenerator.dm
+++ b/code/modules/hydroponics/biogenerator.dm
@@ -31,7 +31,7 @@
..()
if(A == beaker)
beaker = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/biogenerator/contents_explosion(severity, target)
..()
@@ -63,9 +63,10 @@
. += span_notice("The status display reads: Productivity at [productivity*100]%.
Matter consumption reduced by [(efficiency*25)-25]%.
Machine can hold up to [max_items] pieces of produce.")
/obj/machinery/biogenerator/on_reagent_change(changetype) //When the reagents change, change the icon as well.
- update_icon()
+ update_appearance(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)
@@ -88,7 +89,7 @@
var/obj/item/reagent_containers/glass/B = beaker
B.forceMove(drop_location())
beaker = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(default_deconstruction_crowbar(O))
@@ -104,7 +105,7 @@
return
beaker = O
to_chat(user, span_notice("You add the container to the machine."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("Close the maintenance panel first."))
return
@@ -184,12 +185,12 @@
qdel(I)
if(S)
processing = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(loc, 'sound/machines/blender.ogg', 50, TRUE)
use_power(S * 30)
sleep(S + 15 / productivity)
processing = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/biogenerator/proc/check_cost(list/materials, multiplier = 1, remove_points = TRUE)
if(materials.len != 1 || materials[1] != getmaterialref(/datum/material/biomass))
@@ -199,7 +200,7 @@
else
if(remove_points)
points -= materials[getmaterialref(/datum/material/biomass)]*multiplier/efficiency
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/biogenerator/proc/check_container_volume(list/reagents, multiplier = 1)
@@ -240,7 +241,7 @@
beaker.reagents.add_reagent(R, D.make_reagents[R])
. = 1
--i
- update_icon()
+ update_appearance(UPDATE_ICON)
return .
/obj/machinery/biogenerator/proc/detach(mob/living/user)
@@ -250,7 +251,7 @@
else
beaker.drop_location(get_turf(src))
beaker = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/biogenerator/ui_status(mob/user)
if(stat & BROKEN || panel_open)
diff --git a/code/modules/hydroponics/fermenting_barrel.dm b/code/modules/hydroponics/fermenting_barrel.dm
index efc99f269478..dae9aecdbe9c 100644
--- a/code/modules/hydroponics/fermenting_barrel.dm
+++ b/code/modules/hydroponics/fermenting_barrel.dm
@@ -63,9 +63,10 @@
ENABLE_BITFIELD(reagents.flags, DRAINABLE)
DISABLE_BITFIELD(reagents.flags, REFILLABLE)
to_chat(user, span_notice("You close [src], letting you draw from its tap."))
- update_icon()
+ update_appearance(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 14f4baaf914b..3e359763d439 100644
--- a/code/modules/hydroponics/gene_modder.dm
+++ b/code/modules/hydroponics/gene_modder.dm
@@ -55,23 +55,25 @@
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(disk)
- add_overlay("dnamod-disk")
+ . += "dnamod-disk"
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))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(default_deconstruction_crowbar(I))
return
@@ -261,7 +263,7 @@
seed.verb_pickup()
seed = null
update_genes()
- update_icon()
+ update_appearance(UPDATE_ICON)
else
var/obj/item/I = usr.get_active_held_item()
if (istype(I, /obj/item/seeds))
@@ -269,7 +271,7 @@
return
insert_seed(I)
to_chat(usr, span_notice("You add [I] to the machine."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(href_list["eject_disk"] && !operation)
var/obj/item/I = usr.get_active_held_item()
eject_disk()
@@ -278,7 +280,7 @@
return
disk = I
to_chat(usr, span_notice("You add [I] to the machine."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(href_list["op"] == "insert" && disk && disk.gene && seed)
if(!operation) // Wait for confirmation
operation = "insert"
@@ -336,11 +338,10 @@
gene.value = max(gene.value, min_wrate)
else if(istype(G, /datum/plant_gene/core/weed_chance))
gene.value = max(gene.value, min_wchance)
- disk.update_name()
- disk.update_icon()
+ disk.update_appearance()
qdel(seed)
seed = null
- update_icon()
+ update_appearance(UPDATE_ICON)
if("replace")
if(disk && disk.gene && istype(disk.gene, G.type) && istype(G, /datum/plant_gene/core))
seed.genes -= G
@@ -372,7 +373,7 @@
S.forceMove(src)
seed = S
update_genes()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/plantgenes/proc/eject_disk()
if (disk && !operation)
@@ -383,7 +384,7 @@
disk.forceMove(drop_location())
disk = null
update_genes()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/plantgenes/proc/update_genes()
core_genes = list()
@@ -436,16 +437,17 @@
/obj/item/disk/plantgene/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
src.pixel_x = rand(-5, 5)
src.pixel_y = rand(-5, 5)
-/obj/item/disk/plantgene/update_icon()
- cut_overlays()
+/obj/item/disk/plantgene/update_overlays()
+ . = ..()
if(gene)
- add_overlay("datadisk_gene")
+ . += "datadisk_gene"
-/obj/item/disk/plantgene/proc/update_name()
+/obj/item/disk/plantgene/update_name(updates=ALL)
+ . = ..()
if(gene)
name = "[gene.get_name()] (plant data disk)"
else
diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm
index aef012e31693..1319a2c44d8b 100644
--- a/code/modules/hydroponics/hydroponics.dm
+++ b/code/modules/hydroponics/hydroponics.dm
@@ -215,7 +215,7 @@
weedinvasion() // Weed invasion into empty tray
needs_update = 1
if (needs_update)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
/obj/machinery/hydroponics/proc/nutrimentMutation()
@@ -237,7 +237,8 @@
return
return
-/obj/machinery/hydroponics/update_icon()
+/obj/machinery/hydroponics/update_icon(updates=ALL)
+ . = ..()
//Refreshes the icon and sets the luminosity
cut_overlays()
@@ -360,9 +361,8 @@
harvest = 0
weedlevel = 0 // Reset
pestlevel = 0 // Reset
- update_icon()
visible_message(span_warning("The [oldPlantName] is overtaken by some [myseed.plantname]!"))
- update_name()
+ update_appearance()
/obj/machinery/hydroponics/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0) // Mutates the current seed
if(!myseed)
@@ -394,9 +394,8 @@
weedlevel = 0 // Reset
sleep(0.5 SECONDS) // Wait a while
- update_icon()
visible_message(span_warning("[oldPlantName] suddenly mutates into [myseed.plantname]!"))
- update_name()
+ update_appearance()
/obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant
if( weedlevel > 5 )
@@ -414,9 +413,8 @@
weedlevel = 0 // Reset
sleep(0.5 SECONDS) // Wait a while
- update_icon()
visible_message(span_warning("The mutated weeds in [src] spawn some [myseed.plantname]!"))
- update_name()
+ update_appearance()
else
to_chat(usr, span_warning("The few weeds in [src] seem to react, but only for a moment..."))
@@ -426,10 +424,8 @@
pestlevel = 0 // Pests die
lastproduce = 0
if(!dead)
- update_icon()
- dead = 1
-
-
+ dead = TRUE
+ update_appearance(UPDATE_ICON)
/obj/machinery/hydroponics/proc/mutatepest(mob/user)
if(pestlevel > 5)
@@ -777,9 +773,9 @@
S.clear_reagents()
qdel(S)
- H.update_icon()
+ H.update_appearance(UPDATE_ICON)
if(reagent_source) // If the source wasn't composted and destroyed
- reagent_source.update_icon()
+ reagent_source.update_appearance(UPDATE_ICON)
return 1
else if(istype(O, /obj/item/seeds) && !istype(O, /obj/item/seeds/sample))
@@ -791,11 +787,10 @@
to_chat(user, span_notice("You plant [O]."))
dead = 0
myseed = O
- update_name()
age = 1
plant_health = myseed.endurance
lastcycle = world.time
- update_icon()
+ update_appearance()
else
to_chat(user, span_warning("[src] already has seeds in it!"))
@@ -823,7 +818,7 @@
if(weedlevel > 0)
user.visible_message("[user] uproots the weeds.", span_notice("You remove the weeds from [src]."))
weedlevel = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("This plot is completely devoid of weeds! It doesn't need uprooting."))
@@ -844,7 +839,7 @@
user.visible_message(span_notice("[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses."), \
span_notice("You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses."))
for(var/obj/machinery/hydroponics/h in range(1,src))
- h.update_icon()
+ h.update_appearance(UPDATE_ICON)
else if(istype(O, /obj/item/shovel/spade))
if(!myseed && !weedlevel)
@@ -862,9 +857,8 @@
harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it
qdel(myseed)
myseed = null
- update_name()
weedlevel = 0 //Has a side effect of cleaning up those nasty weeds
- update_icon()
+ update_appearance()
else
return ..()
@@ -894,8 +888,7 @@
to_chat(user, span_notice("You remove the dead plant from [src]."))
qdel(myseed)
myseed = null
- update_name()
- update_icon()
+ update_appearance()
else
if(user)
examine(user)
@@ -903,7 +896,7 @@
/obj/machinery/hydroponics/AltClick(mob/user)
. = ..()
if(!anchored)
- update_icon()
+ update_appearance(UPDATE_ICON)
return FALSE
var/warning = tgui_alert(user, "Are you sure you wish to empty the tray's nutrient beaker?","Empty Tray Nutrients?", list("Yes", "No"))
if(warning == "Yes" && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
@@ -929,9 +922,8 @@
if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest))
qdel(myseed)
myseed = null
- update_name()
dead = 0
- update_icon()
+ update_appearance()
/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds.///
/obj/machinery/hydroponics/proc/adjustNutri(adjustamt)
@@ -965,9 +957,10 @@
/obj/machinery/hydroponics/proc/become_self_sufficient() // Ambrosia Gaia effect
visible_message(span_boldnotice("[src] begins to glow with a beautiful light!"))
self_sustaining = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/hydroponics/proc/update_name()
+/obj/machinery/hydroponics/update_name(updates=ALL)
+ . = ..()
if(myseed)
name = "[initial(name)] ([myseed.plantname])"
else
diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm
index f0acd1979f1f..3d9a7e170a89 100644
--- a/code/modules/hydroponics/plant_genes.dm
+++ b/code/modules/hydroponics/plant_genes.dm
@@ -239,8 +239,8 @@
C.charge = newcharge
if(isobj(C.loc))
var/obj/O = C.loc
- O.update_icon() //update power meters and such
- C.update_icon()
+ O.update_appearance(UPDATE_ICON) //update power meters and such
+ C.update_appearance(UPDATE_ICON)
batteries_recharged = 1
if(batteries_recharged)
to_chat(target, span_notice("Your batteries are recharged!"))
diff --git a/code/modules/instruments/items.dm b/code/modules/instruments/items.dm
index 7394c38f8656..0101ffbe9a02 100644
--- a/code/modules/instruments/items.dm
+++ b/code/modules/instruments/items.dm
@@ -94,14 +94,14 @@
*/
/obj/item/instrument/piano_synth/headphones/proc/start_playing()
icon_state = "[initial(icon_state)]_on"
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Called by a component signal when our song stops playing.
*/
/obj/item/instrument/piano_synth/headphones/proc/stop_playing()
icon_state = "[initial(icon_state)]"
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/instrument/banjo
name = "banjo"
diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm
index ffa127dfe698..b47cc00c4dc9 100644
--- a/code/modules/jobs/job_types/_job.dm
+++ b/code/modules/jobs/job_types/_job.dm
@@ -329,7 +329,7 @@
H.equip_to_slot_if_possible(PDA, ITEM_SLOT_ID)
PDA.update_label()
- PDA.update_icon()
+ PDA.update_appearance(UPDATE_ICON)
PDA.update_filters()
else
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index e11fa80ceebc..0fa649ac58f1 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -48,7 +48,7 @@
for(var/obj/item/I in loc)
if(istype(I, /obj/item/book))
I.forceMove(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bookcase/attackby(obj/item/I, mob/user, params)
switch(state)
@@ -82,13 +82,13 @@
if(is_type_in_list(I, allowed_books))
if(!user.transferItemToLoc(I, src))
return
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(STR)
for(var/obj/item/T in I.contents)
if(istype(T, /obj/item/book) || istype(T, /obj/item/spellbook))
STR.remove_from_storage(T, src)
to_chat(user, span_notice("You empty \the [I] into \the [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(istype(I, /obj/item/pen))
if(!user.is_literate())
to_chat(user, span_notice("You scribble illegibly on the side of [src]!"))
@@ -129,7 +129,7 @@
user.put_in_hands(choice)
else
choice.forceMove(drop_location())
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bookcase/deconstruct(disassembled = TRUE)
@@ -139,7 +139,8 @@
qdel(src)
-/obj/structure/bookcase/update_icon()
+/obj/structure/bookcase/update_icon_state()
+ . = ..()
if(contents.len < 5)
icon_state = "book-[contents.len]"
else
@@ -152,7 +153,7 @@
/obj/structure/bookcase/manuals/medical/Initialize(mapload)
. = ..()
new /obj/item/book/manual/wiki/medical_cloning(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bookcase/manuals/engineering
@@ -165,7 +166,7 @@
new /obj/item/book/manual/wiki/engineering_guide(src)
new /obj/item/book/manual/wiki/engineering_singulo_tesla(src)
new /obj/item/book/manual/wiki/robotics_cyborgs(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/bookcase/manuals/research_and_development
@@ -174,7 +175,7 @@
/obj/structure/bookcase/manuals/research_and_development/Initialize(mapload)
. = ..()
new /obj/item/book/manual/wiki/research_and_development(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/*
diff --git a/code/modules/library/random_books.dm b/code/modules/library/random_books.dm
index 97f9366e0732..4847689a48b1 100644
--- a/code/modules/library/random_books.dm
+++ b/code/modules/library/random_books.dm
@@ -31,11 +31,11 @@
/obj/structure/bookcase/random/Initialize(mapload)
. = ..()
if(!book_count || !isnum(book_count))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
book_count += pick(-1,-1,0,1,1)
create_random_books(book_count, src, FALSE, category)
- update_icon()
+ update_appearance(UPDATE_ICON)
/proc/create_random_books(amount = 2, location, fail_loud = FALSE, category = null)
. = list()
@@ -45,7 +45,7 @@
if(fail_loud || prob(5))
var/obj/item/paper/P = new(location)
P.info = "There once was a book from Nantucket
But the database failed us, so f*$! it.
I tried to be good to you
Now this is an I.O.U
If you're feeling entitled, well, stuff it!
~"
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
return
if(prob(25))
category = null
diff --git a/code/modules/library/soapstone.dm b/code/modules/library/soapstone.dm
index ee83c53b4e8b..119471b4d873 100644
--- a/code/modules/library/soapstone.dm
+++ b/code/modules/library/soapstone.dm
@@ -145,10 +145,10 @@
creator_key = user.ckey
realdate = world.realtime
map = SSmapping.config.map_name
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/structure/chisel_message/update_icon()
- ..()
+/obj/structure/chisel_message/update_icon(updates=ALL)
+ . = ..()
var/hash = md5(hidden_message)
var/newcolor = copytext_char(hash, 1, 7)
add_atom_colour("#[newcolor]", FIXED_COLOUR_PRIORITY)
@@ -188,7 +188,7 @@
var/turf/newloc = locate(x, y, z)
if(isturf(newloc))
forceMove(newloc)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/chisel_message/examine(mob/user)
. = ..()
diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm
index 4a8a2064af37..0858fb4ea0dd 100644
--- a/code/modules/mapping/mapping_helpers.dm
+++ b/code/modules/mapping/mapping_helpers.dm
@@ -247,7 +247,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava)
else
var/obj/item/organ/O = part
O.organ_flags |= ORGAN_FROZEN
- j.update_icon()
+ j.update_appearance(UPDATE_ICON)
qdel(src)
/obj/effect/mapping_helpers/teleport_anchor
diff --git a/code/modules/mapping/minimap.dm b/code/modules/mapping/minimap.dm
index 084a8b3697cd..d802961f84b9 100644
--- a/code/modules/mapping/minimap.dm
+++ b/code/modules/mapping/minimap.dm
@@ -105,16 +105,16 @@
/obj/item/map/station/Initialize(mapload)
..()
minimaps += SSmapping.station_minimaps
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/map/update_icon()
- cut_overlays()
+/obj/item/map/update_overlays()
+ . = ..()
var/datum/minimap/map = minimaps[1]
if(!map) return
var/image/I = image(map.overlay_icon)
I.pixel_x = 8
I.pixel_y = 8
- add_overlay(I)
+ . += I
/obj/item/map/interact(mob/user)
if(!in_range(user, src) && !isobserver(user))
diff --git a/code/modules/mining/equipment/explorer_gear.dm b/code/modules/mining/equipment/explorer_gear.dm
index aa1adf0be3d4..fef73a241e6e 100644
--- a/code/modules/mining/equipment/explorer_gear.dm
+++ b/code/modules/mining/equipment/explorer_gear.dm
@@ -124,14 +124,13 @@
/obj/item/clothing/head/helmet/space/hostile_environment/Initialize(mapload)
. = ..()
AddComponent(/datum/component/spraycan_paintable)
- update_icon()
+ update_appearance(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 fad185b85682..1bc51eabc4a9 100644
--- a/code/modules/mining/equipment/kinetic_crusher.dm
+++ b/code/modules/mining/equipment/kinetic_crusher.dm
@@ -28,9 +28,9 @@
var/detonation_damage = 50
var/backstab_bonus = 30
-/obj/item/twohanded/kinetic_crusher/update_icon() //Updates the sprite for in-hand and on-mob.
+/obj/item/twohanded/kinetic_crusher/update_icon_state() //Updates the sprite for in-hand and on-mob.
+ . = ..()
icon_state = "mining_hammer[wielded]"
- return
/obj/item/twohanded/kinetic_crusher/Initialize(mapload)
. = ..()
@@ -508,9 +508,9 @@
..()
-/obj/item/twohanded/kinetic_crusher/mega/update_icon()
+/obj/item/twohanded/kinetic_crusher/mega/update_icon_state()
+ . = ..()
icon_state = "magmite_crusher[wielded]"
- return
/obj/item/projectile/destabilizer/mega
name = "destabilizing force"
diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm
index 864fdb0e26b2..6092c14a996d 100644
--- a/code/modules/mining/equipment/marker_beacons.dm
+++ b/code/modules/mining/equipment/marker_beacons.dm
@@ -33,14 +33,15 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
/obj/item/stack/marker_beacon/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stack/marker_beacon/examine(mob/user)
. = ..()
. += "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)
@@ -64,7 +65,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
return
if(input_color)
picked_color = input_color
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/marker_beacon
name = "marker beacon"
@@ -83,20 +84,21 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
/obj/structure/marker_beacon/Initialize(mapload, set_color)
. = ..()
picked_color = set_color
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/marker_beacon/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
var/obj/item/stack/marker_beacon/M = new(loc)
M.picked_color = picked_color
- M.update_icon()
+ M.update_appearance(UPDATE_ICON)
qdel(src)
/obj/structure/marker_beacon/examine(mob/user)
. = ..()
. += span_notice("Alt-click to select a color. Current color is [picked_color].")
-/obj/structure/marker_beacon/update_icon()
+/obj/structure/marker_beacon/update_icon_state()
+ . = ..()
while(!picked_color || !GLOB.marker_beacon_colors[picked_color])
picked_color = pick(GLOB.marker_beacon_colors)
icon_state = "[initial(icon_state)][lowertext(picked_color)]-on"
@@ -110,7 +112,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
if(do_after(user, remove_speed, src))
var/obj/item/stack/marker_beacon/M = new(loc)
M.picked_color = picked_color
- M.update_icon()
+ M.update_appearance(UPDATE_ICON)
transfer_fingerprints_to(M)
if(user.put_in_hands(M, TRUE)) //delete the beacon if it fails
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
@@ -143,4 +145,4 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
return
if(input_color)
picked_color = input_color
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/mining/equipment/regenerative_core.dm b/code/modules/mining/equipment/regenerative_core.dm
index dca5b517ec53..fecd8f48e0dd 100644
--- a/code/modules/mining/equipment/regenerative_core.dm
+++ b/code/modules/mining/equipment/regenerative_core.dm
@@ -42,7 +42,7 @@
/obj/item/organ/regenerative_core/proc/preserved(implanted = 0)
inert = FALSE
preserved = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
name = "preserved regenerative core"
desc = "All that remains of a hivelord. It is preserved, allowing you to use it to heal completely without danger of decay."
if(implanted)
@@ -55,7 +55,7 @@
name = "decayed regenerative core"
desc = "All that remains of a hivelord. It has decayed, and is completely useless."
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "inert"))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/organ/regenerative_core/ui_action_click()
if(inert)
@@ -135,17 +135,19 @@
/obj/item/organ/regenerative_core/legion/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(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()
- if(!inert && !preserved)
- add_overlay("legion_soul_crackle")
- for(var/X in actions)
- var/datum/action/A = X
+ for(var/datum/action/A as anything in actions)
A.build_all_button_icons()
+/obj/item/organ/regenerative_core/update_overlays()
+ . = ..()
+ if(!inert && !preserved)
+ . += "legion_soul_crackle"
+
/obj/item/organ/regenerative_core/legion/go_inert()
..()
desc = "[src] has become inert. It has decayed, and is completely useless."
diff --git a/code/modules/mining/equipment/survival_pod.dm b/code/modules/mining/equipment/survival_pod.dm
index 8baa359fe742..aca65db28b05 100644
--- a/code/modules/mining/equipment/survival_pod.dm
+++ b/code/modules/mining/equipment/survival_pod.dm
@@ -138,11 +138,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
@@ -154,8 +153,9 @@
/obj/machinery/stasis/survival_pod/play_power_sound()
return
-/obj/machinery/stasis/survival_pod/update_icon()
- return
+/obj/machinery/stasis/survival_pod/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
//Computer
/obj/item/gps/computer
@@ -206,8 +206,9 @@
pitches = FALSE
var/empty = FALSE
-/obj/machinery/smartfridge/survival_pod/update_icon()
- return
+/obj/machinery/smartfridge/survival_pod/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/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 4d6908fa6f0b..9b0e1fbec3df 100644
--- a/code/modules/mining/lavaland/ash_flora.dm
+++ b/code/modules/mining/lavaland/ash_flora.dm
@@ -300,14 +300,17 @@
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_icon_state()
+ . = ..()
+ if(!reagents || !reagents.total_volume)
+ icon_state = "mushroom_bowl"
+
+/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
- icon_state = "mushroom_bowl"
+ . += filling
/obj/item/reagent_containers/glass/bowl/mushroom_bowl/attackby(obj/item/I,mob/user, params)
if(istype(I, /obj/item/reagent_containers/food/snacks))
diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm
index e13e3f7da87d..3bebd07549cb 100644
--- a/code/modules/mining/lavaland/necropolis_chests.dm
+++ b/code/modules/mining/lavaland/necropolis_chests.dm
@@ -683,14 +683,20 @@ GLOBAL_LIST_EMPTY(aide_list)
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_desc(updates=ALL)
+ . = ..()
if(reagents.total_volume)
- icon_state = initial(icon_state)
desc = initial(desc)
else
- icon_state = "[initial(icon_state)]_empty"
desc = "An ornate red bottle, with an \"S\" embossed into the underside."
+/obj/item/reagent_containers/glass/bottle/potion/update_icon_state()
+ . = ..()
+ if(reagents.total_volume)
+ icon_state = initial(icon_state)
+ else
+ icon_state = "[initial(icon_state)]_empty"
+
/datum/reagent/flightpotion
name = "Flight Potion"
description = "Strange mutagenic compound of unknown origins."
@@ -1506,7 +1512,8 @@ GLOBAL_LIST_EMPTY(aide_list)
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()
+/obj/item/hierophant_club/update_icon_state()
+ . = ..()
icon_state = "hierophant_club[timer <= world.time ? "_ready":""][(beacon && !QDELETED(beacon)) ? "":"_beacon"]"
item_state = icon_state
if(ismob(loc))
@@ -1515,9 +1522,9 @@ GLOBAL_LIST_EMPTY(aide_list)
M.update_inv_back()
/obj/item/hierophant_club/proc/prepare_icon_update()
- update_icon()
+ update_appearance(UPDATE_ICON)
sleep(timer - world.time)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/hierophant_club/ui_action_click(mob/user, action)
if(istype(action, /datum/action/item_action/toggle_unfriendly_fire)) //toggle friendly fire...
@@ -1745,7 +1752,7 @@ GLOBAL_LIST_EMPTY(aide_list)
var/fauna_damage_type = BRUTE
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
-/obj/item/twohanded/bonespear/stalwartpike/update_icon()
+/obj/item/twohanded/bonespear/stalwartpike/update_icon_state()
. = ..()
if(wielded)
icon_state = "stalwart_spear1"
diff --git a/code/modules/mining/lavaland/world_anvil.dm b/code/modules/mining/lavaland/world_anvil.dm
index acf746ba7888..05673d281cd4 100644
--- a/code/modules/mining/lavaland/world_anvil.dm
+++ b/code/modules/mining/lavaland/world_anvil.dm
@@ -27,7 +27,8 @@
QDEL_NULL(internal)
. = ..()
-/obj/structure/world_anvil/update_icon()
+/obj/structure/world_anvil/update_icon(updates=ALL)
+ . = ..()
icon_state = forge_charges > 0 ? "anvil_a" : "anvil"
if(forge_charges > 0)
set_light(4,1,LIGHT_COLOR_ORANGE)
@@ -44,7 +45,7 @@
forge_charges = forge_charges + placed_ore.quality
to_chat(user,"You place down the gibtonite on the World Anvil, and watch as the gibtonite melts into it. The World Anvil is now heated enough for [forge_charges] forge[forge_charges > 1 ? "s" : ""].")
qdel(placed_ore)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(forge_charges <= 0)
to_chat(user,"The World Anvil is not hot enough to be usable!")
@@ -70,7 +71,7 @@
forge_charges--
if(forge_charges <= 0)
visible_message("The World Anvil cools down.")
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm
index 998142f53fc9..0d1a714d2c28 100644
--- a/code/modules/mining/machine_redemption.dm
+++ b/code/modules/mining/machine_redemption.dm
@@ -345,9 +345,9 @@
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 4727e1a51b3b..199f179584a3 100644
--- a/code/modules/mining/machine_vending.dm
+++ b/code/modules/mining/machine_vending.dm
@@ -105,7 +105,8 @@
var/datum/data/mining_equipment/M = p
GLOB.vending_products[M.equipment_path] = 1
-/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 1527ab7d8c16..c76af3e8265d 100644
--- a/code/modules/mining/ores_coins.dm
+++ b/code/modules/mining/ores_coins.dm
@@ -22,25 +22,24 @@
var/list/stack_overlays
var/edible = FALSE //can a preternis eat it for some funny effect?
-/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;
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)
if(!refined_type)
@@ -620,7 +619,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
/obj/item/coinstack/Initialize(mapload)
. = ..()
coins = list()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/coinstack/examine(mob/user)
. = ..()
@@ -634,11 +633,11 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
if(antag > 1)
. += span_info("But they told me I could only have one at a time...")
-/obj/item/coinstack/update_icon()
- cut_overlays()
+/obj/item/coinstack/update_overlays()
+ . = ..()
for(var/i in 1 to length(coins))
var/obj/item/coin/C = coins[i]
- src.add_overlay(image(icon = C.icon,icon_state = C.coin_stack_icon_state, pixel_y = (i-1)*2))
+ . += image(icon = C.icon,icon_state = C.coin_stack_icon_state, pixel_y = (i-1)*2)
/obj/item/coinstack/attack_hand(mob/user) ///take a coin off the top of the stack
remove_from_stack(user)
@@ -663,7 +662,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
C.pixel_y = 0
src.add_fingerprint(user)
to_chat(user,span_notice("You add [C] to the stack of coins."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/item/coinstack/proc/remove_from_stack(mob/living/user) //you can only remove the topmost coin from the stack
@@ -671,7 +670,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
if(top_coin)
coins -= top_coin
user.put_in_active_hand(top_coin)
- update_icon()
+ update_appearance(UPDATE_ICON)
if(length(coins) <= 1) //one coin left, we're done here
var/obj/item/coin/lastCoin = coins[1]
coins -= coins[1]
diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm
index ad6b3592ae60..0dc2444d07c1 100644
--- a/code/modules/mob/dead/new_player/new_player.dm
+++ b/code/modules/mob/dead/new_player/new_player.dm
@@ -297,7 +297,7 @@
observer.real_name = observer.client.prefs.read_preference(/datum/preference/name/real_name)
observer.name = observer.real_name
observer.client.init_verbs()
- observer.update_icon()
+ observer.update_appearance(UPDATE_ICON)
observer.stop_sound_channel(CHANNEL_LOBBYMUSIC)
QDEL_NULL(mind)
qdel(src)
diff --git a/code/modules/mob/dead/observer/login.dm b/code/modules/mob/dead/observer/login.dm
index e39207ffde59..2740d8c89b45 100644
--- a/code/modules/mob/dead/observer/login.dm
+++ b/code/modules/mob/dead/observer/login.dm
@@ -16,5 +16,5 @@
if (isturf(T))
update_z(T.z)
- update_icon(preferred_form)
+ update_icon(new_form = preferred_form)
updateghostimages()
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 640270573be5..12adf35f59db 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -115,7 +115,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
facial_hair_style = body_human.facial_hair_style
facial_hair_color = brighten_color(body_human.facial_hair_color)
- update_icon()
+ update_appearance(UPDATE_ICON)
if(!T || is_secret_level(T.z))
var/list/turfs = get_area_turfs(/area/shuttle/arrival)
@@ -193,7 +193,9 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
* Hair will always update its dir, so if your sprite has no dirs the haircut will go all over the place.
* |- Ricotez
*/
-/mob/dead/observer/update_icon(new_form)
+/mob/dead/observer/update_icon(updates=ALL, new_form)
+ . = ..()
+
if(client) //We update our preferences in case they changed right before update_icon was called.
ghost_accs = client.prefs.read_preference(/datum/preference/choiced/ghost_accessories)
ghost_others = client.prefs.read_preference(/datum/preference/choiced/ghost_others)
@@ -818,7 +820,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
qdel(species)
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/dead/observer/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
return IsAdminGhost(usr)
@@ -970,7 +972,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/vv_edit_var(var_name, var_value)
. = ..()
- if(var_name == "invisibility")
+ if(var_name == NAMEOF(src, invisibility))
set_invisibility(invisibility) // updates light
/proc/set_observer_default_invisibility(amount, message=null)
diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm
index 57ed3dd01f24..c937b2eb07f9 100644
--- a/code/modules/mob/living/brain/MMI.dm
+++ b/code/modules/mob/living/brain/MMI.dm
@@ -24,7 +24,8 @@
Unless you are slaved as a silicon, you retain crew/antagonist/etc status and should behave as such.\n\
Being placed in a mech does not slave you to any laws."
-/obj/item/mmi/update_icon()
+/obj/item/mmi/update_icon_state()
+ . = ..()
if(!brain)
icon_state = "mmi_off"
return
@@ -34,10 +35,17 @@
else
icon_state = "mmi_brain"
braintype = "Cyborg"
+
+/obj/item/mmi/update_overlays()
+ . = ..()
+ . += add_mmi_overlay()
+
+/obj/item/mmi/proc/add_mmi_overlay()
if(brainmob && brainmob.stat != DEAD)
- add_overlay("mmi_alive")
- else
- add_overlay("mmi_dead")
+ . += "mmi_alive"
+ return
+ if(brain)
+ . += "mmi_dead"
/obj/item/mmi/Initialize(mapload)
. = ..()
@@ -83,7 +91,7 @@
brain = newbrain
name = "[initial(name)]: [brainmob.real_name]"
- update_icon()
+ update_appearance(UPDATE_ICON)
SSblackbox.record_feedback("amount", "mmis_filled", 1)
@@ -110,7 +118,7 @@
if(!brainmob) return
to_chat(brainmob, span_userdanger("Due to the traumatic danger of your removal, all memories of the events leading to your brain being removed are lost[rebooting ? ", along with all memories of the events leading to your death as a cyborg" : ""]"))
eject_brain(user)
- update_icon()
+ update_appearance(UPDATE_ICON)
name = initial(name)
user.visible_message(span_notice("[user] rips the brain out of [src]"), span_danger("You successfully remove the brain from the [src][rebooting ? ", interrupting the reboot process" : ""]"))
if(rebooting)
@@ -159,7 +167,7 @@
name = "[initial(name)]: [brainmob.real_name]"
to_chat(brainmob, welcome_message)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
/obj/item/mmi/proc/replacement_ai_name()
diff --git a/code/modules/mob/living/brain/death.dm b/code/modules/mob/living/brain/death.dm
index e90637f63ed8..1e04d944ed97 100644
--- a/code/modules/mob/living/brain/death.dm
+++ b/code/modules/mob/living/brain/death.dm
@@ -7,7 +7,7 @@
var/obj/item/mmi = container
mmi.visible_message(span_warning("[src]'s MMI flatlines!"), \
span_italics("You hear something flatline."))
- mmi.update_icon()
+ mmi.update_appearance(UPDATE_ICON)
return ..()
diff --git a/code/modules/mob/living/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm
index 5037d46eb4c6..4f7c0b5066f5 100644
--- a/code/modules/mob/living/brain/posibrain.dm
+++ b/code/modules/mob/living/brain/posibrain.dm
@@ -60,12 +60,12 @@ GLOBAL_VAR(posibrain_notify_cooldown)
ping_ghosts("requested", FALSE)
next_ask = world.time + askDelay
searching = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
addtimer(CALLBACK(src, PROC_REF(check_success)), askDelay)
/obj/item/mmi/posibrain/proc/check_success()
searching = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
if(QDELETED(brainmob))
return
if(brainmob.client)
@@ -131,7 +131,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
brainmob.mind.remove_all_antag()
brainmob.mind.wipe_memory()
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/item/mmi/posibrain/proc/transfer_personality(mob/candidate)
@@ -210,11 +210,15 @@ 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)
icon_state = "[initial(icon_state)]-occupied"
- else
- icon_state = initial(icon_state)
+ return
+ icon_state = initial(icon_state)
+
+/obj/item/mmi/posibrain/add_mmi_overlay()
+ return
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 5f8ae0c0c3f6..a84894f41b7e 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -45,10 +45,10 @@
var/atom/movable/screen/inventory/hand/H
H = hud_used.hand_slots["[oindex]"]
if(H)
- H.update_icon()
+ H.update_appearance(UPDATE_ICON)
H = hud_used.hand_slots["[held_index]"]
if(H)
- H.update_icon()
+ H.update_appearance(UPDATE_ICON)
/mob/living/carbon/activate_hand(selhand) //l/r OR 1-held_items.len
diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm
index 2574a5250c22..24508222ca83 100644
--- a/code/modules/mob/living/carbon/human/human_movement.dm
+++ b/code/modules/mob/living/carbon/human/human_movement.dm
@@ -80,7 +80,7 @@
FP.entered_dirs |= dir
FP.bloodiness = S.bloody_shoes[S.blood_state] - BLOOD_LOSS_IN_SPREAD
FP.add_blood_DNA(S.return_blood_DNA())
- FP.update_icon()
+ FP.update_appearance(UPDATE_ICON)
update_inv_shoes()
//End bloody footprints
if(istype(S))
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 c5fdec856f51..696b7b26b661 100644
--- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm
@@ -147,6 +147,9 @@
var/obj/item/light_eater/blade
decay_factor = 0
+/obj/item/organ/heart/nightmare/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/organ/heart/nightmare/attack(mob/M, mob/living/carbon/user, obj/target)
if(M != user)
@@ -179,9 +182,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/process()
if(QDELETED(owner) || owner.stat != DEAD || !owner)
respawn_progress = 0
@@ -261,7 +261,7 @@
var/obj/item/pda/PDA = O
PDA.set_light_on(FALSE)
PDA.set_light_range(0) //It won't be turning on again.
- PDA.update_icon()
+ PDA.update_appearance(UPDATE_ICON)
visible_message(span_danger("The light in [PDA] shorts out!"))
else
visible_message(span_danger("[O] is disintegrated by [src]!"))
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index 11f673676385..64a179f88e09 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -102,7 +102,7 @@ There are several things that need to be remembered:
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_ICLOTHING) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(istype(w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
@@ -148,7 +148,7 @@ There are several things that need to be remembered:
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_ID) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
var/mutable_appearance/id_overlay = overlays_standing[ID_LAYER]
@@ -173,7 +173,7 @@ There are several things that need to be remembered:
if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_GLOVES) + 1])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_GLOVES) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(!gloves && blood_in_hands)
var/mutable_appearance/bloody_overlay = mutable_appearance('icons/effects/blood.dmi', "bloodyhands", -GLOVES_LAYER)
@@ -209,7 +209,7 @@ There are several things that need to be remembered:
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_EYES) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(glasses)
glasses.screen_loc = ui_glasses //...draw the item in the inventory screen
@@ -237,7 +237,7 @@ There are several things that need to be remembered:
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_EARS) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(ears)
ears.screen_loc = ui_ears //move the item to the appropriate screen loc
@@ -258,7 +258,7 @@ There are several things that need to be remembered:
if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_NECK) + 1])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_NECK) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(wear_neck)
wear_neck.screen_loc = ui_neck
@@ -283,7 +283,7 @@ There are several things that need to be remembered:
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_FEET) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(shoes)
var/target_overlay = shoes.icon_state
@@ -311,7 +311,7 @@ There are several things that need to be remembered:
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_SUITSTORE) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(s_store)
s_store.screen_loc = ui_sstore1
@@ -350,7 +350,7 @@ There are several things that need to be remembered:
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_BELT) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(belt)
belt.screen_loc = ui_belt
@@ -373,7 +373,7 @@ There are several things that need to be remembered:
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_OCLOTHING) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(istype(wear_suit, /obj/item))
wear_suit.screen_loc = ui_oclothing
@@ -402,9 +402,9 @@ There are several things that need to be remembered:
var/atom/movable/screen/inventory/inv
inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_LPOCKET) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_RPOCKET) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(l_store)
l_store.screen_loc = ui_storage1
@@ -427,7 +427,7 @@ There are several things that need to be remembered:
if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_MASK) + 1])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_MASK) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(wear_mask)
var/target_overlay = wear_mask.icon_state
@@ -454,7 +454,7 @@ There are several things that need to be remembered:
if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(back)
update_hud_back(back)
diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm
index 7d51955714f9..8a829ab51ceb 100644
--- a/code/modules/mob/living/carbon/update_icons.dm
+++ b/code/modules/mob/living/carbon/update_icons.dm
@@ -117,7 +117,7 @@
if(client && hud_used?.inv_slots[TOBITSHIFT(ITEM_SLOT_MASK) + 1])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_MASK) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(wear_mask)
if(!(ITEM_SLOT_MASK in check_obscured_slots()))
@@ -131,7 +131,7 @@
if(client && hud_used?.inv_slots[TOBITSHIFT(ITEM_SLOT_NECK) + 1])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_NECK) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(wear_neck)
if(!(ITEM_SLOT_NECK in check_obscured_slots()))
@@ -145,7 +145,7 @@
if(client && hud_used?.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(back)
overlays_standing[BACK_LAYER] = back.build_worn_icon(default_layer = BACK_LAYER, default_icon_file = 'icons/mob/clothing/back.dmi')
@@ -161,7 +161,7 @@
if(client && hud_used?.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_HEAD) + 1]
- inv.update_icon()
+ inv.update_appearance(UPDATE_ICON)
if(head)
overlays_standing[HEAD_LAYER] = head.build_worn_icon(default_layer = HEAD_LAYER, default_icon_file = 'icons/mob/clothing/head/head.dmi')
@@ -198,7 +198,7 @@
for(var/hand in hud_used.hand_slots)
var/atom/movable/screen/inventory/hand/H = hud_used.hand_slots[hand]
if(H)
- H.update_icon()
+ H.update_appearance(UPDATE_ICON)
//update whether our head item appears on our hud.
/mob/living/carbon/proc/update_hud_head(obj/item/I)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 2e2025f3315f..61301244b22c 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -1253,7 +1253,7 @@
if(buckled.buckle_lying != -1)
should_be_lying = buckled.buckle_lying
- if(should_be_lying)
+ if(should_be_lying && !HAS_TRAIT(src, TRAIT_FORCED_STANDING))
mobility_flags &= ~MOBILITY_STAND
if(buckled)
if(buckled.buckle_lying != -1)
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index b41b16d05d35..5d890506003f 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -1054,7 +1054,7 @@
playsound(get_turf(src), 'sound/machines/ding.ogg', 50, 1, ignore_walls = FALSE)
to_chat(src, "Hack complete. \The [apc] is now under your exclusive control.")
- apc.update_icon()
+ apc.update_appearance(UPDATE_ICON)
/mob/living/silicon/ai/verb/deploy_to_shell(mob/living/silicon/robot/target)
set category = "AI Commands"
diff --git a/code/modules/mob/living/silicon/ai/decentralized/ai_data_core.dm b/code/modules/mob/living/silicon/ai/decentralized/ai_data_core.dm
index 5bd37f61e407..e2dc2308877f 100644
--- a/code/modules/mob/living/silicon/ai/decentralized/ai_data_core.dm
+++ b/code/modules/mob/living/silicon/ai/decentralized/ai_data_core.dm
@@ -40,7 +40,7 @@ GLOBAL_VAR_INIT(primary_data_core, null)
GLOB.data_cores += src
if(primary && !GLOB.primary_data_core)
GLOB.primary_data_core = src
- update_icon()
+ update_appearance(UPDATE_ICON)
RefreshParts()
/obj/machinery/ai/data_core/RefreshParts()
@@ -165,7 +165,7 @@ GLOBAL_VAR_INIT(primary_data_core, null)
if(valid_holder())
valid_ticks++
if(valid_ticks == 1)
- update_icon()
+ update_appearance(UPDATE_ICON)
use_power = ACTIVE_POWER_USE
if((stat & NOPOWER))
integrated_battery.use(active_power_usage * CELL_POWERUSE_MULTIPLIER)
@@ -174,7 +174,7 @@ GLOBAL_VAR_INIT(primary_data_core, null)
valid_ticks--
if(valid_ticks <= 0)
use_power = IDLE_POWER_USE
- update_icon()
+ update_appearance(UPDATE_ICON)
for(var/mob/living/silicon/ai/AI in contents)
if(!AI.is_dying)
AI.relocate()
@@ -214,8 +214,8 @@ GLOBAL_VAR_INIT(primary_data_core, null)
if(AI.eyeobj)
AI.eyeobj.forceMove(get_turf(src))
-/obj/machinery/ai/data_core/update_icon()
- cut_overlays()
+/obj/machinery/ai/data_core/update_icon_state()
+ . = ..()
if(!(stat & (BROKEN|EMPED)) && has_power())
if(!valid_data_core())
diff --git a/code/modules/mob/living/silicon/ai/decentralized/management/ai_controlpanel.dm b/code/modules/mob/living/silicon/ai/decentralized/management/ai_controlpanel.dm
index a47fbdc71046..682e629b444d 100644
--- a/code/modules/mob/living/silicon/ai/decentralized/management/ai_controlpanel.dm
+++ b/code/modules/mob/living/silicon/ai/decentralized/management/ai_controlpanel.dm
@@ -218,7 +218,7 @@ GLOBAL_VAR_INIT(ai_control_code, random_nukecode(6))
return
downloading.transfer_ai(AI_TRANS_TO_CARD, user_downloading, null, intellicard)
intellicard.forceMove(get_turf(src))
- intellicard.update_icon()
+ intellicard.update_appearance(UPDATE_ICON)
intellicard = null
stop_download(TRUE)
@@ -237,7 +237,7 @@ GLOBAL_VAR_INIT(ai_control_code, random_nukecode(6))
intellicard.AI.control_disabled = FALSE
intellicard.AI.relocate(TRUE)
intellicard.AI = null
- intellicard.update_icon()
+ intellicard.update_appearance(UPDATE_ICON)
/obj/machinery/computer/ai_control_console/ui_act(action, params)
if(..())
diff --git a/code/modules/mob/living/silicon/ai/decentralized/server_cabinet.dm b/code/modules/mob/living/silicon/ai/decentralized/server_cabinet.dm
index 406632bf187a..64b2fca5cd33 100644
--- a/code/modules/mob/living/silicon/ai/decentralized/server_cabinet.dm
+++ b/code/modules/mob/living/silicon/ai/decentralized/server_cabinet.dm
@@ -39,7 +39,7 @@ GLOBAL_LIST_EMPTY(server_cabinets)
roundstart = mapload
installed_racks = list()
GLOB.server_cabinets += src
- update_icon()
+ update_appearance(UPDATE_ICON)
RefreshParts()
/obj/machinery/ai/server_cabinet/Destroy()
@@ -79,7 +79,7 @@ GLOBAL_LIST_EMPTY(server_cabinets)
valid_ticks++
if(!was_valid_holder)
- update_icon()
+ update_appearance(UPDATE_ICON)
was_valid_holder = TRUE
if(!hardware_synced)
@@ -96,26 +96,26 @@ GLOBAL_LIST_EMPTY(server_cabinets)
GLOB.ai_os.update_hardware()
-/obj/machinery/ai/server_cabinet/update_icon()
- cut_overlays()
+/obj/machinery/ai/server_cabinet/update_overlays()
+ . = ..()
if(installed_racks.len > 0)
var/mutable_appearance/top_overlay = mutable_appearance(icon, "expansion_bus_top")
- add_overlay(top_overlay)
+ . += top_overlay
if(installed_racks.len > 1)
var/mutable_appearance/bottom_overlay = mutable_appearance(icon, "expansion_bus_bottom")
- add_overlay(bottom_overlay)
+ . += bottom_overlay
if(!(stat & (BROKEN|NOPOWER|EMPED)))
var/mutable_appearance/on_overlay = mutable_appearance(icon, "expansion_bus_on")
- add_overlay(on_overlay)
+ . += on_overlay
if(!valid_ticks)
return
if(installed_racks.len > 0)
var/mutable_appearance/on_top_overlay = mutable_appearance(icon, "expansion_bus_top_on")
- add_overlay(on_top_overlay)
+ . += on_top_overlay
if(installed_racks.len > 1)
var/mutable_appearance/on_bottom_overlay = mutable_appearance(icon, "expansion_bus_bottom_on")
- add_overlay(on_bottom_overlay)
+ . += on_bottom_overlay
/obj/machinery/ai/server_cabinet/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/server_rack))
@@ -131,7 +131,7 @@ GLOBAL_LIST_EMPTY(server_cabinets)
cached_power_usage += rack.get_power_usage()
GLOB.ai_os.update_hardware()
use_power = ACTIVE_POWER_USE
- update_icon()
+ update_appearance(UPDATE_ICON)
return FALSE
if(W.tool_behaviour == TOOL_CROWBAR)
if(installed_racks.len)
@@ -145,7 +145,7 @@ GLOBAL_LIST_EMPTY(server_cabinets)
GLOB.ai_os.update_hardware()
to_chat(user, span_notice("You remove all the racks from [src]"))
use_power = IDLE_POWER_USE
- update_icon()
+ update_appearance(UPDATE_ICON)
return FALSE
else
if(default_deconstruction_crowbar(W))
diff --git a/code/modules/mob/living/silicon/ai/multicam.dm b/code/modules/mob/living/silicon/ai/multicam.dm
index a5e4f80babeb..a7a07e329fad 100644
--- a/code/modules/mob/living/silicon/ai/multicam.dm
+++ b/code/modules/mob/living/silicon/ai/multicam.dm
@@ -171,14 +171,14 @@ GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room)
continue
cameras_telegraphed -= C
C.in_use_lights--
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
for (var/V in add)
var/obj/machinery/camera/C = V
if(QDELETED(C))
continue
cameras_telegraphed |= C
C.in_use_lights++
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
/mob/camera/aiEye/pic_in_pic/proc/disable_camera_telegraphing()
telegraph_cameras = FALSE
@@ -187,7 +187,7 @@ GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room)
if(QDELETED(C))
continue
C.in_use_lights--
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
cameras_telegraphed.Cut()
/mob/camera/aiEye/pic_in_pic/Destroy()
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index fc9217bf3dc1..44a130b2fa51 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -170,7 +170,7 @@
mmi.brainmob.name = src.real_name
mmi.brainmob.real_name = src.real_name
mmi.brainmob.container = mmi
- mmi.update_icon()
+ mmi.update_appearance(UPDATE_ICON)
updatename()
@@ -195,7 +195,7 @@
mmi.brainmob.remove_from_dead_mob_list()
mmi.brainmob.add_to_alive_mob_list()
mind.transfer_to(mmi.brainmob)
- mmi.update_icon()
+ mmi.update_appearance(UPDATE_ICON)
if(istype(mmi, /obj/item/mmi/posibrain))
ADD_TRAIT(mmi.brainmob, TRAIT_PACIFISM, POSIBRAIN_TRAIT)
else
@@ -803,14 +803,14 @@
set_light_range(1) //Again, like above, this only takes effect when the light is forced on by doomsday mode.
set_light_on(FALSE)
lamp_enabled = FALSE
- lampButton?.update_icon()
+ lampButton?.update_appearance(UPDATE_ICON)
update_icons()
return
set_light_range(lamp_intensity)
set_light_color(lamp_color)
set_light_on(TRUE)
lamp_enabled = TRUE
- lampButton?.update_icon()
+ lampButton?.update_appearance(UPDATE_ICON)
update_icons()
/mob/living/silicon/robot/proc/deconstruct()
diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm
index df5ed87c4484..f722196c2fa2 100644
--- a/code/modules/mob/living/silicon/robot/robot_defense.dm
+++ b/code/modules/mob/living/silicon/robot/robot_defense.dm
@@ -54,7 +54,7 @@
add_fingerprint(user)
if(opened && !wiresexposed && !issilicon(user))
if(cell)
- cell.update_icon()
+ cell.update_appearance(UPDATE_ICON)
cell.add_fingerprint(user)
user.put_in_active_hand(cell)
to_chat(user, span_notice("You remove \the [cell]."))
diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm
index 8fa1fb4cc2f8..1f18949e94e4 100644
--- a/code/modules/mob/living/silicon/robot/robot_modules.dm
+++ b/code/modules/mob/living/silicon/robot/robot_modules.dm
@@ -153,7 +153,7 @@
var/obj/item/assembly/flash/F = I
F.times_used = 0
F.burnt_out = FALSE
- F.update_icon()
+ F.update_appearance(UPDATE_ICON)
else if(istype(I, /obj/item/melee/baton))
var/obj/item/melee/baton/B = I
if(B.cell)
@@ -390,7 +390,7 @@
if(T.cell.charge < T.cell.maxcharge)
var/obj/item/ammo_casing/energy/S = T.ammo_type[T.select]
T.cell.give(S.e_cost * coeff)
- T.update_icon()
+ T.update_appearance(UPDATE_ICON)
else
T.charge_timer = 0
diff --git a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm
index 435c369d4016..899663281cdd 100644
--- a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm
+++ b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm
@@ -60,13 +60,13 @@
return
switch(mode)
if(BOT_IDLE) // idle
- update_icon()
+ update_appearance(UPDATE_ICON)
walk_to(src,0)
look_for_perp() // see if any criminals are in range
if(!mode && auto_patrol) // still idle, and set to patrol
mode = BOT_START_PATROL // switch to patrol mode
if(BOT_HUNT) // hunting for perp
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(src,'sound/effects/beepskyspinsabre.ogg',100,TRUE,-1)
// general beepsky doesn't give up so easily, jedi scum
if(frustration >= 20)
diff --git a/code/modules/mob/living/simple_animal/bot/atmosbot.dm b/code/modules/mob/living/simple_animal/bot/atmosbot.dm
index cff40711067f..d1aff575409a 100644
--- a/code/modules/mob/living/simple_animal/bot/atmosbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/atmosbot.dm
@@ -51,11 +51,11 @@
/mob/living/simple_animal/bot/atmosbot/turn_on()
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/atmosbot/turn_off()
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/atmosbot/set_custom_texts()
text_hack = "You corrupt [name]'s safety protocols."
@@ -82,7 +82,7 @@
if(last_barrier_tick + ATMOSBOT_HOLOBARRIER_COOLDOWN < world.time)
target = return_nearest_breach()
action = ATMOSBOT_DEPLOY_FOAM
- update_icon()
+ update_appearance(UPDATE_ICON)
if(!target)
if(auto_patrol)
@@ -194,9 +194,10 @@
return
breached_pressure = new_breach_pressure
update_controls()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/mob/living/simple_animal/bot/atmosbot/update_icon()
+/mob/living/simple_animal/bot/atmosbot/update_icon_state()
+ . = ..()
icon_state = "atmosbot[on][on?"_[action]":""]"
/mob/living/simple_animal/bot/atmosbot/UnarmedAttack(atom/A, proximity)
diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm
index b69bf925fc76..80e0cd8feb40 100644
--- a/code/modules/mob/living/simple_animal/bot/bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/bot.dm
@@ -130,7 +130,7 @@
on = TRUE
update_mobility()
set_light_on(on)
- update_icon()
+ update_appearance(UPDATE_ICON)
diag_hud_set_botstat()
return TRUE
@@ -139,7 +139,7 @@
update_mobility()
set_light_on(on)
bot_reset() //Resets an AI's call, should it exist.
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/Initialize(mapload)
. = ..()
@@ -400,7 +400,7 @@
if(istype(dropped_item, /obj/item/stock_parts/cell))
var/obj/item/stock_parts/cell/dropped_cell = dropped_item
dropped_cell.charge = 0
- dropped_cell.update_icon()
+ dropped_cell.update_appearance(UPDATE_ICON)
else if(istype(dropped_item, /obj/item/storage))
var/obj/item/storage/S = dropped_item
@@ -409,7 +409,7 @@
else if(istype(dropped_item, /obj/item/gun/energy))
var/obj/item/gun/energy/dropped_gun = dropped_item
dropped_gun.cell.charge = 0
- dropped_gun.update_icon()
+ dropped_gun.update_appearance(UPDATE_ICON)
//Generalized behavior code, override where needed!
@@ -855,7 +855,8 @@ Pass a positive integer as an argument to override a bot's default speed.
ejectpai(usr)
update_controls()
-/mob/living/simple_animal/bot/update_icon()
+/mob/living/simple_animal/bot/update_icon_state()
+ . = ..()
icon_state = "[initial(icon_state)][on]"
// Machinery to simplify topic and access calls
@@ -968,7 +969,7 @@ Pass a positive integer as an argument to override a bot's default speed.
/mob/living/simple_animal/bot/revive(full_heal = 0, admin_revive = 0)
if(..())
- update_icon()
+ update_appearance(UPDATE_ICON)
. = 1
/mob/living/simple_animal/bot/ghost()
diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm
index 52a44ad84592..bc3adbab0a85 100644
--- a/code/modules/mob/living/simple_animal/bot/construction.dm
+++ b/code/modules/mob/living/simple_animal/bot/construction.dm
@@ -212,10 +212,10 @@
/obj/item/bot_assembly/floorbot/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/bot_assembly/floorbot/update_icon()
- ..()
+/obj/item/bot_assembly/floorbot/update_appearance(updates=ALL)
+ . = ..()
switch(build_step)
if(ASSEMBLY_FIRST_STEP)
desc = initial(desc)
@@ -237,7 +237,7 @@
to_chat(user, span_notice("You add [W] to [src]."))
qdel(W)
build_step++
- update_icon()
+ update_appearance(UPDATE_ICON)
if(ASSEMBLY_SECOND_STEP)
if(istype(W, /obj/item/bodypart/l_arm/robot) || istype(W, /obj/item/bodypart/r_arm/robot))
diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
index 2e01b58cd734..90441684ade8 100644
--- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
@@ -388,15 +388,15 @@ Auto Patrol[]"},
if(!lasercolor)
var/obj/item/gun/energy/e_gun/dragnet/G = new (Tsec)
G.cell.charge = 0
- G.update_icon()
+ G.update_appearance(UPDATE_ICON)
else if(lasercolor == "b")
var/obj/item/gun/energy/laser/bluetag/G = new (Tsec)
G.cell.charge = 0
- G.update_icon()
+ G.update_appearance(UPDATE_ICON)
else if(lasercolor == "r")
var/obj/item/gun/energy/laser/redtag/G = new (Tsec)
G.cell.charge = 0
- G.update_icon()
+ G.update_appearance(UPDATE_ICON)
if(prob(50))
new /obj/item/bodypart/l_leg/robot(Tsec)
diff --git a/code/modules/mob/living/simple_animal/bot/firebot.dm b/code/modules/mob/living/simple_animal/bot/firebot.dm
index cdc1f2e12d42..f23f711e00b6 100644
--- a/code/modules/mob/living/simple_animal/bot/firebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/firebot.dm
@@ -41,7 +41,7 @@
/mob/living/simple_animal/bot/firebot/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
var/datum/job/engineer/J = new/datum/job/engineer
access_card.access += J.get_access()
prev_access = access_card.access
@@ -76,11 +76,11 @@
/mob/living/simple_animal/bot/firebot/turn_on()
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/firebot/turn_off()
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/firebot/bot_reset()
..()
@@ -88,14 +88,14 @@
old_target_fire = null
ignore_list = list()
anchored = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/firebot/proc/soft_reset()
path = list()
target_fire = null
mode = BOT_IDLE
last_found = world.time
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/firebot/set_custom_texts()
text_hack = "You corrupt [name]'s safety protocols."
@@ -152,7 +152,7 @@
stationary_mode = !stationary_mode
update_controls()
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/firebot/proc/is_burning(atom/target)
if(ismob(target))
@@ -286,7 +286,8 @@
flick("firebot1_use", user)
internal_ext.afterattack(target, user, null)
-/mob/living/simple_animal/bot/firebot/update_icon()
+/mob/living/simple_animal/bot/firebot/update_icon_state()
+ . = ..()
if(!on)
icon_state = "firebot0"
return
diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm
index a4ad78b124a5..2313094685e2 100644
--- a/code/modules/mob/living/simple_animal/bot/floorbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm
@@ -45,7 +45,7 @@
/mob/living/simple_animal/bot/floorbot/Initialize(mapload, new_toolbox_color)
. = ..()
toolbox_color = new_toolbox_color
- update_icon()
+ update_appearance(UPDATE_ICON)
var/datum/job/engineer/J = new/datum/job/engineer
access_card.access += J.get_access()
prev_access = access_card.access
@@ -55,11 +55,11 @@
/mob/living/simple_animal/bot/floorbot/turn_on()
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/floorbot/turn_off()
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/floorbot/bot_reset()
..()
@@ -67,7 +67,7 @@
oldloc = null
ignore_list = list()
anchored = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/floorbot/set_custom_texts()
text_hack = "You corrupt [name]'s construction protocols."
@@ -355,11 +355,12 @@
if(specialtiles == 0)
speak("Requesting refill of custom floortiles to continue replacing.")
mode = BOT_IDLE
- update_icon()
+ update_appearance(UPDATE_ICON)
anchored = FALSE
target = null
-/mob/living/simple_animal/bot/floorbot/update_icon()
+/mob/living/simple_animal/bot/floorbot/update_icon_state()
+ . = ..()
icon_state = "[toolbox_color]floorbot[on]"
diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm
index 2965832f658d..7de5fcadff37 100644
--- a/code/modules/mob/living/simple_animal/bot/honkbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm
@@ -39,7 +39,7 @@
/mob/living/simple_animal/bot/honkbot/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
auto_patrol = TRUE
var/datum/job/clown/J = new/datum/job/clown
access_card.access += J.get_access()
@@ -133,7 +133,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
oldtarget_name = user.name
audible_message(span_danger("[src] gives out an evil laugh!"))
playsound(src, 'sound/machines/honkbot_evil_laugh.ogg', 75, 1, -1) // evil laughter
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/honkbot/bullet_act(obj/item/projectile/Proj)
if((istype(Proj,/obj/item/projectile/beam)) || (istype(Proj,/obj/item/projectile/bullet) && (Proj.damage_type == BURN))||(Proj.damage_type == BRUTE) && (!Proj.nodamage && Proj.damage < health && ishuman(Proj.firer)))
diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm
index 3cf8e99d2eb6..e38f4bd6c3bd 100644
--- a/code/modules/mob/living/simple_animal/bot/medbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/medbot.dm
@@ -91,10 +91,8 @@
treatment_tox_avoid = null
treatment_tox = /datum/reagent/toxin/sodium_thiopental
-/mob/living/simple_animal/bot/medbot/update_icon()
- cut_overlays()
- if(skin)
- add_overlay("medskin_[skin]")
+/mob/living/simple_animal/bot/medbot/update_icon_state()
+ . = ..()
if(!on)
icon_state = "medibot0"
return
@@ -109,6 +107,11 @@
else
icon_state = "medibot1"
+/mob/living/simple_animal/bot/medbot/update_overlays()
+ . = ..()
+ if(skin)
+ . += "medskin_[skin]"
+
/mob/living/simple_animal/bot/medbot/Initialize(mapload, new_skin)
. = ..()
var/datum/job/doctor/J = new /datum/job/doctor
@@ -116,11 +119,11 @@
prev_access = access_card.access
qdel(J)
skin = new_skin
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/medbot/update_mobility()
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/medbot/bot_reset()
..()
@@ -129,14 +132,14 @@
oldloc = null
last_found = world.time
declare_cooldown = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/medbot/proc/soft_reset() //Allows the medibot to still actively perform its medical duties without being completely halted as a hard reset does.
path = list()
patient = null
mode = BOT_IDLE
last_found = world.time
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/medbot/set_custom_texts()
@@ -222,7 +225,7 @@
else if(href_list["stationary"])
stationary_mode = !stationary_mode
path = list()
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(href_list["virus"])
treat_virus = !treat_virus
@@ -413,7 +416,7 @@
if(patient && (get_dist(src,patient) <= 1)) //Patient is next to us, begin treatment!
if(mode != BOT_HEALING)
mode = BOT_HEALING
- update_icon()
+ update_appearance(UPDATE_ICON)
frustration = 0
medicate_patient(patient)
return
@@ -554,9 +557,9 @@
var/mob/living/carbon/C = A
patient = C
mode = BOT_HEALING
- update_icon()
+ update_appearance(UPDATE_ICON)
medicate_patient(C)
- update_icon()
+ update_appearance(UPDATE_ICON)
else
..()
@@ -664,7 +667,7 @@
if(failed)
visible_message("[src] retracts its syringe.")
- update_icon()
+ update_appearance(UPDATE_ICON)
soft_reset()
return
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index 361ffc9c733b..c9aa2c2700d5 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -112,7 +112,7 @@
..()
else
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
return
/mob/living/simple_animal/bot/mulebot/emag_act(mob/user)
@@ -124,18 +124,20 @@
flick("mulebot-emagged", src)
playsound(src, "sparks", 100, 0)
-/mob/living/simple_animal/bot/mulebot/update_icon()
+/mob/living/simple_animal/bot/mulebot/update_icon_state()
+ . = ..()
if(open)
icon_state="mulebot-hatch"
else
icon_state = "mulebot[wires.is_cut(WIRE_AVOIDANCE)]"
- cut_overlays()
+
+/mob/living/simple_animal/bot/mulebot/update_overlays()
+ . = ..()
if(load && !ismob(load))//buckling handles the mob offsets
load.pixel_y = initial(load.pixel_y) + 9
if(load.layer < layer)
load.layer = layer + 0.01
- add_overlay(load)
- return
+ . += load
/mob/living/simple_animal/bot/mulebot/ex_act(severity)
unload(0)
@@ -386,7 +388,7 @@
load = AM
mode = BOT_IDLE
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/mulebot/proc/load_mob(mob/living/M)
can_buckle = TRUE
@@ -460,7 +462,7 @@
num_steps--
if(!on || client)
return
- update_icon()
+ update_appearance(UPDATE_ICON)
switch(mode)
if(BOT_IDLE) // idle
@@ -569,7 +571,7 @@
mode = BOT_GO_HOME
else
mode = BOT_DELIVER
- update_icon()
+ update_appearance(UPDATE_ICON)
get_nav()
// starts bot moving to home
@@ -580,7 +582,7 @@
spawn(0)
set_destination(home_destination)
mode = BOT_BLOCKED
- update_icon()
+ update_appearance(UPDATE_ICON)
// called when bot reaches current target
/mob/living/simple_animal/bot/mulebot/proc/at_target()
@@ -688,7 +690,7 @@
loaddir = text2num(direction)
else
loaddir = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
if(destination) // No need to calculate a path if you do not have a destination set!
calc_path()
@@ -710,7 +712,7 @@
new /obj/item/stack/cable_coil/cut(Tsec)
if(cell)
cell.forceMove(Tsec)
- cell.update_icon()
+ cell.update_appearance(UPDATE_ICON)
cell = null
do_sparks(3, TRUE, src)
diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm
index ef3b15ef59d5..c92b01854abf 100644
--- a/code/modules/mob/living/simple_animal/bot/secbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/secbot.dm
@@ -71,7 +71,7 @@
/mob/living/simple_animal/bot/secbot/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
var/datum/job/detective/J = new/datum/job/detective
access_card.access += J.get_access()
prev_access = access_card.access
@@ -83,11 +83,10 @@
if(prob(5))
russian = TRUE // imported from Russia
-/mob/living/simple_animal/bot/secbot/update_icon()
+/mob/living/simple_animal/bot/secbot/update_icon_state()
+ . = ..()
if(mode == BOT_HUNT)
icon_state = "[initial(icon_state)]-c"
- return
- ..()
/mob/living/simple_animal/bot/secbot/turn_off()
..()
@@ -209,7 +208,7 @@ Auto Patrol: []"},
oldtarget_name = user.name
audible_message(span_danger("[src] buzzes oddly!"))
declare_arrests = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/bot/secbot/bullet_act(obj/item/projectile/Proj)
if(istype(Proj , /obj/item/projectile/beam)||istype(Proj, /obj/item/projectile/bullet))
diff --git a/code/modules/mob/living/simple_animal/eldritch_demons.dm b/code/modules/mob/living/simple_animal/eldritch_demons.dm
index 1991868eb855..48999f3b2a07 100644
--- a/code/modules/mob/living/simple_animal/eldritch_demons.dm
+++ b/code/modules/mob/living/simple_animal/eldritch_demons.dm
@@ -317,12 +317,12 @@
)
/mob/living/simple_animal/hostile/eldritch/rust_spirit/setDir(newdir)
- . = ..()
- if(newdir == NORTH)
- icon_state = "rust_walker_n"
- else if(newdir == SOUTH)
- icon_state = "rust_walker_s"
- //update_icon()
+ . = ..()
+ if(newdir == NORTH)
+ icon_state = "rust_walker_n"
+ else if(newdir == SOUTH)
+ icon_state = "rust_walker_s"
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/hostile/eldritch/rust_spirit/Moved()
. = ..()
diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
index 64b0860dc4a7..a276f50f18a7 100644
--- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
+++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
@@ -65,7 +65,7 @@
to_chat(user, span_notice("You install [M] in [src]!"))
mmi = M
transfer_personality(M)
- update_icon()
+ update_appearance(UPDATE_ICON)
return 1
else if(O.tool_behaviour == TOOL_WELDER && (user.a_intent != INTENT_HARM || user == src)) ///Removed needless self repair part
@@ -131,7 +131,8 @@
if(!QDELETED(src) && stat != DEAD)
death()
-/mob/living/simple_animal/spiderbot/update_icon()
+/mob/living/simple_animal/spiderbot/update_icon_state()
+ . = ..()
if(mmi)
if(istype(mmi, /obj/item/mmi/posibrain))
icon_state = "spiderbot-chassis-posi"
@@ -150,10 +151,10 @@
else if(key)
mmi.brainmob.key = key
mmi.forceMove(loc)
- mmi.update_icon()
+ mmi.update_appearance(UPDATE_ICON)
mmi = null
name = initial(name)
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/spiderbot/gib()
eject_brain()
diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm
index d95270a0120e..5fe89722a06c 100644
--- a/code/modules/mob/living/simple_animal/guardian/guardian.dm
+++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm
@@ -636,8 +636,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/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/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 9cbd39d01031..d7adc0d13d65 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
@@ -300,9 +300,6 @@ 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/accept_check(obj/item/O)
if(!istype(O))
return FALSE
@@ -312,6 +309,7 @@ Difficulty: Very Hard
return TRUE
/obj/machinery/smartfridge/black_box/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
. = ..()
var/static/obj/machinery/smartfridge/black_box/current
if(current && current != src)
diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm
index 684a7d66b59c..d25d453cef94 100644
--- a/code/modules/mob/living/simple_animal/hostile/mimic.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm
@@ -239,19 +239,19 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
var/obj/item/ammo_casing/energy/shot = Zapgun.ammo_type[Zapgun.select]
if(Zapgun.cell.charge >= shot.e_cost)
Zapgun.cell.use(shot.e_cost)
- Zapgun.update_icon()
+ Zapgun.update_appearance(UPDATE_ICON)
..()
else if(Zapstick)
if(Zapstick.charges)
Zapstick.charges--
- Zapstick.update_icon()
+ Zapstick.update_appearance(UPDATE_ICON)
..()
else if(Pewgun)
if(Pewgun.chambered)
if(Pewgun.chambered.BB)
qdel(Pewgun.chambered.BB)
Pewgun.chambered.BB = null //because qdel takes too long, ensures icon update
- Pewgun.chambered.update_icon()
+ Pewgun.chambered.update_appearance(UPDATE_ICON)
..()
else
visible_message(span_danger("The [src] clears a jam!"))
@@ -260,7 +260,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
if(Pewgun.magazine && Pewgun.magazine.stored_ammo.len)
Pewgun.chambered = Pewgun.magazine.get_round(0)
Pewgun.chambered.forceMove(Pewgun)
- Pewgun.update_icon()
+ Pewgun.update_appearance(UPDATE_ICON)
else if(Pewgun.magazine && Pewgun.magazine.stored_ammo.len) //only true for pumpguns i think
Pewgun.chambered = Pewgun.magazine.get_round(0)
Pewgun.chambered.forceMove(Pewgun)
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index 655a4055317d..1182725f8ead 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -541,10 +541,10 @@
var/atom/movable/screen/inventory/hand/H
H = hud_used.hand_slots["[hand_index]"]
if(H)
- H.update_icon()
+ H.update_appearance(UPDATE_ICON)
H = hud_used.hand_slots["[oindex]"]
if(H)
- H.update_icon()
+ H.update_appearance(UPDATE_ICON)
/mob/living/simple_animal/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE)
. = ..(I, del_on_fail, merge_stacks)
diff --git a/code/modules/mob/living/simple_animal/slime/death.dm b/code/modules/mob/living/simple_animal/slime/death.dm
index 5435ce561ecf..19aa4ec103a1 100644
--- a/code/modules/mob/living/simple_animal/slime/death.dm
+++ b/code/modules/mob/living/simple_animal/slime/death.dm
@@ -15,7 +15,7 @@
E.Grant(src)
revive(full_heal = 1)
regenerate_icons()
- update_name()
+ update_appearance(UPDATE_NAME)
return
if(buckled)
diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm
index 34a93c979cbf..4490a13da32e 100644
--- a/code/modules/mob/living/simple_animal/slime/powers.dm
+++ b/code/modules/mob/living/simple_animal/slime/powers.dm
@@ -152,7 +152,7 @@
for(var/datum/action/innate/slime/evolve/E in actions)
E.Remove(src)
regenerate_icons()
- update_name()
+ update_appearance(UPDATE_NAME)
else
to_chat(src, "I am not ready to evolve yet...")
else
diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm
index 60f16e558944..9d782b06052b 100644
--- a/code/modules/mob/living/simple_animal/slime/slime.dm
+++ b/code/modules/mob/living/simple_animal/slime/slime.dm
@@ -143,13 +143,14 @@
/mob/living/simple_animal/slime/proc/set_colour(new_colour)
colour = new_colour
- update_name()
+ update_appearance(UPDATE_NAME)
slime_mutation = mutation_table(colour)
var/sanitizedcolour = replacetext(colour, " ", "")
coretype = text2path("/obj/item/slime_extract/[sanitizedcolour]")
regenerate_icons()
-/mob/living/simple_animal/slime/proc/update_name()
+/mob/living/simple_animal/slime/update_name(updates=ALL)
+ . = ..()
if(slime_name_regex.Find(name))
number = rand(1, 1000)
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 12c2fda13881..ae9267b10791 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -676,13 +676,13 @@
/mob/proc/update_pull_hud_icon()
if(hud_used)
if(hud_used.pull_icon)
- hud_used.pull_icon.update_icon(src)
+ hud_used.pull_icon.update_appearance(UPDATE_ICON)
///Update the resting hud icon
/mob/proc/update_rest_hud_icon()
if(hud_used)
if(hud_used.rest_icon)
- hud_used.rest_icon.update_icon(src)
+ hud_used.rest_icon.update_appearance(UPDATE_ICON)
/**
* Verb to activate the object in your held hand
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index b3ba9df0a698..a2b7f3eec7b4 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -51,7 +51,7 @@
*/
/// The zone this mob is currently targeting
- var/zone_selected = null
+ var/zone_selected = BODY_ZONE_CHEST
var/computer_id = null
var/list/logging = list()
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index b2368a0ba2a1..e62c604fd91f 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -495,7 +495,7 @@
m_intent = MOVE_INTENT_RUN
if(hud_used && hud_used.static_inventory)
for(var/atom/movable/screen/mov_intent/selector in hud_used.static_inventory)
- selector.update_icon(src)
+ selector.update_appearance(UPDATE_ICON)
///Moves a mob upwards in z level
/mob/verb/up()
diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm
index 8f30343f0aaf..cace6dbe8401 100644
--- a/code/modules/modular_computers/computers/item/computer.dm
+++ b/code/modules/modular_computers/computers/item/computer.dm
@@ -99,7 +99,7 @@
idle_threads = list()
install_starting_components()
install_starting_files()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/modular_computer/Destroy()
kill_program(forced = TRUE)
@@ -262,7 +262,8 @@
. += get_modular_computer_parts_examine(user)
-/obj/item/modular_computer/update_icon()
+/obj/item/modular_computer/update_icon(updates=ALL)
+ . = ..()
if(!physical)
return
@@ -293,11 +294,11 @@
/obj/item/modular_computer/equipped()
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/modular_computer/dropped()
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/modular_computer/proc/update_label()
@@ -338,7 +339,7 @@
else
to_chat(user, span_notice("You press the power button and start up \the [src]."))
enabled = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
play_computer_sound(startup_sound, get_clamped_volume(), FALSE)
ui_interact(user)
else // Unpowered
@@ -480,7 +481,7 @@
var/mob/user = usr
if(user && istype(user))
ui_interact(user) // Re-open the UI on this computer. It should show the main screen now.
- update_icon()
+ update_appearance(UPDATE_ICON)
// Returns 0 for No Signal, 1 for Low Signal and 2 for Good Signal. 3 is for wired connection (always-on)
/obj/item/modular_computer/proc/get_ntnet_status(specific_action = 0)
@@ -504,7 +505,7 @@
if(loud)
physical.visible_message(span_notice("\The [src] shuts down."))
enabled = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
play_computer_sound(shutdown_sound, get_clamped_volume(), FALSE)
/**
@@ -517,7 +518,7 @@
if(!has_light)
return FALSE
set_light_on(!light_on)
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/**
diff --git a/code/modules/modular_computers/computers/item/computer_components.dm b/code/modules/modular_computers/computers/item/computer_components.dm
index 8020167959a6..0be41490d652 100644
--- a/code/modules/modular_computers/computers/item/computer_components.dm
+++ b/code/modules/modular_computers/computers/item/computer_components.dm
@@ -50,7 +50,7 @@
yeet.on_remove(src, user)
if(enabled && !use_power())
shutdown_computer()
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/// This isn't the "uninstall fully" proc, it just makes the computer lose all its references to the component
diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm
index cb6f3f7aa702..9af6c1d7edb0 100644
--- a/code/modules/modular_computers/computers/item/computer_ui.dm
+++ b/code/modules/modular_computers/computers/item/computer_ui.dm
@@ -116,7 +116,7 @@
active_program.program_state = PROGRAM_STATE_BACKGROUND // Should close any existing UIs
active_program = null
- update_icon()
+ update_appearance(UPDATE_ICON)
if(user && istype(user))
ui_interact(user) // Re-open the UI on this computer. It should show the main screen now.
@@ -156,7 +156,7 @@
active_program = P
P.alert_pending = FALSE
idle_threads.Remove(P)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
var/obj/item/computer_hardware/processor_unit/PU = all_components[MC_CPU]
@@ -171,7 +171,7 @@
if(P.run_program(user))
active_program = P
P.alert_pending = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
if("PC_toggle_light")
diff --git a/code/modules/modular_computers/computers/item/laptop/laptop.dm b/code/modules/modular_computers/computers/item/laptop/laptop.dm
index bbdcdb815ae1..bdecc7e504cf 100644
--- a/code/modules/modular_computers/computers/item/laptop/laptop.dm
+++ b/code/modules/modular_computers/computers/item/laptop/laptop.dm
@@ -33,12 +33,12 @@
if(start_open && !screen_on)
toggle_open()
-/obj/item/modular_computer/laptop/update_icon()
+/obj/item/modular_computer/laptop/update_icon(updates=ALL)
+ . = ..()
if(screen_on)
- ..()
- else
- SSvis_overlays.remove_vis_overlay(physical, physical.managed_vis_overlays)
- icon_state = icon_state_closed
+ return
+ SSvis_overlays.remove_vis_overlay(physical, physical.managed_vis_overlays)
+ icon_state = icon_state_closed
/obj/item/modular_computer/laptop/attack_self(mob/user)
if(!screen_on)
@@ -106,7 +106,7 @@
icon_state = icon_state_unpowered
screen_on = !screen_on
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/modular_computers/computers/item/processor.dm b/code/modules/modular_computers/computers/item/processor.dm
index dd636708bd2f..0720cfe412af 100644
--- a/code/modules/modular_computers/computers/item/processor.dm
+++ b/code/modules/modular_computers/computers/item/processor.dm
@@ -62,7 +62,7 @@
if(!machinery_computer)
return
..()
- machinery_computer.update_icon()
+ machinery_computer.update_appearance(UPDATE_ICON)
return
/obj/item/modular_computer/processor/attack_ghost(mob/user)
diff --git a/code/modules/modular_computers/computers/item/tablet/tablet.dm b/code/modules/modular_computers/computers/item/tablet/tablet.dm
index 81e483c3dc95..f372b776d531 100644
--- a/code/modules/modular_computers/computers/item/tablet/tablet.dm
+++ b/code/modules/modular_computers/computers/item/tablet/tablet.dm
@@ -56,12 +56,12 @@
return
to_chat(user, span_notice("You slide \the [C] into \the [src]."))
inserted_item = C
- update_icon()
+ update_appearance(UPDATE_ICON)
else
return ..()
-/obj/item/modular_computer/tablet/update_icon()
- ..()
+/obj/item/modular_computer/tablet/update_icon_state()
+ . = ..()
if (!isnull(variants))
if(!finish_color)
finish_color = pick(variants)
diff --git a/code/modules/modular_computers/computers/machinery/console/modular_console.dm b/code/modules/modular_computers/computers/machinery/console/modular_console.dm
index 29275d051998..006b8de4eb80 100644
--- a/code/modules/modular_computers/computers/machinery/console/modular_console.dm
+++ b/code/modules/modular_computers/computers/machinery/console/modular_console.dm
@@ -42,9 +42,9 @@
network_card.identification_string = "Unknown Console"
if(cpu)
cpu.screen_on = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/modular_computer/console/update_icon()
+/obj/machinery/modular_computer/console/update_icon(updates=ALL)
. = ..()
// this bit of code makes the computer hug the wall its next to
diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm
index 02e8b67c8cc1..bd30abb85358 100644
--- a/code/modules/modular_computers/computers/machinery/modular_computer.dm
+++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm
@@ -75,8 +75,9 @@
return FALSE
return (cpu.emag_act(user))
-/obj/machinery/modular_computer/update_icon()
- cpu.update_icon()
+/obj/machinery/modular_computer/update_icon(updates=ALL)
+ . = ..()
+ cpu.update_appearance(UPDATE_ICON)
/obj/machinery/modular_computer/AltClick(mob/user)
if(cpu)
@@ -105,13 +106,13 @@
if(cpu)
cpu.shutdown_computer(0)
stat |= NOPOWER
- update_icon()
+ update_appearance(UPDATE_ICON)
// Modular computers can have battery in them, we handle power in previous proc, so prevent this from messing it up for us.
/obj/machinery/modular_computer/power_change()
if(cpu && cpu.use_power()) // If MC_CPU still has a power source, PC wouldn't go offline.
stat &= ~NOPOWER
- update_icon()
+ update_appearance(UPDATE_ICON) //modPCs should be changed to use powered() instead.
return
. = ..()
diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm
index b7d3163581b3..0efcfdb19b62 100644
--- a/code/modules/modular_computers/file_system/program.dm
+++ b/code/modules/modular_computers/file_system/program.dm
@@ -68,7 +68,7 @@
// Relays icon update to the computer.
/datum/computer_file/program/proc/update_computer_icon()
if(computer)
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
// Attempts to create a log in global ntnet datum. Returns 1 on success, 0 on fail.
/datum/computer_file/program/proc/generate_network_log(text)
@@ -237,7 +237,7 @@
program_state = PROGRAM_STATE_BACKGROUND // Should close any existing UIs
computer.active_program = null
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
ui.close()
if(user && istype(user))
diff --git a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm
index 28aa6d769e9c..abff81bd1308 100644
--- a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm
+++ b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm
@@ -28,7 +28,7 @@
computer.visible_message(span_notice("\The [computer]'s screen brightly flashes and loud electrical buzzing is heard."))
computer.enabled = FALSE
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
var/obj/item/computer_hardware/battery/battery_module = computer.all_components[MC_CELL]
var/obj/item/computer_hardware/recharger/recharger = computer.all_components[MC_CHARGE]
diff --git a/code/modules/modular_computers/file_system/programs/arcade.dm b/code/modules/modular_computers/file_system/programs/arcade.dm
index 63d6f381d4d8..a576aef69d58 100644
--- a/code/modules/modular_computers/file_system/programs/arcade.dm
+++ b/code/modules/modular_computers/file_system/programs/arcade.dm
@@ -28,7 +28,7 @@
game_active = FALSE
program_icon_state = "arcade_off"
if(istype(computer))
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
ticket_count += 1
sleep(1 SECONDS)
return
@@ -38,7 +38,7 @@
game_active = FALSE
program_icon_state = "arcade_off"
if(istype(computer))
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
sleep(1 SECONDS)
return
return
@@ -168,4 +168,4 @@
boss_id = rand(1,6)
pause_state = FALSE
if(istype(computer))
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
diff --git a/code/modules/modular_computers/file_system/programs/engineering/sm_monitor.dm b/code/modules/modular_computers/file_system/programs/engineering/sm_monitor.dm
index f0d06dc70970..c4afd769d205 100644
--- a/code/modules/modular_computers/file_system/programs/engineering/sm_monitor.dm
+++ b/code/modules/modular_computers/file_system/programs/engineering/sm_monitor.dm
@@ -31,7 +31,7 @@
ui_header = "smmon_[last_status].gif"
program_icon_state = "smmon_[last_status]"
if(istype(computer))
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
/datum/computer_file/program/supermatter_monitor/run_program(mob/living/user)
. = ..(user)
diff --git a/code/modules/modular_computers/file_system/programs/medical/crew_monitor.dm b/code/modules/modular_computers/file_system/programs/medical/crew_monitor.dm
index 2f64d0d938ce..d0986bc7e206 100644
--- a/code/modules/modular_computers/file_system/programs/medical/crew_monitor.dm
+++ b/code/modules/modular_computers/file_system/programs/medical/crew_monitor.dm
@@ -56,7 +56,7 @@
ui_header = "health_green.gif"
if(istype(computer))
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
/datum/computer_file/program/crew_monitor/ui_data(mob/user)
var/list/data = get_header_data()
diff --git a/code/modules/modular_computers/file_system/programs/portrait_printer.dm b/code/modules/modular_computers/file_system/programs/portrait_printer.dm
index 912bf4030dcd..95bd71cb097b 100644
--- a/code/modules/modular_computers/file_system/programs/portrait_printer.dm
+++ b/code/modules/modular_computers/file_system/programs/portrait_printer.dm
@@ -73,7 +73,7 @@
printed_canvas.name = "painting - [title]"
///this is a copy of something that is already in the database- it should not be able to be saved.
printed_canvas.no_save = TRUE
- printed_canvas.update_icon()
+ printed_canvas.update_appearance(UPDATE_ICON)
to_chat(usr, span_notice("You have printed [title] onto a new canvas."))
playsound(computer.physical, 'sound/items/poster_being_created.ogg', 100, TRUE)
diff --git a/code/modules/modular_computers/file_system/programs/radar.dm b/code/modules/modular_computers/file_system/programs/radar.dm
index 97f64584ed06..6f42edf88f70 100644
--- a/code/modules/modular_computers/file_system/programs/radar.dm
+++ b/code/modules/modular_computers/file_system/programs/radar.dm
@@ -17,7 +17,7 @@
var/atom/selected
///Used to store when the next scan is available. Updated by the scan() proc.
var/next_scan = 0
- ///Used to keep track of the last value program_icon_state was set to, to prevent constant unnecessary update_icon() calls
+ ///Used to keep track of the last value program_icon_state was set to, to prevent constant unnecessary update_appearance(UPDATE_ICON) calls
var/last_icon_state = ""
///Used by the tgui interface, themed NT or Syndicate.
var/arrowstyle = "ntosradarpointer.png"
@@ -180,7 +180,7 @@
if(!trackable(signal))
program_icon_state = "[initial(program_icon_state)]lost"
if(last_icon_state != program_icon_state)
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
last_icon_state = program_icon_state
return
@@ -198,7 +198,7 @@
program_icon_state = "[initial(program_icon_state)]far"
if(last_icon_state != program_icon_state)
- computer.update_icon()
+ computer.update_appearance(UPDATE_ICON)
last_icon_state = program_icon_state
computer.setDir(get_dir(here_turf, target_turf))
diff --git a/code/modules/modular_computers/file_system/programs/science/airestorer.dm b/code/modules/modular_computers/file_system/programs/science/airestorer.dm
index 56a9d7463fbd..4251db214748 100644
--- a/code/modules/modular_computers/file_system/programs/science/airestorer.dm
+++ b/code/modules/modular_computers/file_system/programs/science/airestorer.dm
@@ -85,7 +85,7 @@
A.updatehealth()
if(A.health >= 0 && A.stat == DEAD)
A.revive()
- cardhold.update_icon()
+ cardhold.update_appearance(UPDATE_ICON)
// Finished restoring
if(A.health >= 100)
ai_slot.locked = FALSE
diff --git a/code/modules/modular_computers/hardware/printer.dm b/code/modules/modular_computers/hardware/printer.dm
index 4266a46127cd..abb76b538a7c 100644
--- a/code/modules/modular_computers/hardware/printer.dm
+++ b/code/modules/modular_computers/hardware/printer.dm
@@ -37,7 +37,7 @@
P.info = text_to_print
if(paper_title)
P.name = paper_title
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
P.reload_fields()
stored_paper--
P = null
@@ -52,7 +52,7 @@
// Damaged printer causes the resulting paper to be somewhat harder to read.
if(damage > damage_malfunction)
P.info = stars(P.info, 100-malfunction_probability)
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
P.reload_fields()
stored_paper--
P = null
diff --git a/code/modules/ninja/suit/ninjaDrainAct.dm b/code/modules/ninja/suit/ninjaDrainAct.dm
index f8b61cef7b5e..0c33b62b46d6 100644
--- a/code/modules/ninja/suit/ninjaDrainAct.dm
+++ b/code/modules/ninja/suit/ninjaDrainAct.dm
@@ -55,7 +55,7 @@ They *could* go in their appropriate files, but this is supposed to be modular
playsound(loc, "sparks", 50, 1)
obj_flags |= EMAGGED
locked = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
@@ -112,7 +112,7 @@ They *could* go in their appropriate files, but this is supposed to be modular
S.cell.give(charge)
charge = 0
corrupt()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/proc/AI_notify_hack()
var/turf/location = get_turf(src)
diff --git a/code/modules/ninja/suit/suit_attackby.dm b/code/modules/ninja/suit/suit_attackby.dm
index 6a9040497657..510b4c6b5afc 100644
--- a/code/modules/ninja/suit/suit_attackby.dm
+++ b/code/modules/ninja/suit/suit_attackby.dm
@@ -29,7 +29,7 @@
U.put_in_hands(old_cell)
old_cell.add_fingerprint(U)
old_cell.corrupt()
- old_cell.update_icon()
+ old_cell.update_appearance(UPDATE_ICON)
cell = CELL
to_chat(U, span_notice("Upgrade complete. Maximum capacity: [round(cell.maxcharge/100)]%"))
else
diff --git a/code/modules/pai/card.dm b/code/modules/pai/card.dm
index 312b8a26abc1..6ec83b0daa82 100644
--- a/code/modules/pai/card.dm
+++ b/code/modules/pai/card.dm
@@ -58,19 +58,19 @@
if(thing == pai) //double check /mob/living/silicon/pai/Destroy() if you change these.
pai = null
emotion_icon = initial(emotion_icon)
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/item/pai_card/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
SSpai.pai_card_list += src
/obj/item/pai_card/suicide_act(mob/living/user)
user.visible_message(span_suicide("[user] is staring sadly at [src]! [user.p_they()] can't keep living without real human intimacy!"))
return OXYLOSS
-/obj/item/pai_card/proc/update_overlays()
+/obj/item/pai_card/update_overlays()
. = ..()
. += "pai-[emotion_icon]"
if(pai?.hacking_cable)
@@ -79,7 +79,7 @@
/obj/item/pai_card/vv_edit_var(vname, vval)
. = ..()
if(vname == NAMEOF(src, emotion_icon))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/pai_card/ui_interact(mob/user, datum/tgui/ui)
. = ..()
@@ -253,7 +253,7 @@
return FALSE
pai = downloaded
emotion_icon = "null"
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(src, 'sound/effects/pai_boot.ogg', 50, TRUE, -1)
audible_message("[src] plays a cheerful startup noise!")
return TRUE
diff --git a/code/modules/pai/death.dm b/code/modules/pai/death.dm
index 62cd82fe009b..2168f46796fb 100644
--- a/code/modules/pai/death.dm
+++ b/code/modules/pai/death.dm
@@ -14,6 +14,6 @@
card.forceMove(drop_location())
card.pai = null
card.emotion_icon = initial(card.emotion_icon)
- card.update_icon()
+ card.update_appearance(UPDATE_ICON)
qdel(src)
diff --git a/code/modules/pai/door_jack.dm b/code/modules/pai/door_jack.dm
index 50013cf5862c..75cf0fe9b442 100644
--- a/code/modules/pai/door_jack.dm
+++ b/code/modules/pai/door_jack.dm
@@ -116,7 +116,7 @@
untrack_thing(hacking_cable)
QDEL_NULL(hacking_cable)
if(!QDELETED(card))
- card.update_icon()
+ card.update_appearance(UPDATE_ICON)
return FALSE
var/obj/machinery/door/door = hacking_cable.machine
balloon_alert(src, "success")
diff --git a/code/modules/pai/pai.dm b/code/modules/pai/pai.dm
index 71a1013a4c19..ea62ccef1a4e 100644
--- a/code/modules/pai/pai.dm
+++ b/code/modules/pai/pai.dm
@@ -170,7 +170,7 @@
hacking_cable = null
SStgui.update_user_uis(src)
if(!QDELETED(card))
- card.update_icon()
+ card.update_appearance(UPDATE_ICON)
if(deleting_atom == atmos_analyzer)
atmos_analyzer = null
if(deleting_atom == camera)
diff --git a/code/modules/pai/software.dm b/code/modules/pai/software.dm
index 1ff2e02d3585..9fb5cf109e78 100644
--- a/code/modules/pai/software.dm
+++ b/code/modules/pai/software.dm
@@ -142,7 +142,7 @@
if(isnull(new_image))
return FALSE
card.emotion_icon = new_image
- card.update_icon()
+ card.update_appearance(UPDATE_ICON)
return TRUE
/**
diff --git a/code/modules/paperwork/carbonpaper.dm b/code/modules/paperwork/carbonpaper.dm
index d81bbbb5fc2c..4ef391075ba4 100644
--- a/code/modules/paperwork/carbonpaper.dm
+++ b/code/modules/paperwork/carbonpaper.dm
@@ -7,7 +7,8 @@
var/iscopy = FALSE
-/obj/item/paper/carbon/update_icon()
+/obj/item/paper/carbon/update_icon_state()
+ . = ..()
if(iscopy)
if(written.len)
icon_state = "cpaper_words"
@@ -52,8 +53,8 @@
copied = TRUE
copy.copied = TRUE
copy.iscopy = TRUE
- update_icon()
- copy.update_icon()
+ update_appearance(UPDATE_ICON)
+ copy.update_appearance(UPDATE_ICON)
usr.put_in_hands(copy)
else
to_chat(usr, span_warning("There are no more carbon copies attached to this paper!"))
diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm
index 82cc9c8f249a..e29c311c70f6 100644
--- a/code/modules/paperwork/clipboard.dm
+++ b/code/modules/paperwork/clipboard.dm
@@ -17,7 +17,7 @@
return BRUTELOSS//the clipboard's clip is very strong. industrial duty. can kill a man easily.
/obj/item/clipboard/Initialize(mapload)
- update_icon()
+ update_appearance(UPDATE_ICON)
. = ..()
/obj/item/clipboard/Destroy()
@@ -25,8 +25,8 @@
QDEL_NULL(toppaper) //let movable/Destroy handle the rest
return ..()
-/obj/item/clipboard/update_icon()
- cut_overlays()
+/obj/item/clipboard/update_overlays()
+ . = ..()
var/list/dat = list()
if(toppaper)
dat += toppaper.icon_state
@@ -34,7 +34,7 @@
if(haspen)
dat += "clipboard_pen"
dat += "clipboard_over"
- add_overlay(dat)
+ . += dat
/obj/item/clipboard/attackby(obj/item/W, mob/user, params)
@@ -43,10 +43,10 @@
return
toppaper = W
to_chat(user, span_notice("You clip the paper onto \the [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(toppaper)
toppaper.attackby(user.get_active_held_item(), user)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/clipboard/attack_self(mob/user)
@@ -126,4 +126,4 @@
//Update everything
attack_self(usr)
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/paperwork/contract.dm b/code/modules/paperwork/contract.dm
index f8e59ab8369a..45e6b403b591 100644
--- a/code/modules/paperwork/contract.dm
+++ b/code/modules/paperwork/contract.dm
@@ -10,8 +10,9 @@
/obj/item/paper/contract/proc/update_text()
return
-/obj/item/paper/contract/update_icon()
- return
+/obj/item/paper/contract/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/paper/contract/infernal
var/contractType = 0
@@ -269,7 +270,7 @@
var/obj/item/storage/wallet/W = worn
W.front_id = id
id.forceMove(worn)
- worn.update_icon()
+ worn.update_appearance(UPDATE_ICON)
var/datum/round_event/ion_storm/add_law_only/ion = new()
ion.announceEvent = -1
ion.ionMessage = "[user.name] is the only Captain of the station. [user.name] is the highest authority, legitimate or otherwise, on the station. [user.name] was always the captain and highest authority on the station. Do not state this law."
diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm
index 311c6a3cfee3..da63fefc3651 100644
--- a/code/modules/paperwork/faxmachine.dm
+++ b/code/modules/paperwork/faxmachine.dm
@@ -196,7 +196,7 @@ GLOBAL_LIST_EMPTY(adminfaxes)
templist += L
P.written += templist
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
playsound(loc, "sound/items/polaroid1.ogg", 50, 1)
// Stamps
diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm
index 90c0b9ab5d32..bf9c5688377b 100644
--- a/code/modules/paperwork/filingcabinet.dm
+++ b/code/modules/paperwork/filingcabinet.dm
@@ -60,15 +60,15 @@
icon_state = "coloredcabinet_frame"
name = "colored cabinet"
-/obj/structure/filingcabinet/colored/update_icon()
- cut_overlays()
+/obj/structure/filingcabinet/colored/update_overlays()
+ . = ..()
var/mutable_appearance/cab = mutable_appearance(icon, "coloredcabinet_trim")
cab.color = colour
- add_overlay(cab)
+ . += cab
/obj/structure/filingcabinet/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
if(mapload)
for(var/obj/item/I in loc)
if(istype(I, /obj/item/paper) || istype(I, /obj/item/folder) || istype(I, /obj/item/photo))
@@ -185,7 +185,7 @@
colour = colour_choice
name = "colored cabinet" // Having a cabinet called 'Purple Cabinet' while it's green colored would be weird
playsound(src, 'sound/effects/spray.ogg', 5, TRUE, 5)
- update_icon() // reset overlays
+ update_appearance(UPDATE_ICON) // reset overlays
return
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index df5436db67ad..ae42022663ac 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)
@@ -39,7 +39,7 @@
if(!user.transferItemToLoc(W, src))
return
to_chat(user, span_notice("You put [W] into [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(istype(W, /obj/item/pen))
if(!user.is_literate())
to_chat(user, span_notice("You scribble illegibly on the cover of [src]!"))
@@ -94,7 +94,7 @@
//Update everything
attack_self(usr)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/folder/documents
name = "folder- 'TOP SECRET'"
@@ -103,7 +103,7 @@
/obj/item/folder/documents/Initialize(mapload)
. = ..()
new /obj/item/documents/nanotrasen(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/folder/syndicate
icon_state = "folder_syndie"
@@ -116,7 +116,7 @@
/obj/item/folder/syndicate/red/Initialize(mapload)
. = ..()
new /obj/item/documents/syndicate/red(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/folder/syndicate/blue
icon_state = "folder_sblue"
@@ -124,9 +124,9 @@
/obj/item/folder/syndicate/blue/Initialize(mapload)
. = ..()
new /obj/item/documents/syndicate/blue(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/folder/syndicate/mining/Initialize(mapload)
. = ..()
new /obj/item/documents/syndicate/mining(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/paperwork/inspector_booth.dm b/code/modules/paperwork/inspector_booth.dm
index cff2ff91cb79..6c553e82c9fa 100644
--- a/code/modules/paperwork/inspector_booth.dm
+++ b/code/modules/paperwork/inspector_booth.dm
@@ -55,9 +55,10 @@
/obj/machinery/inspector_booth/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/inspector_booth/update_icon()
+/obj/machinery/inspector_booth/update_icon_state()
+ . = ..()
if (stat & NOPOWER)
icon_state = "booth_off"
else if (panel_open || stat & MAINT)
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index 0442a79569ad..5746bdac9e60 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -76,11 +76,11 @@
pixel_y = rand(-8, 8)
pixel_x = rand(-9, 9)
written = list()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/paper/update_icon()
-
+/obj/item/paper/update_icon_state()
+ . = ..()
if(resistance_flags & ON_FIRE)
icon_state = "paper_onfire"
return
@@ -185,7 +185,7 @@
stamps = null
LAZYCLEARLIST(stamped)
cut_overlays()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/paper/proc/parsepencode(t, obj/item/pen/P, mob/user, iscrayon = 0)
@@ -279,7 +279,7 @@
else
written.Insert(text2num(id),templist) // text2num, otherwise it writes to the hashtable index instead of into the array
usr << browse("[name][render_body(usr,TRUE)]
[stamps]", "window=[name]") // Update the window
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/paper/attackby(obj/item/P, mob/living/carbon/human/user, params)
@@ -355,7 +355,7 @@
src.loc = B
P.loc = B
B.amount = 2
- B.update_icon()
+ B.update_appearance(UPDATE_ICON)
add_fingerprint(user)
@@ -368,7 +368,7 @@
/obj/item/paper/extinguish()
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/*
* Construction paper
@@ -393,8 +393,9 @@
icon_state = "scrap"
slot_flags = null
-/obj/item/paper/crumpled/update_icon()
- return
+/obj/item/paper/crumpled/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/paper/crumpled/bloody
icon_state = "scrap_bloodied"
diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm
index 351e5472cc1c..c9a1d7e0e80c 100644
--- a/code/modules/paperwork/paper_bundle.dm
+++ b/code/modules/paperwork/paper_bundle.dm
@@ -58,7 +58,7 @@
usr << browse("", "window=[name]") //Closes the dialog
P = src[page]
P.attackby(W, user)
- update_icon()
+ update_appearance(UPDATE_ICON)
attack_self(usr) //Update the browsed page.
add_fingerprint(usr)
return
@@ -114,7 +114,7 @@
/obj/item/paper_bundle/attack_self(mob/user as mob)
src.show_content(user)
add_fingerprint(usr)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
/obj/item/paper_bundle/proc/update_screen()
@@ -165,7 +165,7 @@
page = amount
if(page == amount)
screen = 2
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(usr, span_notice("You need to hold it in hand!"))
if (istype(src.loc, /mob) || istype(src.loc?.loc, /mob))
@@ -205,8 +205,8 @@
/obj/item/paper_bundle/AltClick(mob/living/user)
unbundle()
-/obj/item/paper_bundle/update_icon()
- cut_overlays()
+/obj/item/paper_bundle/update_overlays()
+ . = ..()
var/obj/item/paper/P = src[1]
icon_state = P.icon_state
overlays = P.overlays
@@ -228,12 +228,12 @@
var/datum/picture/picture2 = PR.picture
img = picture2.picture_icon
photo = 1
- add_overlay(img)
+ . += img
if(i>1)
desc = "[i] papers clipped to each other."
else
desc = "A single sheet of paper."
if(photo)
desc += "\nThere is a photo attached to it."
- add_overlay(image('icons/obj/bureaucracy.dmi', icon_state= "clip"))
+ . += image('icons/obj/bureaucracy.dmi', icon_state= "clip")
return
diff --git a/code/modules/paperwork/paper_cutter.dm b/code/modules/paperwork/paper_cutter.dm
index 127366ab3b44..6479e517e712 100644
--- a/code/modules/paperwork/paper_cutter.dm
+++ b/code/modules/paperwork/paper_cutter.dm
@@ -15,7 +15,7 @@
/obj/item/papercutter/Initialize(mapload)
. = ..()
storedcutter = new /obj/item/hatchet/cutterblade(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/papercutter/suicide_act(mob/user)
@@ -33,14 +33,14 @@
playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1)
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)]")
- if(storedpaper)
- add_overlay("paper")
+/obj/item/papercutter/update_overlays()
+ . = ..()
+ if(storedpaper)
+ . += "paper"
/obj/item/papercutter/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/paper) && !storedpaper)
@@ -49,7 +49,7 @@
playsound(loc, "pageturn", 60, 1)
to_chat(user, span_notice("You place [P] in [src]."))
storedpaper = P
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(istype(P, /obj/item/hatchet/cutterblade) && !storedcutter)
if(!user.transferItemToLoc(P, src))
@@ -57,7 +57,7 @@
to_chat(user, span_notice("You replace [src]'s [P]."))
P.forceMove(src)
storedcutter = P
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(P.tool_behaviour == TOOL_SCREWDRIVER && storedcutter)
P.play_tool_sound(src)
@@ -79,7 +79,7 @@
to_chat(user, span_notice("You remove [src]'s [storedcutter]."))
user.put_in_hands(storedcutter)
storedcutter = null
- update_icon()
+ update_appearance(UPDATE_ICON)
if(storedpaper)
playsound(src.loc, 'sound/weapons/slash.ogg', 50, 1)
@@ -88,7 +88,7 @@
qdel(storedpaper)
new /obj/item/paperslip(get_turf(src))
new /obj/item/paperslip(get_turf(src))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/papercutter/MouseDrop(atom/over_object)
. = ..()
diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm
index c52d915c54b4..5224bf678d83 100644
--- a/code/modules/paperwork/paperbin.dm
+++ b/code/modules/paperwork/paperbin.dm
@@ -25,7 +25,7 @@
if(P && !bin_pen)
P.forceMove(src)
bin_pen = P
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/paper_bin/Destroy()
if(papers)
@@ -37,7 +37,7 @@
/obj/item/paper_bin/fire_act(exposed_temperature, exposed_volume)
if(total_paper)
total_paper = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
..()
/obj/item/paper_bin/MouseDrop(atom/over_object)
@@ -73,14 +73,14 @@
user.put_in_hands(P)
to_chat(user, span_notice("You take [P] out of \the [src]."))
bin_pen = null
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(total_paper >= 1)
response = alert(user, "Do you take regular paper, or Carbon copy paper?", "Paper type request", "Regular", "Carbon Copy", "Cancel")
if (response != "Regular" && response != "Carbon Copy")
add_fingerprint(user)
return
total_paper--
- update_icon()
+ update_appearance(UPDATE_ICON)
// If there's any custom paper on the stack, use that instead of creating a new paper.
var/obj/item/paper/P
if(papers.len > 0)
@@ -113,14 +113,14 @@
to_chat(user, span_notice("You put [P] in [src]."))
papers.Add(P)
total_paper++
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(istype(I, /obj/item/pen) && !bin_pen)
var/obj/item/pen/P = I
if(!user.transferItemToLoc(P, src))
return
to_chat(user, span_notice("You put [P] in [src]."))
bin_pen = P
- update_icon()
+ update_appearance(UPDATE_ICON)
else
return ..()
@@ -131,14 +131,17 @@
else
. += "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 97985c89f6ff..84115fc68f1f 100644
--- a/code/modules/paperwork/paperplane.dm
+++ b/code/modules/paperwork/paperplane.dm
@@ -29,7 +29,7 @@
newPaper.forceMove(src)
else
internalPaper = new(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/paperplane/handle_atom_del(atom/A)
if(A == internalPaper)
@@ -52,12 +52,12 @@
sleep(1 SECONDS)
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, span_notice("You unfold [src]."))
@@ -75,7 +75,7 @@
else if(istype(P, /obj/item/stamp)) //we don't randomize stamps on a paperplane
internalPaper.attackby(P, user) //spoofed attack to update internal paper.
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(P.is_hot())
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10))
diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm
index 3447000a9306..d176edb1d1c0 100644
--- a/code/modules/paperwork/papershredder.dm
+++ b/code/modules/paperwork/papershredder.dm
@@ -11,7 +11,7 @@
/obj/machinery/papershredder/proc/try_insert(mob/user, insert_size = 0)
if(paperamount <= max_paper - insert_size)
paperamount += insert_size
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(src.loc, 'sound/items/pshred.ogg', 75, 1)
return TRUE
else
@@ -30,7 +30,7 @@
if(ran == 3)
SP.color = null
paperamount -=1
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_warning("The [src] was too full and shredded paper goes everywhere!"))
else
to_chat(user, span_warning("The [src] is full please empty it before you continue."))
@@ -74,7 +74,7 @@
SP.color = null
STR.handle_item_insertion(SP)
paperamount -=1
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("The [W] is full."))
return
@@ -85,7 +85,7 @@
if(paperamount < max_paper)
qdel(W)
paperamount += 1
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(shred_amount && try_insert(user, shred_amount))
@@ -113,25 +113,26 @@
if(ran == 3)
SP.color = null
paperamount -=1
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/papershredder/AltClick(mob/living/user)
emptypaper()
-/obj/machinery/papershredder/update_icon()
- if(paperamount == 0)
- icon_state = "papershredder0"
- if(paperamount == 1||paperamount == 2)
- icon_state = "papershredder1"
- if(paperamount == 3||paperamount == 4)
- icon_state = "papershredder2"
- if(paperamount == 5||paperamount == 6)
- icon_state = "papershredder3"
- if(paperamount == 7||paperamount == 8)
- icon_state = "papershredder4"
- if(paperamount == 9||paperamount == 10)
- icon_state = "papershredder5"
- return
+/obj/machinery/papershredder/update_icon_state()
+ . = ..()
+ switch(paperamount) //cant we just use round(paperamount, 2)
+ if(0)
+ icon_state = "papershredder0"
+ if(1, 2)
+ icon_state = "papershredder1"
+ if(3, 4)
+ icon_state = "papershredder2"
+ if(5, 6)
+ icon_state = "papershredder3"
+ if(7, 8)
+ icon_state = "papershredder4"
+ if(9, 10)
+ icon_state = "papershredder5"
/obj/item/shreddedpaper
name = "shredded paper"
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 45dd291ba16f..ebdc031366f4 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -227,9 +227,10 @@
to_chat(user, span_warning("[src] is now active."))
var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering)
butchering.butchering_enabled = on
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/pen/edagger/update_icon()
+/obj/item/pen/edagger/update_icon(updates=ALL)
+ . = ..()
if(on)
icon_state = "edagger"
item_state = "edagger"
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index e57f80e4f676..f41efbc4633f 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -345,7 +345,7 @@
c.written += L
c.name = copy.name
c.fields = copy.fields
- c.update_icon()
+ c.update_appearance(UPDATE_ICON)
c.stamps = copy.stamps
if(copy.stamped)
c.stamped = copy.stamped.Copy()
@@ -378,7 +378,7 @@
p.amount++
//p.amount--
p.loc = src.loc
- p.update_icon()
+ p.update_appearance(UPDATE_ICON)
p.icon_state = "paper_words"
p.name = bundle.name
p.pixel_y = rand(-8, 8)
diff --git a/code/modules/paperwork/ticketmachine.dm b/code/modules/paperwork/ticketmachine.dm
index 8cb813ecbc13..7c77eaaee889 100644
--- a/code/modules/paperwork/ticketmachine.dm
+++ b/code/modules/paperwork/ticketmachine.dm
@@ -18,17 +18,20 @@
/obj/machinery/ticket_machine/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/ticket_machine/update_icon()
+/obj/machinery/ticket_machine/update_overlays()
+ . = ..()
var/Temp = screenNum //This whole thing breaks down a 3 digit number into 3 seperate digits, aka "69" becomes "0","6" and "9"
var/Digit1 = round(Temp%10)//The remainder of any number/10 is always that number's rightmost digit
var/Digit2 = round(((Temp-Digit1)*0.1)%10) //Same idea, but divided by ten, to find the middle digit
var/Digit3 = round(((Temp-Digit1-Digit2*10)*0.01)%10)//Same as above. Despite the weird notation these will only ever output integers, don't worry.
- cut_overlays()//this clears the overlays, so they don't start stacking on each other
- add_overlay(image('icons/obj/bureaucracy_overlays.dmi',icon_state = "machine_first_[Digit1]"))
- add_overlay(image('icons/obj/bureaucracy_overlays.dmi',icon_state = "machine_second_[Digit2]"))
- add_overlay(image('icons/obj/bureaucracy_overlays.dmi',icon_state = "machine_third_[Digit3]"))
+ . += image('icons/obj/bureaucracy_overlays.dmi',icon_state = "machine_first_[Digit1]")
+ . += image('icons/obj/bureaucracy_overlays.dmi',icon_state = "machine_second_[Digit2]")
+ . += image('icons/obj/bureaucracy_overlays.dmi',icon_state = "machine_third_[Digit3]")
+
+/obj/machinery/ticket_machine/update_icon_state()
+ . = ..()
switch(currentNum) //Gives you an idea of how many tickets are left
if(0 to 200)
icon_state = "ticketmachine_100"
@@ -50,7 +53,7 @@
if(currentNum < screenNum - 1)
screenNum -- //this should only happen if the queue is all caught up and more numbers get called than tickets exist
currentNum = screenNum - 1 //so the number wont go onto infinity. Numbers that haven't been taken yet won't show up on the screen yet either.
- update_icon() //Update our icon here
+ update_appearance(UPDATE_ICON) //Update our icon here
if(tickets.len\The [src] already contains a photo.")
..()
@@ -31,7 +31,7 @@
user.put_in_hands(I)
to_chat(user, span_notice("You carefully remove the photo from \the [src]."))
displayed = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/item/wallframe/picture/attack_self(mob/user)
@@ -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))
+ . += image(displayed)
/obj/item/wallframe/picture/after_attach(obj/O)
..()
@@ -106,7 +106,7 @@
else
qdel(framed)
framed = P
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/sign/picture_frame/examine(mob/user)
if(in_range(src, user) && framed)
@@ -135,7 +135,7 @@
if(!user.transferItemToLoc(P, src))
return
framed = P
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, "\The [src] already contains a photo.")
@@ -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))
+ . += image(framed)
/obj/structure/sign/picture_frame/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
@@ -162,5 +162,5 @@
if(contents.len)
var/obj/item/I = pick(contents)
I.forceMove(F)
- F.update_icon()
+ F.update_appearance(UPDATE_ICON)
qdel(src)
diff --git a/code/modules/photography/photos/photo.dm b/code/modules/photography/photos/photo.dm
index 768367a708ed..dabe93bf4e2d 100644
--- a/code/modules/photography/photos/photo.dm
+++ b/code/modules/photography/photos/photo.dm
@@ -21,7 +21,7 @@
if(!istype(P))
return
picture = P
- update_icon()
+ update_appearance(UPDATE_ICON)
if(P.caption)
scribble = P.caption
if(setname && P.picture_name)
@@ -32,7 +32,8 @@
if(setdesc && P.picture_desc)
desc = P.picture_desc
-/obj/item/photo/update_icon()
+/obj/item/photo/update_icon(updates=ALL)
+ . = ..()
if(!istype(picture) || !picture.picture_image)
return
var/icon/I = picture.get_small_icon()
diff --git a/code/modules/plumbing/ducts.dm b/code/modules/plumbing/ducts.dm
index f238a8cc734d..94d793dc5bde 100644
--- a/code/modules/plumbing/ducts.dm
+++ b/code/modules/plumbing/ducts.dm
@@ -57,7 +57,7 @@ All the important duct code:
for(var/atom/movable/AM in get_step(src, D))
if(connect_network(AM, D))
add_connects(D)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/duct/proc/connect_network(atom/movable/AM, direction, ignore_color)
if(istype(AM, /obj/machinery/duct))
@@ -82,7 +82,7 @@ All the important duct code:
add_neighbour(D)
D.add_connects(opposite_dir)
- D.update_icon()
+ D.update_appearance(UPDATE_ICON)
return TRUE //tell the current pipe to also update it's sprite
if(!(D in neighbours)) //we cool
if((duct_color != D.duct_color) && !(ignore_colors || D.ignore_colors))
@@ -125,7 +125,7 @@ All the important duct code:
duct.remove_duct(src)
lose_neighbours()
reset_connects(0)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/duct/proc/create_duct()
duct = new()
@@ -160,7 +160,8 @@ 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() //setting connects isnt a parameter because sometimes we make more than one change, overwrite it completely or just add it to the bitfield
+ . = ..()
var/temp_icon = initial(icon_state)
for(var/D in GLOB.cardinals)
if(D & connects)
@@ -245,7 +246,7 @@ All the important duct code:
return
connect_network(D, direction, TRUE)
add_connects(direction)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/duct/multilayered
name = "duct layer-manifold"
@@ -262,7 +263,8 @@ All the important duct code:
dumb = TRUE
-/obj/machinery/duct/multilayered/update_icon()
+/obj/machinery/duct/multilayered/update_icon_state()
+ . = ..()
icon_state = initial(icon_state)
if((connects & NORTH) || (connects & SOUTH))
icon_state += "_vertical"
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 351f54db9143..4268464d1769 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -206,7 +206,6 @@
operating = FALSE
name = "[area.name] APC"
stat |= MAINT
- src.update_icon()
addtimer(CALLBACK(src, PROC_REF(update)), 5)
/obj/machinery/power/apc/Destroy()
@@ -231,7 +230,7 @@
/obj/machinery/power/apc/handle_atom_del(atom/A)
if(A == cell)
cell = null
- update_icon()
+ update_appearance(UPDATE_ICON)
updateUsrDialog()
/obj/machinery/power/apc/proc/make_terminal()
@@ -251,7 +250,7 @@
cell = new cell_type
cell.charge = start_charge * cell.maxcharge / 100 // (convert percentage to actual value)
- var/area/A = src.loc.loc
+ var/area/A = get_area(loc)
//if area isn't specified use current
if(areastring)
@@ -261,11 +260,11 @@
stack_trace("Bad areastring path for [src], [src.areastring]")
else if(isarea(A) && src.areastring == null)
src.area = A
- update_icon()
make_terminal()
addtimer(CALLBACK(src, PROC_REF(update)), 5)
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/apc/examine(mob/user)
. = ..()
@@ -323,59 +322,9 @@
cell = best_cell
W.play_rped_sound()
-
-// update the APC icon to show the three base states
-// also add overlays for indicator lights
-/obj/machinery/power/apc/update_icon()
- var/update = check_updates() //returns 0 if no need to update icons.
- // 1 if we need to update the icon_state
- // 2 if we need to update the overlays
- if(!update)
- icon_update_needed = FALSE
- return
-
- if(update & 1) // Updating the icon state
- if(update_state & UPSTATE_ALLGOOD)
- icon_state = "apc0"
- else if(update_state & (UPSTATE_OPENED1|UPSTATE_OPENED2))
- var/basestate = "apc[ cell ? "2" : "1" ]"
- if(update_state & UPSTATE_OPENED1)
- if(update_state & (UPSTATE_MAINT|UPSTATE_BROKE))
- icon_state = "apcmaint" //disabled APC cannot hold cell
- else
- icon_state = basestate
- else if(update_state & UPSTATE_OPENED2)
- if (update_state & UPSTATE_BROKE || malfhack)
- icon_state = "[basestate]-b-nocover"
- else
- icon_state = "[basestate]-nocover"
- else if(update_state & UPSTATE_BROKE)
- icon_state = "apc-b"
- else if(update_state & UPSTATE_BLUESCREEN)
- icon_state = "apcemag"
- else if(update_state & UPSTATE_WIREEXP)
- icon_state = "apcewires"
- else if(update_state & UPSTATE_MAINT)
- icon_state = "apc0"
-
- if(!(update_state & UPSTATE_ALLGOOD))
- SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
-
- if(update & 2)
- SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
- if(!(stat & (BROKEN|MAINT)) && update_state & UPSTATE_ALLGOOD)
- SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", layer, EMISSIVE_PLANE, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", layer, EMISSIVE_PLANE, dir)
- if(operating)
- SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", layer, EMISSIVE_PLANE, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", layer, EMISSIVE_PLANE, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", layer, plane, dir)
- SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", layer, EMISSIVE_PLANE, dir)
-
+/obj/machinery/power/apc/update_icon(updates)
+ updates = check_updates()
+ . = ..()
// And now, separately for cleanness, the lighting changing
if(update_state & UPSTATE_ALLGOOD)
switch(charging)
@@ -394,6 +343,52 @@
icon_update_needed = FALSE
+// update the APC icon to show the three base states
+// also add overlays for indicator lights
+/obj/machinery/power/apc/update_icon_state()
+ . = ..()
+ if(update_state & UPSTATE_ALLGOOD)
+ icon_state = "apc0"
+ else if(update_state & (UPSTATE_OPENED1|UPSTATE_OPENED2))
+ var/basestate = "apc[ cell ? "2" : "1" ]"
+ if(update_state & UPSTATE_OPENED1)
+ if(update_state & (UPSTATE_MAINT|UPSTATE_BROKE))
+ icon_state = "apcmaint" //disabled APC cannot hold cell
+ else
+ icon_state = basestate
+ else if(update_state & UPSTATE_OPENED2)
+ if (update_state & UPSTATE_BROKE || malfhack)
+ icon_state = "[basestate]-b-nocover"
+ else
+ icon_state = "[basestate]-nocover"
+ else if(update_state & UPSTATE_BROKE)
+ icon_state = "apc-b"
+ else if(update_state & UPSTATE_BLUESCREEN)
+ icon_state = "apcemag"
+ else if(update_state & UPSTATE_WIREEXP)
+ icon_state = "apcewires"
+ else if(update_state & UPSTATE_MAINT)
+ icon_state = "apc0"
+
+/obj/machinery/power/apc/update_overlays()
+ . = ..()
+ if(!(update_state & UPSTATE_ALLGOOD))
+ SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
+
+ SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
+ if(!(stat & (BROKEN|MAINT)) && update_state & UPSTATE_ALLGOOD)
+ SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", layer, plane, dir)
+ SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", layer, EMISSIVE_PLANE, dir)
+ SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", layer, plane, dir)
+ SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", layer, EMISSIVE_PLANE, dir)
+ if(operating)
+ SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", layer, plane, dir)
+ SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", layer, EMISSIVE_PLANE, dir)
+ SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", layer, plane, dir)
+ SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", layer, EMISSIVE_PLANE, dir)
+ SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", layer, plane, dir)
+ SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", layer, EMISSIVE_PLANE, dir)
+
/obj/machinery/power/apc/proc/check_updates()
var/last_update_state = update_state
var/last_update_overlay = update_overlay
@@ -454,13 +449,13 @@
update_overlay |= APC_UPOVERLAY_ENVIRON2
- var/results = 0
if(last_update_state == update_state && last_update_overlay == update_overlay)
- return 0
+ return
+ var/results = NONE
if(last_update_state != update_state)
- results += 1
+ results ^= UPDATE_ICON_STATE
if(last_update_overlay != update_overlay)
- results += 2
+ results ^= UPDATE_OVERLAYS
return results
// Used in process so it doesn't update the icon too much
@@ -519,7 +514,7 @@
else if (opened!=APC_COVER_REMOVED)
opened = APC_COVER_CLOSED
coverlocked = TRUE //closing cover relocks it
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else if (!(stat & BROKEN))
if(coverlocked && !(stat & MAINT)) // locked...
@@ -530,7 +525,7 @@
return
else
opened = APC_COVER_OPENED
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else
W.play_tool_sound(src)
@@ -539,7 +534,7 @@
W.play_tool_sound(src)
to_chat(user, span_notice("You pry the broken cover off of [src]."))
opened = APC_COVER_REMOVED
- update_icon()
+ update_appearance(UPDATE_ICON)
return
/obj/machinery/power/apc/screwdriver_act(mob/living/user, obj/item/W)
@@ -551,10 +546,10 @@
user.visible_message("[user] removes \the [cell] from [src]!",span_notice("You remove \the [cell]."))
var/turf/T = get_turf(user)
cell.forceMove(T)
- cell.update_icon()
+ cell.update_appearance(UPDATE_ICON)
cell = null
charging = APC_NOT_CHARGING
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else
switch (has_electronics)
@@ -571,14 +566,14 @@
else
to_chat(user, span_warning("There is nothing to secure!"))
return
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(obj_flags & EMAGGED)
to_chat(user, span_warning("The interface is broken!"))
return
else
panel_open = !panel_open
to_chat(user, span_notice("The wires have been [panel_open ? "exposed" : "unexposed"]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/apc/wirecutter_act(mob/living/user, obj/item/W)
if (terminal && opened)
@@ -627,7 +622,7 @@
"[user.name] has inserted the power cell to [src.name]!",\
span_notice("You insert the power cell."))
chargecount = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
else if (W.GetID())
togglelock(user)
else if (istype(W, /obj/item/stack/cable_coil) && opened)
@@ -705,7 +700,7 @@
chargecount = 0
user.visible_message(span_notice("[user] fabricates a weak power cell and places it into [src]."), \
span_warning("Your [P.name] whirrs with strain as you create a weak power cell and place it into [src]!"))
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("[src] has both electronics and a cell."))
return
@@ -720,7 +715,7 @@
to_chat(user, span_notice("You replace missing APC's cover."))
qdel(W)
opened = APC_COVER_OPENED
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if (has_electronics)
to_chat(user, span_warning("You cannot repair this APC until you remove the electronics still inside!"))
@@ -734,7 +729,7 @@
obj_integrity = max_integrity
if (opened==APC_COVER_REMOVED)
opened = APC_COVER_OPENED
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(istype(W, /obj/item/clockwork/integration_cog) && is_servant_of_ratvar(user))
if(integration_cog)
to_chat(user, span_warning("This APC already has a cog."))
@@ -743,7 +738,7 @@
user.visible_message(span_warning("[user] slices [src]'s cover lock, and it swings wide open!"), \
span_alloy("You slice [src]'s cover lock apart with [W], and the cover swings open."))
opened = APC_COVER_OPENED
- update_icon()
+ update_appearance(UPDATE_ICON)
else
user.visible_message(span_warning("[user] presses [W] into [src]!"), \
span_alloy("You hold [W] in place within [src], and it slowly begins to warm up..."))
@@ -760,7 +755,7 @@
playsound(src, 'sound/machines/clockcult/steam_whoosh.ogg', 50, FALSE)
opened = APC_COVER_CLOSED
locked = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else if(istype(W, /obj/item/apc_powercord))
return //because we put our fancy code in the right places, and this is all in the powercord's afterattack()
@@ -816,7 +811,7 @@
chargecount = 0
user.visible_message(span_notice("[user] fabricates a weak power cell and places it into [src]."), \
span_warning("Your [the_rcd.name] whirrs with strain as you create a weak power cell and place it into [src]!"))
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
else
to_chat(user, span_warning("[src] has both electronics and a cell."))
@@ -836,7 +831,7 @@
if(allowed(usr) && !wires.is_cut(WIRE_IDSCAN) && !malfhack)
locked = !locked
to_chat(user, span_notice("You [ locked ? "lock" : "unlock"] the APC interface."))
- update_icon()
+ update_appearance(UPDATE_ICON)
updateUsrDialog()
else
to_chat(user, span_warning("Access denied."))
@@ -867,7 +862,7 @@
opened = APC_COVER_REMOVED
coverlocked = FALSE
visible_message(span_warning("The APC cover is knocked down!"))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/apc/emag_act(mob/user)
if(!(obj_flags & EMAGGED) && !malfhack)
@@ -883,7 +878,7 @@
obj_flags |= EMAGGED
locked = FALSE
to_chat(user, span_notice("You emag the APC interface."))
- update_icon()
+ update_appearance(UPDATE_ICON)
// attack with hand - remove cell (if cover open) or interact with the APC
@@ -900,10 +895,10 @@
if(cell)
user.visible_message("[user] removes \the [cell] from [src]!",span_notice("You remove \the [cell]."))
user.put_in_hands(cell)
- cell.update_icon()
+ cell.update_appearance(UPDATE_ICON)
src.cell = null
charging = APC_NOT_CHARGING
- src.update_icon()
+ src.update_appearance(UPDATE_ICON)
return
if((stat & MAINT) && !opened) //no board; no interface
return
@@ -1041,7 +1036,7 @@
to_chat(usr, "The APC does not respond to the command.")
else
locked = !locked
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("cover")
coverlocked = !coverlocked
@@ -1056,20 +1051,20 @@
chargemode = !chargemode
if(!chargemode)
charging = APC_NOT_CHARGING
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("channel")
if(params["eqp"])
equipment = setsubsystem(text2num(params["eqp"]))
- update_icon()
+ update_appearance(UPDATE_ICON)
update()
else if(params["lgt"])
lighting = setsubsystem(text2num(params["lgt"]))
- update_icon()
+ update_appearance(UPDATE_ICON)
update()
else if(params["env"])
environ = setsubsystem(text2num(params["env"]))
- update_icon()
+ update_appearance(UPDATE_ICON)
update()
. = TRUE
if("overload")
@@ -1087,7 +1082,7 @@
malfvacate()
if("reboot")
failure_timer = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
update()
if("emergency_lighting")
emergency_lights = !emergency_lights
@@ -1112,7 +1107,7 @@
add_hiddenprint(user)
log_combat(user, src, "turned [operating ? "on" : "off"]")
update()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/apc/proc/malfhack(mob/living/silicon/ai/malf)
if(!istype(malf))
@@ -1253,7 +1248,7 @@
/obj/machinery/power/apc/process()
if(icon_update_needed)
- update_icon()
+ update_appearance(UPDATE_ICON)
if(stat & (BROKEN|MAINT))
return
if(!area.requires_power)
@@ -1428,7 +1423,7 @@
if(APC_RESET_EMP)
equipment = 3
environ = 3
- update_icon()
+ update_appearance(UPDATE_ICON)
update()
// damage and destruction acts
@@ -1444,7 +1439,7 @@
lighting = 0
equipment = 0
environ = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
update()
addtimer(CALLBACK(src, PROC_REF(reset), APC_RESET_EMP), 600)
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index ff93006eba42..e36e23e24337 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -90,7 +90,7 @@ By design, d1 is the smallest direction and d2 is the highest
cable_color = param_color || cable_color || pick(cable_colors)
if(cable_colors[cable_color])
cable_color = cable_colors[cable_color]
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/cable/Destroy() // called when a cable is deleted
if(powernet)
@@ -117,9 +117,10 @@ By design, d1 is the smallest direction and d2 is the highest
if(level == 1 && isturf(loc))
invisibility = i ? INVISIBILITY_MAXIMUM : 0
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/structure/cable/update_icon()
+/obj/structure/cable/update_icon(updates=ALL)
+ . = ..()
icon_state = "[d1]-[d2]"
color = null
add_atom_colour(cable_color, FIXED_COLOUR_PRIORITY)
@@ -492,12 +493,12 @@ By design, d1 is the smallest direction and d2 is the highest
pixel_x = rand(-2,2)
pixel_y = rand(-2,2)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stack/cable_coil/proc/set_cable_color(new_color)
color = GLOB.cable_colors[new_color]
cable_color = new_color
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stack/cable_coil/suicide_act(mob/user)
if(locate(/obj/structure/chair/stool) in get_turf(user))
@@ -537,7 +538,7 @@ By design, d1 is the smallest direction and d2 is the highest
if(use(CABLE_RESTRAINTS_COST))
var/obj/item/restraints/handcuffs/cable/restraints = new(null, cable_color)
user.put_in_hands(restraints)
- update_icon()
+ update_appearance(UPDATE_ICON)
///////////////////////////////////
// General procedures
@@ -562,11 +563,17 @@ By design, d1 is the smallest direction and d2 is the highest
return
return ..()
-/obj/item/stack/cable_coil/update_icon()
+/obj/item/stack/cable_coil/update_icon_state()
+ . = ..()
if(novariants)
return
icon_state = "[initial(item_state)][amount < 3 ? amount : ""]"
item_state = "coil_[cable_color]"
+
+/obj/item/stack/cable_coil/update_name(updates=ALL)
+ . = ..()
+ if(novariants)
+ return
name = "cable [amount < 3 ? "piece" : "coil"]"
/obj/item/stack/cable_coil/attack_hand(mob/user)
@@ -576,7 +583,7 @@ By design, d1 is the smallest direction and d2 is the highest
var/obj/item/stack/cable_coil/new_cable = ..()
if(istype(new_cable))
new_cable.cable_color = cable_color
- new_cable.update_icon()
+ new_cable.update_appearance(UPDATE_ICON)
//add cables to the stack
/obj/item/stack/cable_coil/proc/give(extra)
@@ -584,7 +591,7 @@ By design, d1 is the smallest direction and d2 is the highest
amount = max_amount
else
amount += extra
- update_icon()
+ update_appearance(UPDATE_ICON)
@@ -633,7 +640,7 @@ By design, d1 is the smallest direction and d2 is the highest
C.d1 = 0 //it's a O-X node cable
C.d2 = dirn
C.add_fingerprint(user)
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
//create a new powernet with the cable, if needed it will be merged later
var/datum/powernet/PN = new()
@@ -705,7 +712,7 @@ By design, d1 is the smallest direction and d2 is the highest
NC.d1 = 0
NC.d2 = fdirn
NC.add_fingerprint(user)
- NC.update_icon()
+ NC.update_appearance(UPDATE_ICON)
//create a new powernet with the cable, if needed it will be merged later
var/datum/powernet/newPN = new(loc.z)
@@ -747,7 +754,7 @@ By design, d1 is the smallest direction and d2 is the highest
return
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
C.d1 = nd1
C.d2 = nd2
@@ -755,7 +762,7 @@ By design, d1 is the smallest direction and d2 is the highest
//updates the stored cable coil
C.add_fingerprint(user)
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
C.mergeConnectedNetworks(C.d1) //merge the powernets...
@@ -786,7 +793,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/item/stack/cable_coil/cyborg/attack_self(mob/user)
var/picked = tgui_input_list(user, "Pick a cable color.","Cable Color", GLOB.cable_colors)
cable_color = picked
- update_icon()
+ update_appearance(UPDATE_ICON)
//////////////////////////////
// Misc.
@@ -848,7 +855,7 @@ By design, d1 is the smallest direction and d2 is the highest
amount = rand(1,2)
pixel_x = rand(-2,2)
pixel_y = rand(-2,2)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stack/cable_coil/cut/red
cable_color = "red"
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index a15b72fca84f..4bb016a68bca 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -33,7 +33,7 @@
charge = maxcharge
if(ratingdesc)
desc += " This one has a rating of [DisplayEnergy(maxcharge)], and you should not swallow it."
- update_icon()
+ update_appearance(UPDATE_ICON)
RegisterSignal(src, COMSIG_ITEM_MAGICALLY_CHARGED, PROC_REF(on_magic_charge))
var/static/list/loc_connections = list(
@@ -77,7 +77,7 @@
. |= COMPONENT_ITEM_BURNT_OUT
charge = maxcharge
- update_icon()
+ update_appearance(UPDATE_ICON)
// Guns need to process their chamber when we've been charged
if(isgun(loc))
@@ -86,7 +86,7 @@
// The thing we're in might have overlays or icon states for whether the cell is charged
if(!ismob(loc))
- loc.update_icon()
+ loc.update_appearance(UPDATE_ICON)
return .
@@ -96,16 +96,17 @@
else
return PROCESS_KILL
-/obj/item/stock_parts/cell/update_icon()
+/obj/item/stock_parts/cell/update_overlays()
+ . = ..()
cut_overlays()
if(grown_battery)
- add_overlay(image('icons/obj/power.dmi',"grown_wires"))
+ . += image('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
@@ -220,7 +221,7 @@
/obj/item/stock_parts/cell/crap/empty/Initialize(mapload)
. = ..()
charge = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stock_parts/cell/upgraded
name = "upgraded power cell"
@@ -242,7 +243,7 @@
/obj/item/stock_parts/cell/secborg/empty/Initialize(mapload)
. = ..()
charge = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stock_parts/cell/mini_egun
name = "miniature energy gun power cell"
@@ -278,7 +279,7 @@
/obj/item/stock_parts/cell/high/empty/Initialize(mapload)
. = ..()
charge = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stock_parts/cell/super
name = "super-capacity power cell"
@@ -290,7 +291,7 @@
/obj/item/stock_parts/cell/super/empty/Initialize(mapload)
. = ..()
charge = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stock_parts/cell/hyper
name = "hyper-capacity power cell"
@@ -302,7 +303,7 @@
/obj/item/stock_parts/cell/hyper/empty/Initialize(mapload)
. = ..()
charge = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stock_parts/cell/bluespace
name = "bluespace power cell"
@@ -315,7 +316,7 @@
/obj/item/stock_parts/cell/bluespace/empty/Initialize(mapload)
. = ..()
charge = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stock_parts/cell/infinite
name = "infinite-capacity power cell!"
@@ -336,8 +337,9 @@
maxcharge = 50000
ratingdesc = FALSE
-/obj/item/stock_parts/cell/infinite/abductor/update_icon()
- return
+/obj/item/stock_parts/cell/infinite/abductor/Initialize(mapload, override_maxcharge)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/stock_parts/cell/potato
@@ -372,7 +374,7 @@
/obj/item/stock_parts/cell/emproof/empty/Initialize(mapload)
. = ..()
charge = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/stock_parts/cell/emproof/corrupt()
return
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index 6a61c3bbf381..5fdb7e9646cf 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -22,7 +22,7 @@
find_circs()
connect_to_network()
SSair.atmos_machinery += src
- update_icon()
+ update_appearance(UPDATE_ICON)
component_parts = list(new /obj/item/circuitboard/machine/generator)
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS )
@@ -31,29 +31,32 @@
SSair.atmos_machinery -= src
return ..()
-/obj/machinery/power/generator/update_icon()
- cut_overlays()
- SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
-
+/obj/machinery/power/generator/update_icon_state()
+ . = ..()
if(stat & (BROKEN))
icon_state = "teg-broken"
return
- if(hot_circ && cold_circ)
- icon_state = "teg-assembled"
- else
+ if(!hot_circ || !cold_circ)
icon_state = "teg-unassembled"
+ return
+ icon_state = "teg-assembled"
+
+/obj/machinery/power/generator/update_overlays()
+ . = ..()
+ SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
+ if(stat & (BROKEN))
+ return
+
+ if(!hot_circ || !cold_circ)
if(panel_open)
- add_overlay("teg-panel")
+ . += "teg-panel"
return
-
if(!powernet)
- add_overlay("teg-nogrid")
- if(stat & (NOPOWER))
- return
- else
- var/L = min(round(lastgenlev/100000),11)
- if(L != 0)
- SSvis_overlays.add_vis_overlay(src, icon, "teg-op[L]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
+ . += "teg-nogrid"
+
+ var/L = min(round(lastgenlev/100000), 11)
+ if(L != 0)
+ SSvis_overlays.add_vis_overlay(src, icon, "teg-op[L]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
#define GENRATE 800 // generator output coefficient from Q
@@ -106,7 +109,7 @@
var/datum/gas_mixture/cold_circ_air1 = cold_circ.airs[1]
cold_circ_air1.merge(cold_air)
- update_icon()
+ update_appearance(UPDATE_ICON)
src.updateDialog()
@@ -219,7 +222,7 @@
to_chat(user, span_notice("You start removing the circulators..."))
if(I.use_tool(src, user, 30, volume=50))
kill_circs()
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You disconnect [src]'s circulator links."))
playsound(src, 'sound/misc/box_deploy.ogg', 50)
return TRUE
@@ -245,7 +248,7 @@
kill_circs()
connect_to_network()
to_chat(user, span_notice("You [anchored?"secure":"unsecure"] [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/power/generator/screwdriver_act(mob/user, obj/item/I)
@@ -260,7 +263,7 @@
panel_open = !panel_open
I.play_tool_sound(src)
to_chat(user, span_notice("You [panel_open?"open":"close"] the panel on [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/power/generator/crowbar_act(mob/user, obj/item/I)
@@ -283,11 +286,11 @@
/obj/machinery/power/generator/proc/kill_circs()
if(hot_circ)
hot_circ.generator = null
- hot_circ.update_icon()
+ hot_circ.update_appearance(UPDATE_ICON)
hot_circ = null
if(cold_circ)
cold_circ.generator = null
- cold_circ.update_icon()
+ cold_circ.update_appearance(UPDATE_ICON)
cold_circ = null
/obj/machinery/power/generator/obj_break(damage_flag)
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index 5e6593c35804..ef18ec4231a3 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -43,8 +43,8 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
if(tesla_flags & TESLA_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()
@@ -154,7 +154,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
part.sprite_number = count
part.main_part = src
parts += part
- part.update_icon()
+ part.update_appearance(UPDATE_ICON)
/obj/machinery/gravity_generator/main/proc/connected_parts()
return parts.len == 8
@@ -177,7 +177,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
if(M.stat & BROKEN)
M.set_fix()
broken_state = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
set_power()
// Interaction
@@ -190,14 +190,14 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
to_chat(user, span_notice("You secure the screws of the framework."))
I.play_tool_sound(src)
broken_state++
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(GRAV_NEEDS_WELDING)
if(I.tool_behaviour == TOOL_WELDER)
if(I.use_tool(src, user, 0, volume=50, amount=1))
to_chat(user, span_notice("You mend the damaged framework."))
broken_state++
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(GRAV_NEEDS_PLASTEEL)
if(istype(I, /obj/item/stack/sheet/plasteel))
@@ -207,7 +207,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
to_chat(user, span_notice("You add the plating to the framework."))
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
broken_state++
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("You need 10 sheets of plasteel!"))
return
@@ -259,10 +259,10 @@ 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()
- ..()
+/obj/machinery/gravity_generator/main/update_icon(updates=ALL)
+ . = ..()
for(var/obj/O in parts)
- O.update_icon()
+ O.update_appearance(UPDATE_ICON)
// Set the charging state based on power/breaker.
/obj/machinery/gravity_generator/main/proc/set_power()
@@ -274,7 +274,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
charging_state = new_state ? POWER_UP : POWER_DOWN // Startup sequence animation.
investigate_log("is now [charging_state == POWER_UP ? "charging" : "discharging"].", INVESTIGATE_GRAVITY)
- update_icon()
+ update_appearance(UPDATE_ICON)
// Set the state of the gravity.
/obj/machinery/gravity_generator/main/proc/set_state(new_state)
@@ -295,7 +295,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
investigate_log("was brought offline and there is now no gravity for this level.", INVESTIGATE_GRAVITY)
message_admins("The gravity generator was brought offline with no backup generator. [ADMIN_VERBOSEJMP(src)]")
- update_icon()
+ update_appearance(UPDATE_ICON)
update_list()
src.updateUsrDialog()
if(alert)
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index 798de26fd996..a5dd816b8f23 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -87,7 +87,7 @@
if(cell)
user.visible_message("[user] removes [cell] from [src]!",span_notice("You remove [cell]."))
user.put_in_hands(cell)
- cell.update_icon()
+ cell.update_appearance(UPDATE_ICON)
cell = null
add_fingerprint(user)
@@ -339,7 +339,8 @@
QDEL_NULL(cell)
return ..()
-/obj/machinery/light/update_icon()
+/obj/machinery/light/update_icon(updates=ALL)
+ . = ..()
cut_overlays()
switch(status) // set icon_states
if(LIGHT_OK)
@@ -413,7 +414,7 @@
else
use_power = IDLE_POWER_USE
set_light(0)
- update_icon()
+ update_appearance(UPDATE_ICON)
active_power_usage = (brightness * 10)
if(on != on_gs)
@@ -542,7 +543,7 @@
set_light(0)
forced_off = !forced_off
on = !on
- update_icon()
+ update_appearance(UPDATE_ICON)
update()
else
return ..()
diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm
index afe65f073e13..95601ccc3b3a 100644
--- a/code/modules/power/port_gen.dm
+++ b/code/modules/power/port_gen.dm
@@ -45,15 +45,16 @@
/obj/machinery/power/port_gen/proc/TogglePower()
if(active)
active = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
soundloop.stop()
else if(HasFuel())
active = TRUE
START_PROCESSING(SSmachines, src)
- update_icon()
+ update_appearance(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/power.dm b/code/modules/power/power.dm
index b23d8adb3cec..f3a553097b6c 100644
--- a/code/modules/power/power.dm
+++ b/code/modules/power/power.dm
@@ -113,6 +113,7 @@
*/
/obj/machinery/proc/power_change()
if(stat & BROKEN)
+ update_appearance(UPDATE_ICON)
return
if(powered(power_channel))
if(stat & NOPOWER)
@@ -124,7 +125,7 @@
SEND_SIGNAL(src, COMSIG_MACHINERY_POWER_LOST)
. = TRUE
stat |= NOPOWER
- update_icon()
+ update_appearance(UPDATE_ICON)
// connect the machine to a powernet if a node cable is present on the turf
/obj/machinery/power/proc/connect_to_network()
diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm
index 7a8d8c5da898..0e3bc6ba00d4 100644
--- a/code/modules/power/singularity/collector.dm
+++ b/code/modules/power/singularity/collector.dm
@@ -159,7 +159,7 @@
if(!user.transferItemToLoc(W, src))
return
loaded_tank = W
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(W.GetID())
if(togglelock(user))
return TRUE
@@ -294,21 +294,21 @@
if(active)
toggle_power()
else
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/rad_collector/rad_act(pulse_strength, collectable_radiation)
. = ..()
if(loaded_tank && active && collectable_radiation && pulse_strength > RAD_COLLECTOR_EFFICIENCY)
stored_power += (pulse_strength-RAD_COLLECTOR_EFFICIENCY)*RAD_COLLECTOR_COEFFICIENT*(machine_tier+power_bonus)
-/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"
//honestly this should be balanced
/obj/machinery/power/rad_collector/RefreshParts()
@@ -327,7 +327,7 @@
else
icon_state = "ca"
flick("ca_deactive", src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/rad_collector/bullet_act(obj/item/projectile/P)
if(istype(P, /obj/item/projectile/energy/nuclear_particle))
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index 78e4e045a113..645516266611 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -120,7 +120,8 @@
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
@@ -146,7 +147,7 @@
log_game("Emitter turned [active ? "ON" : "OFF"] by [key_name(user)] in [AREACOORD(src)]")
investigate_log("turned [active ? "ON" : "OFF"] by [key_name(user)] at [AREACOORD(src)]", INVESTIGATE_SINGULO)
investigate_log("turned [active ? "ON" : "OFF"] by [key_name(user)] at [AREACOORD(src)]", INVESTIGATE_SUPERMATTER) // yogs - so supermatter investigate is useful
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("The controls are locked!"))
@@ -169,20 +170,20 @@
return
if(state != EMITTER_WELDED || (!powernet && active_power_usage))
active = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(active == TRUE)
if(!active_power_usage || surplus() >= active_power_usage)
add_load(active_power_usage)
if(!powered)
powered = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
investigate_log("regained power and turned ON at [AREACOORD(src)]", INVESTIGATE_SINGULO)
investigate_log("regained power and turned ON at [AREACOORD(src)]", INVESTIGATE_SUPERMATTER) // yogs - so supermatter investigate is useful
else
if(powered)
powered = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
investigate_log("lost power and turned OFF at [AREACOORD(src)]", INVESTIGATE_SINGULO)
investigate_log("lost power and turned OFF at [AREACOORD(src)]", INVESTIGATE_SUPERMATTER) // yogs - so supermatter investigate is useful
log_game("Emitter lost power in [AREACOORD(src)]")
diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm
index 45b2ddb3acca..1e08b665a030 100644
--- a/code/modules/power/singularity/field_generator.dm
+++ b/code/modules/power/singularity/field_generator.dm
@@ -44,14 +44,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(mapload)
@@ -170,7 +170,7 @@ field_generator power level display
var/new_level = round(num_power_levels * power / field_generator_max_power)
if(new_level != power_level)
power_level = new_level
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/field/generator/proc/turn_off()
active = FG_OFFLINE
@@ -179,7 +179,7 @@ field_generator power level display
while (warming_up>0 && !active)
sleep(5 SECONDS)
warming_up--
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/field/generator/proc/turn_on()
active = FG_CHARGING
@@ -187,7 +187,7 @@ field_generator power level display
while (warming_up<3 && active)
sleep(5 SECONDS)
warming_up++
- update_icon()
+ update_appearance(UPDATE_ICON)
if(warming_up >= 3)
start_fields()
@@ -303,7 +303,7 @@ field_generator power level display
connected_gens |= G
G.connected_gens |= src
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/field/generator/proc/cleanup()
@@ -318,7 +318,7 @@ field_generator power level display
FG.cleanup()
connected_gens -= FG
clean_up = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
//This is here to help fight the "hurr durr, release singulo cos nobody will notice before the
//singulo eats the evidence". It's not fool-proof but better than nothing.
diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm
index f451e9b3128b..79c67b3cf459 100644
--- a/code/modules/power/singularity/generator.dm
+++ b/code/modules/power/singularity/generator.dm
@@ -22,16 +22,19 @@
default_unfasten_wrench(user, W, 0)
else
return ..()
-/obj/machinery/the_singularitygen/update_icon(power)
- if(power)
- if(power>150)
- animate(src, icon_state = "[initial(icon_state)]_3", 10)
- else if(power>100)
- animate(src, icon_state = "[initial(icon_state)]_2", 10)
- else if(power>50)
- animate(src, icon_state = "[initial(icon_state)]_1", 10)
- else
- animate(src, icon_state = initial(icon_state), 10)
+
+/obj/machinery/the_singularitygen/update_icon(updates=ALL, power)
+ . = ..()
+ if(!power)
+ return
+ if(power>150)
+ animate(src, icon_state = "[initial(icon_state)]_3", 10)
+ else if(power>100)
+ animate(src, icon_state = "[initial(icon_state)]_2", 10)
+ else if(power>50)
+ animate(src, icon_state = "[initial(icon_state)]_1", 10)
+ else
+ animate(src, icon_state = initial(icon_state), 10)
/obj/machinery/the_singularitygen/process(delta_time)
if(energy > 0)
@@ -43,4 +46,4 @@
qdel(src)
else
energy -= delta_time * 0.5
- update_icon(energy)
+ update_icon(power = energy)
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index 6bc4f7dc0d8c..37674f5e5a38 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -106,7 +106,7 @@
construction_state = PA_CONSTRUCTION_PANEL_OPEN
update_state()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/particle_accelerator/deconstruct(disassembled = TRUE)
@@ -121,7 +121,8 @@
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 a6bc79e0402d..d023e9a83afe 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_control.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm
@@ -54,7 +54,7 @@
var/obj/structure/particle_accelerator/part = CP
part.strength = null
part.powered = FALSE
- part.update_icon()
+ part.update_appearance(UPDATE_ICON)
connected_parts.Cut()
return
if(!part_scan())
@@ -62,9 +62,10 @@
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_boxp[strength]" //yogs- fix sprite not updating (note that /tg/ PA power 2 sprite is incomplete)
+ icon_state = "control_boxp[strength]" //yogs- fix sprite not updating (note that /tg/ PA power 2 sprite is incomplete)
else
if(use_power)
if(assembled)
@@ -84,7 +85,7 @@
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = strength
- part.update_icon()
+ part.update_appearance(UPDATE_ICON)
/obj/machinery/particle_accelerator/control_box/proc/add_strength(s)
if(assembled && (strength < strength_upper_limit))
@@ -120,12 +121,12 @@
if(connected_parts.len < 6)
investigate_log("lost a connected part; It powered down.", INVESTIGATE_SINGULO)
toggle_power()
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(area_restricted && !istype(get_area(src),/area/engine))
investigate_log("had its area restriction turned on while in an invalid area; It powered down.", INVESTIGATE_SINGULO)
toggle_power()
- update_icon()
+ update_appearance(UPDATE_ICON)
return
//emit some particles
for(var/obj/structure/particle_accelerator/particle_emitter/PE in connected_parts)
@@ -198,14 +199,14 @@
var/obj/structure/particle_accelerator/part = CP
part.strength = strength
part.powered = TRUE
- part.update_icon()
+ part.update_appearance(UPDATE_ICON)
else
use_power = IDLE_POWER_USE
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = null
part.powered = FALSE
- part.update_icon()
+ part.update_appearance(UPDATE_ICON)
return TRUE
@@ -269,7 +270,7 @@
if(did_something)
user.changeNext_move(CLICK_CD_MELEE)
update_state()
- update_icon()
+ update_appearance(UPDATE_ICON)
return
..()
@@ -365,7 +366,7 @@
to_chat(operator, "You [locked ? "enable" : "disable"] the area restriction.");
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/particle_accelerator/control_box/charlie //for charlie station
locked = FALSE
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 19d5552a8a4c..ba8c60ddc4ee 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -61,7 +61,7 @@
obj_break()
return
terminal.master = src
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/smes/RefreshParts()
var/IO = 0
@@ -81,7 +81,7 @@
/obj/machinery/power/smes/attackby(obj/item/I, mob/user, params)
//opening using screwdriver
if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
//changing direction using wrench
@@ -98,7 +98,7 @@
to_chat(user, span_alert("No power terminal found."))
return
stat &= ~BROKEN
- update_icon()
+ update_appearance(UPDATE_ICON)
return
//building and linking a terminal
@@ -205,28 +205,26 @@
obj_break()
-/obj/machinery/power/smes/update_icon()
- cut_overlays()
+/obj/machinery/power/smes/update_overlays()
+ . = ..()
if(stat & BROKEN)
return
-
if(panel_open)
return
if(outputting)
- add_overlay("smes-out1")
+ . += "smes-out1"
else
- add_overlay("smes-out0")
+ . += "smes-out0"
if(inputting)
- add_overlay("smes-inp1")
- else
- if(input_attempt)
- add_overlay("smes-inp0")
+ . += "smes-inp1"
+ else if(input_attempt)
+ . += "smes-inp0"
var/clevel = chargedisplay()
- if(clevel>0)
- add_overlay("smes-og[clevel]")
+ if(clevel > 0)
+ . += "smes-og[clevel]"
/obj/machinery/power/smes/proc/chargedisplay()
@@ -286,7 +284,7 @@
// only update icon if state changed
if(last_disp != chargedisplay() || last_chrg != inputting || last_onln != outputting)
- update_icon()
+ update_appearance(UPDATE_ICON)
@@ -316,7 +314,7 @@
output_used -= excess
if(clev != chargedisplay() ) //if needed updates the icons overlay
- update_icon()
+ update_appearance(UPDATE_ICON)
return
@@ -353,12 +351,12 @@
if("tryinput")
input_attempt = !input_attempt
log_smes(usr)
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("tryoutput")
output_attempt = !output_attempt
log_smes(usr)
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("input")
var/target = params["target"]
@@ -420,7 +418,7 @@
output_level = rand(0, output_level_max)
input_level = rand(0, input_level_max)
charge = max(charge - 1e6/severity, 0)
- update_icon()
+ update_appearance(UPDATE_ICON)
log_smes()
/obj/machinery/power/smes/engineering
@@ -446,7 +444,7 @@
return
output_attempt = !output_attempt
log_smes(user)
- update_icon()
+ update_appearance(UPDATE_ICON)
#undef SMES_OUTPUTTING
#undef SMES_NOT_OUTPUTTING
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index bb9e9457076e..49c3ec5f7170 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -20,8 +20,6 @@
var/obj/machinery/power/solar_control/control
var/needs_to_turn = TRUE //do we need to turn next tick?
var/needs_to_update_solar_exposure = TRUE //do we need to call update_solar_exposure() next tick?
- var/mutable_appearance/panelstructure
- var/mutable_appearance/paneloverlay
var/multiplier
var/panelcolor
var/obj/item/stack/sheet/glass_type
@@ -31,10 +29,7 @@
Make(S)
connect_to_network()
RegisterSignal(SSsun, COMSIG_SUN_MOVED, PROC_REF(queue_update_solar_exposure))
- panelstructure = mutable_appearance(icon, "solar_panel", FLY_LAYER)
- paneloverlay = mutable_appearance(icon, "solar_panel-o", FLY_LAYER)
- paneloverlay.color = panelcolor
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/solar/Destroy()
unset_control() //remove from control computer
@@ -113,14 +108,19 @@
new /obj/item/shard(src.loc)
qdel(src)
-/obj/machinery/power/solar/update_icon()
- ..()
- cut_overlays()
+/obj/machinery/power/solar/update_overlays()
+ . = ..()
var/matrix/turner = matrix()
turner.Turn(azimuth_current)
+
+ var/mutable_appearance/panelstructure = mutable_appearance(icon, "solar_panel", FLY_LAYER)
panelstructure.transform = turner
+ . += panelstructure
+
+ var/mutable_appearance/paneloverlay = mutable_appearance(icon, "solar_panel-o", FLY_LAYER)
paneloverlay.transform = turner
- add_overlay(list(paneloverlay, panelstructure))
+ paneloverlay.color = panelcolor
+ . += paneloverlay
/obj/machinery/power/solar/proc/queue_turn(azimuth)
needs_to_turn = TRUE
@@ -134,7 +134,7 @@
if(azimuth_current != azimuth_target)
azimuth_current = azimuth_target
occlusion_setup()
- update_icon()
+ update_appearance(UPDATE_ICON)
needs_to_update_solar_exposure = TRUE
///trace towards sun to see if we're in shadow
@@ -349,7 +349,7 @@
if(connected_tracker && length(connected_panels))
track = SOLAR_TRACK_AUTO
connected_tracker.sun_update(SSsun, SSsun.azimuth)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/solar_control/Destroy()
for(var/obj/machinery/power/solar/M in connected_panels)
@@ -372,16 +372,16 @@
if(!T.control) //i.e unconnected
T.set_control(src)
-/obj/machinery/power/solar_control/update_icon()
- cut_overlays()
+/obj/machinery/power/solar_control/update_overlays()
+ . = ..()
if(stat & NOPOWER)
- add_overlay("[icon_keyboard]_off")
+ . += "[icon_keyboard]_off"
return
- add_overlay(icon_keyboard)
+ . += icon_keyboard
if(stat & BROKEN)
- add_overlay("[icon_state]_broken")
+ . += "[icon_state]_broken"
else
- add_overlay(icon_screen)
+ . += icon_screen
/obj/machinery/power/solar_control/ui_interact(mob/user, datum/tgui/ui)
diff --git a/code/modules/projectiles/ammunition/_ammunition.dm b/code/modules/projectiles/ammunition/_ammunition.dm
index 5ae45fcc4890..bc64d3c9fa66 100644
--- a/code/modules/projectiles/ammunition/_ammunition.dm
+++ b/code/modules/projectiles/ammunition/_ammunition.dm
@@ -33,11 +33,14 @@
pixel_x = rand(-10, 10)
pixel_y = rand(-10, 10)
setDir(pick(GLOB.alldirs))
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/ammo_casing/update_icon()
- ..()
+/obj/item/ammo_casing/update_icon_state()
+ . = ..()
icon_state = "[initial(icon_state)][BB && !CHECK_BITFIELD(casing_flags, CASINGFLAG_NO_LIVE_SPRITE) ? "-live" : ""]"
+
+/obj/item/ammo_casing/update_desc(updates=ALL)
+ . = ..()
desc = "[initial(desc)][!BB && !CHECK_BITFIELD(casing_flags, CASINGFLAG_NO_LIVE_SPRITE) ? " This one is spent." : ""]"
//proc to magically refill a casing with a new projectile
@@ -59,7 +62,7 @@
else
continue
if (boolets > 0)
- box.update_icon()
+ box.update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You collect [boolets] shell\s. [box] now contains [box.stored_ammo.len] shell\s."))
else
to_chat(user, span_warning("You fail to collect anything!"))
@@ -72,7 +75,7 @@
. = ..()
/obj/item/ammo_casing/proc/bounce_away(still_warm = FALSE, bounce_delay = 3)
- update_icon()
+ update_appearance(UPDATE_ICON)
SpinAnimation(10, 1)
var/matrix/M = matrix(transform)
M.Turn(rand(-170,170))
diff --git a/code/modules/projectiles/ammunition/_firing.dm b/code/modules/projectiles/ammunition/_firing.dm
index 846c96a80fb0..85b5374638e6 100644
--- a/code/modules/projectiles/ammunition/_firing.dm
+++ b/code/modules/projectiles/ammunition/_firing.dm
@@ -19,7 +19,7 @@
else
user.changeNext_move(CLICK_CD_RANGE)
user.newtonian_move(get_dir(target, user))
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/item/ammo_casing/proc/ready_proj(atom/target, mob/living/user, quiet, zone_override = "", atom/fired_from)
diff --git a/code/modules/projectiles/ammunition/reusable/_reusable.dm b/code/modules/projectiles/ammunition/reusable/_reusable.dm
index f34ed497f52a..9344d0e5a102 100644
--- a/code/modules/projectiles/ammunition/reusable/_reusable.dm
+++ b/code/modules/projectiles/ammunition/reusable/_reusable.dm
@@ -31,4 +31,4 @@
if(!BB)
newshot()
in_air = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/projectiles/ammunition/reusable/arrow.dm b/code/modules/projectiles/ammunition/reusable/arrow.dm
index 124516d06256..ed6259c15279 100644
--- a/code/modules/projectiles/ammunition/reusable/arrow.dm
+++ b/code/modules/projectiles/ammunition/reusable/arrow.dm
@@ -40,21 +40,20 @@
if(LAZYLEN(new_parts))
CheckParts(new_parts)
-/obj/item/ammo_casing/reusable/arrow/update_icon(force_update)
+/obj/item/ammo_casing/reusable/arrow/update_overlays()
..()
- cut_overlays()
if(istype(explosive))
- add_overlay(mutable_appearance(icon, "arrow_explosive[explosive.active ? "_active" : ""]"), TRUE)
+ . += mutable_appearance(icon, "arrow_explosive[explosive.active ? "_active" : ""]")
if(istype(bola))
- add_overlay(mutable_appearance(icon, "arrow_bola"), TRUE)
+ . += mutable_appearance(icon, "arrow_bola")
if(istype(syringe))
- add_overlay(mutable_appearance(icon, "arrow_syringe"), TRUE)
+ . += mutable_appearance(icon, "arrow_syringe")
if(syringe.reagents && syringe.reagents.total_volume)
var/image/filling_overlay = mutable_appearance(icon, "arrow_syringe[clamp(round((syringe.reagents.total_volume / syringe.volume * 15),5), 1, 15)]")
filling_overlay.color = mix_color_from_reagents(syringe.reagents.reagent_list)
- add_overlay(filling_overlay)
+ . += filling_overlay
if(flaming)
- add_overlay(mutable_appearance(icon, "arrow_fire"), TRUE)
+ . += mutable_appearance(icon, "arrow_fire")
/obj/item/ammo_casing/reusable/arrow/examine(mob/user)
. = ..()
@@ -76,7 +75,7 @@
if(iscarbon(user))
var/mob/living/carbon/C = user
C.throw_mode_off()
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/item/ammo_casing/reusable/arrow/wirecutter_act(mob/living/user, obj/item/I)
@@ -131,23 +130,23 @@
if(istype(new_explosive))
explosive = new_explosive
LAZYADD(attached_parts, new_explosive)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/ammo_casing/reusable/arrow/proc/add_bola(obj/item/restraints/legcuffs/bola/new_bola)
if(istype(new_bola))
bola = new_bola
LAZYADD(attached_parts, new_bola)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/ammo_casing/reusable/arrow/proc/add_syringe(obj/item/reagent_containers/syringe/new_syringe)
if(istype(new_syringe))
syringe = new_syringe
LAZYADD(attached_parts, new_syringe)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/ammo_casing/reusable/arrow/proc/add_flame()
flaming = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/ammo_casing/reusable/arrow/proc/on_embed(target, mob/living/carbon/embedde)
if(syringe)
@@ -439,13 +438,13 @@
// Otherwise, move it to the arrow and make it the new shard
new_shard.forceMove(src)
shard = new_shard
- update_icon()
+ update_appearance(UPDATE_ICON)
..()
-/obj/item/ammo_casing/reusable/arrow/singulo/update_icon(force_update)
- ..()
+/obj/item/ammo_casing/reusable/arrow/singulo/update_overlays()
+ . = ..()
if(istype(shard))
- add_overlay(mutable_appearance(icon, "[icon_state]_[shard.icon_state]"), TRUE)
+ . += mutable_appearance(icon, "[icon_state]_[shard.icon_state]")
/// Handles the special effect of the singulo arrow, called by the projectile on hit
/obj/item/ammo_casing/reusable/arrow/singulo/proc/shard_effect()
diff --git a/code/modules/projectiles/ammunition/reusable/foam.dm b/code/modules/projectiles/ammunition/reusable/foam.dm
index 90ebfb71bdf5..7217f9ffb3e2 100644
--- a/code/modules/projectiles/ammunition/reusable/foam.dm
+++ b/code/modules/projectiles/ammunition/reusable/foam.dm
@@ -10,8 +10,8 @@
var/modified = FALSE
var/obj/item/pen/pen
-/obj/item/ammo_casing/reusable/foam_dart/update_icon()
- ..()
+/obj/item/ammo_casing/reusable/foam_dart/update_icon_state()
+ . = ..()
if (modified)
icon_state = "foamdart_empty"
else
@@ -26,7 +26,7 @@
if (A.tool_behaviour == TOOL_SCREWDRIVER && !modified)
modified = TRUE
to_chat(user, span_notice("You pop the safety cap off [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else if (istype(A, /obj/item/pen))
if(modified)
if(!pen)
diff --git a/code/modules/projectiles/attachments/_attachment.dm b/code/modules/projectiles/attachments/_attachment.dm
index a7b59c5a9f93..48ea3dbdc41f 100644
--- a/code/modules/projectiles/attachments/_attachment.dm
+++ b/code/modules/projectiles/attachments/_attachment.dm
@@ -35,10 +35,9 @@
/// See code/modules/projectiles/attachments/laser_sight.dm for example.
var/list/actions_list = list()
-/obj/item/attachment/update_icon()
- icon_state = "[initial(icon_state)][is_on ? "_on" : ""]"
+/obj/item/attachment/update_icon_state()
. = ..()
- attached_gun?.update_attachments()
+ icon_state = "[initial(icon_state)][is_on ? "_on" : ""]"
/obj/item/attachment/Destroy()
if(attached_gun)
@@ -61,7 +60,7 @@
pickup_user(user)
G.attachment_flags |= attachment_type
G.current_attachments += src
- G.update_attachments()
+ G.update_appearance(UPDATE_ICON)
forceMove(G)
if(user)
@@ -84,7 +83,7 @@
drop_user(user)
G.attachment_flags ^= attachment_type
G.current_attachments -= src
- G.update_attachments()
+ G.update_appearance(UPDATE_ICON)
if(user)
user.put_in_hands(src)
else
diff --git a/code/modules/projectiles/attachments/laser_sight.dm b/code/modules/projectiles/attachments/laser_sight.dm
index 23569ceadf88..fcc00d98237c 100644
--- a/code/modules/projectiles/attachments/laser_sight.dm
+++ b/code/modules/projectiles/attachments/laser_sight.dm
@@ -48,7 +48,7 @@
else
attached_gun.spread += 6
QDEL_LIST(attached_gun.current_tracers)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/attachment/laser_sight/process()
return aiming_beam(TRUE)
diff --git a/code/modules/projectiles/attachments/scopes.dm b/code/modules/projectiles/attachments/scopes.dm
index 4a340175c638..479064cdad1c 100644
--- a/code/modules/projectiles/attachments/scopes.dm
+++ b/code/modules/projectiles/attachments/scopes.dm
@@ -47,7 +47,7 @@
else
attached_gun.spread += accuracy
drop_user(current_user)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/attachment/scope/infrared/pickup_user(mob/user)
. = ..()
diff --git a/code/modules/projectiles/boxes_magazines/_box_magazine.dm b/code/modules/projectiles/boxes_magazines/_box_magazine.dm
index b68ca45f49ab..1ebb4d8d772b 100644
--- a/code/modules/projectiles/boxes_magazines/_box_magazine.dm
+++ b/code/modules/projectiles/boxes_magazines/_box_magazine.dm
@@ -39,7 +39,7 @@
calc_mats()
if(!start_empty)
top_off(starting=TRUE)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* top_off is used to refill the magazine to max, in case you want to increase the size of a magazine with VV then refill it at once
@@ -59,7 +59,7 @@
for(var/i = max(1, stored_ammo.len), i <= max_ammo, i++)
stored_ammo += new round_check(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/ammo_box/proc/calc_mats(force = FALSE)
if (force || !bullet_cost)
@@ -138,8 +138,8 @@
if(!silent)
to_chat(user, span_notice("You load [num_loaded] round\s into \the [src]!"))
playsound(src, 'sound/weapons/bulletinsert.ogg', 60, TRUE)
- A.update_icon()
- update_icon()
+ A.update_appearance(UPDATE_ICON)
+ update_appearance(UPDATE_ICON)
return num_loaded
/obj/item/ammo_box/attack_self(mob/user)
@@ -150,7 +150,7 @@
A.bounce_away(FALSE, NONE)
playsound(src, 'sound/weapons/bulletinsert.ogg', 60, TRUE)
to_chat(user, span_notice("You remove a round from [src]!"))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/ammo_box/AltClick(mob/user)
. = ..()
@@ -167,20 +167,28 @@
A.bounce_away(FALSE, NONE)
playsound(src, 'sound/weapons/bulletinsert.ogg', 60, TRUE)
to_chat(user, span_notice("You remove a round from [src]!"))
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/ammo_box/update_icon()
+/obj/item/ammo_box/update_icon(updates=ALL)
+ . = ..()
+ for(var/material in bullet_cost)
+ var/material_amount = bullet_cost[material]
+ material_amount = (material_amount*stored_ammo.len) + base_cost[material]
+ materials[material] = material_amount
+
+/obj/item/ammo_box/update_icon_state()
+ . = ..()
var/rounds_left = stored_ammo.len
switch(multiple_sprites)
if(AMMO_BOX_PER_BULLET)
icon_state = "[initial(icon_state)]-[rounds_left]"
if(AMMO_BOX_FULL_EMPTY)
icon_state = "[initial(icon_state)]-[rounds_left ? "[max_ammo]" : "0"]"
+
+/obj/item/ammo_box/update_desc(updates=ALL)
+ . = ..()
+ var/rounds_left = stored_ammo.len
desc = "[initial(desc)] There [(rounds_left == 1) ? "is" : "are"] [rounds_left] round\s left!"
- for (var/material in bullet_cost)
- var/material_amount = bullet_cost[material]
- material_amount = (material_amount*stored_ammo.len) + base_cost[material]
- materials[material] = material_amount
///Count of number of bullets in the magazine
/obj/item/ammo_box/magazine/proc/ammo_count(countempties = TRUE)
@@ -206,4 +214,4 @@
/obj/item/ammo_box/magazine/handle_atom_del(atom/A)
stored_ammo -= A
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/projectiles/boxes_magazines/external/grenade.dm b/code/modules/projectiles/boxes_magazines/external/grenade.dm
index 690c880c15a1..f669a80805a9 100644
--- a/code/modules/projectiles/boxes_magazines/external/grenade.dm
+++ b/code/modules/projectiles/boxes_magazines/external/grenade.dm
@@ -5,8 +5,8 @@
caliber = "75"
max_ammo = 8
-/obj/item/ammo_box/magazine/m75/update_icon()
- ..()
+/obj/item/ammo_box/magazine/m75/update_icon_state()
+ . = ..()
if(ammo_count())
icon_state = "75-8"
else
diff --git a/code/modules/projectiles/boxes_magazines/external/lmg.dm b/code/modules/projectiles/boxes_magazines/external/lmg.dm
index 8132339a8e3d..f7a2879a9412 100644
--- a/code/modules/projectiles/boxes_magazines/external/lmg.dm
+++ b/code/modules/projectiles/boxes_magazines/external/lmg.dm
@@ -32,6 +32,6 @@
ammo_type = /obj/item/ammo_casing/mm712x82/inc
sprite_designation = "I"
-/obj/item/ammo_box/magazine/mm712x82/update_icon()
- ..()
+/obj/item/ammo_box/magazine/mm712x82/update_icon_state()
+ . = ..()
icon_state = "a762[sprite_designation]-[round(ammo_count(),10)]"
diff --git a/code/modules/projectiles/boxes_magazines/external/pistol.dm b/code/modules/projectiles/boxes_magazines/external/pistol.dm
index 951b1411d8ef..42d5651532f3 100644
--- a/code/modules/projectiles/boxes_magazines/external/pistol.dm
+++ b/code/modules/projectiles/boxes_magazines/external/pistol.dm
@@ -64,8 +64,8 @@
caliber = ".45"
max_ammo = 8
-/obj/item/ammo_box/magazine/m45/update_icon()
- ..()
+/obj/item/ammo_box/magazine/m45/update_icon_state()
+ . = ..()
if (ammo_count() >= 8)
icon_state = "45-8"
else
@@ -81,8 +81,8 @@
caliber = "9mm"
max_ammo = 15
-/obj/item/ammo_box/magazine/pistolm9mm/update_icon()
- ..()
+/obj/item/ammo_box/magazine/pistolm9mm/update_icon_state()
+ . = ..()
icon_state = "9x19p-[ammo_count() ? "10" : "0"]"
//Desert Eagle
@@ -95,7 +95,7 @@
caliber = ".50ae"
max_ammo = 7
-/obj/item/ammo_box/magazine/m50/update_icon()
+/obj/item/ammo_box/magazine/m50/update_icon_state()
. = ..()
if (ammo_count() >= 7)
icon_state = "50ae-7"
@@ -112,8 +112,8 @@
caliber = "38"
max_ammo = 8
-/obj/item/ammo_box/magazine/v38/update_icon()
- ..()
+/obj/item/ammo_box/magazine/v38/update_icon_state()
+ . = ..()
if (ammo_count() >= 8)
icon_state = "v38[sprite_designation]-8"
else
diff --git a/code/modules/projectiles/boxes_magazines/external/rechargable.dm b/code/modules/projectiles/boxes_magazines/external/rechargable.dm
index e98aff2bbc60..41ebe99338fe 100644
--- a/code/modules/projectiles/boxes_magazines/external/rechargable.dm
+++ b/code/modules/projectiles/boxes_magazines/external/rechargable.dm
@@ -8,16 +8,18 @@
caliber = LASER
max_ammo = 20
-/obj/item/ammo_box/magazine/recharge/update_icon()
- ..()
+/obj/item/ammo_box/magazine/recharge/update_desc(updates=ALL)
+ . = ..()
desc = "[initial(desc)] It has [stored_ammo.len] shot\s left."
- cut_overlays()
+
+/obj/item/ammo_box/magazine/recharge/update_overlays()
+ . = ..()
var/cur_ammo = ammo_count()
if(cur_ammo)
if(cur_ammo >= max_ammo)
- add_overlay("[icon_state]_o_full")
+ . += "[icon_state]_o_full"
else
- add_overlay("[icon_state]_o_mid")
+ . += "[icon_state]_o_mid"
/obj/item/ammo_box/magazine/recharge/attack_self() //No popping out the "bullets"
@@ -28,10 +30,9 @@
icon = 'icons/obj/guns/grimdark.dmi'
icon_state = "lasgunmag"
desc = "A rechargeable, detachable battery that serves as a magazine for las weaponry."
-
-/obj/item/ammo_box/magazine/recharge/lasgun/update_icon()
- ..()
- desc = "[initial(desc)] It has [stored_ammo.len] shot\s left."
+
+/obj/item/ammo_box/magazine/recharge/lasgun/update_icon_state()
+ . = ..()
if(ammo_count())
icon_state = "[initial(icon_state)]"
else
@@ -74,7 +75,8 @@
"fire" = 2
)
-/obj/item/gun/ballistic/automatic/pistol/ntusp/update_icon()
+/obj/item/gun/ballistic/automatic/pistol/ntusp/update_icon(updates=ALL)
+ . = ..()
icon_state = initial(icon_state)
if(istype(magazine, /obj/item/ammo_box/magazine/recharge/ntusp/laser))
// Tricks the parent proc into thinking we have a skin so it uses the laser-variant icon_state
@@ -82,7 +84,6 @@
current_skin = "ntusp-l"
unique_reskin = list()
unique_reskin[current_skin] = current_skin
- ..()
current_skin = null
unique_reskin = null
@@ -104,7 +105,7 @@
var/bullets_to_remove = round(bullet_count / (severity*2))
for(var/i = 0; i < bullets_to_remove, i++)
qdel(get_round())
- update_icon()
+ update_appearance(UPDATE_ICON)
if(isgun(loc))
var/obj/item/gun/ballistic/G = loc
if(!G.magazine == src)
@@ -135,15 +136,14 @@
icon_state = "powerpack_small-l"
max_ammo = 8
-/obj/item/ammo_box/magazine/recharge/ntusp/laser/update_icon()
- ..()
- cut_overlays()
+/obj/item/ammo_box/magazine/recharge/ntusp/laser/update_overlays()
+ . = ..()
var/cur_ammo = ammo_count()
if(cur_ammo)
if(cur_ammo >= max_ammo)
- add_overlay("powerpack_small_o_full")
+ . += "powerpack_small_o_full"
else
- add_overlay("powerpack_small_o_mid")
+ . += "powerpack_small_o_mid"
/obj/item/ammo_box/magazine/recharge/ntusp/laser/empty
start_empty = TRUE
diff --git a/code/modules/projectiles/boxes_magazines/external/rifle.dm b/code/modules/projectiles/boxes_magazines/external/rifle.dm
index f33ba8a15753..d8ab658bc0a0 100644
--- a/code/modules/projectiles/boxes_magazines/external/rifle.dm
+++ b/code/modules/projectiles/boxes_magazines/external/rifle.dm
@@ -8,8 +8,8 @@
caliber = ".45"
max_ammo = 10
-/obj/item/ammo_box/magazine/m10mm/rifle/update_icon()
- ..()
+/obj/item/ammo_box/magazine/m10mm/rifle/update_icon_state()
+ . = ..()
if(ammo_count())
icon_state = "75-8"
else
@@ -25,8 +25,8 @@
caliber = "a556"
max_ammo = 30
-/obj/item/ammo_box/magazine/m556/update_icon()
- ..()
+/obj/item/ammo_box/magazine/m556/update_icon_state()
+ . = ..()
icon_state = "5.56m[sprite_designation]-[round(ammo_count(),5)]"
/obj/item/ammo_box/magazine/m556/ap
@@ -55,8 +55,8 @@
caliber = "a556"
max_ammo = 30
-/obj/item/ammo_box/magazine/r556/update_icon()
- ..()
+/obj/item/ammo_box/magazine/r556/update_icon_state()
+ . = ..()
if(ammo_count())
icon_state = "arg556[sprite_designation]"
else
@@ -96,8 +96,8 @@
caliber = "m308"
max_ammo = 15
-/obj/item/ammo_box/magazine/m308/update_icon()
- ..()
+/obj/item/ammo_box/magazine/m308/update_icon_state()
+ . = ..()
if(ammo_count())
icon_state = "m308[sprite_designation]"
else
@@ -130,8 +130,8 @@
caliber = "a762"
max_ammo = 11
-/obj/item/ammo_box/magazine/ks762/update_icon()
- ..()
+/obj/item/ammo_box/magazine/ks762/update_icon_state()
+ . = ..()
if(ammo_count())
icon_state = "ks762[sprite_designation]"
else
diff --git a/code/modules/projectiles/boxes_magazines/external/shotgun.dm b/code/modules/projectiles/boxes_magazines/external/shotgun.dm
index 46eaf75985f4..a7445adb6ae6 100644
--- a/code/modules/projectiles/boxes_magazines/external/shotgun.dm
+++ b/code/modules/projectiles/boxes_magazines/external/shotgun.dm
@@ -10,8 +10,8 @@
max_ammo = 8
sprite_designation = "b"
-/obj/item/ammo_box/magazine/m12g/update_icon()
- ..()
+/obj/item/ammo_box/magazine/m12g/update_icon_state()
+ . = ..()
if(ammo_count())
icon_state = "m12g[sprite_designation]-8"
else
diff --git a/code/modules/projectiles/boxes_magazines/external/smg.dm b/code/modules/projectiles/boxes_magazines/external/smg.dm
index c05c7332e51a..4255afba672a 100644
--- a/code/modules/projectiles/boxes_magazines/external/smg.dm
+++ b/code/modules/projectiles/boxes_magazines/external/smg.dm
@@ -8,7 +8,8 @@
caliber = "4.6x30mm"
max_ammo = 20
-/obj/item/ammo_box/magazine/wt550m9/update_icon()
+/obj/item/ammo_box/magazine/wt550m9/update_icon_state()
+ . = ..()
..()
switch(ammo_count())
if(17 to 21) //Considers the extra bullet in the chamber
@@ -75,7 +76,7 @@
sprite_designation = "B"
max_ammo = 10
-/obj/item/ammo_box/magazine/wt550m9/wt_airburst/update_icon() // Snowflake code snowflake code
+/obj/item/ammo_box/magazine/wt550m9/wt_airburst/update_icon_state() // Snowflake code snowflake code //gun code in general be like
..()
switch(ammo_count())
if(9 to 11) //Considers the extra bullet in the chamber
@@ -101,8 +102,8 @@
caliber = "9mm"
max_ammo = 32
-/obj/item/ammo_box/magazine/uzim9mm/update_icon()
- ..()
+/obj/item/ammo_box/magazine/uzim9mm/update_icon_state()
+ . = ..()
icon_state = "uzi9mm-[round(ammo_count(),4)]"
//NT Saber SMG
@@ -115,8 +116,8 @@
caliber = "9mm"
max_ammo = 21
-/obj/item/ammo_box/magazine/smgm9mm/update_icon()
- ..()
+/obj/item/ammo_box/magazine/smgm9mm/update_icon_state()
+ . = ..()
icon_state = "smg9mm[sprite_designation]-[ammo_count() ? "42" : "0"]"
/obj/item/ammo_box/magazine/smgm9mm/ap
@@ -145,8 +146,8 @@
caliber = ".45"
max_ammo = 24
-/obj/item/ammo_box/magazine/smgm45/update_icon()
- ..()
+/obj/item/ammo_box/magazine/smgm45/update_icon_state()
+ . = ..()
icon_state = "c20r45[sprite_designation]-[round(ammo_count(),2)]"
/obj/item/ammo_box/magazine/smgm45/ap
diff --git a/code/modules/projectiles/boxes_magazines/external/sniper.dm b/code/modules/projectiles/boxes_magazines/external/sniper.dm
index 6da8640160d9..3bdaf440940d 100644
--- a/code/modules/projectiles/boxes_magazines/external/sniper.dm
+++ b/code/modules/projectiles/boxes_magazines/external/sniper.dm
@@ -9,8 +9,8 @@
max_ammo = 6
caliber = ".50bmg"
-/obj/item/ammo_box/magazine/sniper_rounds/update_icon()
- ..()
+/obj/item/ammo_box/magazine/sniper_rounds/update_icon_state()
+ . = ..()
if(ammo_count())
icon_state = "[initial(icon_state)]-ammo"
else
diff --git a/code/modules/projectiles/boxes_magazines/external/toy.dm b/code/modules/projectiles/boxes_magazines/external/toy.dm
index 82c97ea054ff..118f05bb51fd 100644
--- a/code/modules/projectiles/boxes_magazines/external/toy.dm
+++ b/code/modules/projectiles/boxes_magazines/external/toy.dm
@@ -9,8 +9,8 @@
ammo_type = /obj/item/ammo_casing/reusable/foam_dart
max_ammo = 20
-/obj/item/ammo_box/magazine/toy/smg/update_icon()
- ..()
+/obj/item/ammo_box/magazine/toy/smg/update_icon_state()
+ . = ..()
if(ammo_count())
icon_state = "smg9mm-42"
else
@@ -35,8 +35,8 @@
ammo_type = /obj/item/ammo_casing/reusable/foam_dart
max_ammo = 20
-/obj/item/ammo_box/magazine/toy/smgm45/update_icon()
- ..()
+/obj/item/ammo_box/magazine/toy/smgm45/update_icon_state()
+ . = ..()
icon_state = "c20r45-[round(ammo_count(),2)]"
/obj/item/ammo_box/magazine/toy/smgm45/riot
@@ -50,8 +50,8 @@
ammo_type = /obj/item/ammo_casing/reusable/foam_dart
max_ammo = 50
-/obj/item/ammo_box/magazine/toy/m762/update_icon()
- ..()
+/obj/item/ammo_box/magazine/toy/m762/update_icon_state()
+ . = ..()
icon_state = "a762-[round(ammo_count(),10)]"
/obj/item/ammo_box/magazine/toy/m762/riot
diff --git a/code/modules/projectiles/boxes_magazines/internal/_cylinder.dm b/code/modules/projectiles/boxes_magazines/internal/_cylinder.dm
index a1d16826ccfe..7b47c450a3bd 100644
--- a/code/modules/projectiles/boxes_magazines/internal/_cylinder.dm
+++ b/code/modules/projectiles/boxes_magazines/internal/_cylinder.dm
@@ -58,4 +58,4 @@
for(var/i = 1, i <= max_ammo, i++)
if(!give_round(new load_type(src)))
break
- update_icon()
\ No newline at end of file
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index d6128dfa15bf..deadab326b3d 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -20,7 +20,9 @@
attack_verb = list("struck", "hit", "bashed")
cryo_preserve = TRUE
fryable = TRUE
+ appearance_flags = TILE_BOUND|PIXEL_SCALE|LONG_GLIDE|KEEP_TOGETHER
+ var/automatic = 0 //can gun use it, 0 is no, anything above 0 is the delay between clicks in ds
var/fire_sound = "gunshot"
var/vary_fire_sound = TRUE
var/fire_sound_volume = 50
@@ -54,12 +56,10 @@
var/can_flashlight = FALSE //if a flashlight can be added or removed if it already has one.
var/obj/item/flashlight/seclite/gun_light
- var/mutable_appearance/flashlight_overlay
- var/datum/action/item_action/toggle_gunlight/alight
+ var/datum/action/item_action/toggle_gunlight/gunlight_toggle
var/can_bayonet = FALSE //if a bayonet can be added or removed if it already has one.
var/obj/item/kitchen/knife/bayonet
- var/mutable_appearance/knife_overlay
var/knife_x_offset = 0
var/knife_y_offset = 0
@@ -67,7 +67,6 @@
var/max_attachments = 0 // How many attachments can this gun hold, recommend not going over 5
var/list/current_attachments = list()
- var/list/attachment_overlays = list()
var/attachment_flags = 0
var/attachment_actions = list()
@@ -86,6 +85,8 @@
var/list/obj/effect/projectile/tracer/current_tracers
+ var/gunlight_state = "flight"
+
/obj/item/gun/Initialize(mapload)
. = ..()
if(pin)
@@ -93,8 +94,6 @@
pin = null
else
pin = new pin(src)
- if(gun_light)
- alight = new(src)
current_tracers = list()
build_zooming()
@@ -121,7 +120,7 @@
pin = null
if(A == chambered)
chambered = null
- update_icon()
+ update_appearance(UPDATE_ICON)
if(A == bayonet)
clear_bayonet()
if(A == gun_light)
@@ -206,7 +205,7 @@
w_class -= suppressed.w_class
qdel(suppressed)
suppressed = null
- update_icon()
+ update_appearance(UPDATE_ICON)
else
if(enloudened && enloudened.enloudened_sound)
playsound(user, enloudened.enloudened_sound, fire_sound_volume, vary_fire_sound)
@@ -355,7 +354,7 @@
firing_burst = FALSE
return FALSE
process_chamber()
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/// cd_override is FALSE or 0 by default (no override), if you want to make a gun have no click cooldown then just make it something small like 0.001
@@ -409,7 +408,7 @@
shoot_with_empty_chamber(user)
return
process_chamber()
- update_icon()
+ update_appearance(UPDATE_ICON)
semicd = TRUE
addtimer(CALLBACK(src, PROC_REF(reset_semicd)), fire_delay)
@@ -419,10 +418,6 @@
recent_shoot = world.time
return TRUE
-/obj/item/gun/update_icon()
- ..()
-
-
/obj/item/gun/proc/reset_semicd()
semicd = FALSE
@@ -484,15 +479,12 @@
if(!can_flashlight)
return ..()
var/obj/item/flashlight/seclite/S = I
- if(!gun_light)
- if(!user.transferItemToLoc(I, src))
- return
- to_chat(user, span_notice("You click [S] into place on [src]."))
- set_gun_light(S)
- update_gunlight()
- alight = new(src)
- if(loc == user)
- alight.Grant(user)
+ if(gun_light)
+ return
+ if(!user.transferItemToLoc(I, src))
+ return
+ to_chat(user, span_notice("You click [S] into place on [src]."))
+ set_gun_light(S)
else if(istype(I, /obj/item/kitchen/knife))
var/obj/item/kitchen/knife/K = I
if(!can_bayonet || !K.bayonet || bayonet) //ensure the gun has an attachment point available, and that the knife is compatible with it.
@@ -501,14 +493,7 @@
return
to_chat(user, span_notice("You attach [K] to [src]'s bayonet lug."))
bayonet = K
- var/state = "bayonet" //Generic state.
- if(bayonet.icon_state in icon_states('icons/obj/guns/bayonets.dmi')) //Snowflake state?
- state = bayonet.icon_state
- var/icon/bayonet_icons = 'icons/obj/guns/bayonets.dmi'
- knife_overlay = mutable_appearance(bayonet_icons, state)
- knife_overlay.pixel_x = knife_x_offset
- knife_overlay.pixel_y = knife_y_offset
- add_overlay(knife_overlay, TRUE)
+ update_appearance(UPDATE_ICON)
else
return ..()
@@ -567,9 +552,7 @@
if(!bayonet)
return
bayonet = null
- if(knife_overlay)
- cut_overlay(knife_overlay, TRUE)
- knife_overlay = null
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/item/gun/proc/clear_gunlight()
@@ -577,9 +560,7 @@
return
var/obj/item/flashlight/seclite/removed_light = gun_light
set_gun_light(null)
- update_gunlight()
removed_light.update_brightness()
- QDEL_NULL(alight)
return TRUE
///Called when gun_light value changes.
@@ -592,14 +573,19 @@
gun_light.set_light_flags(gun_light.light_flags | LIGHT_ATTACHED)
if(gun_light.loc != src)
gun_light.forceMove(src)
+ gunlight_toggle = new(src)
+ add_item_action(gunlight_toggle)
else if(.)
var/obj/item/flashlight/seclite/old_gun_light = .
old_gun_light.set_light_flags(old_gun_light.light_flags & ~LIGHT_ATTACHED)
if(old_gun_light.loc == src)
old_gun_light.forceMove(get_turf(src))
+ remove_item_action(gunlight_toggle)
+ gunlight_toggle = null
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ui_action_click(mob/user, actiontype)
- if(istype(actiontype, alight))
+ if(istype(actiontype, gunlight_toggle))
toggle_gunlight()
else
..()
@@ -614,40 +600,33 @@
to_chat(user, span_notice("You toggle the gunlight [gun_light.on ? "on":"off"]."))
playsound(user, 'sound/weapons/empty.ogg', 100, TRUE)
- update_gunlight()
+ update_appearance(UPDATE_ICON)
-/obj/item/gun/proc/update_gunlight()
+/obj/item/gun/update_overlays()
+ . = ..()
if(gun_light)
- cut_overlay(flashlight_overlay, TRUE)
- var/state = "flight[gun_light.on? "_on":""]" //Generic state.
- if(gun_light.icon_state in icon_states('icons/obj/guns/flashlights.dmi')) //Snowflake state?
- state = gun_light.icon_state
- flashlight_overlay = mutable_appearance('icons/obj/guns/flashlights.dmi', state)
+ var/mutable_appearance/flashlight_overlay = mutable_appearance('icons/obj/guns/flashlights.dmi', "[gunlight_state][gun_light.on? "_on":""]")
flashlight_overlay.pixel_x = flight_x_offset
flashlight_overlay.pixel_y = flight_y_offset
- add_overlay(flashlight_overlay, TRUE)
- else
- cut_overlay(flashlight_overlay, TRUE)
- flashlight_overlay = null
- update_icon()
- for(var/X in actions)
- var/datum/action/A = X
- A.build_all_button_icons()
-
-/obj/item/gun/proc/update_attachments()
- for(var/mutable_appearance/M in attachment_overlays)
- cut_overlay(M, TRUE)
- attachment_overlays = list()
-
+ . += flashlight_overlay
+
+ if(bayonet)
+ var/state = "bayonet" //Generic state.
+ if(bayonet.icon_state in icon_states('icons/obj/guns/bayonets.dmi')) //Snowflake state?
+ state = bayonet.icon_state
+ var/icon/bayonet_icons = 'icons/obj/guns/bayonets.dmi'
+ var/mutable_appearance/knife_overlay = mutable_appearance(bayonet_icons, state)
+ knife_overlay.pixel_x = knife_x_offset
+ knife_overlay.pixel_y = knife_y_offset
+ . += knife_overlay
+
var/att_position = 0
- for(var/obj/item/attachment/A in current_attachments)
- var/mutable_appearance/M = mutable_appearance('icons/obj/guns/attachment.dmi', "[A.icon_state]_a")
+ for(var/obj/item/attachment/A as anything in current_attachments)
+ var/mutable_appearance/M = mutable_appearance(A.icon, "[A.icon_state]_a")
M.pixel_x = att_position * 6
- add_overlay(M, TRUE)
- attachment_overlays += M
- att_position += 1
+ . += M
+ att_position++
- update_icon(TRUE)
for(var/datum/action/A as anything in actions)
A.build_all_button_icons()
diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm
index 703e8dfe6a9d..10e7e985b1c1 100644
--- a/code/modules/projectiles/guns/ballistic.dm
+++ b/code/modules/projectiles/guns/ballistic.dm
@@ -45,6 +45,8 @@
///whether empty alarm sound varies
var/empty_alarm_vary = TRUE
+ ///Hides the bolt icon.
+ var/show_bolt_icon = TRUE
///Whether the gun will spawn loaded with a magazine
var/spawnwithmagazine = TRUE
///Compatible magazines with the gun
@@ -120,53 +122,6 @@
max_attachments = 4
recoil = 0.3
-/obj/item/gun/ballistic/proc/feedback(type) // checks to see if gun has that feedback type enabled then commences the animation
- if(feedback_types[type])
- feedback_commence(type, feedback_types[type])
-
-/obj/item/gun/ballistic/proc/feedback_commence(type,frames)
- if(type && frames)
- cut_overlays()
- if (suppressed)
- add_overlay("[icon_state]_[suppressed.icon_state]")
- if(type == "fire")
- if(!chambered)
- return
- if (magazine)
- if (special_mags)
- add_overlay("[icon_state]_mag_[initial(magazine.icon_state)]")
- if (!magazine.ammo_count())
- add_overlay("[icon_state]_mag_empty")
- else
- add_overlay("[icon_state]_mag")
- var/capacity_number = 0
- switch(get_ammo() / magazine.max_ammo)
- if(0.2 to 0.39)
- capacity_number = 20
- if(0.4 to 0.59)
- capacity_number = 40
- if(0.6 to 0.79)
- capacity_number = 60
- if(0.8 to 0.99)
- capacity_number = 80
- if(1.0)
- capacity_number = 100
- if (capacity_number)
- add_overlay("[icon_state]_mag_[capacity_number]")
- feedback_fire_slide ? add_overlay(feedback_firing_icon) : add_overlay(feedback_original_icon)
- DabAnimation(speed = feedback_recoil_speed, angle = ((rand(25,50)) * feedback_recoil_amount), direction = (feedback_recoil_reverse ? 2 : 3), hold_seconds = feedback_recoil_hold)
- sleep(frames)
- update_icon()
- return
- if (bolt_type == BOLT_TYPE_LOCKING)
- if(type != "slide*")
- add_overlay("[icon_state]_bolt[bolt_locked ? "_locked" : ""]")
- if(type == "slide_close") // cause the gun to move clockwise if slide is closed
- DabAnimation(speed = feedback_recoil_speed, angle = ((rand(20,25)) * feedback_recoil_amount), direction = 2)
- add_overlay("[feedback_original_icon_base]_[type]") // actual animation
- sleep(frames)
- update_icon()
-
/obj/item/gun/ballistic/Initialize(mapload)
. = ..()
feedback_original_icon_base = icon_state
@@ -177,7 +132,7 @@
feedback_firing_icon = feedback_original_icon_base
if (!spawnwithmagazine)
bolt_locked = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if (!magazine)
if (!starting_mag_type)
@@ -185,49 +140,81 @@
else
magazine = new starting_mag_type(src)
chamber_round()
- update_icon()
-
+ update_appearance(UPDATE_ICON)
-/obj/item/gun/ballistic/update_icon()
- if (QDELETED(src))
+/obj/item/gun/ballistic/proc/feedback(type) // checks to see if gun has that feedback type enabled then commences the animation
+ if(feedback_types[type])
+ feedback_commence(type, feedback_types[type])
+
+/obj/item/gun/ballistic/proc/feedback_commence(type, frames)
+ if(!type || !frames)
return
- ..()
+ update_appearance(UPDATE_OVERLAYS)
+ if(type == "fire")
+ feedback_fire_slide ? add_overlay(feedback_firing_icon) : add_overlay(feedback_original_icon)
+ DabAnimation(speed = feedback_recoil_speed, angle = ((rand(25,50)) * feedback_recoil_amount), direction = (feedback_recoil_reverse ? 2 : 3), hold_seconds = feedback_recoil_hold)
+ else if(bolt_type == BOLT_TYPE_LOCKING)
+ if(type == "slide_close") // cause the gun to move clockwise if slide is closed
+ DabAnimation(speed = feedback_recoil_speed, angle = ((rand(20,25)) * feedback_recoil_amount), direction = 2)
+ if(type != "fire")
+ add_overlay("[feedback_original_icon_base]_[type]") // actual animation
+ sleep(frames)
+ update_appearance(UPDATE_OVERLAYS)
+
+/obj/item/gun/ballistic/update_icon_state()
+ if(QDELETED(src))
+ return
+ . = ..()
if(current_skin)
icon_state = "[unique_reskin[current_skin]][sawn_off ? "_sawn" : ""]"
else
icon_state = "[initial(icon_state)][sawn_off ? "_sawn" : ""]"
- cut_overlays()
- if (bolt_type == BOLT_TYPE_LOCKING)
- add_overlay("[icon_state]_bolt[bolt_locked ? "_locked" : ""]")
- if (bolt_type == BOLT_TYPE_OPEN && bolt_locked)
- add_overlay("[icon_state]_bolt")
+
+/obj/item/gun/ballistic/update_overlays()
+ if(QDELETED(src))
+ return
+ . = ..()
+ if(show_bolt_icon)
+ if (bolt_type == BOLT_TYPE_LOCKING)
+ . += "[icon_state]_bolt[bolt_locked ? "_locked" : ""]"
+ if (bolt_type == BOLT_TYPE_OPEN && bolt_locked)
+ . += "[icon_state]_bolt"
+
if (suppressed)
- add_overlay("[icon_state]_[suppressed.icon_state]")
+ . += "[icon_state]_[suppressed.icon_state]"
if (enloudened)
- add_overlay("[icon_state]_[enloudened.icon_state]")
+ . += "[icon_state]_[enloudened.icon_state]"
+
if(!chambered && empty_indicator)
- add_overlay("[icon_state]_empty")
- if (magazine)
- if (special_mags)
- add_overlay("[icon_state]_mag_[initial(magazine.icon_state)]")
- if (!magazine.ammo_count())
- add_overlay("[icon_state]_mag_empty")
- else
- add_overlay("[icon_state]_mag")
- var/capacity_number = 0
- switch(get_ammo() / magazine.max_ammo)
- if(0.2 to 0.39)
- capacity_number = 20
- if(0.4 to 0.59)
- capacity_number = 40
- if(0.6 to 0.79)
- capacity_number = 60
- if(0.8 to 0.99)
- capacity_number = 80
- if(1.0)
- capacity_number = 100
- if (capacity_number)
- add_overlay("[icon_state]_mag_[capacity_number]")
+ . += "[icon_state]_empty"
+
+ if(!magazine || internal_magazine || !mag_display)
+ return
+
+ if(special_mags)
+ . += "[icon_state]_mag_[initial(magazine.icon_state)]"
+ if(mag_display_ammo && !magazine.ammo_count())
+ . += "[icon_state]_mag_empty"
+ return
+
+ . += "[icon_state]_mag"
+ if(!mag_display_ammo)
+ return
+
+ var/capacity_number = 0
+ switch(get_ammo() / magazine.max_ammo)
+ if(1 to INFINITY) //cause we can have one in the chamber.
+ capacity_number = 100
+ if(0.8 to 1)
+ capacity_number = 80
+ if(0.6 to 0.8)
+ capacity_number = 60
+ if(0.4 to 0.6)
+ capacity_number = 40
+ if(0.2 to 0.4)
+ capacity_number = 20
+ if (capacity_number)
+ . += "[icon_state]_mag_[capacity_number]"
/obj/item/gun/ballistic/process_chamber(empty_chamber = TRUE, from_firing = TRUE, chamber_next_round = TRUE)
@@ -281,7 +268,7 @@
else
playsound(src, rack_sound, rack_sound_volume, rack_sound_vary)
feedback("slide_close")
- update_icon()
+ update_appearance(UPDATE_ICON)
///Drops the bolt from a locked position
/obj/item/gun/ballistic/proc/drop_bolt(mob/user = null)
@@ -291,7 +278,7 @@
bolt_locked = FALSE
feedback("slide_close")
chamber_round()
- update_icon()
+ update_appearance(UPDATE_ICON)
///Handles all the logic needed for magazine insertion
/obj/item/gun/ballistic/proc/insert_magazine(mob/user, obj/item/ammo_box/magazine/AM, display_message = TRUE)
@@ -308,7 +295,7 @@
feedback("mag_in")
if (bolt_type == BOLT_TYPE_OPEN && !bolt_locked)
chamber_round(TRUE)
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
else
to_chat(user, span_warning("You cannot seem to get \the [src] out of your hands!"))
@@ -340,10 +327,10 @@
else
magazine = null
user.put_in_hands(old_mag)
- old_mag.update_icon()
+ old_mag.update_appearance(UPDATE_ICON)
if (display_message)
to_chat(user, span_notice("You pull the [magazine_wording] out of \the [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/can_shoot()
return chambered
@@ -376,8 +363,8 @@
user.say(reload_say, forced = "reloading")
if (chambered == null && bolt_type == BOLT_TYPE_NO_BOLT)
chamber_round()
- A.update_icon()
- update_icon()
+ A.update_appearance(UPDATE_ICON)
+ update_appearance(UPDATE_ICON)
return
if(istype(A, /obj/item/suppressor))
var/obj/item/suppressor/S = A
@@ -420,11 +407,11 @@
/obj/item/gun/ballistic/proc/install_suppressor(obj/item/suppressor/S)
suppressed = S
w_class += S.w_class //so pistols do not fit in pockets when suppressed
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/proc/install_enloudener(obj/item/enloudener/E)
enloudened = E
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/AltClick(mob/user)
if (unique_reskin && !current_skin && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
@@ -438,7 +425,7 @@
user.put_in_hands(suppressed)
w_class -= suppressed.w_class
suppressed = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(enloudened && can_unsuppress)
if(!user.is_holding(src))
@@ -447,7 +434,7 @@
user.put_in_hands(enloudened)
w_class -= enloudened.w_class
enloudened = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return
///Prefire empty checks for the bolt drop
@@ -456,7 +443,7 @@
if (bolt_type == BOLT_TYPE_OPEN && !bolt_locked)
bolt_locked = TRUE
playsound(src, bolt_drop_sound, bolt_drop_sound_volume)
- update_icon()
+ update_appearance(UPDATE_ICON)
///postfire empty checks for bolt locking and sound alarms
/obj/item/gun/ballistic/proc/postfire_empty_checks()
@@ -464,12 +451,12 @@
if (!alarmed && empty_alarm)
playsound(src, empty_alarm_sound, empty_alarm_volume, empty_alarm_vary)
alarmed = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
if (bolt_type == BOLT_TYPE_LOCKING)
if(!bolt_locked)
feedback("slide_open")
bolt_locked = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/afterattack()
prefire_empty_checks()
@@ -500,7 +487,7 @@
if (num_unloaded)
to_chat(user, span_notice("You unload [num_unloaded] [cartridge_wording]\s from [src]."))
playsound(user, eject_sound, eject_sound_volume, eject_sound_vary)
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("[src] is empty!"))
return
@@ -630,7 +617,7 @@ GLOBAL_LIST_INIT(gun_saw_types, typecacheof(list(
slot_flags |= ITEM_SLOT_BELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally)
recoil = SAWN_OFF_RECOIL
sawn_off = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
///used for sawing guns, causes the gun to fire without the input of the user
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index d5cb70c7d868..d246d592991d 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -23,16 +23,17 @@
pin = null
bolt_type = BOLT_TYPE_LOCKING
mag_display = TRUE
+ show_bolt_icon = FALSE
/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))
@@ -56,7 +57,7 @@
to_chat(user, span_notice("You switch to [burst_size]-rnd burst."))
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
- update_icon()
+ update_appearance(UPDATE_ICON)
for(var/X in actions)
var/datum/action/A = X
A.build_all_button_icons()
@@ -82,7 +83,7 @@
/obj/item/gun/ballistic/automatic/c20r/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/automatic/wt550
name = "\improper security auto carbine"
@@ -113,6 +114,7 @@
burst_size = 2
bolt_type = BOLT_TYPE_OPEN
mag_display = TRUE
+ show_bolt_icon = FALSE
rack_sound = "sound/weapons/pistollock.ogg"
/obj/item/gun/ballistic/automatic/m90
@@ -133,7 +135,7 @@
/obj/item/gun/ballistic/automatic/m90/Initialize(mapload)
. = ..()
underbarrel = new /obj/item/gun/ballistic/revolver/grenadelauncher(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/automatic/m90/unrestricted
pin = /obj/item/firing_pin
@@ -141,7 +143,7 @@
/obj/item/gun/ballistic/automatic/m90/unrestricted/Initialize(mapload)
. = ..()
underbarrel = new /obj/item/gun/ballistic/revolver/grenadelauncher/unrestricted(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/automatic/m90/afterattack(atom/target, mob/living/user, flag, params)
if(select == 2)
@@ -157,16 +159,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
@@ -188,7 +189,7 @@
spread -= spread_difference
to_chat(user, span_notice("You switch to semi-auto."))
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
- update_icon()
+ update_appearance(UPDATE_ICON)
return
/obj/item/gun/ballistic/automatic/tommygun
@@ -205,6 +206,7 @@
spread = 30
fire_delay = 1
bolt_type = BOLT_TYPE_OPEN
+ show_bolt_icon = FALSE
/obj/item/gun/ballistic/automatic/ar
name = "\improper NT-ARG 'Boarder' Rifle"
@@ -239,6 +241,7 @@
bolt_type = BOLT_TYPE_OPEN
mag_display = TRUE
mag_display_ammo = TRUE
+ show_bolt_icon = FALSE
tac_reloads = FALSE
automatic = TRUE
fire_sound = 'sound/weapons/rifleshot.ogg'
@@ -262,12 +265,12 @@
playsound(user, 'sound/weapons/sawopen.ogg', 60, 1)
else
playsound(user, 'sound/weapons/sawopen.ogg', 60, 1)
- update_icon()
+ update_appearance(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)
@@ -276,7 +279,7 @@
return
else
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/gun/ballistic/automatic/l6_saw/attack_hand(mob/user)
diff --git a/code/modules/projectiles/guns/ballistic/bow.dm b/code/modules/projectiles/guns/ballistic/bow.dm
index 4e6044bc33c9..dd80bbdbacc3 100644
--- a/code/modules/projectiles/guns/ballistic/bow.dm
+++ b/code/modules/projectiles/guns/ballistic/bow.dm
@@ -33,7 +33,6 @@
var/draw_time = 0.5 SECONDS
var/draw_slowdown = 0.75
var/draw_sound = 'sound/weapons/sound_weapons_bowdraw.ogg'
- var/mutable_appearance/arrow_overlay
/// If the last loaded arrow was a toy arrow or not, used to see if foam darts / arrows should do stamina damage
var/nerfed = FALSE
@@ -43,7 +42,7 @@
/obj/item/gun/ballistic/bow/chamber_round()
chambered = magazine.get_round(1)
update_slowdown()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/bow/dropped()
. = ..()
@@ -61,7 +60,7 @@
chambered = null
magazine.give_round(old_chambered)
update_slowdown()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/bow/equipped(mob/user, slot)
..()
@@ -71,7 +70,7 @@
chambered = null
magazine.get_round(FALSE)
update_slowdown()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/bow/attack_self(mob/living/user)
if(drawing)
@@ -121,7 +120,7 @@
user.put_in_hands(AC)
to_chat(user, span_notice("You remove [AC]."))
update_slowdown()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/bow/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/ammo_casing))
@@ -131,15 +130,18 @@
to_chat(user, span_notice("You notch [I]."))
nerfed = istype(I, /obj/item/ammo_casing/reusable/arrow/toy)
update_slowdown()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/gun/ballistic/bow/update_icon()
- cut_overlay(arrow_overlay, TRUE)
+/obj/item/gun/ballistic/bow/update_icon_state()
+ . = ..()
icon_state = "[initial(icon_state)][chambered ? "_firing" : ""]"
+
+/obj/item/gun/ballistic/bow/update_overlays()
+ . = ..()
if(get_ammo())
- var/obj/item/ammo_casing/reusable/arrow/energy/E = magazine.get_round(TRUE)
- arrow_overlay = mutable_appearance(icon, "[initial(E.item_state)][chambered ? "_firing" : ""]")
- add_overlay(arrow_overlay, TRUE)
+ var/obj/item/ammo_casing/reusable/arrow/E = magazine.get_round(TRUE)
+ var/mutable_appearance/arrow_overlay = mutable_appearance(icon, "[initial(E.item_state)][chambered ? "_firing" : ""]")
+ . += arrow_overlay
/obj/item/gun/ballistic/bow/proc/update_slowdown()
if(chambered || drawing)
@@ -451,21 +453,16 @@
if(TIMER_COOLDOWN_CHECK(src, "arrow_recharge"))
. += span_warning("It is currently recharging!")
-/obj/item/gun/ballistic/bow/energy/update_icon()
- cut_overlay(arrow_overlay, TRUE)
-
+/obj/item/gun/ballistic/bow/energy/update_icon_state()
+ . = ..()
if(folded)
icon_state = "[initial(icon_state)]_folded"
item_state = "[initial(item_state)]_folded"
- else
+ else if(get_ammo())
icon_state = initial(icon_state)
+ else
item_state = initial(item_state)
-
- if(get_ammo())
- var/obj/item/ammo_casing/reusable/arrow/energy/E = magazine.get_round(TRUE)
- arrow_overlay = mutable_appearance(icon, "[initial(E.icon_state)][chambered ? "_firing" : ""]")
- add_overlay(arrow_overlay, TRUE)
- item_state = "[item_state]_[E.icon_state]"
+ icon_state = initial(icon_state)
if(ismob(loc))
var/mob/M = loc
@@ -492,7 +489,7 @@
to_chat(user, span_notice("You fabricate an arrow."))
recharge_arrow()
update_slowdown()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/bow/energy/proc/recharge_arrow()
if(folded || magazine.get_round(TRUE))
@@ -500,7 +497,7 @@
var/ammo_type = magazine.ammo_type
magazine.give_round(new ammo_type())
update_slowdown()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/bow/energy/attackby(obj/item/I, mob/user, params)
return
@@ -512,7 +509,7 @@
QDEL_NULL(current_round)
if(!TIMER_COOLDOWN_CHECK(src, "arrow_recharge"))
recharge_arrow()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/bow/energy/proc/select_projectile(mob/living/user)
var/obj/item/ammo_box/magazine/internal/bow/energy/M = magazine
@@ -550,7 +547,7 @@
to_chat(user, span_notice("You switch \the [src]'s firing mode to \"[initial(choice.name)]\"."))
QDEL_NULL(choice_list)
QDEL_NULL(radial_list)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/bow/energy/CtrlClick(mob/living/user)
if(!can_fold || !user.is_holding(src))
@@ -580,7 +577,7 @@
//magazine.stored_ammo = stored_ammo
if(user)
to_chat(user, span_notice("You extend [src], allowing it to be fired."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/bow/energy/advanced
name = "advanced hardlight bow"
diff --git a/code/modules/projectiles/guns/ballistic/laser_gatling.dm b/code/modules/projectiles/guns/ballistic/laser_gatling.dm
index 9bca7518e0cc..8b3e4384d831 100644
--- a/code/modules/projectiles/guns/ballistic/laser_gatling.dm
+++ b/code/modules/projectiles/guns/ballistic/laser_gatling.dm
@@ -42,7 +42,7 @@
armed = 0
to_chat(user, span_warning("You need a free hand to hold the gun!"))
return
- update_icon()
+ update_appearance(UPDATE_ICON)
user.update_inv_back()
else
to_chat(user, span_warning("You are already holding the gun!"))
@@ -81,7 +81,8 @@
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
-/obj/item/minigunpack/update_icon()
+/obj/item/minigunpack/update_icon_state()
+ . = ..()
if(armed)
icon_state = "notholstered"
else
@@ -96,7 +97,7 @@
to_chat(user, span_notice("You attach the [gun.name] to the [name]."))
else
src.visible_message(span_warning("The [gun.name] snaps back onto the [name]!"))
- update_icon()
+ update_appearance(UPDATE_ICON)
user.update_inv_back()
@@ -127,6 +128,7 @@
ammo_pack = loc
else
return INITIALIZE_HINT_QDEL //No pack, no gun
+ AddElement(/datum/element/update_icon_blocker)
return ..()
diff --git a/code/modules/projectiles/guns/ballistic/minigun.dm b/code/modules/projectiles/guns/ballistic/minigun.dm
index a7c5e9da5701..6c8172a7b0bd 100644
--- a/code/modules/projectiles/guns/ballistic/minigun.dm
+++ b/code/modules/projectiles/guns/ballistic/minigun.dm
@@ -42,7 +42,7 @@
armed = FALSE
to_chat(user, span_warning("You need a free hand to hold the gun!"))
return
- update_icon()
+ update_appearance(UPDATE_ICON)
user.update_inv_back()
else
to_chat(user, span_warning("You are already holding the gun!"))
@@ -81,7 +81,8 @@
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
-/obj/item/minigunbackpack/update_icon()
+/obj/item/minigunbackpack/update_icon_state()
+ . = ..()
if(armed)
icon_state = "notholstered"
else
@@ -96,7 +97,7 @@
to_chat(user, span_notice("You attach the [gun.name] to the [name]."))
else
visible_message(span_warning("The [gun.name] snaps back onto the [name]!"))
- update_icon()
+ update_appearance(UPDATE_ICON)
user.update_inv_back()
diff --git a/code/modules/projectiles/guns/ballistic/pistol.dm b/code/modules/projectiles/guns/ballistic/pistol.dm
index 2c1950738697..fe64aa0ce3da 100644
--- a/code/modules/projectiles/guns/ballistic/pistol.dm
+++ b/code/modules/projectiles/guns/ballistic/pistol.dm
@@ -91,6 +91,7 @@
feedback_types = list(
"fire" = 2
)
+ show_bolt_icon = FALSE
/obj/item/gun/ballistic/automatic/pistol/stickman/pickup(mob/living/user)
SHOULD_CALL_PARENT(FALSE)
diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm
index 002f16d91691..30a76ee99871 100644
--- a/code/modules/projectiles/guns/ballistic/revolver.dm
+++ b/code/modules/projectiles/guns/ballistic/revolver.dm
@@ -181,8 +181,8 @@
..()
if(get_ammo(FALSE) > 0)
spin()
- update_icon()
- A.update_icon()
+ update_appearance(UPDATE_ICON)
+ A.update_appearance(UPDATE_ICON)
return
/obj/item/gun/ballistic/revolver/russian/attack_self(mob/user)
diff --git a/code/modules/projectiles/guns/ballistic/rifle.dm b/code/modules/projectiles/guns/ballistic/rifle.dm
index 2b3d488f7b57..0d289c383bb9 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/mosinboltin.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)
@@ -25,7 +25,7 @@ obj/item/gun/ballistic/rifle/rack(mob/user = null)
playsound(src, rack_sound, rack_sound_volume, rack_sound_vary)
process_chamber(FALSE, FALSE, FALSE)
bolt_locked = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
return
drop_bolt(user)
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index e5626fb46520..17448eff59d1 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -228,12 +228,12 @@
slot_flags = ITEM_SLOT_BACK
to_chat(user, span_notice("You tie the lengths of cable to the shotgun, making a sling."))
slung = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("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()
+ . = ..()
if(slung)
icon_state = "ishotgunsling"
@@ -243,7 +243,7 @@
if(. && slung) //sawing off the gun removes the sling
new /obj/item/stack/cable_coil(get_turf(src), 10)
slung = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/ballistic/shotgun/doublebarrel/improvised/sawn
name = "sawn-off improvised shotgun"
diff --git a/code/modules/projectiles/guns/ballistic/toy.dm b/code/modules/projectiles/guns/ballistic/toy.dm
index c65adaa8a00f..0ee56ca1ece5 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
@@ -56,9 +56,9 @@
casing_ejector = FALSE
can_suppress = FALSE
-/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/unrestricted
pin = /obj/item/firing_pin
@@ -90,9 +90,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"
@@ -110,6 +110,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 cf7810067b49..2841592363ce 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -3,6 +3,7 @@
name = "energy gun"
desc = "A basic energy-based gun."
icon = 'icons/obj/guns/energy.dmi'
+ ammo_x_offset = 2
var/obj/item/stock_parts/cell/cell //What type of power cell this uses
var/cell_type = /obj/item/stock_parts/cell
@@ -10,11 +11,9 @@
var/list/ammo_type = list(/obj/item/ammo_casing/energy)
var/select = 1 //The state of the select fire switch. Determines from the ammo_type list what kind of shot is fired next.
var/can_charge = TRUE //Can it be charged in a recharger?
- var/automatic_charge_overlays = TRUE //Do we handle overlays with base update_icon()?
+ var/automatic_charge_overlays = TRUE //Do we handle overlays with base update_overlays?
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_timer = 0
var/charge_delay = 8
@@ -45,7 +44,7 @@
emp_jam_timer = addtimer(CALLBACK(src, PROC_REF(emp_unjam)), unjam_time, TIMER_STOPPABLE)
chambered = null //we empty the chamber
recharge_newshot() //and try to charge a new shot
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/energy/shoot_with_empty_chamber(mob/living/user as mob|obj)
if(emp_jammed)
@@ -73,7 +72,7 @@
recharge_newshot(TRUE)
if(selfcharge)
START_PROCESSING(SSobj, src)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/energy/proc/update_ammo_types()
var/obj/item/ammo_casing/energy/shot
@@ -100,12 +99,12 @@
cell.give(100*charge_amount)
if(!chambered) //if empty chamber we try to charge a new shot
recharge_newshot(TRUE)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/energy/attack_self(mob/living/user as mob)
if(ammo_type.len > 1)
select_fire(user)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/energy/can_shoot()
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
@@ -156,44 +155,49 @@
to_chat(user, span_notice("[src] is now set to [shot.select_name]."))
chambered = null
recharge_newshot(TRUE)
- update_icon(TRUE)
+ update_appearance(UPDATE_ICON)
return
-/obj/item/gun/energy/update_icon(force_update)
+/obj/item/gun/energy/update_icon_state()
+ if(QDELETED(src))
+ return
+ . = ..()
+ var/obj/item/ammo_casing/energy/shot = ammo_type[select]
+ var/ratio = get_charge_ratio()
+ if(!isnull(initial(item_state))) //static item states
+ return
+ item_state = "[initial(icon_state)][modifystate ? "[shot.select_name]" : ""][ratio]"
+
+/obj/item/gun/energy/update_overlays()
if(QDELETED(src))
return
- ..()
+ . = ..()
if(!automatic_charge_overlays)
return
- var/ratio = CEILING(clamp(cell.charge / cell.maxcharge, 0, 1) * charge_sections, 1)
- if(ratio == old_ratio && !force_update)
+
+ var/overlay_icon_state = "[icon_state]_charge"
+ if(modifystate)
+ var/obj/item/ammo_casing/energy/shot = ammo_type[select]
+ . += mutable_appearance(icon, "[icon_state]_[initial(shot.select_name)]")
+ if(cell.charge < shot.e_cost)
+ . += "[icon_state]_empty"
+ return
+ overlay_icon_state += "_[initial(shot.select_name)]"
+
+ var/ratio = get_charge_ratio()
+ if(shaded_charge)
+ . += "[icon_state]_charge[ratio]"
return
- old_ratio = ratio
- cut_overlays()
- var/obj/item/ammo_casing/energy/shot = ammo_type[select]
- var/iconState = "[icon_state]_charge"
- var/itemState = null
- if(!initial(item_state))
- itemState = icon_state
- if (modifystate)
- add_overlay("[icon_state]_[shot.select_name]")
- iconState += "_[shot.select_name]"
- if(itemState)
- itemState += "[shot.select_name]"
- if(cell.charge < shot.e_cost)
- add_overlay("[icon_state]_empty")
- else
- if(!shaded_charge)
- var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
- for(var/i = ratio, i >= 1, i--)
- charge_overlay.pixel_x = ammo_x_offset * (i - 1)
- charge_overlay.pixel_y = ammo_y_offset * (i - 1)
- add_overlay(charge_overlay)
- else
- add_overlay("[icon_state]_charge[ratio]")
- if(itemState)
- itemState += "[ratio]"
- item_state = itemState
+ for(var/i = ratio, i >= 1, i--)
+ var/mutable_appearance/charge_overlay = mutable_appearance(icon, overlay_icon_state)
+ charge_overlay.pixel_x = ammo_x_offset * (i - 1)
+ charge_overlay.pixel_y = ammo_y_offset * (i - 1)
+ . += charge_overlay
+
+///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))
@@ -204,7 +208,7 @@
playsound(loc, fire_sound, 50, 1, -1)
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
cell.use(shot.e_cost)
- update_icon()
+ update_appearance(UPDATE_ICON)
return(FIRELOSS)
else
user.visible_message(span_suicide("[user] panics and starts choking to death!"))
diff --git a/code/modules/projectiles/guns/energy/dueling.dm b/code/modules/projectiles/guns/energy/dueling.dm
index d7ede30bf273..2cc685eee4ff 100644
--- a/code/modules/projectiles/guns/energy/dueling.dm
+++ b/code/modules/projectiles/guns/energy/dueling.dm
@@ -173,14 +173,13 @@
if(DUEL_SETTING_C)
setting = DUEL_SETTING_A
to_chat(user,span_notice("You switch [src] setting to [setting] mode."))
- update_icon()
+ update_appearance(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()
. = ..()
@@ -230,7 +229,7 @@
duration = 30
var/setting
-/obj/effect/temp_visual/dueling_chaff/update_icon()
+/obj/effect/temp_visual/dueling_chaff/update_icon(updates=ALL)
. = ..()
switch(setting)
if(DUEL_SETTING_A)
@@ -251,13 +250,13 @@
. = ..()
var/obj/item/projectile/energy/duel/D = BB
D.setting = setting
- D.update_icon()
+ D.update_appearance(UPDATE_ICON)
/obj/item/ammo_casing/energy/duel/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread, atom/fired_from)
. = ..()
var/obj/effect/temp_visual/dueling_chaff/C = new(get_turf(user))
C.setting = setting
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
//Projectile
@@ -268,7 +267,7 @@
homing = TRUE
var/setting
-/obj/item/projectile/energy/duel/update_icon()
+/obj/item/projectile/energy/duel/update_icon(updates=ALL)
. = ..()
switch(setting)
if(DUEL_SETTING_A)
@@ -323,7 +322,8 @@
STR.max_items = 2
STR.set_holdable(list(/obj/item/gun/energy/dueling))
-/obj/item/storage/lockbox/dueling/update_icon()
+/obj/item/storage/lockbox/dueling/update_icon(updates=ALL)
+ . = ..()
cut_overlays()
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(locked)
diff --git a/code/modules/projectiles/guns/energy/energy_gun.dm b/code/modules/projectiles/guns/energy/energy_gun.dm
index f35aff17fee8..94a6dbe9d884 100644
--- a/code/modules/projectiles/guns/energy/energy_gun.dm
+++ b/code/modules/projectiles/guns/energy/energy_gun.dm
@@ -2,9 +2,9 @@
name = "energy gun"
desc = "A basic hybrid energy gun with two settings: disable and kill."
icon_state = "energy"
- item_state = null //so the human update icon uses the icon_state instead.
+ item_state = null //so the human update icon uses the icon_state instead.
ammo_type = list(/obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser)
- modifystate = 1
+ modifystate = TRUE
can_flashlight = TRUE
ammo_x_offset = 3
flight_x_offset = 15
@@ -25,15 +25,14 @@
ammo_x_offset = 2
charge_sections = 3
can_flashlight = FALSE // Can't attach or detach the flashlight, and override it's icon update
+ gunlight_state = "mini-light"
+ flight_x_offset = 19
+ flight_y_offset = 13
/obj/item/gun/energy/e_gun/mini/Initialize(mapload)
- set_gun_light(new /obj/item/flashlight/seclite(src))
- return ..()
-
-/obj/item/gun/energy/e_gun/mini/update_icon()
- ..()
- if(gun_light && gun_light.on)
- add_overlay("mini-light")
+ . = ..()
+ var/obj/item/flashlight/seclite/new_seclite = new()
+ set_gun_light(new_seclite)
/obj/item/gun/energy/e_gun/stun
name = "tactical energy gun"
@@ -143,7 +142,6 @@
pin = null
can_charge = FALSE
ammo_x_offset = 1
- old_ratio = 1
ammo_type = list(/obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser, /obj/item/ammo_casing/energy/xray, /obj/item/ammo_casing/energy/anoxia) //a lot of firemodes so it's really an ADVANCED egun
dead_cell = TRUE //Fuel not included, you will have to get irradiated to shoot this gun
@@ -163,7 +161,7 @@
I.use(1)
cell.give(250*charge_multiplier)
user.radiation += (75*charge_multiplier) //You are putting you hand into a nuclear reactor to put more uranium in it
- update_icon(TRUE)
+ update_appearance(UPDATE_ICON)
else
if(!(previous_loc == user.loc))
to_chat(user, span_boldwarning("You move, bumping your hand on [src]'s nulear reactor's core!")) //when I said devoid of ANY safety measures I meant it
diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
index 563a01fc4b3c..5cad3d3cc066 100644
--- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
+++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
@@ -108,7 +108,7 @@
/obj/item/gun/energy/kinetic_accelerator/proc/empty()
if(cell)
cell.use(cell.charge)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/energy/kinetic_accelerator/proc/attempt_reload(recharge_time)
if(!cell)
@@ -142,15 +142,13 @@
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
else
to_chat(loc, span_warning("[src] silently charges up."))
- update_icon()
+ update_appearance(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"
/obj/item/gun/energy/kinetic_accelerator/mega
name = "mega proto-kinetic accelerator"
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index 35eea472bb4d..fab652d3eff5 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -51,6 +51,7 @@
item_state = LASER
desc = "An industrial-grade heavy-duty laser rifle with a modified laser lens to scatter its shot into multiple smaller lasers. The inner-core can self-charge for theoretically infinite use."
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser)
+ shaded_charge = FALSE
/obj/item/gun/energy/laser/cyborg
can_charge = FALSE
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index 6ac021300bab..5a9bca598c5a 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -34,11 +34,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
@@ -138,6 +138,7 @@
toolspeed = 2
/obj/item/gun/energy/plasmacutter/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
. = ..()
AddComponent(/datum/component/butchering, 25, 105, 0, 'sound/weapons/plasma_cutter.ogg')
@@ -207,10 +208,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"
@@ -306,7 +303,8 @@
desc = "A projector that emits high density quantum-coupled bluespace beams. This one seems to be modified to go through glass."
ammo_type = list(/obj/item/ammo_casing/energy/wormhole/upgraded, /obj/item/ammo_casing/energy/wormhole/orange/upgraded)
-/obj/item/gun/energy/wormhole_projector/update_icon()
+/obj/item/gun/energy/wormhole_projector/update_icon_state()
+ . = ..()
icon_state = "[initial(icon_state)][select]"
item_state = icon_state
@@ -375,6 +373,10 @@
can_charge = FALSE
use_cyborg_cell = TRUE
+/obj/item/gun/energy/printer/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
+
/obj/item/gun/energy/printer/flamethrower
name = "cyborg flame projector"
desc = "Originally intended for cyborgs to assist in atmospherics projects, was soon scrapped due to safety concerns."
@@ -384,9 +386,6 @@
can_charge = FALSE
use_cyborg_cell = TRUE
-/obj/item/gun/energy/printer/update_icon()
- return
-
/obj/item/gun/energy/printer/emp_act()
return
@@ -410,6 +409,9 @@
desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit."
ammo_type = list(/obj/item/ammo_casing/energy/instakill)
force = 60
+ charge_sections = 5
+ ammo_x_offset = 2
+ shaded_charge = FALSE
/obj/item/gun/energy/laser/instakill/red
desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit. This one has a red design."
diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm
index 7b08f3da3ab4..9d932166f90e 100644
--- a/code/modules/projectiles/guns/magic.dm
+++ b/code/modules/projectiles/guns/magic.dm
@@ -49,7 +49,7 @@
. |= COMPONENT_ITEM_BURNT_OUT
charges = max_charges
- update_icon()
+ update_appearance(UPDATE_ICON)
recharge_newshot()
return .
@@ -108,8 +108,9 @@
recharge_newshot()
return 1
-/obj/item/gun/magic/update_icon()
- return
+/obj/item/gun/magic/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
to_chat(user, span_warning("The [name] whizzles quietly."))
diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm
index 383cb47830c5..f463f48c872a 100644
--- a/code/modules/projectiles/guns/magic/wand.dm
+++ b/code/modules/projectiles/guns/magic/wand.dm
@@ -21,7 +21,8 @@
. = ..()
. += "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)
@@ -44,7 +45,7 @@
zap_self(user)
else
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/magic/wand/proc/zap_self(mob/living/user)
diff --git a/code/modules/projectiles/guns/misc/beam_rifle.dm b/code/modules/projectiles/guns/misc/beam_rifle.dm
index ab196eda9af9..c6ddd4e87055 100644
--- a/code/modules/projectiles/guns/misc/beam_rifle.dm
+++ b/code/modules/projectiles/guns/misc/beam_rifle.dm
@@ -148,13 +148,13 @@
current_zoom_x = 0
current_zoom_y = 0
-/obj/item/gun/energy/beam_rifle/update_icon()
- cut_overlays()
+/obj/item/gun/energy/beam_rifle/update_overlays()
+ . = ..()
var/obj/item/ammo_casing/energy/primary_ammo = ammo_type[1]
if(!QDELETED(cell) && (cell.charge >= primary_ammo.e_cost))
- add_overlay(charged_overlay)
+ . += charged_overlay
else
- add_overlay(drained_overlay)
+ . += drained_overlay
/obj/item/gun/energy/beam_rifle/attack_self(mob/user)
projectile_setting_pierce = !projectile_setting_pierce
diff --git a/code/modules/projectiles/guns/misc/blastcannon.dm b/code/modules/projectiles/guns/misc/blastcannon.dm
index ae5f27377a2b..878bc373ecf5 100644
--- a/code/modules/projectiles/guns/misc/blastcannon.dm
+++ b/code/modules/projectiles/guns/misc/blastcannon.dm
@@ -41,10 +41,11 @@
user.put_in_hands(bomb)
user.visible_message(span_warning("[user] detaches [bomb] from [src]."))
bomb = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
-/obj/item/gun/blastcannon/update_icon()
+/obj/item/gun/blastcannon/update_icon(updates=ALL)
+ . = ..()
if(bomb)
icon_state = icon_state_loaded
name = "blast cannon"
@@ -65,7 +66,7 @@
return FALSE
user.visible_message(span_warning("[user] attaches [T] to [src]!"))
bomb = T
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
return ..()
@@ -94,7 +95,7 @@
var/power = bomb? calculate_bomb() : debug_power
power = min(power, max_power)
QDEL_NULL(bomb)
- update_icon()
+ update_appearance(UPDATE_ICON)
var/heavy = power * 0.25
var/medium = power * 0.5
var/light = power
diff --git a/code/modules/projectiles/guns/misc/syringe_gun.dm b/code/modules/projectiles/guns/misc/syringe_gun.dm
index 9798c722b26a..009f7232810f 100644
--- a/code/modules/projectiles/guns/misc/syringe_gun.dm
+++ b/code/modules/projectiles/guns/misc/syringe_gun.dm
@@ -18,7 +18,7 @@
/obj/item/gun/syringe/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
chambered = new /obj/item/ammo_casing/syringegun(src)
/obj/item/gun/syringe/handle_atom_del(atom/A)
@@ -37,7 +37,7 @@
/obj/item/gun/syringe/process_chamber()
if(chambered && !chambered.BB) //we just fired
recharge_newshot()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/gun/syringe/examine(mob/user)
. = ..()
@@ -71,19 +71,19 @@
to_chat(user, span_notice("You load [A] into \the [src]."))
syringes += A
recharge_newshot()
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(loc, load_sound, 40)
return TRUE
else
to_chat(user, span_warning("[src] cannot hold more syringes!"))
return FALSE
-/obj/item/gun/syringe/update_icon()
+/obj/item/gun/syringe/update_overlays()
. = ..()
if(!has_syringe_overlay)
return
var/syringe_count = syringes.len
- add_overlay("[initial(icon_state)]_[syringe_count ? clamp(syringe_count, 1, initial(max_syringes)) : "empty"]")
+ . += "[initial(icon_state)]_[syringe_count ? clamp(syringe_count, 1, initial(max_syringes)) : "empty"]"
/obj/item/gun/syringe/rapidsyringe
name = "rapid syringe gun"
@@ -124,7 +124,7 @@
to_chat(user, span_notice("You load \the [D] into \the [src]."))
syringes += D
recharge_newshot()
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(loc, load_sound, 40)
return TRUE
else
@@ -142,7 +142,7 @@
/obj/item/gun/syringe/blowgun/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
chambered = new /obj/item/ammo_casing/blowgun(src)
diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm
index 175a73c951ce..cdb90cfd1447 100644
--- a/code/modules/projectiles/projectile/magic.dm
+++ b/code/modules/projectiles/projectile/magic.dm
@@ -450,7 +450,7 @@
for(var/atom/movable/AM in contents)
C.insert(AM)
C.welded = weld
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
created = TRUE
return ..()
@@ -477,7 +477,7 @@
if(!welded)
return
icon_state = magic_icon
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/closet/decay/after_weld(weld_state)
if(weld_state)
@@ -497,7 +497,7 @@
/obj/structure/closet/decay/proc/unmagify()
icon_state = weakened_icon
- update_icon()
+ update_appearance(UPDATE_ICON)
addtimer(CALLBACK(src, PROC_REF(decay)), 15 SECONDS)
icon_welded = "welded"
diff --git a/code/modules/projectiles/projectile/reusable/arrow.dm b/code/modules/projectiles/projectile/reusable/arrow.dm
index 30058fb07342..751419a950e1 100644
--- a/code/modules/projectiles/projectile/reusable/arrow.dm
+++ b/code/modules/projectiles/projectile/reusable/arrow.dm
@@ -37,7 +37,7 @@
L.ignite_mob()
arrow.flaming = FALSE
- arrow.update_icon()
+ arrow.update_appearance(UPDATE_ICON)
/obj/item/projectile/bullet/reusable/arrow/handle_drop(atom/target)
if(dropped || !ammo_type)
diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
index d5d0914bde36..d3d6176835d8 100644
--- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
@@ -27,7 +27,6 @@
var/amount = 30
var/recharge_amount = 10
var/recharge_counter = 0
- var/mutable_appearance/beaker_overlay
var/working_state = "dispenser_working"
var/nopower_state = "dispenser_nopower"
var/has_panel_overlay = TRUE
@@ -107,7 +106,7 @@
t4_upgrade_reagents = sortList(t4_upgrade_reagents, /proc/cmp_reagents_asc)
display_reagents |= t4_upgrade_reagents
//we don't sort display_reagents again after adding these because they will fuck up the order
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/chem_dispenser/Destroy()
QDEL_NULL(beaker)
@@ -136,26 +135,26 @@
recharge_counter += delta_time
/obj/machinery/chem_dispenser/proc/display_beaker()
- var/mutable_appearance/b_o = beaker_overlay || mutable_appearance(icon, "disp_beaker")
+ var/mutable_appearance/b_o = mutable_appearance(icon, "disp_beaker")
b_o.pixel_y = -4
b_o.pixel_x = -7
return b_o
/obj/machinery/chem_dispenser/proc/work_animation()
if(working_state)
- flick(working_state,src)
+ 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)]"
- if(has_panel_overlay && panel_open)
- add_overlay(mutable_appearance(icon, "[initial(icon_state)]_panel-o"))
+/obj/machinery/chem_dispenser/update_overlays()
+ . = ..()
+ if(has_panel_overlay && panel_open)
+ . += mutable_appearance(icon, "[initial(icon_state)]_panel-o")
if(beaker)
- beaker_overlay = display_beaker()
- add_overlay(beaker_overlay)
-
-
+ var/mutable_appearance/beaker_overlay = display_beaker()
+ . += beaker_overlay
/obj/machinery/chem_dispenser/emag_act(mob/user)
if(obj_flags & EMAGGED)
@@ -347,7 +346,7 @@
if(default_unfasten_wrench(user, I))
return
if(default_deconstruction_screwdriver(user, icon_state, icon_state, I))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
if(default_deconstruction_crowbar(I))
return
@@ -375,7 +374,7 @@
replace_beaker(user, B)
to_chat(user, span_notice("You add [B] to [src]."))
updateUsrDialog()
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(user.a_intent != INTENT_HARM && !istype(I, /obj/item/card/emag))
to_chat(user, span_warning("You can't load [I] into [src]!"))
return ..()
@@ -434,7 +433,7 @@
beaker = new_beaker
else
beaker = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/chem_dispenser/on_deconstruction()
@@ -479,10 +478,10 @@
var/old = dir
. = ..()
if(dir != old)
- update_icon() // the beaker needs to be re-positioned if we rotate
+ update_appearance(UPDATE_ICON) // the beaker needs to be re-positioned if we rotate
/obj/machinery/chem_dispenser/drinks/display_beaker()
- var/mutable_appearance/b_o = beaker_overlay || mutable_appearance(icon, "disp_beaker")
+ var/mutable_appearance/b_o = mutable_appearance(icon, "disp_beaker")
switch(dir)
if(NORTH)
b_o.pixel_y = 7
@@ -493,7 +492,7 @@
if(WEST)
b_o.pixel_x = -5
b_o.pixel_y = rand(-5, 7)
- else//SOUTH
+ if(SOUTH)
b_o.pixel_y = -7
b_o.pixel_x = rand(-9, 9)
return b_o
diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm
index b7d6268b8347..b3011d3cb8d8 100644
--- a/code/modules/reagents/chemistry/machinery/chem_heater.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm
@@ -21,16 +21,17 @@
. = ..()
if(A == beaker)
beaker = null
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/chem_heater/update_icon()
+/obj/machinery/chem_heater/update_icon_state()
+ . = ..()
icon_state = "mixer[beaker ? 1 : 0][on ? "a" : "b"]"
/obj/machinery/chem_heater/CtrlClick(mob/user)
if(!user.canUseTopic(src, !issilicon(user)))
return
on = !on
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/chem_heater/AltClick(mob/living/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
@@ -47,7 +48,7 @@
beaker = new_beaker
else
beaker = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/chem_heater/RefreshParts()
@@ -91,7 +92,7 @@
replace_beaker(user, B)
to_chat(user, span_notice("You add [B] to [src]."))
updateUsrDialog()
- update_icon()
+ update_appearance(UPDATE_ICON)
return
return ..()
@@ -129,7 +130,7 @@
if("power")
on = !on
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
if("temperature")
var/target = params["target"]
var/adjust = text2num(params["adjust"])
diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm
index 177d08bc2404..468fc2593c1d 100644
--- a/code/modules/reagents/chemistry/machinery/chem_master.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_master.dm
@@ -65,14 +65,17 @@
if(A == beaker)
beaker = null
reagents.clear_reagents()
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(A == bottle)
bottle = null
-/obj/machinery/chem_master/update_icon()
- cut_overlays()
+/obj/machinery/chem_master/update_overlays()
+ . = ..()
if (stat & BROKEN)
- add_overlay("waitlight")
+ . += "waitlight"
+
+/obj/machinery/chem_master/update_icon_state()
+ . = ..()
if(beaker)
icon_state = "mixer1"
else
@@ -103,7 +106,7 @@
replace_beaker(user, B)
to_chat(user, span_notice("You add [B] to [src]."))
updateUsrDialog()
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(!condi && istype(I, /obj/item/storage/pill_bottle))
if(bottle)
to_chat(user, span_warning("A pill bottle is already loaded into [src]!"))
@@ -131,7 +134,7 @@
beaker = new_beaker
else
beaker = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/chem_master/on_deconstruction()
diff --git a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
index 4bc6fd486e40..9fcf3822a6e7 100644
--- a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
@@ -53,7 +53,7 @@
var/input = text2num(params["amount"])
if(input)
amount = input
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/chem_dispenser/chem_synthesizer/proc/find_reagent(input)
. = FALSE
diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm
index 59b9f2a427f9..a3f76dc58395 100644
--- a/code/modules/reagents/chemistry/machinery/pandemic.dm
+++ b/code/modules/reagents/chemistry/machinery/pandemic.dm
@@ -17,7 +17,7 @@
/obj/machinery/computer/pandemic/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/computer/pandemic/Destroy()
QDEL_NULL(beaker)
@@ -42,7 +42,7 @@
/obj/machinery/computer/pandemic/handle_atom_del(atom/A)
if(A == beaker)
beaker = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return ..()
/obj/machinery/computer/pandemic/proc/get_by_index(thing, index)
@@ -122,25 +122,28 @@
/obj/machinery/computer/pandemic/proc/reset_replicator_cooldown()
wait = FALSE
- update_icon()
+ update_appearance(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"]"
+
+/obj/machinery/computer/pandemic/update_overlays()
+ . = ..()
+ if(stat & BROKEN)
+ return
if(wait)
- add_overlay("waitlight")
- else
- cut_overlays()
+ . += "waitlight"
/obj/machinery/computer/pandemic/proc/eject_beaker()
if(beaker)
beaker.forceMove(drop_location())
beaker = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/computer/pandemic/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
@@ -215,7 +218,7 @@
B.desc = "A small bottle. Contains [A.agent] culture in synthblood medium."
B.reagents.add_reagent(/datum/reagent/blood, 20, data)
wait = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
var/turf/source_turf = get_turf(src)
log_virus("A culture bottle was printed for the virus [A.admin_details()] at [loc_name(source_turf)] by [key_name(usr)]")
addtimer(CALLBACK(src, PROC_REF(reset_replicator_cooldown)), 50)
@@ -229,7 +232,7 @@
B.name = "[D.name] vaccine bottle"
B.reagents.add_reagent(/datum/reagent/vaccine, 15, list(id))
wait = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
addtimer(CALLBACK(src, PROC_REF(reset_replicator_cooldown)), 200)
. = TRUE
@@ -247,7 +250,7 @@
beaker = I
to_chat(user, span_notice("You insert [I] into [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else
return ..()
diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
index 8be38a4680d0..59513d3e86d7 100644
--- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
+++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
@@ -37,7 +37,7 @@
. = ..()
holdingitems = list()
QDEL_NULL(container)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/reagentgrinder/Destroy()
if(container)
@@ -89,7 +89,7 @@
. = ..()
if(A == container)
container = null
- update_icon()
+ update_appearance(UPDATE_ICON)
if(holdingitems[A])
holdingitems -= A
@@ -99,11 +99,11 @@
AM.forceMove(drop_location())
holdingitems = list()
-/obj/machinery/reagentgrinder/update_icon()
+/obj/machinery/reagentgrinder/update_icon_state()
+ . = ..()
if(!container)
icon_state = "juicer"
return
-
if(istype(container, /obj/item/reagent_containers/glass/mixbowl))
icon_state = "juicer_bowl"
else
@@ -118,7 +118,7 @@
container = new_container
else
container = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/reagentgrinder/attackby(obj/item/I, mob/user, params)
@@ -142,7 +142,7 @@
return
replace_container(user, B)
to_chat(user, span_notice("You add [B] to [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE //no afterattack
if(holdingitems.len >= limit)
diff --git a/code/modules/reagents/chemistry/machinery/smoke_machine.dm b/code/modules/reagents/chemistry/machinery/smoke_machine.dm
index b883fedc1ed1..baa3ad4c796d 100644
--- a/code/modules/reagents/chemistry/machinery/smoke_machine.dm
+++ b/code/modules/reagents/chemistry/machinery/smoke_machine.dm
@@ -36,7 +36,8 @@
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"
@@ -44,7 +45,6 @@
icon_state = "smoke0"
else
icon_state = "smoke1"
- return ..()
/obj/machinery/smoke_machine/RefreshParts()
var/new_volume = REAGENTS_BASE_VOLUME
@@ -70,12 +70,12 @@
return
if(reagents.total_volume == 0)
on = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
return
var/turf/location = get_turf(src)
var/smoke_test = locate(/obj/effect/particle_effect/fluid/smoke) in location
if(on && !smoke_test)
- update_icon()
+ update_appearance(UPDATE_ICON)
var/datum/effect_system/fluid_spread/smoke/chem/smoke_machine/smoke = new()
smoke.set_up(setting * 3, location = location, carry = reagents, efficiency = efficiency)
smoke.start()
@@ -131,7 +131,7 @@
switch(action)
if("purge")
reagents.clear_reagents()
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("setting")
var/amount = text2num(params["amount"])
@@ -140,7 +140,7 @@
. = TRUE
if("power")
on = !on
- update_icon()
+ update_appearance(UPDATE_ICON)
if(on)
message_admins("[ADMIN_LOOKUPFLW(usr)] activated a smoke machine that contains [english_list(reagents.reagent_list)] at [ADMIN_VERBOSEJMP(src)].")
log_game("[key_name(usr)] activated a smoke machine that contains [english_list(reagents.reagent_list)] at [AREACOORD(src)].")
diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm
index 0eb2e1075a5f..1eba0a7713dc 100644
--- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm
+++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm
@@ -438,9 +438,9 @@
if(slime.docile) //Undoes docility, but doesn't make rabid.
slime.visible_message(span_danger("[slime] forgets its training, becoming wild once again!"))
slime.docile = FALSE
- slime.update_name()
+ slime.update_appearance(UPDATE_NAME)
continue
- slime.rabid = 1
+ slime.rabid = TRUE
slime.visible_message(span_danger("The [slime] is driven into a frenzy!"))
..()
diff --git a/code/modules/reagents/chemistry/recipes/special.dm b/code/modules/reagents/chemistry/recipes/special.dm
index 96054f949928..3419ba010036 100644
--- a/code/modules/reagents/chemistry/recipes/special.dm
+++ b/code/modules/reagents/chemistry/recipes/special.dm
@@ -208,4 +208,4 @@ GLOBAL_LIST_INIT(food_reagents, build_reagents_to_food()) //reagentid = related
dat += " above [recipe.required_temp] degrees"
dat += "."
info = dat.Join("")
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm
index 633b94a1001b..e3643b8016dd 100644
--- a/code/modules/reagents/reagent_containers/blood_pack.dm
+++ b/code/modules/reagents/reagent_containers/blood_pack.dm
@@ -57,7 +57,7 @@
. = ..()
if(blood_type != null)
reagents.add_reagent(unique_blood ? unique_blood : /datum/reagent/blood, 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=blood_type,"resistances"=null,"trace_chem"=null))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/reagent_containers/blood/on_reagent_change(changetype)
if(reagents)
@@ -69,7 +69,7 @@
else
blood_type = null
update_pack_name()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/reagent_containers/blood/proc/update_pack_name()
if(!labelled)
@@ -78,15 +78,15 @@
else
name = "blood pack"
-/obj/item/reagent_containers/blood/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/blood/update_overlays()
+ . = ..()
var/v = min(round(reagents.total_volume / volume * 10), 10)
if(v > 0)
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "bloodpack1")
filling.icon_state = "bloodpack[v]"
filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
+ . += filling
/obj/item/reagent_containers/blood/random
icon_state = "random_bloodpack"
@@ -141,4 +141,4 @@
labelled = 0
update_pack_name()
else
- return ..()
\ No newline at end of file
+ return ..()
diff --git a/code/modules/reagents/reagent_containers/borghypo.dm b/code/modules/reagents/reagent_containers/borghypo.dm
index 31ef33730ecc..9568d4d14527 100644
--- a/code/modules/reagents/reagent_containers/borghypo.dm
+++ b/code/modules/reagents/reagent_containers/borghypo.dm
@@ -55,7 +55,8 @@ Borg Hypospray
regenerate_reagents()
charge_timer = 0
- //update_icon()
+ update_appearance(UPDATE_ICON)
+ . = ..()
return 1
// Use this to add more chemicals for the borghypo to produce.
diff --git a/code/modules/reagents/reagent_containers/bottle.dm b/code/modules/reagents/reagent_containers/bottle.dm
index 916c955288e0..279950f7505d 100644
--- a/code/modules/reagents/reagent_containers/bottle.dm
+++ b/code/modules/reagents/reagent_containers/bottle.dm
@@ -15,33 +15,34 @@
. = ..()
if(!icon_state)
icon_state = "bottle"
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/reagent_containers/glass/bottle/on_reagent_change(changetype)
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/reagent_containers/glass/bottle/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/glass/bottle/update_overlays()
+ . = ..()
if(!filling_icon_state)
filling_icon_state = icon_state
- if(reagents.total_volume)
- var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[filling_icon_state]-10")
-
- var/percent = round((reagents.total_volume / volume) * 100)
- switch(percent)
- if(0 to 9)
- filling.icon_state = "[filling_icon_state]-10"
- if(10 to 29)
- filling.icon_state = "[filling_icon_state]25"
- if(30 to 49)
- filling.icon_state = "[filling_icon_state]50"
- if(50 to 69)
- filling.icon_state = "[filling_icon_state]75"
- if(70 to INFINITY)
- filling.icon_state = "[filling_icon_state]100"
-
- filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
+ if(!reagents.total_volume)
+ return
+ var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[filling_icon_state]-10")
+
+ var/percent = round((reagents.total_volume / volume) * 100)
+ switch(percent)
+ if(0 to 9)
+ filling.icon_state = "[filling_icon_state]-10"
+ if(10 to 29)
+ filling.icon_state = "[filling_icon_state]25"
+ if(30 to 49)
+ filling.icon_state = "[filling_icon_state]50"
+ if(50 to 69)
+ filling.icon_state = "[filling_icon_state]75"
+ if(70 to INFINITY)
+ filling.icon_state = "[filling_icon_state]100"
+
+ filling.color = mix_color_from_reagents(reagents.reagent_list)
+ . += filling
/obj/item/reagent_containers/glass/bottle/epinephrine
name = "epinephrine bottle"
diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm
index 640716e6e1b8..95fc24b7c089 100644
--- a/code/modules/reagents/reagent_containers/dropper.dm
+++ b/code/modules/reagents/reagent_containers/dropper.dm
@@ -44,7 +44,7 @@
span_userdanger("[user] tries to squirt something into [target]'s eyes, but fails!"))
to_chat(user, span_notice("You transfer [trans] unit\s of the solution."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return
else if(isalien(target)) //hiss-hiss has no eyes!
to_chat(target, span_danger("[target] does not seem to have any eyes!"))
@@ -82,7 +82,7 @@
trans = src.reagents.trans_to(target, amount_per_transfer_from_this, transfered_by = user)
to_chat(user, span_notice("You transfer [trans] unit\s of the solution."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else
@@ -98,11 +98,11 @@
to_chat(user, span_notice("You fill [src] with [trans] unit\s of the solution."))
- update_icon()
+ update_appearance(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)
+ . += filling
diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm
index 0d4d5a14eeae..e9b44fa45d48 100755
--- a/code/modules/reagents/reagent_containers/glass.dm
+++ b/code/modules/reagents/reagent_containers/glass.dm
@@ -119,39 +119,39 @@
/obj/item/reagent_containers/glass/beaker/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/reagent_containers/glass/beaker/get_part_rating()
return reagents.maximum_volume
/obj/item/reagent_containers/glass/beaker/on_reagent_change(changetype)
- update_icon()
-
-/obj/item/reagent_containers/glass/beaker/update_icon()
- cut_overlays()
-
- if(reagents.total_volume)
- var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[icon_state]10")
-
- var/percent = round((reagents.total_volume / volume) * 100)
- switch(percent)
- if(0 to 9)
- filling.icon_state = "[icon_state]-10"
- if(10 to 24)
- filling.icon_state = "[icon_state]10"
- if(25 to 49)
- filling.icon_state = "[icon_state]25"
- if(50 to 74)
- filling.icon_state = "[icon_state]50"
- if(75 to 79)
- filling.icon_state = "[icon_state]75"
- if(80 to 90)
- filling.icon_state = "[icon_state]80"
- if(91 to INFINITY)
- filling.icon_state = "[icon_state]100"
-
- filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
+ update_appearance(UPDATE_ICON)
+
+/obj/item/reagent_containers/glass/beaker/update_overlays()
+ . = ..()
+ if(!reagents.total_volume)
+ return
+ var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[icon_state]10")
+
+ var/percent = round((reagents.total_volume / volume) * 100)
+ switch(percent)
+ if(0 to 9)
+ filling.icon_state = "[icon_state]-10"
+ if(10 to 24)
+ filling.icon_state = "[icon_state]10"
+ if(25 to 49)
+ filling.icon_state = "[icon_state]25"
+ if(50 to 74)
+ filling.icon_state = "[icon_state]50"
+ if(75 to 79)
+ filling.icon_state = "[icon_state]75"
+ if(80 to 90)
+ filling.icon_state = "[icon_state]80"
+ if(91 to INFINITY)
+ filling.icon_state = "[icon_state]100"
+
+ filling.color = mix_color_from_reagents(reagents.reagent_list)
+ . += filling
/obj/item/reagent_containers/glass/beaker/jar
name = "honey jar"
@@ -177,9 +177,9 @@
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()
+/obj/item/reagent_containers/glass/beaker/plastic/update_icon_state()
icon_state = "beakerlarge" // hack to lets us reuse the large beaker reagent fill states
- ..()
+ . = ..()
icon_state = "beakerwhite"
/obj/item/reagent_containers/glass/beaker/meta
@@ -422,29 +422,29 @@
/obj/item/reagent_containers/glass/mixbowl/on_reagent_change(changetype)
..()
- update_icon()
-
-/obj/item/reagent_containers/glass/mixbowl/update_icon()
- cut_overlays()
-
- if(reagents.total_volume)
- var/mutable_appearance/filling = mutable_appearance('yogstation/icons/obj/reagentfillings.dmi', "[icon_state]11")
-
- var/percent = round((reagents.total_volume / volume) * 100)
- switch(percent)
- if(0 to 9)
- filling.icon_state = "[icon_state]0"
- if(10 to 24)
- filling.icon_state = "[icon_state]10"
- if(25 to 49)
- filling.icon_state = "[icon_state]25"
- if(50 to 74)
- filling.icon_state = "[icon_state]50"
- if(75 to INFINITY)
- filling.icon_state = "[icon_state]75"
-
- filling.color = mix_color_from_reagents(reagents.reagent_list)
- add_overlay(filling)
+ update_appearance(UPDATE_ICON)
+
+/obj/item/reagent_containers/glass/mixbowl/update_overlays()
+ . = ..()
+ if(!reagents.total_volume)
+ return
+ var/mutable_appearance/filling = mutable_appearance('yogstation/icons/obj/reagentfillings.dmi', "[icon_state]11")
+
+ var/percent = round((reagents.total_volume / volume) * 100)
+ switch(percent)
+ if(0 to 9)
+ filling.icon_state = "[icon_state]0"
+ if(10 to 24)
+ filling.icon_state = "[icon_state]10"
+ if(25 to 49)
+ filling.icon_state = "[icon_state]25"
+ if(50 to 74)
+ filling.icon_state = "[icon_state]50"
+ if(75 to INFINITY)
+ filling.icon_state = "[icon_state]75"
+
+ filling.color = mix_color_from_reagents(reagents.reagent_list)
+ . += filling
/obj/item/reagent_containers/glass/urn
name = "urn"
diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm
index 685083f3619f..8843183d70da 100644
--- a/code/modules/reagents/reagent_containers/hypospray.dm
+++ b/code/modules/reagents/reagent_containers/hypospray.dm
@@ -126,7 +126,7 @@
if(!iscyborg(user))
reagents.maximum_volume = 0 //Makes them useless afterwards
reagents.flags = NONE
- update_icon()
+ update_appearance(UPDATE_ICON)
addtimer(CALLBACK(src, PROC_REF(cyborg_recharge), user), 80)
/obj/item/reagent_containers/autoinjector/medipen/proc/cyborg_recharge(mob/living/silicon/robot/user)
@@ -134,9 +134,10 @@
var/mob/living/silicon/robot/R = user
if(R.cell.use(100))
reagents.add_reagent_list(list_reagents)
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/reagent_containers/autoinjector/medipen/update_icon()
+/obj/item/reagent_containers/autoinjector/medipen/update_icon_state()
+ . = ..()
if(reagents.total_volume > 0)
icon_state = initial(icon_state)
else
@@ -304,33 +305,35 @@
if(ispath(container))
container = new container
antispam = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/hypospray/update_icon()
- ..()
- cut_overlays()
+/obj/item/hypospray/update_icon(updates=ALL)
+ . = ..()
if(ismob(loc))
var/mob/M = loc
M.update_inv_hands()
- if(container?.reagents?.total_volume)
- var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[icon_state]-10")
-
- var/percent = round((container.reagents.total_volume / container.volume) * 100)
- switch(percent)
- if(0 to 9)
- filling.icon_state = "[icon_state]-10"
- if(10 to 29)
- filling.icon_state = "[icon_state]25"
- if(30 to 49)
- filling.icon_state = "[icon_state]50"
- if(50 to 69)
- filling.icon_state = "[icon_state]75"
- if(70 to INFINITY)
- filling.icon_state = "[icon_state]100"
-
- filling.color = mix_color_from_reagents(container.reagents.reagent_list)
- add_overlay(filling)
- return
+
+/obj/item/hypospray/update_overlays()
+ . = ..()
+ if(!container?.reagents?.total_volume)
+ return
+ var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[icon_state]-10")
+
+ var/percent = round((container.reagents.total_volume / container.volume) * 100)
+ switch(percent)
+ if(0 to 9)
+ filling.icon_state = "[icon_state]-10"
+ if(10 to 29)
+ filling.icon_state = "[icon_state]25"
+ if(30 to 49)
+ filling.icon_state = "[icon_state]50"
+ if(50 to 69)
+ filling.icon_state = "[icon_state]75"
+ if(70 to INFINITY)
+ filling.icon_state = "[icon_state]100"
+
+ filling.color = mix_color_from_reagents(container.reagents.reagent_list)
+ . += filling
/obj/item/hypospray/examine(mob/user)
. = ..()
@@ -352,7 +355,7 @@
user.put_in_hands(container)
to_chat(user, span_notice("You remove [container] from [src]."))
container = null
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(loc, pick(eject_sound), 50, 1)
else
to_chat(user, span_notice("This hypo isn't loaded!"))
@@ -373,7 +376,7 @@
unload_hypo(user)
container = V
user.visible_message(span_notice("[user] has loaded [container] into [src]."),span_notice("You have loaded [container] into [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(loc, pick(load_sound), 35, 1)
return TRUE
else
@@ -430,7 +433,7 @@
if(HYPO_DRAW)
draw(target, user)
antispam = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/hypospray/proc/inject(mob/living/carbon/target, mob/user)
//Initial Checks/Logging
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index d338a4a87afb..52f7d7da604e 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -21,28 +21,28 @@
. = ..()
if(list_reagents) //syringe starts in inject mode if its already got something inside
mode = SYRINGE_INJECT
- update_icon()
+ update_appearance(UPDATE_ICON)
RegisterSignal(src, COMSIG_ITEM_EMBED_TICK, PROC_REF(embed_inject))
/obj/item/reagent_containers/syringe/on_reagent_change(changetype)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/reagent_containers/syringe/pickup(mob/user)
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/reagent_containers/syringe/dropped(mob/user)
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/reagent_containers/syringe/attack_self(mob/user)
mode = !mode
- update_icon()
+ update_appearance(UPDATE_ICON)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/reagent_containers/syringe/attack_hand()
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/reagent_containers/syringe/attack_paw(mob/user)
return attack_hand(user)
@@ -103,7 +103,7 @@
to_chat(user, span_notice("You fill [src] with [trans] units of the solution. It now contains [reagents.total_volume] units."))
if (reagents.total_volume >= reagents.maximum_volume)
mode=!mode
- update_icon()
+ update_appearance(UPDATE_ICON)
if(SYRINGE_INJECT)
// Always log attemped injections for admins
@@ -165,17 +165,16 @@
to_chat(user, span_notice("You inject [amount_per_transfer_from_this] units of the solution. The syringe now contains [reagents.total_volume] units."))
if (reagents.total_volume <= 0 && mode==SYRINGE_INJECT)
mode = SYRINGE_DRAW
- update_icon()
+ update_appearance(UPDATE_ICON)
-
-/obj/item/reagent_containers/syringe/update_icon()
- cut_overlays()
+/obj/item/reagent_containers/syringe/update_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)
+ . += filling_overlay
else
rounded_vol = 0
icon_state = "[rounded_vol]"
@@ -188,7 +187,7 @@
injoverlay = "draw"
if (SYRINGE_INJECT)
injoverlay = "inject"
- add_overlay(injoverlay)
+ . += injoverlay
M.update_inv_hands()
/obj/item/reagent_containers/syringe/proc/embed_inject(target, mob/living/carbon/human/embedde, obj/item/bodypart/part)
diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm
index 0350cdd533c2..bdd330317f78 100644
--- a/code/modules/reagents/reagent_dispenser.dm
+++ b/code/modules/reagents/reagent_dispenser.dm
@@ -101,7 +101,7 @@
reagents.trans_to(W, W.max_fuel, transfered_by = user)
user.visible_message(span_notice("[user] refills [user.p_their()] [W.name]."), span_notice("You refill [W]."))
playsound(src, 'sound/effects/refill.ogg', 50, 1)
- W.update_icon()
+ W.update_appearance(UPDATE_ICON)
else
user.visible_message(span_warning("[user] catastrophically fails at refilling [user.p_their()] [W.name]!"), span_userdanger("That was stupid of you."))
diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm
index e53ad86b9a7b..fad188faca75 100644
--- a/code/modules/recycling/conveyor2.dm
+++ b/code/modules/recycling/conveyor2.dm
@@ -121,7 +121,8 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
movedir = backwards
update()
-/obj/machinery/conveyor/update_icon()
+/obj/machinery/conveyor/update_icon_state()
+ . = ..()
if(!operating)
icon_state = "conveyor[inverted ? "-0" : "0"]"
else
@@ -132,7 +133,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
if(stat & NOPOWER)
operating = FALSE
. = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
// machine process
// move items to the target location
@@ -197,7 +198,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
inverted = !inverted
update_move_direction()
to_chat(user, span_notice("You set [src]'s direction [inverted ? "backwards" : "back to default"]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(I.tool_behaviour == TOOL_MULTITOOL)
switch(conveytime)
@@ -253,7 +254,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
. = ..()
if (newid)
id = newid
- update_icon()
+ update_appearance(UPDATE_ICON)
LAZYADD(GLOB.conveyors_by_id[id], src)
/obj/machinery/conveyor_switch/Destroy()
@@ -271,13 +272,14 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
// update the icon depending on the position
-/obj/machinery/conveyor_switch/update_icon()
- if(position<0)
+/obj/machinery/conveyor_switch/update_icon_state()
+ . = ..()
+ if(position < 0)
if(invert_icon)
icon_state = "switch-fwd"
else
icon_state = "switch-rev"
- else if(position>0)
+ else if(position > 0)
if(invert_icon)
icon_state = "switch-rev"
else
@@ -297,7 +299,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
for(var/obj/machinery/conveyor/C in GLOB.conveyors_by_id[id])
C.operating = position
C.update_move_direction()
- C.update_icon()
+ C.update_appearance(UPDATE_ICON)
CHECK_TICK
// attack with hand, switch position
@@ -319,13 +321,13 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
position = 0
operated = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
// find any switches with same id as this one, and set their positions to match us
for(var/obj/machinery/conveyor_switch/S in GLOB.conveyors_by_id[id])
S.invert_icon = invert_icon
S.position = position
- S.update_icon()
+ S.update_appearance(UPDATE_ICON)
CHECK_TICK
/obj/machinery/conveyor_switch/attackby(obj/item/I, mob/user, params)
diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm
index bab1c389c7b8..38031365e711 100644
--- a/code/modules/recycling/disposal/bin.dm
+++ b/code/modules/recycling/disposal/bin.dm
@@ -39,7 +39,7 @@
air_contents = new /datum/gas_mixture()
//gas.volume = 1.05 * CELLSTANDARD
- update_icon()
+ update_appearance(UPDATE_ICON)
return INITIALIZE_HINT_LATELOAD //we need turfs to have air
@@ -96,7 +96,7 @@
if((I.item_flags & ABSTRACT) || !user.temporarilyRemoveItemFromInventory(I))
return
place_item_in_disposal(I, user)
- update_icon()
+ update_appearance(UPDATE_ICON)
return 1 //no afterattack
else
return ..()
@@ -140,7 +140,7 @@
target.visible_message(span_danger("[user] has placed [target] in [src]."), span_userdanger("[user] has placed [target] in [src]."))
log_combat(user, target, "stuffed", addition="into [src]")
target.LAssailant = WEAKREF(user)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/disposal/relaymove(mob/user)
attempt_escape(user)
@@ -157,14 +157,14 @@
// leave the disposal
/obj/machinery/disposal/proc/go_out(mob/user)
user.forceMove(loc)
- update_icon()
+ update_appearance(UPDATE_ICON)
// monkeys and xenos can only pull the flush lever
/obj/machinery/disposal/attack_paw(mob/user)
if(stat & BROKEN)
return
flush = !flush
- update_icon()
+ update_appearance(UPDATE_ICON)
// eject the contents of the disposal unit
@@ -173,11 +173,12 @@
for(var/atom/movable/AM in src)
AM.forceMove(T)
AM.pipe_eject(0)
- update_icon()
+ update_appearance(UPDATE_ICON)
// update the icon & overlays to reflect mode & status
-/obj/machinery/disposal/update_icon()
- return
+/obj/machinery/disposal/Initialize(mapload, obj/structure/disposalconstruct/make_from)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/machinery/disposal/proc/flush()
flushing = TRUE
@@ -233,7 +234,7 @@
src.transfer_fingerprints_to(stored)
stored.anchored = FALSE
stored.density = TRUE
- stored.update_icon()
+ stored.update_appearance(UPDATE_ICON)
for(var/atom/movable/AM in src) //out, out, darned crowbar!
AM.forceMove(T)
..()
@@ -273,8 +274,8 @@
to_chat(user, span_warning("You empty the bag."))
for(var/obj/item/O in T.contents)
STR.remove_from_storage(O,src)
- T.update_icon()
- update_icon()
+ T.update_appearance(UPDATE_ICON)
+ update_appearance(UPDATE_ICON)
else
return ..()
@@ -285,7 +286,7 @@
if(!user.canUseTopic(src, TRUE))
return
flush = !flush
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/disposal/bin/ui_state(mob/user)
return GLOB.notcontained_state
@@ -315,22 +316,22 @@
switch(action)
if("handle-0")
flush = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("handle-1")
if(!panel_open)
flush = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("pump-0")
if(pressure_charging)
pressure_charging = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("pump-1")
if(!pressure_charging)
pressure_charging = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
if("eject")
eject()
@@ -346,7 +347,7 @@
visible_message(span_notice("[AM] lands in [src] and triggers the flush system!."))
else
visible_message(span_notice("[AM] lands in [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
else
visible_message(span_notice("[AM] bounces off of [src]'s rim!"))
return ..()
@@ -357,10 +358,10 @@
..()
full_pressure = FALSE
pressure_charging = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/disposal/bin/update_icon()
- cut_overlays()
+/obj/machinery/disposal/bin/update_overlays()
+ . = ..()
if(stat & BROKEN)
pressure_charging = FALSE
flush = FALSE
@@ -368,7 +369,7 @@
//flush handle
if(flush)
- add_overlay("dispover-handle")
+ . += "dispover-handle"
//only handle is shown if no power
if(stat & NOPOWER || panel_open)
@@ -376,13 +377,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
@@ -435,7 +436,7 @@
if(air_contents.return_pressure() >= SEND_PRESSURE)
full_pressure = TRUE
pressure_charging = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
return
/obj/machinery/disposal/bin/get_remote_view_fullscreens(mob/user)
diff --git a/code/modules/recycling/disposal/construction.dm b/code/modules/recycling/disposal/construction.dm
index 7697a7036590..42d680720e3f 100644
--- a/code/modules/recycling/disposal/construction.dm
+++ b/code/modules/recycling/disposal/construction.dm
@@ -32,7 +32,7 @@
if(flip)
rotcomp.BaseRot(null,ROTATION_FLIP)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/disposalconstruct/Move()
var/old_dir = dir
@@ -40,7 +40,8 @@
setDir(old_dir) //pipes changing direction when moved is just annoying and buggy
// update iconstate and dpdir due to dir and type
-/obj/structure/disposalconstruct/update_icon()
+/obj/structure/disposalconstruct/update_icon_state()
+ . = ..()
icon_state = initial(pipe_type.icon_state)
if(is_pipe())
icon_state = "con[icon_state]"
@@ -63,7 +64,7 @@
// change visibility status and force update of icon
/obj/structure/disposalconstruct/hide(intact)
invisibility = (intact && level==1) ? INVISIBILITY_MAXIMUM: 0 // hide if floor is intact
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/disposalconstruct/proc/get_disposal_dir()
if(!is_pipe())
@@ -94,7 +95,7 @@
if(dir in GLOB.diagonals) // Fix RPD-induced diagonal turning
setDir(turn(dir, 45))
pipe_type = initial(temp.flip_type)
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/disposalconstruct/proc/can_be_rotated(mob/user,rotation_type)
if(anchored)
@@ -147,7 +148,7 @@
density = initial(pipe_type.density)
to_chat(user, span_notice("You attach the [pipename] to the underfloor."))
I.play_tool_sound(src, 100)
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/structure/disposalconstruct/welder_act(mob/living/user, obj/item/I)
diff --git a/code/modules/religion/religion_structures.dm b/code/modules/religion/religion_structures.dm
index c69675312af7..8a0879a510bd 100644
--- a/code/modules/religion/religion_structures.dm
+++ b/code/modules/religion/religion_structures.dm
@@ -64,11 +64,12 @@
to_chat(user, span_notice("The liquid feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards."))
user.reagents.add_reagent(/datum/reagent/medicine/omnizine/godblood,10) //Hurts your brain and makes you go insane
user.reagents.add_reagent(/datum/reagent/toxin/mindbreaker,10) //However, it gives rather potent healing.
- update_icon()
+ update_appearance(UPDATE_ICON)
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom/, update_icon)), time_between_uses)
-/obj/structure/holyfountain/update_icon()
+/obj/structure/holyfountain/update_icon_state()
+ . = ..()
if(last_process + time_between_uses > world.time)
icon_state = "fountain"
else
diff --git a/code/modules/research/designs/biogenerator_designs.dm b/code/modules/research/designs/biogenerator_designs.dm
index e393517e71ae..54d8b8778027 100644
--- a/code/modules/research/designs/biogenerator_designs.dm
+++ b/code/modules/research/designs/biogenerator_designs.dm
@@ -191,7 +191,7 @@
id = "rollingpapers"
build_type = BIOGENERATOR
materials = list(/datum/material/biomass = 50)
- build_path = /obj/item/storage/box/fancy/rollingpapers
+ build_path = /obj/item/storage/fancy/rollingpapers
category = list("initial", "Organic Materials")
/datum/design/cloth
diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm
index 45f8e8afc293..c2ce73940991 100644
--- a/code/modules/research/destructive_analyzer.dm
+++ b/code/modules/research/destructive_analyzer.dm
@@ -48,10 +48,11 @@ Note: Must be placed within 3 tiles of the R&D Console
linked_console.updateUsrDialog()
/obj/machinery/rnd/destructive_analyzer/proc/finish_loading()
- update_icon()
+ update_appearance(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
@@ -94,7 +95,7 @@ Note: Must be placed within 3 tiles of the R&D Console
else
qdel(thing)
if (!innermode)
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/rnd/destructive_analyzer/proc/user_try_decon_id(id, mob/user)
@@ -150,5 +151,5 @@ Note: Must be placed within 3 tiles of the R&D Console
return FALSE
loaded_item.forceMove(get_turf(src))
loaded_item = null
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm
index 7d6c2fc83e70..d4e18bc08cf1 100644
--- a/code/modules/research/experimentor.dm
+++ b/code/modules/research/experimentor.dm
@@ -563,13 +563,14 @@
addtimer(CALLBACK(src, PROC_REF(reset_exp)), resetTime)
/obj/machinery/rnd/experimentor/proc/reset_exp()
- update_icon()
+ update_appearance(UPDATE_ICON)
recentlyExperimented = FALSE
if(autoexperiment)
do_experiment()
-/obj/machinery/rnd/experimentor/update_icon()
- icon_state = "h_lathe"
+/obj/machinery/rnd/experimentor/update_icon_state()
+ . = ..()
+ icon_state = initial(icon_state)
/obj/machinery/rnd/experimentor/proc/warn_admins(user, ReactionName)
var/turf/T = get_turf(user)
diff --git a/code/modules/research/nanites/nanite_chamber.dm b/code/modules/research/nanites/nanite_chamber.dm
index 305f9711f963..f7dec9341ae9 100644
--- a/code/modules/research/nanites/nanite_chamber.dm
+++ b/code/modules/research/nanites/nanite_chamber.dm
@@ -38,7 +38,7 @@
busy = status
busy_message = message
busy_icon_state = working_icon
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/nanite_chamber/proc/set_safety(threshold)
if(!occupant)
@@ -104,19 +104,19 @@
return
SEND_SIGNAL(occupant, COMSIG_NANITE_DELETE)
-/obj/machinery/nanite_chamber/update_icon()
- cut_overlays()
+/obj/machinery/nanite_chamber/update_overlays()
+ . = ..()
if((stat & MAINT) || panel_open)
- add_overlay("maint")
+ . += "maint"
else if(!(stat & (NOPOWER|BROKEN)))
if(busy || locked)
- add_overlay("red")
+ . += "red"
if(locked)
- add_overlay("bolted")
+ . += "bolted"
else
- add_overlay("green")
+ . += "green"
//running and someone in there
if(occupant)
@@ -188,7 +188,7 @@
/obj/machinery/nanite_chamber/attackby(obj/item/I, mob/user, params)
if(!occupant && default_deconstruction_screwdriver(user, icon_state, icon_state, I))//sent icon_state is irrelevant...
- update_icon()//..since we're updating the icon here, since the scanner can be unpowered when opened/closed
+ update_appearance(UPDATE_ICON)//..since we're updating the icon here, since the scanner can be unpowered when opened/closed
return
if(default_pry_open(I))
diff --git a/code/modules/research/nanites/nanite_chamber_computer.dm b/code/modules/research/nanites/nanite_chamber_computer.dm
index f244b96d6aee..9fc62c1ce89c 100644
--- a/code/modules/research/nanites/nanite_chamber_computer.dm
+++ b/code/modules/research/nanites/nanite_chamber_computer.dm
@@ -122,7 +122,7 @@
switch(action)
if("toggle_lock")
chamber.locked = !chamber.locked
- chamber.update_icon()
+ chamber.update_appearance(UPDATE_ICON)
. = TRUE
if("eject")
eject(usr)
diff --git a/code/modules/research/nanites/nanite_remote.dm b/code/modules/research/nanites/nanite_remote.dm
index ad787af0069f..842afaa2ec7e 100644
--- a/code/modules/research/nanites/nanite_remote.dm
+++ b/code/modules/research/nanites/nanite_remote.dm
@@ -33,7 +33,7 @@
if(allowed(user))
to_chat(user, span_notice("You unlock [src]."))
locked = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("Access denied."))
@@ -44,15 +44,14 @@
obj_flags |= EMAGGED
if(locked)
locked = FALSE
- update_icon()
+ update_appearance(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)
@@ -166,7 +165,7 @@
if("lock")
if(!(obj_flags & EMAGGED))
locked = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
. = TRUE
diff --git a/code/modules/research/nanites/public_chamber.dm b/code/modules/research/nanites/public_chamber.dm
index 5451fdd8e952..a90708d6f12e 100644
--- a/code/modules/research/nanites/public_chamber.dm
+++ b/code/modules/research/nanites/public_chamber.dm
@@ -30,7 +30,7 @@
/obj/machinery/public_nanite_chamber/proc/set_busy(status, working_icon)
busy = status
busy_icon_state = working_icon
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/public_nanite_chamber/proc/inject_nanites(mob/living/attacker)
if(stat & (NOPOWER|BROKEN))
@@ -60,32 +60,29 @@
log_combat(attacker, occupant, "injected", null, "with nanites via [src]")
occupant.AddComponent(/datum/component/nanites, 75, cloud_id)
-/obj/machinery/public_nanite_chamber/update_icon()
- cut_overlays()
+/obj/machinery/public_nanite_chamber/update_overlays()
+ . = ..()
if((stat & MAINT) || panel_open)
- add_overlay("maint")
+ . += "maint"
else if(!(stat & (NOPOWER|BROKEN)))
if(busy || locked)
- add_overlay("red")
+ . += "red"
if(locked)
- add_overlay("bolted")
+ . += "bolted"
else
- add_overlay("green")
-
-
+ . += "green"
- //running and someone in there
- if(occupant)
- if(busy)
- icon_state = busy_icon_state
- else
- icon_state = initial(icon_state)+ "_occupied"
+/obj/machinery/public_nanite_chamber/update_icon_state()
+ . = ..()
+ if(!occupant)
+ icon_state = initial(icon_state)+ (state_open ? "_open" : "")
return
-
- //running
- icon_state = initial(icon_state)+ (state_open ? "_open" : "")
+ if(busy)
+ icon_state = busy_icon_state
+ else
+ icon_state = initial(icon_state)+ "_occupied"
/obj/machinery/public_nanite_chamber/proc/toggle_open(mob/user)
if(panel_open)
@@ -161,7 +158,7 @@
/obj/machinery/public_nanite_chamber/attackby(obj/item/I, mob/user, params)
if(!occupant && default_deconstruction_screwdriver(user, icon_state, icon_state, I))//sent icon_state is irrelevant...
- update_icon()//..since we're updating the icon here, since the scanner can be unpowered when opened/closed
+ update_appearance(UPDATE_ICON)//..since we're updating the icon here, since the scanner can be unpowered when opened/closed
return
if(default_pry_open(I))
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index f304969ebc76..ed8f1453ab1f 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -27,7 +27,7 @@
var/obj/item/circuitboard/machine/B = new /obj/item/circuitboard/machine/rdserver(null)
B.apply_default_parts(src)
current_temp = get_env_temp()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/rnd/server/Destroy()
SSresearch.servers -= src
@@ -39,7 +39,8 @@
tot_rating += SP.rating
heat_gen /= max(1, tot_rating)
-/obj/machinery/rnd/server/update_icon()
+/obj/machinery/rnd/server/update_icon_state()
+ . = ..()
if(panel_open)
icon_state = "server_t"
return
@@ -53,19 +54,18 @@
/obj/machinery/rnd/server/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/I)
.=..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/rnd/server/power_change()
. = ..()
refresh_working()
- return
/obj/machinery/rnd/server/proc/refresh_working()
if(stat & EMPED || research_disabled || stat & NOPOWER)
working = FALSE
else
working = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/rnd/server/emp_act()
. = ..()
diff --git a/code/modules/research/xenobiology/crossbreeding/industrial.dm b/code/modules/research/xenobiology/crossbreeding/industrial.dm
index 6f7ca1f79e7b..ca376fae8663 100644
--- a/code/modules/research/xenobiology/crossbreeding/industrial.dm
+++ b/code/modules/research/xenobiology/crossbreeding/industrial.dm
@@ -180,13 +180,13 @@ Industrial extracts:
colour = "black"
effect_desc = "Produces slime brand regenerative cigarettes."
plasmarequired = 6
- itempath = /obj/item/storage/box/fancy/cigarettes/cigpack_xeno
+ itempath = /obj/item/storage/fancy/cigarettes/cigpack_xeno
/obj/item/slimecross/industrial/lightpink
colour = "light pink"
effect_desc = "Produces heart shaped boxes that have candies in them."
plasmarequired = 3
- itempath = /obj/item/storage/box/fancy/heart_box
+ itempath = /obj/item/storage/fancy/heart_box
/obj/item/slimecross/industrial/adamantine
colour = "adamantine"
diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm
index 0db2e85e71bd..b48a1295fcfb 100644
--- a/code/modules/security_levels/keycard_authentication.dm
+++ b/code/modules/security_levels/keycard_authentication.dm
@@ -137,7 +137,7 @@ GLOBAL_VAR_INIT(emergency_access, FALSE)
for(var/turf/in_area as anything in A.get_contained_turfs())
for(var/obj/machinery/door/airlock/D in in_area)
D.emergency = TRUE
- D.update_icon(ALL, 0)
+ D.update_icon(state=ALL, override=0)
minor_announce("Access restrictions on maintenance and external airlocks have been lifted.", "Attention! Station-wide emergency declared!",1)
GLOB.emergency_access = TRUE
SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "enabled"))
@@ -147,7 +147,7 @@ GLOBAL_VAR_INIT(emergency_access, FALSE)
for(var/turf/in_area as anything in A.get_contained_turfs())
for(var/obj/machinery/door/airlock/D in in_area)
D.emergency = FALSE
- D.update_icon(ALL, 0)
+ D.update_icon(state=ALL, override=0)
minor_announce("Access restrictions in maintenance areas have been restored.", "Attention! Station-wide emergency rescinded:")
GLOB.emergency_access = FALSE
SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "disabled"))
diff --git a/code/modules/security_levels/level_interface.dm b/code/modules/security_levels/level_interface.dm
index 11fff53c633e..c840fa4400f0 100644
--- a/code/modules/security_levels/level_interface.dm
+++ b/code/modules/security_levels/level_interface.dm
@@ -28,27 +28,28 @@
radio.independent = TRUE
radio.recalculateChannels()
-/obj/machinery/level_interface/update_icon()
- cut_overlays()
+/obj/machinery/level_interface/update_icon(updates=ALL)
+ . = ..()
if(!is_operational())
set_light_on(FALSE)
- return
else
set_light_on(TRUE)
+/obj/machinery/level_interface/update_overlays()
+ . = ..()
switch(GLOB.security_level)
if(SEC_LEVEL_GREEN)
- add_overlay("alert-level-green")
+ . += "alert-level-green"
if(SEC_LEVEL_BLUE)
- add_overlay("alert-level-blue")
+ . += "alert-level-blue"
if(SEC_LEVEL_RED)
- add_overlay("alert-level-red")
+ . += "alert-level-red"
if(SEC_LEVEL_GAMMA)
- add_overlay("alert-level-gamma")
+ . += "alert-level-gamma"
if(SEC_LEVEL_EPSILON)
- add_overlay("alert-level-epsilon")
+ . += "alert-level-epsilon"
if(SEC_LEVEL_DELTA)
- add_overlay("alert-level-delta")
+ . += "alert-level-delta"
/obj/machinery/level_interface/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
@@ -58,15 +59,13 @@
ui = new(user, src, "LevelInterface", name)
ui.open()
-/obj/machinery/level_interface/ui_act(action, list/params)
- . = ..()
-
/obj/machinery/level_interface/ui_data(mob/user)
var/list/data = ..()
data["alertLevel"] = GLOB.security_level
return data
/obj/machinery/level_interface/ui_act(action, list/params, mob/user)
+ . = ..()
if(..())
return TRUE
@@ -84,7 +83,7 @@
balloon_alert(usr, "Nanotrasen override in progress!")
return TRUE
if(!check_access(usr.get_idcard()))
- balloon_alert(usr, "No access!")
+ balloon_alert(usr, "no access!")
return TRUE
var/alert_level = params["level_number"]
if(!isnum(alert_level))
@@ -95,7 +94,7 @@
return TRUE
for(var/obj/machinery/computer/communications/comms_console in GLOB.machines)
if(!COOLDOWN_FINISHED(comms_console, important_action_cooldown))
- balloon_alert(usr, "On cooldown!")
+ balloon_alert(usr, "on cooldown!")
to_chat(usr, span_warning("The system is not able to change the security alert level more than once per minute, please wait."))
return TRUE
COOLDOWN_START(comms_console, important_action_cooldown, IMPORTANT_ACTION_COOLDOWN)
diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm
index e83b789c568b..45fd7b7eef61 100644
--- a/code/modules/security_levels/security_levels.dm
+++ b/code/modules/security_levels/security_levels.dm
@@ -82,10 +82,10 @@ GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN)
GLOB.security_level = level
for(var/obj/machinery/firealarm/FA in GLOB.machines)
if(is_station_level(FA.z))
- FA.update_icon()
+ FA.update_appearance(UPDATE_ICON)
for(var/obj/machinery/level_interface/LI in GLOB.machines)
- LI.update_icon()
+ LI.update_appearance(UPDATE_ICON)
if(level >= SEC_LEVEL_RED)
for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines)
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index 5d5f8eac070c..ada242f152b2 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -498,8 +498,9 @@
density = FALSE
clockwork = TRUE //it'd look weird
-/obj/machinery/computer/shuttle/pod/update_icon()
- return
+/obj/machinery/computer/shuttle/pod/Initialize(mapload, obj/item/circuitboard/C)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/machinery/computer/shuttle/pod/emag_act(mob/user)
if(obj_flags & EMAGGED)
diff --git a/code/modules/shuttle/manipulator.dm b/code/modules/shuttle/manipulator.dm
index c82232e217a5..600290de1082 100644
--- a/code/modules/shuttle/manipulator.dm
+++ b/code/modules/shuttle/manipulator.dm
@@ -12,11 +12,11 @@
density = TRUE
-/obj/machinery/shuttle_manipulator/update_icon()
- cut_overlays()
- var/mutable_appearance/hologram_projection = mutable_appearance(icon, "hologram_on")
- hologram_projection.pixel_y = 22
- var/mutable_appearance/hologram_ship = mutable_appearance(icon, "hologram_whiteship")
- hologram_ship.pixel_y = 27
- add_overlay(hologram_projection)
- add_overlay(hologram_ship)
\ No newline at end of file
+/obj/machinery/shuttle_manipulator/update_overlays()
+ . = ..()
+ var/mutable_appearance/hologram_projection = mutable_appearance(icon, "hologram_on")
+ hologram_projection.pixel_y = 22
+ var/mutable_appearance/hologram_ship = mutable_appearance(icon, "hologram_whiteship")
+ hologram_ship.pixel_y = 27
+ . += hologram_projection
+ . += hologram_ship
diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm
index 2faa462705f4..99be3d6a1f9a 100644
--- a/code/modules/shuttle/on_move.dm
+++ b/code/modules/shuttle/on_move.dm
@@ -258,8 +258,8 @@ All ShuttleMove procs go here
A.addMember(src)
SSair.add_to_rebuild_queue(src)
else
- // atmosinit() calls update_icon(), so we don't need to call it
- update_icon()
+ // atmosinit() calls update_appearance(UPDATE_ICON), so we don't need to call it
+ update_appearance(UPDATE_ICON)
/obj/machinery/atmospherics/pipe/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
. = ..()
diff --git a/code/modules/shuttle/shuttle_rotate.dm b/code/modules/shuttle/shuttle_rotate.dm
index 61e43d69fb8c..c13af51c7769 100644
--- a/code/modules/shuttle/shuttle_rotate.dm
+++ b/code/modules/shuttle/shuttle_rotate.dm
@@ -42,7 +42,7 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
/mob/dead/observer/shuttleRotate(rotation, params)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/************************************Structure rotate procs************************************/
@@ -59,7 +59,7 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
var/temp = d1
d1 = d2
d2 = temp
- update_icon()
+ update_appearance(UPDATE_ICON)
//Fixes dpdir on shuttle rotation
/obj/structure/disposalpipe/shuttleRotate(rotation, params)
diff --git a/code/modules/shuttle/spaceship_navigation_beacon.dm b/code/modules/shuttle/spaceship_navigation_beacon.dm
index 8b128e9f886f..ce10314952b8 100644
--- a/code/modules/shuttle/spaceship_navigation_beacon.dm
+++ b/code/modules/shuttle/spaceship_navigation_beacon.dm
@@ -29,16 +29,13 @@ 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
icon_state = "core-open"
-/obj/machinery/spaceship_navigation_beacon/power_change()
- . = ..()
- update_icon()
-
/obj/machinery/spaceship_navigation_beacon/multitool_act(mob/living/user, obj/item/multitool/I)
if(panel_open)
var/new_name = "Beacon_[input("Enter the custom name for this beacon", "It be Beacon ..your input..") as text]"
diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm
index d4564362a1e9..b91f9320e89b 100644
--- a/code/modules/shuttle/special.dm
+++ b/code/modules/shuttle/special.dm
@@ -19,9 +19,10 @@
. = ..()
if(prob(50))
desc = "Oh no, not again."
- update_icon()
+ update_appearance(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
@@ -39,7 +40,7 @@
visible_message("\
[src] closes its eyes.")
active = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/emitter/energycannon/magical/attackby(obj/item/W, mob/user, params)
return
diff --git a/code/modules/spells/spell_types/self/summonitem.dm b/code/modules/spells/spell_types/self/summonitem.dm
index 26d960eb4038..61a2066d0f70 100644
--- a/code/modules/spells/spell_types/self/summonitem.dm
+++ b/code/modules/spells/spell_types/self/summonitem.dm
@@ -125,7 +125,7 @@
if(istype(retrieved_item, /obj/machinery/portable_atmospherics))
var/obj/machinery/portable_atmospherics/atmos_item = retrieved_item
atmos_item.disconnect()
- atmos_item.update_icon()
+ atmos_item.update_appearance(UPDATE_ICON)
// Otherwise bring the whole thing with us
item_to_retrieve = retrieved_item
diff --git a/code/modules/surgery/anesthesia_machine.dm b/code/modules/surgery/anesthesia_machine.dm
index 8fb1b92fac3b..af386474096c 100644
--- a/code/modules/surgery/anesthesia_machine.dm
+++ b/code/modules/surgery/anesthesia_machine.dm
@@ -20,16 +20,16 @@
if(is_roundstart)
var/obj/item/tank/T = new /obj/item/tank/internals/anesthetic(src)
attached_tank = T
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/anesthetic_machine/update_icon()
- cut_overlays()
+/obj/machinery/anesthetic_machine/update_overlays()
+ . = ..()
if(mask_out)
- add_overlay("mask_off")
+ . += "mask_off"
else
- add_overlay("mask_on")
+ . += "mask_on"
if(attached_tank)
- add_overlay("tank_on")
+ . += "tank_on"
/obj/machinery/anesthetic_machine/attack_hand(mob/living/user)
@@ -44,7 +44,7 @@
I.forceMove(src) // Put new tank in, set it as attached tank
visible_message("[user] inserts [I] into [src].")
attached_tank = I
- update_icon()
+ update_appearance(UPDATE_ICON)
return
. = ..()
@@ -54,7 +54,7 @@
attached_tank.forceMove(loc)
to_chat(user, "You remove the [attached_tank].")
attached_tank = null
- update_icon()
+ update_appearance(UPDATE_ICON)
if(mask_out)
retract_mask()
@@ -67,7 +67,7 @@
else
attached_mask.forceMove(src)
mask_out = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
return FALSE
@@ -87,7 +87,7 @@
target.open_internals(attached_tank, TRUE)
mask_out = TRUE
START_PROCESSING(SSmachines, src)
- update_icon()
+ update_appearance(UPDATE_ICON)
else
to_chat(usr, "[mask_out ? "The machine is already in use!" : "The machine has no attached tank!"]")
diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm
index c591bf219261..0b3becbd171d 100644
--- a/code/modules/surgery/bodyparts/dismemberment.dm
+++ b/code/modules/surgery/bodyparts/dismemberment.dm
@@ -231,7 +231,7 @@
if(C.hud_used)
var/atom/movable/screen/inventory/hand/R = C.hud_used.hand_slots["[held_index]"]
if(R)
- R.update_icon()
+ R.update_appearance(UPDATE_ICON)
if(C.gloves)
C.dropItemToGround(C.gloves, TRUE)
C.update_inv_gloves() //to remove the bloody hands overlay
@@ -249,7 +249,7 @@
if(C.hud_used)
var/atom/movable/screen/inventory/hand/L = C.hud_used.hand_slots["[held_index]"]
if(L)
- L.update_icon()
+ L.update_appearance(UPDATE_ICON)
if(C.gloves)
C.dropItemToGround(C.gloves, TRUE)
C.update_inv_gloves() //to remove the bloody hands overlay
@@ -334,7 +334,7 @@
if(C.hud_used)
var/atom/movable/screen/inventory/hand/hand = C.hud_used.hand_slots["[held_index]"]
if(hand)
- hand.update_icon()
+ hand.update_appearance(UPDATE_ICON)
C.update_inv_gloves()
if(special) //non conventional limb attachment
diff --git a/code/modules/surgery/bodyparts/parts.dm b/code/modules/surgery/bodyparts/parts.dm
index 199aeffaae44..89d9c76f975f 100644
--- a/code/modules/surgery/bodyparts/parts.dm
+++ b/code/modules/surgery/bodyparts/parts.dm
@@ -124,7 +124,7 @@
if(owner.hud_used)
var/atom/movable/screen/inventory/hand/L = owner.hud_used.hand_slots["[held_index]"]
if(L)
- L.update_icon()
+ L.update_appearance(UPDATE_ICON)
/obj/item/bodypart/l_arm/monkey
icon = 'icons/mob/animal_parts.dmi'
@@ -219,7 +219,7 @@
if(owner.hud_used)
var/atom/movable/screen/inventory/hand/R = owner.hud_used.hand_slots["[held_index]"]
if(R)
- R.update_icon()
+ R.update_appearance(UPDATE_ICON)
/obj/item/bodypart/r_arm/monkey
icon = 'icons/mob/animal_parts.dmi'
diff --git a/code/modules/surgery/implant_removal.dm b/code/modules/surgery/implant_removal.dm
index 502e94bb786b..e00d42966643 100644
--- a/code/modules/surgery/implant_removal.dm
+++ b/code/modules/surgery/implant_removal.dm
@@ -68,7 +68,7 @@
return TRUE
case.imp.implant(target, user)
case.imp = null
- case.update_icon()
+ case.update_appearance(UPDATE_ICON)
display_results(user, target, span_notice("You implant \the [I] into [target]'s [parse_zone(target_zone)]."),
"[user] implants \the [I] into [target]'s [parse_zone(target_zone)]!",
"[user] inserts something into [target]'s [parse_zone(target_zone)]!")
@@ -92,7 +92,7 @@
if(case && !case.imp)
case.imp = I
I.forceMove(case)
- case.update_icon()
+ case.update_appearance(UPDATE_ICON)
display_results(user, target, span_notice("You place [I] into [case]."),
"[user] places [I] into [case]!",
"[user] places it into [case]!")
diff --git a/code/modules/surgery/organs/appendix.dm b/code/modules/surgery/organs/appendix.dm
index a4e2da4064d1..10419ae5496d 100644
--- a/code/modules/surgery/organs/appendix.dm
+++ b/code/modules/surgery/organs/appendix.dm
@@ -10,14 +10,20 @@
now_fixed = span_info("The pain in your abdomen has subsided.")
var/inflamed
-/obj/item/organ/appendix/update_icon()
+/obj/item/organ/appendix/update_name(updates=ALL)
+ . = ..()
if(inflamed)
- icon_state = "appendixinflamed"
name = "inflamed appendix"
else
- icon_state = "appendix"
name = "appendix"
+/obj/item/organ/appendix/update_icon_state()
+ . = ..()
+ if(inflamed)
+ icon_state = "appendixinflamed"
+ else
+ icon_state = "appendix"
+
/obj/item/organ/appendix/on_life()
..()
if(!(organ_flags & ORGAN_FAILING))
@@ -30,7 +36,7 @@
for(var/datum/disease/appendicitis/A in M.diseases)
A.cure()
inflamed = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
..()
/obj/item/organ/appendix/Insert(mob/living/carbon/M, special = 0)
@@ -65,10 +71,14 @@
inflamed = FALSE
M.emote("chuckle") //you really think that will stop me?
-/obj/item/organ/appendix/cybernetic/update_icon()
- icon_state = "implant-filter"
+/obj/item/organ/appendix/cybernetic/update_name(updates=ALL)
+ . = ..()
name = "cybernetic appendix"
+/obj/item/organ/appendix/cybernetic/update_icon(updates=ALL)
+ . = ..()
+ icon_state = "implant-filter"
+
/obj/item/organ/appendix/cybernetic/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
diff --git a/code/modules/surgery/organs/augment_legs.dm b/code/modules/surgery/organs/augment_legs.dm
index 5fa0ea931ed0..94225758f760 100644
--- a/code/modules/surgery/organs/augment_legs.dm
+++ b/code/modules/surgery/organs/augment_legs.dm
@@ -11,7 +11,7 @@
/obj/item/organ/cyberimp/leg/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
SetSlotFromZone()
/obj/item/organ/cyberimp/leg/emp_act(severity)
@@ -59,7 +59,8 @@
else
CRASH("Invalid zone for [type]")
-/obj/item/organ/cyberimp/leg/update_icon()
+/obj/item/organ/cyberimp/leg/update_icon(updates=ALL)
+ . = ..()
if(zone == BODY_ZONE_R_LEG)
transform = null
else // Mirroring the icon
@@ -81,7 +82,7 @@
zone = BODY_ZONE_R_LEG
SetSlotFromZone()
to_chat(user, span_notice("You modify [src] to be installed on the [zone == BODY_ZONE_R_LEG ? "right" : "left"] leg."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/organ/cyberimp/leg/emp_act(severity)
. = ..()
diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm
index b4afa3c8038f..3b082efe3cab 100644
--- a/code/modules/surgery/organs/augments_arms.dm
+++ b/code/modules/surgery/organs/augments_arms.dm
@@ -18,7 +18,7 @@
if(ispath(holder))
holder = new holder(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
SetSlotFromZone()
items_list = contents.Copy()
@@ -33,7 +33,8 @@
return FALSE
return TRUE
-/obj/item/organ/cyberimp/arm/update_icon()
+/obj/item/organ/cyberimp/arm/update_icon(updates=ALL)
+ . = ..()
if(zone == BODY_ZONE_R_ARM)
transform = null
else // Mirroring the icon
@@ -53,7 +54,7 @@
zone = BODY_ZONE_R_ARM
if(SetSlotFromZone())
I.play_tool_sound(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You modify [src] to be installed on the [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm."))
else
to_chat(user, span_warning("[src] cannot be modified!"))
diff --git a/code/modules/surgery/organs/augments_chest.dm b/code/modules/surgery/organs/augments_chest.dm
index 8e8318edfab1..4c33ca221569 100644
--- a/code/modules/surgery/organs/augments_chest.dm
+++ b/code/modules/surgery/organs/augments_chest.dm
@@ -169,15 +169,15 @@
if(!silent)
to_chat(owner, span_notice("You turn your thrusters set off."))
on = FALSE
- update_icon()
+ update_appearance(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
+ for(var/datum/action/A as anything in actions)
A.build_all_button_icons()
/obj/item/organ/cyberimp/chest/thrusters/proc/move_react()
@@ -275,15 +275,15 @@
on = !on
if(!silent)
to_chat(owner, span_notice("You turn your spinal implant [on? "on" : "off"]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/organ/cyberimp/chest/spinalspeed/update_icon()
+/obj/item/organ/cyberimp/chest/spinalspeed/update_icon_state()
+ . = ..()
if(on)
icon_state = "imp_spinal-on"
else
icon_state = "imp_spinal"
- for(var/X in actions)
- var/datum/action/A = X
+ for(var/datum/action/A as anything in actions)
A.build_all_button_icons()
/obj/item/organ/cyberimp/chest/spinalspeed/proc/move_react()//afterimage
diff --git a/code/modules/surgery/organs/autosurgeon.dm b/code/modules/surgery/organs/autosurgeon.dm
index ef4d029470ef..5c36f6392aa0 100644
--- a/code/modules/surgery/organs/autosurgeon.dm
+++ b/code/modules/surgery/organs/autosurgeon.dm
@@ -41,7 +41,7 @@
if(user.getorganslot(bastard.slot)) //NEVERMIND WE ARE NOT BALLING
bastard.zone = original_zone //MISSION ABORT
bastard.SetSlotFromZone()
- bastard.update_icon()
+ bastard.update_appearance(UPDATE_ICON)
storedorgan.Insert(user)//insert stored organ into the user
user.visible_message(span_notice("[user] presses a button on [src], and you hear a short mechanical noise."), span_notice("You feel a sharp sting as [src] plunges into your body."))
playsound(get_turf(user), 'sound/weapons/circsawhit.ogg', 50, 1)
@@ -148,7 +148,7 @@
implant.zone = BODY_ZONE_R_ARM
to_chat(user, span_notice("You change the autosurgeon to target the right arm."))
implant.SetSlotFromZone()
- implant.update_icon() //If for whatever reason, the implant is removed from the autosurgeon after it's switched
+ implant.update_appearance(UPDATE_ICON) //If for whatever reason, the implant is removed from the autosurgeon after it's switched
/obj/item/autosurgeon/arm/syndicate/syndie_mantis
uses = 1
@@ -325,7 +325,7 @@
if(user.getorganslot(bastard.slot)) //NEVERMIND WE ARE NOT BALLING
bastard.zone = original_zone //MISSION ABORT
bastard.SetSlotFromZone()
- bastard.update_icon()
+ bastard.update_appearance(UPDATE_ICON)
toimplant.Insert(user)//insert stored organ into the user
user.visible_message(span_notice("[user] presses a button on [src], and you hear a short mechanical noise."), span_notice("You feel a sharp sting as [src] plunges into your body."))
playsound(get_turf(user), 'sound/weapons/circsawhit.ogg', 50, 1)
diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm
index 434931c55e1b..254362eb145d 100644
--- a/code/modules/surgery/organs/heart.dm
+++ b/code/modules/surgery/organs/heart.dm
@@ -24,9 +24,10 @@
/obj/item/organ/heart/Initialize(mapload)
. = ..()
icon_base = icon_state
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/item/organ/heart/update_icon()
+/obj/item/organ/heart/update_icon_state()
+ . = ..()
if(beating)
icon_state = "[icon_base]-on"
else
@@ -51,12 +52,12 @@
/obj/item/organ/heart/proc/Stop()
beating = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/item/organ/heart/proc/Restart()
beating = 1
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/item/organ/heart/prepare_eat()
diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm
index 7c8ba9e08ac2..0f8bf96bd7c6 100644
--- a/code/modules/surgery/organs/tongue.dm
+++ b/code/modules/surgery/organs/tongue.dm
@@ -39,10 +39,10 @@
. = ..()
languages_possible = languages_possible_base
-/obj/item/organ/tongue/update_icon()
+/obj/item/organ/tongue/update_overlays()
. = ..()
if(honked) // This tongue has a bike horn inside of it. Let's draw it
- add_overlay("honked")
+ . += "honked"
/obj/item/organ/tongue/proc/handle_speech(datum/source, list/speech_args)
if(honked) // you have a bike horn inside of your tongue. Time to honk
@@ -75,7 +75,7 @@
/obj/item/organ/tongue/Initialize(mapload) // this only exists to make sure the spawned tongue has a horn inside of it visually
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/organ/tongue/examine(mob/user)
. = ..()
diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm
index 0494cda52a29..17147bb77179 100644
--- a/code/modules/uplink/uplink_items.dm
+++ b/code/modules/uplink/uplink_items.dm
@@ -2390,7 +2390,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
name = "Box of Singulonuts"
desc = "A box with six Waffle Co. brand Singulonuts. Banned in four sectors for their sheer calorie content. \
Caution: Product known to the safety board of Nanotrasen to increase risks of stomach cancer and cause instant obesity. \ Disguised as a regular box of regular donuts."
- item = /obj/item/storage/box/fancy/donut_box/deadly
+ item = /obj/item/storage/fancy/donut_box/deadly
cost = 6
manufacturer = /datum/corporation/traitor/waffleco
restricted_roles = list("Assistant", "Cook", "Clerk")
@@ -2682,7 +2682,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
/datum/uplink_item/badass/syndiecigs
name = "Syndicate Smokes"
desc = "Strong flavor, dense smoke, infused with omnizine."
- item = /obj/item/storage/box/fancy/cigarettes/cigpack_syndicate
+ item = /obj/item/storage/fancy/cigarettes/cigpack_syndicate
cost = 2
manufacturer = /datum/corporation/traitor/donkco
illegal_tech = FALSE
diff --git a/code/modules/vehicles/motorized_wheelchair.dm b/code/modules/vehicles/motorized_wheelchair.dm
index ee690b5b5806..487649cc2d7a 100644
--- a/code/modules/vehicles/motorized_wheelchair.dm
+++ b/code/modules/vehicles/motorized_wheelchair.dm
@@ -33,7 +33,7 @@
var/mob/living/L = A
L.update_mobility()
if(power_cell)
- power_cell.update_icon()
+ power_cell.update_appearance(UPDATE_ICON)
refresh_parts()
/obj/vehicle/ridden/wheelchair/motorized/obj_destruction(damage_flag)
@@ -75,7 +75,7 @@
/obj/vehicle/ridden/wheelchair/motorized/attack_hand(mob/living/user)
if(power_cell && panel_open)
- power_cell.update_icon()
+ power_cell.update_appearance(UPDATE_ICON)
user.put_in_hands(power_cell)
to_chat(user, span_notice("You remove the [power_cell] from [src]."))
power_cell = null
diff --git a/code/modules/vehicles/pimpin_ride.dm b/code/modules/vehicles/pimpin_ride.dm
index e174ffc33cb4..3535b1958a9d 100644
--- a/code/modules/vehicles/pimpin_ride.dm
+++ b/code/modules/vehicles/pimpin_ride.dm
@@ -9,7 +9,7 @@
/obj/vehicle/ridden/janicart/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
var/datum/component/riding/D = LoadComponent(/datum/component/riding)
D.set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(0, 4), TEXT_SOUTH = list(0, 7), TEXT_EAST = list(-12, 7), TEXT_WEST = list( 12, 7)))
@@ -42,7 +42,7 @@
return
to_chat(user, span_notice("You hook the trashbag onto [src]."))
mybag = I
- update_icon()
+ update_appearance(UPDATE_ICON)
else if(istype(I, /obj/item/janiupgrade))
if(floorbuffer)
to_chat(user, span_warning("[src] already has a floor buffer!"))
@@ -51,16 +51,16 @@
qdel(I)
to_chat(user, span_notice("You upgrade [src] with the floor buffer."))
AddElement(/datum/element/cleaning)
- update_icon()
+ update_appearance(UPDATE_ICON)
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)
. = ..()
@@ -70,7 +70,7 @@
mybag.forceMove(get_turf(user))
user.put_in_hands(mybag)
mybag = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/vehicle/ridden/janicart/upgraded
floorbuffer = TRUE
diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm
index 905570268698..124bb3aa9431 100644
--- a/code/modules/vending/_vending.dm
+++ b/code/modules/vending/_vending.dm
@@ -266,14 +266,16 @@ 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"
+ return
+
+ 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)
@@ -974,7 +976,7 @@ GLOBAL_LIST_EMPTY(vending_products)
else
stat |= NOPOWER
- update_icon()
+ return ..()
//Somebody cut an important wire and now we're following a new definition of "pitch."
/**
diff --git a/code/modules/vending/cigarette.dm b/code/modules/vending/cigarette.dm
index 40be780e6992..e86c6985e87d 100644
--- a/code/modules/vending/cigarette.dm
+++ b/code/modules/vending/cigarette.dm
@@ -4,52 +4,52 @@
product_slogans = "Space cigs taste good like a cigarette should.;I'd rather toolbox than switch.;Smoke!;Don't believe the reports - smoke today!"
product_ads = "Probably not bad for you!;Don't believe the scientists!;It's good for you!;Don't quit, buy more!;Smoke!;Nicotine heaven.;Best cigarettes since 2150.;Award-winning cigs."
icon_state = "cigs"
- products = list(/obj/item/storage/box/fancy/cigarettes = 5,
- /obj/item/storage/box/fancy/cigarettes/cigpack_uplift = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_robust = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_carp = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_midori = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_nonico = 3,
+ products = list(/obj/item/storage/fancy/cigarettes = 5,
+ /obj/item/storage/fancy/cigarettes/cigpack_uplift = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_robust = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_carp = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_midori = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_nonico = 3,
/obj/item/storage/box/matches = 10,
/obj/item/lighter/greyscale = 4,
- /obj/item/storage/box/fancy/rollingpapers = 5)
+ /obj/item/storage/fancy/rollingpapers = 5)
contraband = list(/obj/item/clothing/mask/vape = 5)
- premium = list(/obj/item/storage/box/fancy/cigarettes/cigpack_robustgold = 3,
+ premium = list(/obj/item/storage/fancy/cigarettes/cigpack_robustgold = 3,
/obj/item/lighter = 3,
- /obj/item/storage/box/fancy/cigarettes/cigars = 1,
- /obj/item/storage/box/fancy/cigarettes/cigars/havana = 1,
- /obj/item/storage/box/fancy/cigarettes/cigars/cohiba = 1)
+ /obj/item/storage/fancy/cigarettes/cigars = 1,
+ /obj/item/storage/fancy/cigarettes/cigars/havana = 1,
+ /obj/item/storage/fancy/cigarettes/cigars/cohiba = 1)
refill_canister = /obj/item/vending_refill/cigarette
default_price = 10
extra_price = 50
payment_department = ACCOUNT_SRV
/obj/machinery/vending/cigarette/syndicate
- products = list(/obj/item/storage/box/fancy/cigarettes/cigpack_syndicate = 7,
- /obj/item/storage/box/fancy/cigarettes/cigpack_uplift = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_robust = 2,
- /obj/item/storage/box/fancy/cigarettes/cigpack_carp = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_nonico = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_midori = 1,
+ products = list(/obj/item/storage/fancy/cigarettes/cigpack_syndicate = 7,
+ /obj/item/storage/fancy/cigarettes/cigpack_uplift = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_robust = 2,
+ /obj/item/storage/fancy/cigarettes/cigpack_carp = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_nonico = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_midori = 1,
/obj/item/storage/box/matches = 10,
/obj/item/lighter/greyscale = 4,
- /obj/item/storage/box/fancy/rollingpapers = 5)
+ /obj/item/storage/fancy/rollingpapers = 5)
/obj/machinery/vending/cigarette/beach //Used in the lavaland_biodome_beach.dmm ruin
name = "\improper ShadyCigs Ultra"
desc = "Now with extra premium products!"
product_ads = "Probably not bad for you!;Dope will get you through times of no money better than money will get you through times of no dope!;It's good for you!"
product_slogans = "Turn on, tune in, drop out!;Better living through chemistry!;Toke!;Don't forget to keep a smile on your lips and a song in your heart!"
- products = list(/obj/item/storage/box/fancy/cigarettes = 5,
- /obj/item/storage/box/fancy/cigarettes/cigpack_uplift = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_robust = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_carp = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_midori = 3,
- /obj/item/storage/box/fancy/cigarettes/cigpack_cannabis = 5,
+ products = list(/obj/item/storage/fancy/cigarettes = 5,
+ /obj/item/storage/fancy/cigarettes/cigpack_uplift = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_robust = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_carp = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_midori = 3,
+ /obj/item/storage/fancy/cigarettes/cigpack_cannabis = 5,
/obj/item/storage/box/matches = 10,
/obj/item/lighter/greyscale = 4,
- /obj/item/storage/box/fancy/rollingpapers = 5)
- premium = list(/obj/item/storage/box/fancy/cigarettes/cigpack_mindbreaker = 5,
+ /obj/item/storage/fancy/rollingpapers = 5)
+ premium = list(/obj/item/storage/fancy/cigarettes/cigpack_mindbreaker = 5,
/obj/item/clothing/mask/vape = 5,
/obj/item/lighter = 3)
diff --git a/code/modules/vending/security.dm b/code/modules/vending/security.dm
index 4a07e936eef3..e48049a9ba60 100644
--- a/code/modules/vending/security.dm
+++ b/code/modules/vending/security.dm
@@ -16,7 +16,7 @@
/obj/item/flashlight/seclite = 4,
/obj/item/restraints/legcuffs/bola/energy = 7)
contraband = list(/obj/item/clothing/glasses/sunglasses = 2,
- /obj/item/storage/box/fancy/donut_box = 2)
+ /obj/item/storage/fancy/donut_box = 2)
premium = list(/obj/item/storage/belt/security/webbing = 5,
/obj/item/coin/antagtoken = 1,
/obj/item/clothing/head/helmet/warhelmet = 5,
diff --git a/code/modules/vending/security_armaments.dm b/code/modules/vending/security_armaments.dm
index 4c7d2ceb86a1..d4e102afc784 100644
--- a/code/modules/vending/security_armaments.dm
+++ b/code/modules/vending/security_armaments.dm
@@ -82,7 +82,7 @@
var/list/items = list()
for(var/obj/item/wep in inventory)
var/obj/item/gun/weapon = wep
- weapon.update_icon(TRUE)
+ weapon.update_appearance(UPDATE_ICON)
var/icon/gun_icon = getFlatIcon(wep)
var/list/details = list()
diff --git a/code/modules/vending/wardrobes.dm b/code/modules/vending/wardrobes.dm
index 3443fd4bb88c..75b83965918c 100644
--- a/code/modules/vending/wardrobes.dm
+++ b/code/modules/vending/wardrobes.dm
@@ -427,7 +427,7 @@
/obj/item/clothing/suit/hooded/caretakercloak = 1,
/obj/item/clothing/suit/yogs/monkrobes = 1,
/obj/item/clothing/suit/hooded/amech = 2,
- /obj/item/storage/box/fancy/candle_box = 2,
+ /obj/item/storage/fancy/candle_box = 2,
/obj/item/clothing/head/kippah = 3,
/obj/item/clothing/suit/chaplainsuit/whiterobe = 1,
/obj/item/clothing/head/taqiyahwhite = 1,
diff --git a/icons/obj/cryogenics.dmi b/icons/obj/cryogenics.dmi
index 114fd7a38d79..bd82d4bbacee 100644
Binary files a/icons/obj/cryogenics.dmi and b/icons/obj/cryogenics.dmi differ
diff --git a/icons/obj/doors/airlocks/station/overlays.dmi b/icons/obj/doors/airlocks/station/overlays.dmi
index e61be04cc5f7..923f653dd92a 100644
Binary files a/icons/obj/doors/airlocks/station/overlays.dmi and b/icons/obj/doors/airlocks/station/overlays.dmi differ
diff --git a/icons/obj/guns/energy.dmi b/icons/obj/guns/energy.dmi
index 306dd202208d..3864cddaccac 100644
Binary files a/icons/obj/guns/energy.dmi and b/icons/obj/guns/energy.dmi differ
diff --git a/icons/obj/guns/flashlights.dmi b/icons/obj/guns/flashlights.dmi
index a651cea313df..eef6d953f94a 100644
Binary files a/icons/obj/guns/flashlights.dmi and b/icons/obj/guns/flashlights.dmi differ
diff --git a/tgui/docs/tutorial-and-examples.md b/tgui/docs/tutorial-and-examples.md
index 3dba803c959a..fb553fc07c71 100644
--- a/tgui/docs/tutorial-and-examples.md
+++ b/tgui/docs/tutorial-and-examples.md
@@ -84,7 +84,7 @@ input. The input's `action` and `params` are passed to the proc.
return FALSE
color = new_color
. = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
```
The `..()` (parent call) is very important here, as it is how we check that the
@@ -312,7 +312,7 @@ upon code review):
// A demo of proper input sanitation.
var = CLAMP(newvar, min_val, max_val)
. = TRUE
- update_icon() // Not applicable to all objects.
+ update_appearance(UPDATE_ICON) // Not applicable to all objects.
```
And the template:
diff --git a/yogstation.dme b/yogstation.dme
index 29ff814e8a03..54b35db41c72 100644
--- a/yogstation.dme
+++ b/yogstation.dme
@@ -249,6 +249,7 @@
#include "code\_globalvars\misc.dm"
#include "code\_globalvars\regexes.dm"
#include "code\_globalvars\religion.dm"
+#include "code\_globalvars\lists\ambience.dm"
#include "code\_globalvars\lists\client.dm"
#include "code\_globalvars\lists\flavor_misc.dm"
#include "code\_globalvars\lists\keybindings.dm"
@@ -259,7 +260,6 @@
#include "code\_globalvars\lists\objects.dm"
#include "code\_globalvars\lists\poll_ignore.dm"
#include "code\_globalvars\lists\typecache.dm"
-#include "code\_globalvars\lists\ambience.dm"
#include "code\_js\byjax.dm"
#include "code\_js\menus.dm"
#include "code\_onclick\adjacent.dm"
@@ -324,6 +324,7 @@
#include "code\controllers\subsystem\acid.dm"
#include "code\controllers\subsystem\adjacent_air.dm"
#include "code\controllers\subsystem\air.dm"
+#include "code\controllers\subsystem\ambience.dm"
#include "code\controllers\subsystem\area_contents.dm"
#include "code\controllers\subsystem\asset_loading.dm"
#include "code\controllers\subsystem\assets.dm"
@@ -403,7 +404,6 @@
#include "code\controllers\subsystem\processing\slowprocess.dm"
#include "code\controllers\subsystem\processing\station.dm"
#include "code\controllers\subsystem\processing\wet_floors.dm"
-#include "code\controllers\subsystem\ambience.dm"
#include "code\datums\ai_laws.dm"
#include "code\datums\armor.dm"
#include "code\datums\beam.dm"
@@ -644,6 +644,7 @@
#include "code\datums\elements\earhealing.dm"
#include "code\datums\elements\firestacker.dm"
#include "code\datums\elements\squish.dm"
+#include "code\datums\elements\update_icon_blocker.dm"
#include "code\datums\helper_datums\events.dm"
#include "code\datums\helper_datums\getrev.dm"
#include "code\datums\helper_datums\icon_snapshot.dm"
diff --git a/yogstation/code/_globalvars/lists/maintenance_loot.dm b/yogstation/code/_globalvars/lists/maintenance_loot.dm
index 5ba0c6e5010c..11e4a88eee66 100644
--- a/yogstation/code/_globalvars/lists/maintenance_loot.dm
+++ b/yogstation/code/_globalvars/lists/maintenance_loot.dm
@@ -232,22 +232,22 @@ GLOBAL_LIST_INIT(maintenance_loot_traditional,list(
/obj/item/stack/sheet/rglass/fifty = W_RARE,
/obj/item/stack/sheet/ruinous_metal = W_MYTHICAL,
/obj/item/stack/sheet/runed_metal = W_MYTHICAL,
- /obj/item/storage/box/fancy/cigarettes = W_ESSENTIAL,
- /obj/item/storage/box/fancy/cigarettes/cigars = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigars/cohiba = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigars/havana = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigpack_cannabis = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigpack_carp = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigpack_midori = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigpack_mindbreaker = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigpack_nonico = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigpack_robust = W_ESSENTIAL,
- /obj/item/storage/box/fancy/cigarettes/cigpack_robustgold = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigpack_shadyjims = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigpack_syndicate = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/cigpack_uplift = W_ESSENTIAL,
- /obj/item/storage/box/fancy/cigarettes/cigpack_xeno = W_UNCOMMON,
- /obj/item/storage/box/fancy/cigarettes/dromedaryco = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes = W_ESSENTIAL,
+ /obj/item/storage/fancy/cigarettes/cigars = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigars/cohiba = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigars/havana = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigpack_cannabis = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigpack_carp = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigpack_midori = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigpack_mindbreaker = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigpack_nonico = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigpack_robust = W_ESSENTIAL,
+ /obj/item/storage/fancy/cigarettes/cigpack_robustgold = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigpack_shadyjims = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigpack_syndicate = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/cigpack_uplift = W_ESSENTIAL,
+ /obj/item/storage/fancy/cigarettes/cigpack_xeno = W_UNCOMMON,
+ /obj/item/storage/fancy/cigarettes/dromedaryco = W_UNCOMMON,
/obj/item/a_gift = W_ESSENTIAL,
/obj/item/airlock_painter = W_COMMON,
/obj/item/ammo_box/foambox = W_UNCOMMON,
@@ -368,7 +368,7 @@ GLOBAL_LIST_INIT(maintenance_loot_traditional,list(
/obj/item/storage/box/disks = W_RARE,
/obj/item/storage/box/disks_nanite = W_RARE,
/obj/item/storage/box/disks_plantgene = W_RARE,
- /obj/item/storage/box/fancy/candle_box = W_RARE,
+ /obj/item/storage/fancy/candle_box = W_RARE,
/obj/item/storage/box/fountainpens = W_RARE,
/obj/item/storage/box/matches = W_UNCOMMON,
/obj/item/storage/box/official_posters = W_RARE,
@@ -454,9 +454,9 @@ GLOBAL_LIST_INIT(maintenance_loot_traditional,list(
/obj/item/storage/box/donkpockets/donkpocketpizza = W_ESSENTIAL,
/obj/item/storage/box/donkpockets/donkpocketspicy = W_ESSENTIAL,
/obj/item/storage/box/donkpockets/donkpocketteriyaki = W_ESSENTIAL,
- /obj/item/storage/box/fancy/donut_box = W_RARE,
- /obj/item/storage/box/fancy/egg_box = W_MYTHICAL,
- /obj/item/storage/box/fancy/heart_box = W_RARE,
+ /obj/item/storage/fancy/donut_box = W_RARE,
+ /obj/item/storage/fancy/egg_box = W_MYTHICAL,
+ /obj/item/storage/fancy/heart_box = W_RARE,
/obj/item/storage/box/ingredients/wildcard = W_RARE,
/obj/item/storage/box/mre = W_ESSENTIAL,
/obj/item/storage/box/mre/menu2 = W_RARE,
@@ -515,7 +515,7 @@ GLOBAL_LIST_INIT(maintenance_loot_makeshift,list(
/obj/item/storage/belt/military/snack = W_RARE,
/obj/item/storage/belt/utility/makeshift = W_UNCOMMON,
/obj/item/storage/book/bible/booze = W_UNCOMMON,
- /obj/item/storage/box/fancy/rollingpapers = W_RARE,
+ /obj/item/storage/fancy/rollingpapers = W_RARE,
/obj/item/storage/box/hug = W_RARE,
/obj/item/tank/jetpack/improvised = W_MYTHICAL,
/obj/item/twohanded/rcl/ghetto = W_MYTHICAL,
@@ -1014,7 +1014,7 @@ GLOBAL_LIST_INIT(maintenance_loot_serious,list(
/obj/item/storage/belt/military/assault = W_MYTHICAL,
/obj/item/storage/belt/multi = W_MYTHICAL,
/obj/item/storage/box/donkpockets/donkpocketgondola = W_LEGENDARY,
- /obj/item/storage/box/fancy/donut_box/deadly = W_MYTHICAL,
+ /obj/item/storage/fancy/donut_box/deadly = W_MYTHICAL,
/obj/item/storage/box/flashbangs = W_MYTHICAL,
/obj/item/storage/box/flashes = W_RARE,
/obj/item/storage/box/gorillacubes = W_LEGENDARY,
diff --git a/yogstation/code/controllers/subsystem/bluespace_locker.dm b/yogstation/code/controllers/subsystem/bluespace_locker.dm
index e54b407ef0c0..9469d82ed2b3 100644
--- a/yogstation/code/controllers/subsystem/bluespace_locker.dm
+++ b/yogstation/code/controllers/subsystem/bluespace_locker.dm
@@ -65,8 +65,8 @@ SUBSYSTEM_DEF(bluespace_locker)
internal_locker.contents += external_locker.contents
internal_locker.open()
internal_locker.dump_contents()
- internal_locker.update_icon()
- external_locker.update_icon()
+ internal_locker.update_appearance(UPDATE_ICON)
+ external_locker.update_appearance(UPDATE_ICON)
/datum/controller/subsystem/bluespace_locker/proc/redistribute_locker()
if(!internal_locker)
diff --git a/yogstation/code/controllers/subsystem/yogs.dm b/yogstation/code/controllers/subsystem/yogs.dm
index 2c2903a81988..7abe1b406fc2 100644
--- a/yogstation/code/controllers/subsystem/yogs.dm
+++ b/yogstation/code/controllers/subsystem/yogs.dm
@@ -125,7 +125,7 @@ SUBSYSTEM_DEF(Yogs)
for(var/datum/department_goal/d in listOfGoals[account])
P.info += d.get_name()
P.info += "
"
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
else
var/obj/item/paper/P = new /obj/item/paper(C.loc)
@@ -135,7 +135,7 @@ SUBSYSTEM_DEF(Yogs)
if(d.account == account)
P.info += d.get_name()
P.info += ""
- P.update_icon()
+ P.update_appearance(UPDATE_ICON)
for(var/path in subtypesof(/datum/corporation))
diff --git a/yogstation/code/game/gamemodes/gangs/dominator.dm b/yogstation/code/game/gamemodes/gangs/dominator.dm
index 01baadd16576..7f1c896a0522 100644
--- a/yogstation/code/game/gamemodes/gangs/dominator.dm
+++ b/yogstation/code/game/gamemodes/gangs/dominator.dm
@@ -28,7 +28,7 @@
spark_system = new
spark_system.set_up(5, TRUE, src)
countdown = new(src)
- update_icon()
+ update_appearance(UPDATE_ICON)
.=..()
/obj/machinery/dominator/Destroy()
@@ -54,21 +54,27 @@
/obj/machinery/dominator/tesla_act()
qdel(src)
-/obj/machinery/dominator/update_icon()
- cut_overlays()
- if(!(stat & BROKEN))
- icon_state = "dominator-active"
- if(operating)
- var/mutable_appearance/dominator_overlay = mutable_appearance('icons/obj/machines/dominator.dmi', "dominator-overlay")
- if(gang)
- dominator_overlay.color = gang.color
- add_overlay(dominator_overlay)
- else
- icon_state = "dominator"
- if(obj_integrity/max_integrity < 0.66)
- add_overlay("damage")
- else
+/obj/machinery/dominator/update_overlays()
+ . = ..()
+ if(stat & BROKEN)
+ return
+ if(operating)
+ var/mutable_appearance/dominator_overlay = mutable_appearance('icons/obj/machines/dominator.dmi', "dominator-overlay")
+ if(gang)
+ dominator_overlay.color = gang.color
+ . += dominator_overlay
+ if(obj_integrity/max_integrity < 0.66)
+ . += "damage"
+
+/obj/machinery/dominator/update_icon_state()
+ . = ..()
+ if(stat & BROKEN)
icon_state = "dominator-broken"
+ return
+ if(!operating)
+ icon_state = "dominator"
+ return
+ icon_state = "dominator-active"
/obj/machinery/dominator/examine(mob/user)
. = ..()
@@ -137,7 +143,7 @@
spark_system.start()
else if(!(stat & BROKEN))
spark_system.start()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/dominator/obj_break(damage_flag)
@@ -196,7 +202,7 @@
SSshuttle.registerHostileEnvironment(src)
name = "[gang.name] Gang [name]"
operating = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
countdown.color = gang.color
countdown.start()
@@ -244,7 +250,7 @@
set_light(0)
operating = FALSE
stat |= BROKEN
- update_icon()
+ update_appearance(UPDATE_ICON)
STOP_PROCESSING(SSmachines, src)
if(nukedisk)
nukedisk.forceMove(drop_location())
diff --git a/yogstation/code/game/gamemodes/gangs/gangtool.dm b/yogstation/code/game/gamemodes/gangs/gangtool.dm
index f26843e72475..f35fd60a665f 100644
--- a/yogstation/code/game/gamemodes/gangs/gangtool.dm
+++ b/yogstation/code/game/gamemodes/gangs/gangtool.dm
@@ -21,7 +21,7 @@
var/list/tags = list()
/obj/item/gangtool/Initialize(mapload)
- update_icon()
+ update_appearance(UPDATE_ICON)
if(buyable_items.len)
return ..()
for(var/i in subtypesof(/datum/gang_item))
@@ -138,12 +138,12 @@
recall(usr)
attack_self(usr)
-/obj/item/gangtool/update_icon()
- overlays.Cut()
+/obj/item/gangtool/update_overlays()
+ . = ..()
var/image/I = new(icon, "[icon_state]-overlay")
if(gang)
I.color = gang.color
- overlays.Add(I)
+ . += I
/obj/item/gangtool/proc/ping_gang(mob/user)
if(!can_use(user))
@@ -174,7 +174,7 @@
if(G)
gang = G.gang
gang.gangtools += src
- update_icon()
+ update_appearance(UPDATE_ICON)
if(!(user.mind in gang.leaders) && promotable)
G.promote()
free_pen = TRUE
diff --git a/yogstation/code/game/mecha/makeshift/lockermech.dm b/yogstation/code/game/mecha/makeshift/lockermech.dm
index 2bd3abe045a4..cc2d63696f9c 100644
--- a/yogstation/code/game/mecha/makeshift/lockermech.dm
+++ b/yogstation/code/game/mecha/makeshift/lockermech.dm
@@ -26,11 +26,11 @@
/obj/mecha/working/makeshift/go_out()
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/mecha/working/makeshift/moved_inside(mob/living/carbon/human/H)
..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/mecha/working/makeshift/Exit(atom/movable/O)
diff --git a/yogstation/code/game/objects/items/brace.dm b/yogstation/code/game/objects/items/brace.dm
index b8ec8cbadaa4..55dfcbf15379 100644
--- a/yogstation/code/game/objects/items/brace.dm
+++ b/yogstation/code/game/objects/items/brace.dm
@@ -23,11 +23,10 @@
var/obj/machinery/door/airlock/placed_on
var/cover_open = FALSE
-/obj/structure/deployed_brace/update_icon()
- ..()
- cut_overlays()
+/obj/structure/deployed_brace/update_overlays()
+ . = ..()
if(cover_open)
- add_overlay("cover_open")
+ . += "cover_open"
/obj/structure/deployed_brace/examine(mob/user)
. = ..()
@@ -53,7 +52,7 @@
cover_open = !cover_open
tool.play_tool_sound(src)
to_chat(user, span_notice("You [cover_open ? "open" : "close"] the cover."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/deployed_brace/wrench_act(mob/user, obj/item/tool)
if(get_dist(user, placed_on) > 1)
diff --git a/yogstation/code/game/objects/items/cards_ids.dm b/yogstation/code/game/objects/items/cards_ids.dm
index cd65f78f6397..c3c7be199b35 100644
--- a/yogstation/code/game/objects/items/cards_ids.dm
+++ b/yogstation/code/game/objects/items/cards_ids.dm
@@ -8,45 +8,45 @@
/obj/item/card/id/proc/ID_fluff()
var/job = originalassignment
- var/list/idfluff = list(
- "Assistant" = list("civillian","green"),
- "Captain" = list("captain","gold"),
- "Head of Personnel" = list("civillian","silver"),
- "Head of Security" = list("security","silver"),
- "Chief Engineer" = list("engineering","silver"),
- "Research Director" = list("science","silver"),
- "Chief Medical Officer" = list("medical","silver"),
- "Station Engineer" = list("engineering","yellow"),
- "Atmospheric Technician" = list("engineering","white"),
- "Network Admin" = list("engineering","green"),
- "Medical Doctor" = list("medical","blue"),
- "Geneticist" = list("medical","purple"),
- "Virologist" = list("medical","green"),
- "Chemist" = list("medical","orange"),
- "Paramedic" = list("medical","white"),
- "Psychiatrist" = list("medical","brown"),
- "Scientist" = list("science","purple"),
- "Roboticist" = list("science","black"),
- "Quartermaster" = list("cargo","silver"),
- "Cargo Technician" = list("cargo","brown"),
- "Shaft Miner" = list("cargo","black"),
- "Mining Medic" = list("cargo","blue"),
- "Bartender" = list("civillian","black"),
- "Botanist" = list("civillian","blue"),
- "Cook" = list("civillian","white"),
- "Janitor" = list("civillian","purple"),
- "Curator" = list("civillian","purple"),
- "Chaplain" = list("civillian","black"),
- "Clown" = list("clown","rainbow"),
- "Mime" = list("mime","white"),
- "Artist" = list("civillian","yellow"),
- "Clerk" = list("civillian","blue"),
- "Tourist" = list("civillian","yellow"),
- "Warden" = list("security","black"),
- "Security Officer" = list("security","red"),
- "Detective" = list("security","brown"),
- "Brig Physician" = list("security","blue"),
- "Lawyer" = list("security","purple")
+ var/static/list/idfluff = list(
+ "Assistant" = list("civillian","green"),
+ "Captain" = list("captain","gold"),
+ "Head of Personnel" = list("civillian","silver"),
+ "Head of Security" = list("security","silver"),
+ "Chief Engineer" = list("engineering","silver"),
+ "Research Director" = list("science","silver"),
+ "Chief Medical Officer" = list("medical","silver"),
+ "Station Engineer" = list("engineering","yellow"),
+ "Atmospheric Technician" = list("engineering","white"),
+ "Network Admin" = list("engineering","green"),
+ "Medical Doctor" = list("medical","blue"),
+ "Geneticist" = list("medical","purple"),
+ "Virologist" = list("medical","green"),
+ "Chemist" = list("medical","orange"),
+ "Paramedic" = list("medical","white"),
+ "Psychiatrist" = list("medical","brown"),
+ "Scientist" = list("science","purple"),
+ "Roboticist" = list("science","black"),
+ "Quartermaster" = list("cargo","silver"),
+ "Cargo Technician" = list("cargo","brown"),
+ "Shaft Miner" = list("cargo","black"),
+ "Mining Medic" = list("cargo","blue"),
+ "Bartender" = list("civillian","black"),
+ "Botanist" = list("civillian","blue"),
+ "Cook" = list("civillian","white"),
+ "Janitor" = list("civillian","purple"),
+ "Curator" = list("civillian","purple"),
+ "Chaplain" = list("civillian","black"),
+ "Clown" = list("clown","rainbow"),
+ "Mime" = list("mime","white"),
+ "Artist" = list("civillian","yellow"),
+ "Clerk" = list("civillian","blue"),
+ "Tourist" = list("civillian","yellow"),
+ "Warden" = list("security","black"),
+ "Security Officer" = list("security","red"),
+ "Detective" = list("security","brown"),
+ "Brig Physician" = list("security","blue"),
+ "Lawyer" = list("security","purple"),
)
if(job in idfluff)
has_fluff = TRUE
diff --git a/yogstation/code/game/objects/items/crayons.dm b/yogstation/code/game/objects/items/crayons.dm
index ddee748e0504..cd9fa6acb177 100644
--- a/yogstation/code/game/objects/items/crayons.dm
+++ b/yogstation/code/game/objects/items/crayons.dm
@@ -88,7 +88,7 @@
if(G)
gang = G
paint_color = G.color
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/toy/crayon/spraycan/gang/examine(mob/user)
. = ..()
diff --git a/yogstation/code/game/objects/items/fishing/rods.dm b/yogstation/code/game/objects/items/fishing/rods.dm
index d007f0eab550..b979e654c32a 100644
--- a/yogstation/code/game/objects/items/fishing/rods.dm
+++ b/yogstation/code/game/objects/items/fishing/rods.dm
@@ -206,10 +206,11 @@
opened = !opened
w_class = opened ? WEIGHT_CLASS_BULKY : WEIGHT_CLASS_SMALL
playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE)
- update_icon()
+ update_appearance(UPDATE_ICON)
user.regenerate_icons()
-/obj/item/twohanded/fishingrod/collapsible/update_icon()
+/obj/item/twohanded/fishingrod/collapsible/update_icon_state()
+ . = ..()
item_state = opened ? "fishing_rod" : ""
icon_state = "[rod_icon_state][opened ? "" : "_c"]"
diff --git a/yogstation/code/game/objects/items/holotool/holotool.dm b/yogstation/code/game/objects/items/holotool/holotool.dm
index f85969bcfaf0..e8f16d8de0cb 100644
--- a/yogstation/code/game/objects/items/holotool/holotool.dm
+++ b/yogstation/code/game/objects/items/holotool/holotool.dm
@@ -68,7 +68,7 @@
if(!C || QDELETED(src))
return
current_color = C
- update_icon()
+ update_appearance(UPDATE_ICON)
action.build_all_button_icons()
user.regenerate_icons()
@@ -80,7 +80,7 @@
current_tool = mode
current_tool.on_set(src)
playsound(loc, 'yogstation/sound/items/holotool.ogg', get_clamped_volume(), 1, -1)
- update_icon()
+ update_appearance(UPDATE_ICON)
user.regenerate_icons()
@@ -101,7 +101,8 @@
else
qdel(M)
-/obj/item/holotool/update_icon()
+/obj/item/holotool/update_icon(updates=ALL)
+ . = ..()
cut_overlays()
if(current_tool)
var/mutable_appearance/holo_item = mutable_appearance(icon, current_tool.name)
@@ -117,7 +118,7 @@
icon_state = "holotool"
set_light(0)
- for(var/datum/action/A in actions)
+ for(var/datum/action/A as anything in actions)
A.build_all_button_icons()
/obj/item/holotool/proc/check_menu(mob/living/user)
diff --git a/yogstation/code/game/objects/items/premadepapers.dm b/yogstation/code/game/objects/items/premadepapers.dm
index a8add201328f..564b23bbb402 100644
--- a/yogstation/code/game/objects/items/premadepapers.dm
+++ b/yogstation/code/game/objects/items/premadepapers.dm
@@ -24,7 +24,7 @@
written += new/datum/langtext("
Reason: ",/datum/language/common)
written += ""
written += new/datum/langtext("
Stamp Below if Approved",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
@@ -57,7 +57,7 @@
written += new/datum/langtext("
Administrator Notes: ",/datum/language/common)
written += ""
written += new/datum/langtext("
Stamp Below if Accepted:",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
*
@@ -106,7 +106,7 @@
written += new/datum/langtext("
",/datum/language/common)
written += new/datum/langtext("
",/datum/language/common)
written += new/datum/langtext("Signed: ",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
*
@@ -173,7 +173,7 @@
written += ""
written += new/datum/langtext("
",/datum/language/common)
written += new/datum/langtext("Reporting Officer's Signature:",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
*
@@ -207,7 +207,7 @@
written += ""
written += new/datum/langtext("
",/datum/language/common)
written += new/datum/langtext("Stamp Below if Approved",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
@@ -243,7 +243,7 @@
written += new/datum/langtext("Signed, ",/datum/language/common)
written += ""
written += new/datum/langtext("
Roboticist Notes:",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
*
@@ -274,7 +274,7 @@
written += ""
written += new/datum/langtext("
",/datum/language/common)
written += new/datum/langtext("Stamp Below if Approved",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
*
@@ -312,7 +312,7 @@
written += ""
written += new/datum/langtext("
",/datum/language/common)
written += new/datum/langtext("Stamp Below if Approved",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
*
@@ -340,7 +340,7 @@
written += ""
written += new/datum/langtext("
",/datum/language/common)
written += new/datum/langtext("Stamp Below if Approved",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
//RD upgrade form not included because from personal experience if you don't upgrade stuff you will be lynched
@@ -372,7 +372,7 @@
written += new/datum/langtext("
Signed, ",/datum/language/common)
written += ""
written += new/datum/langtext("
Stamp Below if Approved",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
*
@@ -403,7 +403,7 @@
written += ""
written += new/datum/langtext("
Stamp:",/datum/language/common)
written += new/datum/langtext("",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
*
@@ -476,7 +476,7 @@
written += ""
written += new/datum/langtext(", hereby acknowledge that I have answered this test's questions to the best of my ability, and acknowledge that if I fail this test, a penalty to be determined may be applied to me.
",/datum/language/common)
written += new/datum/langtext("Test Administrator: ",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
*
@@ -501,7 +501,7 @@
written += new/datum/langtext("4. Who is the CEO of Nanotrasen? Answer below. Theo Deimi
",/datum/language/common)
written += new/datum/langtext("5. From the following letters, Z V B D M K T P H S Y C, which 2, in order, come last in the alphabet? YZ
",/datum/language/common)
written += new/datum/langtext("TOP SECRET - Command Eyes Only",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
// How to perform autopsy
@@ -514,7 +514,7 @@
written += new/datum/langtext("Step 1: Apply drapes to the chest and select Autopsy.
",/datum/language/common)
written += new/datum/langtext("Step 2: Incise the chest with a scalpel.
",/datum/language/common)
written += new/datum/langtext("Step 3: While holding a forensic scanner in your off-hand, perform the autopsy using the scalpel again.
",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
//academy ruin papers
@@ -551,7 +551,7 @@
written += new/datum/langtext("To: Recruiter Billy the Lame
",/datum/language/common)
written += new/datum/langtext("Bill, where the heck did you find this guy? Are you sure he's wizard material..? He st--te-s a-lot. He's a -tink-ng l-zard--
",/datum/language/common)
written += new/datum/langtext("The rest of the paper is charred...",/datum/language/common)
- update_icon()
+ update_appearance(UPDATE_ICON)
@@ -606,7 +606,7 @@
new /obj/item/paper/paperwork/incident_report(src)
new /obj/item/paper/paperwork/literacytest(src)
toppaper = contents[contents.len]
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Initializes the Head of Security's clipboard.
@@ -633,7 +633,7 @@
for (var/i in 1 to 10)
new /obj/item/paper/paperwork/sec_incident_report(src)
toppaper = contents[contents.len]
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Initializes the Captain's clipboard.
@@ -658,7 +658,7 @@
new /obj/item/paper/paperwork/literacytest(src)
new /obj/item/paper/paperwork/literacytest/answers(src)
toppaper = contents[contents.len]
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Initializes the Head of Personnels clipboard.
@@ -685,7 +685,7 @@
new /obj/item/paper/paperwork/literacytest(src)
new /obj/item/paper/paperwork/literacytest/answers(src)
toppaper = contents[contents.len]
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Initializes the Warden's clipboard.
@@ -709,7 +709,7 @@
for (var/i in 1 to 10)
new /obj/item/paper/paperwork/sec_incident_report(src)
toppaper = contents[contents.len]
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Initializes the Chief Engineer's clipboard.
@@ -732,7 +732,7 @@
new /obj/item/paper/paperwork/hopaccessrequestform(src)
new /obj/item/paper/paperwork/incident_report(src)
toppaper = contents[contents.len]
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Initializes the Chief Medical Officer's clipboard.
@@ -755,7 +755,7 @@
new /obj/item/paper/paperwork/hopaccessrequestform(src)
new /obj/item/paper/paperwork/incident_report(src)
toppaper = contents[contents.len]
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Initializes security officer clipboards.
@@ -771,7 +771,7 @@
for (var/i in 1 to 10)
new /obj/item/paper/paperwork/incident_report(src)
toppaper = contents[contents.len]
- update_icon()
+ update_appearance(UPDATE_ICON)
/**
* Initializes the admin variant clipboard.
@@ -808,5 +808,5 @@
new /obj/item/paper/paperwork/literacytest(src)
new /obj/item/paper/paperwork/literacytest/answers(src)
toppaper = contents[contents.len]
- update_icon()
+ update_appearance(UPDATE_ICON)
//turdis bad
diff --git a/yogstation/code/game/objects/items/sharpener.dm b/yogstation/code/game/objects/items/sharpener.dm
index e30c0094ec3b..c92bd58f8142 100644
--- a/yogstation/code/game/objects/items/sharpener.dm
+++ b/yogstation/code/game/objects/items/sharpener.dm
@@ -1,2 +1,3 @@
-/obj/item/sharpener/update_icon()
- icon_state = "[initial(icon_state)]_used"
+/obj/item/sharpener/update_icon_state()
+ . = ..()
+ icon_state = "[initial(icon_state)]_used"
diff --git a/yogstation/code/game/objects/items/tools.dm b/yogstation/code/game/objects/items/tools.dm
index cde82f097b5b..1f26e2a8aa74 100644
--- a/yogstation/code/game/objects/items/tools.dm
+++ b/yogstation/code/game/objects/items/tools.dm
@@ -66,7 +66,7 @@
to_chat(user,span_notice("Your servos whirr as the cutting head reconfigures into a prying head."))
else
to_chat(user, span_notice("You attach the pry jaws to [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/jawsoflife/proc/transform_cutters(mob/user)
attack_verb = list("pinched", "nipped")
@@ -80,7 +80,7 @@
to_chat(user,span_notice("Your servos whirr as the prying head reconfigures into a cutting head."))
else
to_chat(user, span_notice("You attach the cutting jaws to [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
//better handdrill
/obj/item/handdrill
@@ -138,7 +138,7 @@
to_chat(user,span_notice("Your servos whirr as the drill reconfigures into bolt mode."))
else
to_chat(user, span_notice("You attach the bolt driver bit to [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/handdrill/proc/transform_screwdriver(mob/user)
desc = "A simple powered hand drill. It's fitted with a screw bit."
@@ -150,7 +150,7 @@
to_chat(user,span_notice("Your servos whirr as the drill reconfigures into screw mode."))
else
to_chat(user, span_notice("You attach the screw driver bit to [src]."))
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/jawsoflife/jimmy
name = "airlock jimmy"
diff --git a/yogstation/code/game/objects/structures/fireaxe.dm b/yogstation/code/game/objects/structures/fireaxe.dm
index 2ceb921d75bf..183eb87d48b8 100644
--- a/yogstation/code/game/objects/structures/fireaxe.dm
+++ b/yogstation/code/game/objects/structures/fireaxe.dm
@@ -9,7 +9,7 @@
/obj/structure/fireaxecabinet/Initialize(mapload)//<-- mirrored/overwritten proc
. = ..()
fireaxe = new
- update_icon()
+ update_appearance(UPDATE_ICON)
//Sets up a spark system
spark_system = new /datum/effect_system/spark_spread
spark_system.set_up(2, 1, src)
@@ -86,7 +86,7 @@
audible_message("You hear an audible clunk as the [name]'s bolt [locked ? "retracts" : "locks into place"].")
playsound(loc, "sound/machines/locktoggle.ogg", 30, 1, -3)
locked = !locked
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/structure/fireaxecabinet/emag_act(mob/user)
//this allows you to emag the fireaxe cabinet, unlocking it immediately.
@@ -105,5 +105,5 @@
playsound(loc, "sound/machines/locktoggle.ogg", 30, 1, -3)
locked = 0
audible_message("You hear an audible clunk as the [name]'s bolt retracts.")
- update_icon()
+ update_appearance(UPDATE_ICON)
//Fireaxe Cabinet is now permanently unlocked.
diff --git a/yogstation/code/game/objects/structures/toilet_bong.dm b/yogstation/code/game/objects/structures/toilet_bong.dm
index 6236ddc89caf..0fbe6ca10f13 100644
--- a/yogstation/code/game/objects/structures/toilet_bong.dm
+++ b/yogstation/code/game/objects/structures/toilet_bong.dm
@@ -20,11 +20,10 @@
weed_overlay = mutable_appearance('yogstation/icons/obj/watercloset.dmi', "weed")
START_PROCESSING(SSobj, src)
-/obj/structure/toilet_bong/update_icon()
+/obj/structure/toilet_bong/update_overlays()
. = ..()
- cut_overlays()
if (LAZYLEN(contents))
- add_overlay(weed_overlay)
+ . += weed_overlay
/obj/structure/toilet_bong/attack_hand(mob/user)
. = ..()
@@ -44,7 +43,7 @@
smoke.set_up(smoke_spread, location = location, carry = boof.reagents, silent = TRUE)
smoke.start()
qdel(boof)
- update_icon()
+ update_appearance(UPDATE_ICON)
// It's a bong powered by a **flamethrower**, it's definitely an open flame!!
/obj/structure/toilet_bong/process()
diff --git a/yogstation/code/modules/antagonists/darkspawn/darkspawn_objects/umbral_tendrils.dm b/yogstation/code/modules/antagonists/darkspawn/darkspawn_objects/umbral_tendrils.dm
index 1c55ec101a61..a4f15945230b 100644
--- a/yogstation/code/modules/antagonists/darkspawn/darkspawn_objects/umbral_tendrils.dm
+++ b/yogstation/code/modules/antagonists/darkspawn/darkspawn_objects/umbral_tendrils.dm
@@ -82,7 +82,7 @@
if(istype(O, /obj/item/pda))
var/obj/item/pda/PDA = O
PDA.set_light_on(FALSE)
- PDA.update_icon()
+ PDA.update_appearance(UPDATE_ICON)
visible_message(span_danger("The light in [PDA] shorts out!"))
else
visible_message(span_danger("[O] is disintegrated by [src]!"))
diff --git a/yogstation/code/modules/antagonists/shadowling/shadowling_abilities.dm b/yogstation/code/modules/antagonists/shadowling/shadowling_abilities.dm
index bd7bf2d88a81..fa3c739017ff 100644
--- a/yogstation/code/modules/antagonists/shadowling/shadowling_abilities.dm
+++ b/yogstation/code/modules/antagonists/shadowling/shadowling_abilities.dm
@@ -521,7 +521,7 @@
target_apc.cell?.charge = 0 //Sent to the shadow realm
target_apc.chargemode = 0 //Won't recharge either until an engineer hits the button
target_apc.charging = 0
- target_apc.update_icon()
+ target_apc.update_appearance(UPDATE_ICON)
return TRUE
diff --git a/yogstation/code/modules/antagonists/slaughter/slaughter.dm b/yogstation/code/modules/antagonists/slaughter/slaughter.dm
index 561a30f50e9d..16a114100244 100644
--- a/yogstation/code/modules/antagonists/slaughter/slaughter.dm
+++ b/yogstation/code/modules/antagonists/slaughter/slaughter.dm
@@ -133,8 +133,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/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/organ/heart/demon/attack(mob/M, mob/living/carbon/user, obj/target)
if(M != user)
diff --git a/yogstation/code/modules/assembly/signaler.dm b/yogstation/code/modules/assembly/signaler.dm
index 951b9fbb2e83..08dc33171402 100644
--- a/yogstation/code/modules/assembly/signaler.dm
+++ b/yogstation/code/modules/assembly/signaler.dm
@@ -3,19 +3,14 @@
var/static/list/label_colors = list("red", "green", "blue", "cyan", "magenta", "yellow", "white")
var/label_color = "green"
-/obj/item/assembly/signaler/Initialize(mapload)
+/obj/item/assembly/signaler/update_overlays()
. = ..()
- update_icon()
-
-/obj/item/assembly/signaler/update_icon()
if(label_color)
- cut_overlays()
attached_overlays = list()
- var/mutable_appearance/A = mutable_appearance('yogstation/icons/obj/assemblies/new_assemblies.dmi', "signaller_color")
+ var/mutable_appearance/A = mutable_appearance(icon, "signaller_color")
A.color = label_color
- add_overlay(A)
+ . += A
attached_overlays += A
- return ..()
/obj/item/assembly/signaler/anomaly
label_color = null
diff --git a/yogstation/code/modules/atmospherics/machinery/pipes/bluespace.dm b/yogstation/code/modules/atmospherics/machinery/pipes/bluespace.dm
index 7e9daa9c63f1..1487e1ad519a 100644
--- a/yogstation/code/modules/atmospherics/machinery/pipes/bluespace.dm
+++ b/yogstation/code/modules/atmospherics/machinery/pipes/bluespace.dm
@@ -47,21 +47,17 @@ GLOBAL_LIST_EMPTY(bluespace_pipe_networks)
return ..() + GLOB.bluespace_pipe_networks[bluespace_network_name] - src
/obj/machinery/atmospherics/pipe/bluespace/hide()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/machinery/atmospherics/pipe/bluespace/update_icon(showpipe)
+/obj/machinery/atmospherics/pipe/bluespace/update_icon(updates=ALL)
+ . = ..()
underlays.Cut()
var/turf/T = loc
- if(level == 2 || !T.intact)
- showpipe = TRUE
- plane = GAME_PLANE
- else
- showpipe = FALSE
+ if(level != 2 && !!T.intact)
plane = FLOOR_PLANE
-
- if(!showpipe)
return //no need to update the pipes if they aren't showing
+ plane = GAME_PLANE
var/connected = 0 //Direction bitset
@@ -83,4 +79,4 @@ GLOBAL_LIST_EMPTY(bluespace_pipe_networks)
if(color)
. = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir, color)
else
- . = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir)
\ No newline at end of file
+ . = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir)
diff --git a/yogstation/code/modules/clothing/head/helmet.dm b/yogstation/code/modules/clothing/head/helmet.dm
index ffd7174204d6..0c55cc0756d5 100644
--- a/yogstation/code/modules/clothing/head/helmet.dm
+++ b/yogstation/code/modules/clothing/head/helmet.dm
@@ -5,7 +5,8 @@
. = ..()
initial_state = "[initial(icon_state)]"
-/obj/item/clothing/head/helmet/update_icon()
+/obj/item/clothing/head/helmet/update_icon_state()
+ . = ..()
var/state = "[initial_state]"
if(attached_light)
if(attached_light.on)
diff --git a/yogstation/code/modules/clothing/suits/miscellaneous.dm b/yogstation/code/modules/clothing/suits/miscellaneous.dm
index 4bd350392f00..a2a8e270b9ed 100644
--- a/yogstation/code/modules/clothing/suits/miscellaneous.dm
+++ b/yogstation/code/modules/clothing/suits/miscellaneous.dm
@@ -173,21 +173,21 @@
desc = "Aviators not included. Now in dark blue!"
icon_state = "navymiljacket"
item_state = "navymiljacket"
- allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter, /obj/item/radio)
+ allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter, /obj/item/radio)
/obj/item/clothing/suit/yogs/desertmiljacket
name = "desert military jacket"
desc = "Aviators not included. Now in dark brown!"
icon_state = "desertmiljacket"
item_state = "desertmiljacket"
- allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter, /obj/item/radio)
+ allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter, /obj/item/radio)
/obj/item/clothing/suit/yogs/denimjacket
name = "denim jacket"
desc = "A bit scratchy but pretty cool looking."
icon_state = "denim_jacket"
item_state = "denim_jacket"
- allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/box/fancy/cigarettes, /obj/item/lighter, /obj/item/radio)
+ allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant, /obj/item/toy, /obj/item/storage/fancy/cigarettes, /obj/item/lighter, /obj/item/radio)
/obj/item/clothing/suit/hooded/fiendcowl
mob_overlay_icon = 'yogstation/icons/mob/clothing/suit/suit.dmi'
diff --git a/yogstation/code/modules/clothing/suits/nerd.dm b/yogstation/code/modules/clothing/suits/nerd.dm
index 94abc9883b90..a1f1a94c230b 100644
--- a/yogstation/code/modules/clothing/suits/nerd.dm
+++ b/yogstation/code/modules/clothing/suits/nerd.dm
@@ -57,7 +57,7 @@
. = ..()
GC = new(src)
GC.scanning = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/item/clothing/suit/armor/nerd/Destroy()
QDEL_NULL(GC)
diff --git a/yogstation/code/modules/guardian/abilities/major/healing.dm b/yogstation/code/modules/guardian/abilities/major/healing.dm
index d471a2b1fe89..1683af8a48fb 100644
--- a/yogstation/code/modules/guardian/abilities/major/healing.dm
+++ b/yogstation/code/modules/guardian/abilities/major/healing.dm
@@ -45,7 +45,7 @@
guardian.do_attack_animation(O)
O.obj_integrity = min(O.obj_integrity + (O.max_integrity * 0.1), O.max_integrity)
var/obj/effect/temp_visual/heal/H = new /obj/effect/temp_visual/heal(get_turf(O))
- O.update_icon()
+ O.update_appearance(UPDATE_ICON)
if (guardian.namedatum)
H.color = guardian.namedatum.color
guardian.changeNext_move(CLICK_CD_MELEE)
diff --git a/yogstation/code/modules/jobs/job_types/_job.dm b/yogstation/code/modules/jobs/job_types/_job.dm
index 6f74b51930a9..266bafbc687f 100644
--- a/yogstation/code/modules/jobs/job_types/_job.dm
+++ b/yogstation/code/modules/jobs/job_types/_job.dm
@@ -49,18 +49,18 @@
var/obj/item/modular_computer/tablet/pda/PDA = locate(/obj/item/modular_computer/tablet/pda) in H.get_all_contents()
if(PDA)
PDA.finish_color = "glass"
- PDA.update_icon()
+ PDA.update_appearance(UPDATE_ICON)
if(PDA_COLOR_PIPBOY)
var/obj/item/modular_computer/tablet/pda/PDA = locate(/obj/item/modular_computer/tablet/pda) in H.get_all_contents()
if(PDA)
PDA.finish_color = "pipboy"
PDA.slot_flags |= ITEM_SLOT_GLOVES
- PDA.update_icon()
+ PDA.update_appearance(UPDATE_ICON)
if(PDA_COLOR_RAINBOW)
var/obj/item/modular_computer/tablet/pda/PDA = locate(/obj/item/modular_computer/tablet/pda) in H.get_all_contents()
if(PDA)
PDA.finish_color = "rainbow"
- PDA.update_icon()
+ PDA.update_appearance(UPDATE_ICON)
/datum/job/proc/give_cape(mob/living/H, mob/M)
var/client/C = M.client
diff --git a/yogstation/code/modules/jobs/job_types/clerk.dm b/yogstation/code/modules/jobs/job_types/clerk.dm
index c57b7640125a..9ba5a203c724 100644
--- a/yogstation/code/modules/jobs/job_types/clerk.dm
+++ b/yogstation/code/modules/jobs/job_types/clerk.dm
@@ -29,8 +29,8 @@
/obj/item/circuitboard/computer/slot_machine = 15,
/obj/item/twohanded/dualsaber/toy = 10,
/obj/item/toy/windupToolbox = 10,
- /obj/item/storage/box/fancy/cigarettes/cigpack_syndicate = 5,
- /obj/item/storage/box/fancy/heart_box = 5,
+ /obj/item/storage/fancy/cigarettes/cigpack_syndicate = 5,
+ /obj/item/storage/fancy/heart_box = 5,
/obj/item/lipstick/random = 5,
/obj/item/skub = 2, //pro skub have taken over the mail
/obj/item/stack/ore/bluespace_crystal/refined/nt = 1
diff --git a/yogstation/code/modules/mob/living/brain/MMI.dm b/yogstation/code/modules/mob/living/brain/MMI.dm
index 938d33afd02c..6fc408eca8df 100644
--- a/yogstation/code/modules/mob/living/brain/MMI.dm
+++ b/yogstation/code/modules/mob/living/brain/MMI.dm
@@ -7,7 +7,7 @@
brain = newbrain
name = "[initial(name)]: [brain.real_name]"
to_chat(brainmob, "(If your brain was removed after your death you don't remember how you died, or who killed you. See rule 1.6.") //yogs
- update_icon()
+ update_appearance(UPDATE_ICON)
return
.=..()
diff --git a/yogstation/code/modules/mob/living/simple_animal/friendly/chocobo.dm b/yogstation/code/modules/mob/living/simple_animal/friendly/chocobo.dm
index c99a33a04e1d..d4ad2323a2d4 100644
--- a/yogstation/code/modules/mob/living/simple_animal/friendly/chocobo.dm
+++ b/yogstation/code/modules/mob/living/simple_animal/friendly/chocobo.dm
@@ -33,7 +33,7 @@
if(random_color)
var/newcolor = rgb(rand(0, 255), rand(0, 255), rand(0, 255))
add_atom_colour(newcolor, FIXED_COLOUR_PRIORITY)
- update_icon()
+ update_appearance(UPDATE_ICON)
var/datum/component/riding/D = LoadComponent(/datum/component/riding)
D.set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(0, 8, MOB_LAYER), TEXT_SOUTH = list(0, 8, MOB_LAYER), TEXT_EAST = list(0, 8, MOB_LAYER), TEXT_WEST = list( 0, 8, MOB_LAYER)))
D.set_vehicle_dir_layer(SOUTH, ABOVE_MOB_LAYER)
@@ -44,7 +44,7 @@
/mob/living/simple_animal/chocobo/death(gibbed)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
for(var/mob/living/N in buckled_mobs)
unbuckle_mob(N)
can_buckle = FALSE
@@ -53,17 +53,17 @@
. = ..()
if(.)
can_buckle = initial(can_buckle)
- update_icon()
+ update_appearance(UPDATE_ICON)
-/mob/living/simple_animal/chocobo/update_icon()
+/mob/living/simple_animal/chocobo/update_overlays()
+ . = ..()
if(!random_color) //icon override
return
- cut_overlays()
if(stat == DEAD)
var/mutable_appearance/base_overlay = mutable_appearance(icon, "chocobo_limbs_dead")
base_overlay.appearance_flags = RESET_COLOR
- add_overlay(base_overlay)
+ . += base_overlay
else
var/mutable_appearance/base_overlay = mutable_appearance(icon, "chocobo_limbs")
base_overlay.appearance_flags = RESET_COLOR
- add_overlay(base_overlay)
+ . += base_overlay
diff --git a/yogstation/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm b/yogstation/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm
index 930ef01a8919..6872cab8cb93 100644
--- a/yogstation/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm
+++ b/yogstation/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm
@@ -107,7 +107,7 @@ Difficulty: Insanely Hard
/mob/living/simple_animal/hostile/retaliate/goat/king/phase2/Initialize(mapload)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/mob/living/simple_animal/hostile/retaliate/goat/king/Found(atom/A)
if(isliving(A))
@@ -256,11 +256,12 @@ Difficulty: Insanely Hard
player.music_path = /datum/music/sourced/battle/king_goat_2
player.do_range_check(0)
stun_chance = 10
- update_icon()
+ update_appearance(UPDATE_ICON)
visible_message(span_cult("\The [src]' wounds close with a flash, and when he emerges, he's even larger than before!"))
-/mob/living/simple_animal/hostile/retaliate/goat/king/phase2/update_icon()
+/mob/living/simple_animal/hostile/retaliate/goat/king/phase2/update_icon_state()
+ . = ..()
var/matrix/M = new
if(phase3)
icon_state = "king_goat3"
diff --git a/yogstation/code/modules/power/singularity/particle_accelerator/particle_control.dm b/yogstation/code/modules/power/singularity/particle_accelerator/particle_control.dm
index 0e252afdaf75..554048023299 100644
--- a/yogstation/code/modules/power/singularity/particle_accelerator/particle_control.dm
+++ b/yogstation/code/modules/power/singularity/particle_accelerator/particle_control.dm
@@ -16,4 +16,4 @@
if(!active)
toggle_power()
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/yogstation/code/modules/power/validhunter.dm b/yogstation/code/modules/power/validhunter.dm
index 63262bd57139..8bbf585d4db2 100644
--- a/yogstation/code/modules/power/validhunter.dm
+++ b/yogstation/code/modules/power/validhunter.dm
@@ -15,7 +15,8 @@
connect_to_network()
return ..()
-/obj/machinery/power/validhunter_engine/update_icon()
+/obj/machinery/power/validhunter_engine/update_icon_state()
+ . = ..()
if(operating)
icon_state = "throw_me_in_the_trash_and_feed_my_remains_to_the_devil_operating"
else
@@ -74,7 +75,7 @@
/obj/machinery/power/validhunter_engine/proc/process_mob(mob/living/L, mob/user)
operating = TRUE
- update_icon()
+ update_appearance(UPDATE_ICON)
playsound(src.loc, 'sound/machines/terminal_on.ogg', 50, 1)
L.forceMove(src)
@@ -159,7 +160,7 @@
pixel_x = initial(pixel_x) //return to its spot after shaking
operating = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/machinery/power/validhunter_engine/proc/fake_gib(mob/living/L)
playsound(src.loc, 'sound/machines/terminal_off.ogg', 50, 1)
@@ -167,5 +168,5 @@
dropContents()
operating = FALSE
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/yogstation/code/modules/projectiles/guns/ballistic/launchers.dm b/yogstation/code/modules/projectiles/guns/ballistic/launchers.dm
index 9aaa8b623031..060b47aee275 100644
--- a/yogstation/code/modules/projectiles/guns/ballistic/launchers.dm
+++ b/yogstation/code/modules/projectiles/guns/ballistic/launchers.dm
@@ -13,8 +13,9 @@
casing_ejector = FALSE
internal_magazine = TRUE
-/obj/item/gun/ballistic/speargun/update_icon()
- return
+/obj/item/gun/ballistic/speargun/Initialize(mapload)
+ AddElement(/datum/element/update_icon_blocker)
+ return ..()
/obj/item/gun/ballistic/speargun/attack_self()
return
diff --git a/yogstation/code/modules/reagents/reagent_containers/hypospray.dm b/yogstation/code/modules/reagents/reagent_containers/hypospray.dm
index 64698a74717a..bdacdabff9cd 100644
--- a/yogstation/code/modules/reagents/reagent_containers/hypospray.dm
+++ b/yogstation/code/modules/reagents/reagent_containers/hypospray.dm
@@ -23,7 +23,8 @@
amount_per_transfer_from_this = 25
list_reagents = list(/datum/reagent/medicine/stimulants = 75)
-/obj/item/reagent_containers/autoinjector/medipen/stimpack/large/update_icon()
+/obj/item/reagent_containers/autoinjector/medipen/stimpack/large/update_icon_state()
+ . = ..()
if(reagents.total_volume > 25)
icon_state = initial(icon_state)
else if(reagents.total_volume)
@@ -45,7 +46,8 @@
var/enlightenment = pick(strings(REDPILL_FILE, "redpill_questions"))
to_chat(M, span_notice("[enlightenment]"))
-/obj/item/reagent_containers/autoinjector/medipen/stimpack/large/redpill/update_icon()
+/obj/item/reagent_containers/autoinjector/medipen/stimpack/large/redpill/update_icon_state()
+ . = ..()
if(reagents.total_volume > 25)
icon_state = initial(icon_state)
else if(reagents.total_volume)
diff --git a/yogstation/code/modules/recycling/disposal/pipe_sorting.dm b/yogstation/code/modules/recycling/disposal/pipe_sorting.dm
index f62799bbc453..e66d58d8b4b7 100644
--- a/yogstation/code/modules/recycling/disposal/pipe_sorting.dm
+++ b/yogstation/code/modules/recycling/disposal/pipe_sorting.dm
@@ -27,17 +27,16 @@
if(!wires.is_cut(WIRE_SORT_SCAN))
sort_scan = TRUE
-/obj/structure/disposalpipe/sorting/update_icon()
- cut_overlays()
+/obj/structure/disposalpipe/sorting/update_overlays()
. = ..()
if(panel_open)
- add_overlay(image('yogstation/icons/obj/atmospherics/pipes/disposal.dmi', "[icon_state]-open"))
+ . += image('yogstation/icons/obj/atmospherics/pipes/disposal.dmi', "[icon_state]-open")
/obj/structure/disposalpipe/sorting/screwdriver_act(mob/living/user, obj/item/I)
panel_open = !panel_open
I.play_tool_sound(src)
to_chat(user, span_notice("You [panel_open ? "open" : "close"] the wire panel."))
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
/obj/structure/disposalpipe/sorting/attackby(obj/item/I, mob/user)
diff --git a/yogstation/code/modules/spacepods/construction.dm b/yogstation/code/modules/spacepods/construction.dm
index 52b704d195ca..02a6e2a13949 100644
--- a/yogstation/code/modules/spacepods/construction.dm
+++ b/yogstation/code/modules/spacepods/construction.dm
@@ -200,4 +200,4 @@
user.visible_message("[user] welds [src]'s armor.", "You weld [src]'s armor.")
// finally this took too fucking long
// somehow this takes up 40 lines less code than the original, code-less version. And it actually works
- update_icon()
+ update_appearance(UPDATE_ICON)
diff --git a/yogstation/code/modules/spacepods/equipment.dm b/yogstation/code/modules/spacepods/equipment.dm
index aec8c6517d61..54454085cea5 100644
--- a/yogstation/code/modules/spacepods/equipment.dm
+++ b/yogstation/code/modules/spacepods/equipment.dm
@@ -38,7 +38,7 @@
/obj/item/spacepod_equipment/weaponry/on_install(obj/spacepod/SP)
. = ..()
SP.weapon = src
- SP.update_icon()
+ SP.update_appearance(UPDATE_ICON)
/obj/item/spacepod_equipment/weaponry/on_uninstall()
. = ..()
diff --git a/yogstation/code/modules/spacepods/physics.dm b/yogstation/code/modules/spacepods/physics.dm
index 4eb92c5b40c5..5ba97f85e2d3 100644
--- a/yogstation/code/modules/spacepods/physics.dm
+++ b/yogstation/code/modules/spacepods/physics.dm
@@ -207,7 +207,7 @@
C.pixel_y = last_offset_y*32
animate(C, pixel_x = offset_x*32, pixel_y = offset_y*32, time = time SECONDS, flags=ANIMATION_END_NOW)
user_thrust_dir = 0
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/spacepod/Bumped(atom/movable/A)
if(A.dir & NORTH)
diff --git a/yogstation/code/modules/spacepods/spacepod.dm b/yogstation/code/modules/spacepods/spacepod.dm
index f6fe8a57dd6f..6fae6028cfc5 100644
--- a/yogstation/code/modules/spacepods/spacepod.dm
+++ b/yogstation/code/modules/spacepods/spacepod.dm
@@ -168,12 +168,12 @@ GLOBAL_LIST_INIT(spacepods_list, list())
if(W.use_tool(src, user, 50, amount=3, volume = 50))
if(repairing)
obj_integrity = min(max_integrity, obj_integrity + 10)
- update_icon()
+ update_appearance(UPDATE_ICON)
to_chat(user, span_notice("You mend some [pick("dents","bumps","damage")] with [W]"))
else if(!cell && !internal_tank && !equipment.len && !pilot && !passengers.len && construction_state == SPACEPOD_ARMOR_WELDED)
user.visible_message("[user] slices off [src]'s armor.", span_notice("You slice off [src]'s armor."))
construction_state = SPACEPOD_ARMOR_SECURED
- update_icon()
+ update_appearance(UPDATE_ICON)
return TRUE
return ..()
@@ -235,7 +235,7 @@ GLOBAL_LIST_INIT(spacepods_list, list())
max_integrity = armor.pod_integrity
obj_integrity = max_integrity - integrity_failure + obj_integrity
pod_armor = armor
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/spacepod/proc/remove_armor()
if(!pod_armor)
@@ -243,7 +243,7 @@ GLOBAL_LIST_INIT(spacepods_list, list())
max_integrity = integrity_failure
desc = initial(desc)
pod_armor = null
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/spacepod/proc/InterceptClickOn(mob/user, params, atom/target)
@@ -255,8 +255,8 @@ GLOBAL_LIST_INIT(spacepods_list, list())
return TRUE
/obj/spacepod/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = TRUE, attack_dir, armour_penetration = 0)
- . = ..()
- update_icon()
+ ..()
+ update_appearance(UPDATE_ICON)
/obj/spacepod/return_air()
return cabin_air
@@ -396,20 +396,13 @@ GLOBAL_LIST_INIT(spacepods_list, list())
// there here's your frame pieces back, happy?
qdel(src)
-/obj/spacepod/update_icon()
- cut_overlays()
+/obj/spacepod/update_icon_state()
+ . = ..()
if(construction_state != SPACEPOD_ARMOR_WELDED)
icon = 'goon/icons/obj/spacepods/construction_2x2.dmi'
icon_state = "pod_[construction_state]"
- if(pod_armor && construction_state >= SPACEPOD_ARMOR_LOOSE)
- var/mutable_appearance/masked_armor = mutable_appearance(icon = 'goon/icons/obj/spacepods/construction_2x2.dmi', icon_state = "armor_mask")
- var/mutable_appearance/armor = mutable_appearance(pod_armor.pod_icon, pod_armor.pod_icon_state)
- armor.blend_mode = BLEND_MULTIPLY
- masked_armor.overlays = list(armor)
- masked_armor.appearance_flags = KEEP_TOGETHER
- add_overlay(masked_armor)
return
-
+
if(pod_armor)
icon = pod_armor.pod_icon
icon_state = pod_armor.pod_icon_state
@@ -417,13 +410,25 @@ GLOBAL_LIST_INIT(spacepods_list, list())
icon = 'goon/icons/obj/spacepods/2x2.dmi'
icon_state = initial(icon_state)
+/obj/spacepod/update_overlays()
+ . = ..()
+ if(construction_state != SPACEPOD_ARMOR_WELDED)
+ if(pod_armor && construction_state >= SPACEPOD_ARMOR_LOOSE)
+ var/mutable_appearance/masked_armor = mutable_appearance(icon = 'goon/icons/obj/spacepods/construction_2x2.dmi', icon_state = "armor_mask")
+ var/mutable_appearance/armor = mutable_appearance(pod_armor.pod_icon, pod_armor.pod_icon_state)
+ armor.blend_mode = BLEND_MULTIPLY
+ masked_armor.overlays = list(armor)
+ masked_armor.appearance_flags = KEEP_TOGETHER
+ . += masked_armor
+ return
+
if(obj_integrity <= max_integrity / 2)
- add_overlay(image(icon='goon/icons/obj/spacepods/2x2.dmi', icon_state="pod_damage"))
+ . += image(icon='goon/icons/obj/spacepods/2x2.dmi', icon_state="pod_damage")
if(obj_integrity <= max_integrity / 4)
- add_overlay(image(icon='goon/icons/obj/spacepods/2x2.dmi', icon_state="pod_fire"))
+ . += image(icon='goon/icons/obj/spacepods/2x2.dmi', icon_state="pod_fire")
if(weapon && weapon.overlay_icon_state)
- add_overlay(image(icon=weapon.overlay_icon,icon_state=weapon.overlay_icon_state))
+ . += image(icon=weapon.overlay_icon,icon_state=weapon.overlay_icon_state)
light_color = icon_light_color[icon_state] || LIGHT_COLOR_WHITE
@@ -456,13 +461,13 @@ GLOBAL_LIST_INIT(spacepods_list, list())
var/left_thrust = left_thrusts[cdir]
var/right_thrust = right_thrusts[cdir]
if(left_thrust)
- add_overlay(image(icon = 'yogstation/icons/obj/spacepods/2x2.dmi', icon_state = "rcs_left", dir = cdir))
+ . += image(icon = 'yogstation/icons/obj/spacepods/2x2.dmi', icon_state = "rcs_left", dir = cdir)
if(right_thrust)
- add_overlay(image(icon = 'yogstation/icons/obj/spacepods/2x2.dmi', icon_state = "rcs_right", dir = cdir))
+ . += image(icon = 'yogstation/icons/obj/spacepods/2x2.dmi', icon_state = "rcs_right", dir = cdir)
if(back_thrust)
var/image/I = image(icon = 'yogstation/icons/obj/spacepods/2x2.dmi', icon_state = "thrust")
I.transform = matrix(1, 0, 0, 0, 1, -32)
- add_overlay(I)
+ . += I
/obj/spacepod/MouseDrop_T(atom/movable/A, mob/living/user)
if(user == pilot || (user in passengers) || construction_state != SPACEPOD_ARMOR_WELDED)
diff --git a/yogstation/code/modules/xenoarch/loot/gigadrill.dm b/yogstation/code/modules/xenoarch/loot/gigadrill.dm
index 32c252da6d48..5d108ab2308c 100644
--- a/yogstation/code/modules/xenoarch/loot/gigadrill.dm
+++ b/yogstation/code/modules/xenoarch/loot/gigadrill.dm
@@ -13,13 +13,13 @@
/obj/vehicle/ridden/gigadrill/after_add_occupant(mob/M)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
/obj/vehicle/ridden/gigadrill/after_remove_occupant(mob/M)
. = ..()
- update_icon()
+ update_appearance(UPDATE_ICON)
-/obj/vehicle/ridden/gigadrill/update_icon()
+/obj/vehicle/ridden/gigadrill/update_icon_state()
. = ..()
if(occupant_amount())
icon_state = "gigadrill_mov"
diff --git a/yogstation/code/modules/xenoarch/loot/guns.dm b/yogstation/code/modules/xenoarch/loot/guns.dm
index 5c59228e29a1..0fd29c83886c 100644
--- a/yogstation/code/modules/xenoarch/loot/guns.dm
+++ b/yogstation/code/modules/xenoarch/loot/guns.dm
@@ -17,7 +17,8 @@
. = ..()
playsound(src, 'yogstation/sound/weapons/spur_spawn.ogg')
-/obj/item/gun/energy/polarstar/update_icon(force_update)
+/obj/item/gun/energy/polarstar/update_icon(updates=ALL)
+ . = ..()
var/maxcharge = cell.maxcharge
var/charge = cell.charge
@@ -42,9 +43,7 @@
if(chargesound != oldsound)
playsound(src, chargesound, 100)
-
addtimer(CALLBACK(src, PROC_REF(playsound), src, chargesound, 75), 0.1 SECONDS)
- return
/obj/item/gun/energy/polarstar/spur
name = "Spur"