Made items that get unbloodied update their icon during the unbloodying, so you can tell how much you used your gun between getting blood on it and cleaning it.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@791 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
n3ophyt3@gmail.com
2011-01-06 17:08:33 +00:00
parent f70263ab36
commit bd9819c272
20 changed files with 79 additions and 79 deletions

View File

@@ -49,5 +49,5 @@ obj/machinery/atmospherics
disconnect(obj/machinery/atmospherics/reference) disconnect(obj/machinery/atmospherics/reference)
update_icon() update_icon()
return null return null

View File

@@ -644,14 +644,13 @@
user << "\blue You inject 5 units of the solution. The syringe now contains [src.reagents.total_volume] units." user << "\blue You inject 5 units of the solution. The syringe now contains [src.reagents.total_volume] units."
return return
proc update_icon()
update_icon() var/rounded_vol = round(reagents.total_volume,5)
var/rounded_vol = round(reagents.total_volume,5) if(ismob(loc))
if(ismob(loc)) icon_state = "[mode][rounded_vol]"
icon_state = "[mode][rounded_vol]" else
else icon_state = "[rounded_vol]"
icon_state = "[rounded_vol]" item_state = "syringe_[rounded_vol]"
item_state = "syringe_[rounded_vol]"
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// Syringes. END /// Syringes. END

View File

@@ -20,11 +20,10 @@ obj/item/toy/blink
w_class = 1.0 w_class = 1.0
var/amount_left = 7.0 var/amount_left = 7.0
proc update_icon()
update_icon() src.icon_state = text("357-[]", src.amount_left)
src.icon_state = text("357-[]", src.amount_left) src.desc = text("There are [] caps\s left!", src.amount_left)
src.desc = text("There are [] caps\s left!", src.amount_left) return
return
/obj/item/toy/ammo/crossbow /obj/item/toy/ammo/crossbow
name = "foam dart" name = "foam dart"

View File

@@ -163,6 +163,7 @@
source2.blood_DNA = null source2.blood_DNA = null
// var/icon/I = new /icon(source2.icon_old, source2.icon_state) // var/icon/I = new /icon(source2.icon_old, source2.icon_state)
source2.icon = source2.icon_old source2.icon = source2.icon_old
source2.update_icon()
if (istype(src, /turf/simulated)) if (istype(src, /turf/simulated))
var/obj/item/source2 = src var/obj/item/source2 = src
source2.blood_DNA = null source2.blood_DNA = null

View File

@@ -104,7 +104,7 @@ obj/machinery/airlock_sensor
var/on = 1 var/on = 1
var/alert = 0 var/alert = 0
proc/update_icon() update_icon()
if(on) if(on)
if(alert) if(alert)
icon_state = "airlock_sensor_alert" icon_state = "airlock_sensor_alert"
@@ -170,7 +170,7 @@ obj/machinery/access_button
var/on = 1 var/on = 1
proc/update_icon() update_icon()
if(on) if(on)
icon_state = "access_button_standby" icon_state = "access_button_standby"
else else

View File

@@ -22,7 +22,7 @@ obj/machinery/air_sensor
var/datum/radio_frequency/radio_connection var/datum/radio_frequency/radio_connection
proc/update_icon() update_icon()
icon_state = "gsensor[on]" icon_state = "gsensor[on]"
process() process()

View File

@@ -30,9 +30,10 @@
..() ..()
update_icon()
return null
proc proc
update_icon()
return null
connect(obj/machinery/atmospherics/portables_connector/new_port) connect(obj/machinery/atmospherics/portables_connector/new_port)
//Make sure not already connected to something else //Make sure not already connected to something else

View File

@@ -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. on_reagent_change() //When the reagents change, change the icon as well.
update_icon() update_icon()
proc
update_icon() //Changes the icon depending on how full it is and whether it has the jug attached. update_icon() //Changes the icon depending on how full it is and whether it has the jug attached.
if(src.container) if(src.container)
switch(src.reagents.total_volume) switch(src.reagents.total_volume)
if(0) if(0)
src.icon_state = "blender_e" //Empty src.icon_state = "blender_e" //Empty
if(1 to 75) if(1 to 75)
src.icon_state = "blender_h" //Some but not full src.icon_state = "blender_h" //Some but not full
if(76 to 100) if(76 to 100)
src.icon_state = "blender_f" //Mostly full. src.icon_state = "blender_f" //Mostly full.
else else
src.icon_state = "blender_d" //No jug. Should be redundant but just in case. src.icon_state = "blender_d" //No jug. Should be redundant but just in case.
return return
/obj/machinery/blender/attackby(var/obj/item/O as obj, var/mob/user as mob) //Attack it with an object. /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 if(src.contents.len >= 10 || src.reagents.total_volume >= 80) //Too full. Max 10 items or 80 units of reagent

View File

@@ -160,7 +160,7 @@
// if NOPOWER, display blank // if NOPOWER, display blank
// if BROKEN, display blue screen of death icon AI uses // if BROKEN, display blue screen of death icon AI uses
// if timing=true, run update display function // if timing=true, run update display function
/obj/machinery/door_timer/proc/update_icon() /obj/machinery/door_timer/update_icon()
if(stat & (NOPOWER)) if(stat & (NOPOWER))
icon_state = "frame" icon_state = "frame"
return return

View File

@@ -156,7 +156,7 @@
s.set_up(2, 1, src) s.set_up(2, 1, src)
s.start() s.start()
/obj/machinery/door/proc/update_icon() /obj/machinery/door/update_icon()
if(density) if(density)
icon_state = "door1" icon_state = "door1"
else else

View File

@@ -32,7 +32,7 @@ obj/machinery/embedded_controller
user.machine = src user.machine = src
onclose(user, "computer") onclose(user, "computer")
proc/update_icon() update_icon()
proc/return_text() proc/return_text()
proc/post_signal(datum/signal/signal, comm_line) proc/post_signal(datum/signal/signal, comm_line)

View File

@@ -569,7 +569,7 @@ However people seem to like it for some reason.
..() ..()
return return
/obj/machinery/emitter/proc/update_icon() /obj/machinery/emitter/update_icon()
if (active && !(stat & (NOPOWER|BROKEN))) if (active && !(stat & (NOPOWER|BROKEN)))
icon_state = "Emitter +a" icon_state = "Emitter +a"
else else
@@ -1076,7 +1076,7 @@ However people seem to like it for some reason.
var/list/obj/machinery/containment_field/fields var/list/obj/machinery/containment_field/fields
////FIELD GEN START ////FIELD GEN START
/obj/machinery/field_generator/proc/update_icon() /obj/machinery/field_generator/update_icon()
if (!active) if (!active)
icon_state = "Field_Gen" icon_state = "Field_Gen"
return return

View File

@@ -22,7 +22,7 @@
update_icon() update_icon()
return return
proc/update_icon() update_icon()
if(open) if(open)
icon_state = "sheater-open" icon_state = "sheater-open"
else else

View File

@@ -100,39 +100,40 @@
process() 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 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 Exadv1: I know this isn't how it's going to work, but this was just to check

View File

@@ -58,7 +58,7 @@
playsound(src.loc, 'Glasshit.ogg', 75, 1) playsound(src.loc, 'Glasshit.ogg', 75, 1)
return return
/obj/displaycase/proc/update_icon() /obj/displaycase/update_icon()
if(src.destroyed) if(src.destroyed)
src.icon_state = "glassboxb[src.occupied]" src.icon_state = "glassboxb[src.occupied]"
else else

View File

@@ -5,9 +5,6 @@ ZIPPO
*/ */
/obj/item/weapon/cigpacket/proc/update_icon()
return
/obj/item/weapon/cigpacket/update_icon() /obj/item/weapon/cigpacket/update_icon()
src.icon_state = text("cigpacket[]", src.cigcount) src.icon_state = text("cigpacket[]", src.cigcount)
src.desc = text("There are [] cigs\s left!", src.cigcount) src.desc = text("There are [] cigs\s left!", src.cigcount)

View File

@@ -96,7 +96,7 @@ TELEPORT GUN
// AMMO // AMMO
/obj/item/weapon/ammo/proc/update_icon() /obj/item/weapon/ammo/update_icon()
return return
@@ -541,7 +541,7 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/us
// ENERGY GUN // 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 if (istype(src, /obj/item/weapon/gun/energy/crossbow)) return
var/ratio = src.charges / 10 var/ratio = src.charges / 10
ratio = round(ratio, 0.25) * 100 ratio = round(ratio, 0.25) * 100

View File

@@ -69,7 +69,7 @@ STUN BATON
// STUN BATON // STUN BATON
/obj/item/weapon/baton/proc/update_icon() /obj/item/weapon/baton/update_icon()
if(src.status) if(src.status)
icon_state = "stunbaton_active" icon_state = "stunbaton_active"
else else

View File

@@ -80,7 +80,7 @@
playsound(src.loc, 'Glasshit.ogg', 75, 1) playsound(src.loc, 'Glasshit.ogg', 75, 1)
return return
/obj/lamarr/proc/update_icon() /obj/lamarr/update_icon()
if(src.destroyed) if(src.destroyed)
src.icon_state = "labcageb[src.occupied]" src.icon_state = "labcageb[src.occupied]"
else else

View File

@@ -15,6 +15,8 @@
src.attack_hand(M) src.attack_hand(M)
AutoUpdateAI(src) AutoUpdateAI(src)
/obj/proc/update_icon()
return
/obj/item/proc/updateSelfDialog() /obj/item/proc/updateSelfDialog()
var/mob/M = src.loc var/mob/M = src.loc