Extension additions and multitool menu tweaks.

Relocates obj extension code to the extension file.
Adds a support method, set_extension, to ensure that proper cleanup occurs in the case of multiple additions to the same extension type.
The default multitool menu title is now much shorter.
The cloning computer multitool menu now lists all connected cloning pods.
This commit is contained in:
PsiOmegaDelta
2015-12-05 22:51:41 +01:00
parent 4e8eb1f4dc
commit 39f0fcebaa
8 changed files with 41 additions and 20 deletions
+9 -2
View File
@@ -24,12 +24,19 @@
var/atom/buffer_object
/obj/item/device/multitool/proc/get_buffer(var/typepath)
// Update the buffer name only when someone fetches the buffer.
// Only allow clearing the buffer name when someone fetches the buffer.
// Means you cannot be sure the source hasn't been destroyed until the very moment it's needed.
buffer_name = buffer_object ? buffer_object.name : null
get_buffer_name(TRUE)
if(buffer_object && (!typepath || istype(buffer_object, typepath)))
return buffer_object
/obj/item/device/multitool/proc/get_buffer_name(var/null_name_if_missing = FALSE)
if(buffer_object)
buffer_name = buffer_object.name
else if(null_name_if_missing)
buffer_name = null
return buffer_name
/obj/item/device/multitool/proc/set_buffer(var/atom/buffer)
if(!buffer || istype(buffer))
buffer_name = buffer ? buffer.name : null