Merge pull request #10212 from Ghommie/Ghommie-cit471
Ports some hud and update_icon code updates.
This commit is contained in:
@@ -47,8 +47,7 @@
|
||||
|
||||
/obj/item/defibrillator/update_icon()
|
||||
update_power()
|
||||
update_overlays()
|
||||
update_charge()
|
||||
return ..()
|
||||
|
||||
/obj/item/defibrillator/proc/update_power()
|
||||
if(!QDELETED(cell))
|
||||
@@ -59,23 +58,20 @@
|
||||
else
|
||||
powered = FALSE
|
||||
|
||||
/obj/item/defibrillator/proc/update_overlays()
|
||||
cut_overlays()
|
||||
/obj/item/defibrillator/update_overlays()
|
||||
. = ..()
|
||||
if(!on)
|
||||
add_overlay("[initial(icon_state)]-paddles")
|
||||
. += "[initial(icon_state)]-paddles"
|
||||
if(powered)
|
||||
add_overlay("[initial(icon_state)]-powered")
|
||||
if(!cell)
|
||||
add_overlay("[initial(icon_state)]-nocell")
|
||||
if(!safety)
|
||||
add_overlay("[initial(icon_state)]-emagged")
|
||||
|
||||
/obj/item/defibrillator/proc/update_charge()
|
||||
if(powered) //so it doesn't show charge if it's unpowered
|
||||
. += "[initial(icon_state)]-powered"
|
||||
if(!QDELETED(cell))
|
||||
var/ratio = cell.charge / cell.maxcharge
|
||||
ratio = CEILING(ratio*4, 1) * 25
|
||||
add_overlay("[initial(icon_state)]-charge[ratio]")
|
||||
if(!cell)
|
||||
. += "[initial(icon_state)]-nocell"
|
||||
if(!safety)
|
||||
. += "[initial(icon_state)]-emagged"
|
||||
|
||||
/obj/item/defibrillator/CheckParts(list/parts_list)
|
||||
..()
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
|
||||
merge_gases()
|
||||
for(var/i in 1 to 6)
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 20 + (i - 1) * 10)
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), 20 + (i - 1) * 10)
|
||||
|
||||
else if(valve_open && tank_one && tank_two)
|
||||
split_gases()
|
||||
|
||||
@@ -173,9 +173,6 @@
|
||||
/obj/proc/container_resist(mob/living/user)
|
||||
return
|
||||
|
||||
/obj/proc/update_icon()
|
||||
return
|
||||
|
||||
/mob/proc/unset_machine()
|
||||
if(machine)
|
||||
machine.on_unset_machine(src)
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
to_chat(user, "<span class='notice'>The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.</span>")
|
||||
user.reagents.add_reagent("godblood",20)
|
||||
update_icon()
|
||||
addtimer(CALLBACK(src, .proc/update_icon), time_between_uses)
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), time_between_uses)
|
||||
|
||||
|
||||
/obj/structure/healingfountain/update_icon()
|
||||
|
||||
Reference in New Issue
Block a user