Recharger QoL Tweaks (#3826)

changes:

Rechargers now briefly show a progress bar showing the current charge level of the device currently charging.
Examining a recharger will now specify what is in the charger.
Atoms can now mark themselves as requiring an icon update on initialize instead of overriding Initialize() just to call update_icon().
Charger code is now slightly more modular, using proc/get_cell() to get a ref to the power cell instead of hard-coded if-else chains for each supported type.
This commit is contained in:
Lohikar
2017-11-18 18:46:14 +02:00
committed by Erki
parent def00ac176
commit 58519daeba
16 changed files with 133 additions and 85 deletions
+6
View File
@@ -75,6 +75,8 @@
var/icon_override //Used to override hardcoded clothing dmis in human clothing pr
var/charge_failure_message = " cannot be recharged."
/obj/item/Destroy()
if(ismob(loc))
var/mob/m = loc
@@ -84,9 +86,13 @@
src.loc = null
return ..()
/obj/item/device
icon = 'icons/obj/device.dmi'
/obj/item/proc/get_cell()
return DEVICE_NO_CELL
//Checks if the item is being held by a mob, and if so, updates the held icons
/obj/item/proc/update_held_icon()
if(ismob(src.loc))