diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 57cf83abde..2dcadfa1c7 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -49,5 +49,5 @@ obj/machinery/atmospherics disconnect(obj/machinery/atmospherics/reference) - update_icon() - return null \ No newline at end of file + update_icon() + return null \ No newline at end of file diff --git a/code/WorkInProgress/Chemistry-Tools.dm b/code/WorkInProgress/Chemistry-Tools.dm index 93648f4e80..38ae603f40 100644 --- a/code/WorkInProgress/Chemistry-Tools.dm +++ b/code/WorkInProgress/Chemistry-Tools.dm @@ -644,14 +644,13 @@ user << "\blue You inject 5 units of the solution. The syringe now contains [src.reagents.total_volume] units." return - proc - update_icon() - var/rounded_vol = round(reagents.total_volume,5) - if(ismob(loc)) - icon_state = "[mode][rounded_vol]" - else - icon_state = "[rounded_vol]" - item_state = "syringe_[rounded_vol]" + update_icon() + var/rounded_vol = round(reagents.total_volume,5) + if(ismob(loc)) + icon_state = "[mode][rounded_vol]" + else + icon_state = "[rounded_vol]" + item_state = "syringe_[rounded_vol]" //////////////////////////////////////////////////////////////////////////////// /// Syringes. END diff --git a/code/defines/obj/toy.dm b/code/defines/obj/toy.dm index 4fdf8887e4..e1ea24fd61 100644 --- a/code/defines/obj/toy.dm +++ b/code/defines/obj/toy.dm @@ -20,11 +20,10 @@ obj/item/toy/blink w_class = 1.0 var/amount_left = 7.0 - proc - update_icon() - src.icon_state = text("357-[]", src.amount_left) - src.desc = text("There are [] caps\s left!", src.amount_left) - return + update_icon() + src.icon_state = text("357-[]", src.amount_left) + src.desc = text("There are [] caps\s left!", src.amount_left) + return /obj/item/toy/ammo/crossbow name = "foam dart" diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index 32cc5fb1b4..a6f5b7c71f 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -163,6 +163,7 @@ source2.blood_DNA = null // var/icon/I = new /icon(source2.icon_old, source2.icon_state) source2.icon = source2.icon_old + source2.update_icon() if (istype(src, /turf/simulated)) var/obj/item/source2 = src source2.blood_DNA = null diff --git a/code/game/machinery/airlock_control.dm b/code/game/machinery/airlock_control.dm index 438a499949..de5b8d220a 100644 --- a/code/game/machinery/airlock_control.dm +++ b/code/game/machinery/airlock_control.dm @@ -104,7 +104,7 @@ obj/machinery/airlock_sensor var/on = 1 var/alert = 0 - proc/update_icon() + update_icon() if(on) if(alert) icon_state = "airlock_sensor_alert" @@ -170,7 +170,7 @@ obj/machinery/access_button var/on = 1 - proc/update_icon() + update_icon() if(on) icon_state = "access_button_standby" else diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm index 625be0d385..6692f2b8fd 100644 --- a/code/game/machinery/atmo_control.dm +++ b/code/game/machinery/atmo_control.dm @@ -22,7 +22,7 @@ obj/machinery/air_sensor var/datum/radio_frequency/radio_connection - proc/update_icon() + update_icon() icon_state = "gsensor[on]" process() diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index f7c964dea8..9a1cdaa2dc 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -30,9 +30,10 @@ ..() + update_icon() + return null + proc - update_icon() - return null connect(obj/machinery/atmospherics/portables_connector/new_port) //Make sure not already connected to something else diff --git a/code/game/machinery/blender.dm b/code/game/machinery/blender.dm index 8b91eeaecf..25786ef77a 100644 --- a/code/game/machinery/blender.dm +++ b/code/game/machinery/blender.dm @@ -30,19 +30,19 @@ the blender or the processor: Processor items are solid objects and Blender resu on_reagent_change() //When the reagents change, change the icon as well. update_icon() - proc - update_icon() //Changes the icon depending on how full it is and whether it has the jug attached. - if(src.container) - switch(src.reagents.total_volume) - if(0) - src.icon_state = "blender_e" //Empty - if(1 to 75) - src.icon_state = "blender_h" //Some but not full - if(76 to 100) - src.icon_state = "blender_f" //Mostly full. - else - src.icon_state = "blender_d" //No jug. Should be redundant but just in case. - return + + update_icon() //Changes the icon depending on how full it is and whether it has the jug attached. + if(src.container) + switch(src.reagents.total_volume) + if(0) + src.icon_state = "blender_e" //Empty + if(1 to 75) + src.icon_state = "blender_h" //Some but not full + if(76 to 100) + src.icon_state = "blender_f" //Mostly full. + else + src.icon_state = "blender_d" //No jug. Should be redundant but just in case. + return /obj/machinery/blender/attackby(var/obj/item/O as obj, var/mob/user as mob) //Attack it with an object. if(src.contents.len >= 10 || src.reagents.total_volume >= 80) //Too full. Max 10 items or 80 units of reagent diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 60086494cf..2a67150c88 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -160,7 +160,7 @@ // if NOPOWER, display blank // if BROKEN, display blue screen of death icon AI uses // if timing=true, run update display function -/obj/machinery/door_timer/proc/update_icon() +/obj/machinery/door_timer/update_icon() if(stat & (NOPOWER)) icon_state = "frame" return diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 0b30d13460..4b1adf9c4f 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -156,7 +156,7 @@ s.set_up(2, 1, src) s.start() -/obj/machinery/door/proc/update_icon() +/obj/machinery/door/update_icon() if(density) icon_state = "door1" else diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index 6542f39a72..f1b6466796 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -32,7 +32,7 @@ obj/machinery/embedded_controller user.machine = src onclose(user, "computer") - proc/update_icon() + update_icon() proc/return_text() proc/post_signal(datum/signal/signal, comm_line) diff --git a/code/game/machinery/singularity.dm b/code/game/machinery/singularity.dm index 0f45fbc53d..f3d44c320e 100644 --- a/code/game/machinery/singularity.dm +++ b/code/game/machinery/singularity.dm @@ -569,7 +569,7 @@ However people seem to like it for some reason. ..() return -/obj/machinery/emitter/proc/update_icon() +/obj/machinery/emitter/update_icon() if (active && !(stat & (NOPOWER|BROKEN))) icon_state = "Emitter +a" else @@ -1076,7 +1076,7 @@ However people seem to like it for some reason. var/list/obj/machinery/containment_field/fields ////FIELD GEN START -/obj/machinery/field_generator/proc/update_icon() +/obj/machinery/field_generator/update_icon() if (!active) icon_state = "Field_Gen" return diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 4b210cdf17..629725132c 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -22,7 +22,7 @@ update_icon() return - proc/update_icon() + update_icon() if(open) icon_state = "sheater-open" else diff --git a/code/game/objects/assemblies.dm b/code/game/objects/assemblies.dm index 9ff1bcd449..7b64ca0c3b 100644 --- a/code/game/objects/assemblies.dm +++ b/code/game/objects/assemblies.dm @@ -100,39 +100,40 @@ process() + update_icon() + src.overlays = new/list() + src.underlays = new/list() + if(!tank_one && !tank_two && !attached_device) + icon_state = "valve_1" + return + icon_state = "valve" + var/tank_one_icon = "" + var/tank_two_icon = "" + if(tank_one) + tank_one_icon = tank_one.icon_state + if(tank_two) + tank_two_icon = tank_two.icon_state + if(tank_one) + var/icon/I = new(src.icon, icon_state = "[tank_one_icon]") + //var/obj/overlay/tank_one_overlay = new + //tank_one_overlay.icon = src.icon + //tank_one_overlay.icon_state = tank_one_icon + src.underlays += I + if(tank_two) + var/icon/J = new(src.icon, icon_state = "[tank_two_icon]") + //I.Flip(EAST) this breaks the perspective! + J.Shift(WEST, 13) + //var/obj/underlay/tank_two_overlay = new + //tank_two_overlay.icon = I + src.underlays += J + if(attached_device) + var/icon/K = new(src.icon, icon_state = "device") + //var/obj/overlay/device_overlay = new + //device_overlay.icon = src.icon + //device_overlay.icon_state = device_icon + src.overlays += K proc - update_icon() - src.overlays = new/list() - src.underlays = new/list() - if(!tank_one && !tank_two && !attached_device) - icon_state = "valve_1" - return - icon_state = "valve" - var/tank_one_icon = "" - var/tank_two_icon = "" - if(tank_one) - tank_one_icon = tank_one.icon_state - if(tank_two) - tank_two_icon = tank_two.icon_state - if(tank_one) - var/icon/I = new(src.icon, icon_state = "[tank_one_icon]") - //var/obj/overlay/tank_one_overlay = new - //tank_one_overlay.icon = src.icon - //tank_one_overlay.icon_state = tank_one_icon - src.underlays += I - if(tank_two) - var/icon/J = new(src.icon, icon_state = "[tank_two_icon]") - //I.Flip(EAST) this breaks the perspective! - J.Shift(WEST, 13) - //var/obj/underlay/tank_two_overlay = new - //tank_two_overlay.icon = I - src.underlays += J - if(attached_device) - var/icon/K = new(src.icon, icon_state = "device") - //var/obj/overlay/device_overlay = new - //device_overlay.icon = src.icon - //device_overlay.icon_state = device_icon - src.overlays += K + /* Exadv1: I know this isn't how it's going to work, but this was just to check diff --git a/code/game/objects/displaycase.dm b/code/game/objects/displaycase.dm index cc7733a03a..3dfabfc378 100644 --- a/code/game/objects/displaycase.dm +++ b/code/game/objects/displaycase.dm @@ -58,7 +58,7 @@ playsound(src.loc, 'Glasshit.ogg', 75, 1) return -/obj/displaycase/proc/update_icon() +/obj/displaycase/update_icon() if(src.destroyed) src.icon_state = "glassboxb[src.occupied]" else diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 2ab5405ffa..4a7cd3135c 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -5,9 +5,6 @@ ZIPPO */ -/obj/item/weapon/cigpacket/proc/update_icon() - return - /obj/item/weapon/cigpacket/update_icon() src.icon_state = text("cigpacket[]", src.cigcount) src.desc = text("There are [] cigs\s left!", src.cigcount) diff --git a/code/game/objects/items/weapons/guns_ammo.dm b/code/game/objects/items/weapons/guns_ammo.dm index aa1959212f..575e30a784 100644 --- a/code/game/objects/items/weapons/guns_ammo.dm +++ b/code/game/objects/items/weapons/guns_ammo.dm @@ -96,7 +96,7 @@ TELEPORT GUN // AMMO -/obj/item/weapon/ammo/proc/update_icon() +/obj/item/weapon/ammo/update_icon() return @@ -541,7 +541,7 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/us // ENERGY GUN -/obj/item/weapon/gun/energy/proc/update_icon() +/obj/item/weapon/gun/energy/update_icon() if (istype(src, /obj/item/weapon/gun/energy/crossbow)) return var/ratio = src.charges / 10 ratio = round(ratio, 0.25) * 100 diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index b1b82f175f..ced3958009 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -69,7 +69,7 @@ STUN BATON // STUN BATON -/obj/item/weapon/baton/proc/update_icon() +/obj/item/weapon/baton/update_icon() if(src.status) icon_state = "stunbaton_active" else diff --git a/code/game/objects/lamarr.dm b/code/game/objects/lamarr.dm index 87fdbafdca..413ecc0a05 100644 --- a/code/game/objects/lamarr.dm +++ b/code/game/objects/lamarr.dm @@ -80,7 +80,7 @@ playsound(src.loc, 'Glasshit.ogg', 75, 1) return -/obj/lamarr/proc/update_icon() +/obj/lamarr/update_icon() if(src.destroyed) src.icon_state = "labcageb[src.occupied]" else diff --git a/code/game/objects/object_procs.dm b/code/game/objects/object_procs.dm index d1c467cfd4..3bd03ef244 100644 --- a/code/game/objects/object_procs.dm +++ b/code/game/objects/object_procs.dm @@ -15,6 +15,8 @@ src.attack_hand(M) AutoUpdateAI(src) +/obj/proc/update_icon() + return /obj/item/proc/updateSelfDialog() var/mob/M = src.loc