mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-25 22:28:00 +01:00
storage gets LateInitializeName
LateInitializeName allows storage items to set their name flexibly after normal initialization is completed, allowing it to be based on holder, contents, location, etc. Also hoisted storage/internal/Destroy to its rightful place.
This commit is contained in:
@@ -4,18 +4,24 @@
|
||||
preserve_item = 1
|
||||
var/atom/movable/master_atom
|
||||
|
||||
/obj/item/storage/internal/Initialize()
|
||||
. = ..()
|
||||
master_atom = loc
|
||||
if(!istype(master_atom))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
loc = master_atom
|
||||
name = master_atom.name
|
||||
verbs -= /obj/item/verb/verb_pickup //make sure this is never picked up.
|
||||
|
||||
/obj/item/storage/internal/Destroy()
|
||||
master_atom = null
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/storage/internal/Initialize()
|
||||
. = ..()
|
||||
master_atom = loc
|
||||
if (!istype(master_atom))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
loc = master_atom
|
||||
verbs -= /obj/item/verb/verb_pickup
|
||||
|
||||
|
||||
/obj/item/storage/internal/LateInitializeName()
|
||||
name = master_atom.name
|
||||
|
||||
|
||||
/obj/item/storage/internal/attack_hand()
|
||||
return //make sure this is never picked up
|
||||
|
||||
@@ -96,6 +96,11 @@
|
||||
new newtype (src)
|
||||
starts_with = null
|
||||
calibrate_size()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
|
||||
/obj/item/storage/LateInitialize()
|
||||
LateInitializeName()
|
||||
|
||||
|
||||
/obj/item/storage/MouseDrop(obj/over_object as obj)
|
||||
@@ -666,6 +671,11 @@
|
||||
max_w_class = max(I.w_class, max_w_class)
|
||||
max_storage_space += I.get_storage_cost()
|
||||
|
||||
|
||||
/obj/item/storage/proc/LateInitializeName()
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
* Trinket Box - READDING SOON
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user