Partially ports the GLOB system

This commit is contained in:
Anewbe
2018-08-14 18:14:09 -05:00
parent 2eafa13c96
commit eebb627f00
74 changed files with 448 additions and 154 deletions

View File

@@ -85,7 +85,7 @@
current.verbs -= /datum/changeling/proc/EvolutionMenu
current.mind = null
nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user
GLOB.nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user
if(new_character.mind) //remove any mind currently in our new body's mind variable
new_character.mind.current = null

View File

@@ -8,7 +8,7 @@
// /old_dir: The dir before the change.
// /new_dir: The dir after the change.
var/decl/observ/dir_set/dir_set_event = new()
GLOBAL_DATUM_INIT(dir_set_event, /decl/observ/dir_set, new)
/decl/observ/dir_set
name = "Direction Set"
@@ -27,9 +27,9 @@ var/decl/observ/dir_set/dir_set_event = new()
/atom/movable/Entered(var/atom/movable/am, atom/old_loc)
. = ..()
if(. != CANCEL_MOVE_EVENT && dir_set_event.has_listeners(am))
dir_set_event.register(src, am, /atom/proc/recursive_dir_set)
if(. != CANCEL_MOVE_EVENT && GLOB.dir_set_event.has_listeners(am))
GLOB.dir_set_event.register(src, am, /atom/proc/recursive_dir_set)
/atom/movable/Exited(var/atom/movable/am, atom/old_loc)
. = ..()
dir_set_event.unregister(src, am, /atom/proc/recursive_dir_set)
GLOB.dir_set_event.unregister(src, am, /atom/proc/recursive_dir_set)

View File

@@ -7,7 +7,7 @@
// /mob/equipper: The mob that equipped the item.
// /obj/item/item: The equipped item.
// slot: The slot equipped to.
var/decl/observ/mob_equipped/mob_equipped_event = new()
GLOBAL_DATUM_INIT(mob_equipped_event, /decl/observ/mob_equipped, new)
/decl/observ/mob_equipped
name = "Mob Equipped"
@@ -22,7 +22,7 @@ var/decl/observ/mob_equipped/mob_equipped_event = new()
// /obj/item/item: The equipped item.
// /mob/equipper: The mob that equipped the item.
// slot: The slot equipped to.
var/decl/observ/item_equipped/item_equipped_event = new()
GLOBAL_DATUM_INIT(item_equipped_event, /decl/observ/item_equipped, new)
/decl/observ/item_equipped
name = "Item Equipped"
@@ -34,5 +34,5 @@ var/decl/observ/item_equipped/item_equipped_event = new()
/obj/item/equipped(var/mob/user, var/slot)
. = ..()
mob_equipped_event.raise_event(user, src, slot)
item_equipped_event.raise_event(src, user, slot)
GLOB.mob_equipped_event.raise_event(user, src, slot)
GLOB.item_equipped_event.raise_event(src, user, slot)

View File

@@ -11,8 +11,8 @@
/proc/register_all_movement(var/event_source, var/listener)
moved_event.register(event_source, listener, /atom/movable/proc/recursive_move)
dir_set_event.register(event_source, listener, /atom/proc/recursive_dir_set)
GLOB.dir_set_event.register(event_source, listener, /atom/proc/recursive_dir_set)
/proc/unregister_all_movement(var/event_source, var/listener)
moved_event.unregister(event_source, listener, /atom/movable/proc/recursive_move)
dir_set_event.unregister(event_source, listener, /atom/proc/recursive_dir_set)
GLOB.dir_set_event.unregister(event_source, listener, /atom/proc/recursive_dir_set)

View File

@@ -22,7 +22,7 @@
/datum/progressbar/Destroy()
if (client)
client.images -= bar
qdel_null(bar)
QDEL_NULL(bar)
user = null
client = null
return ..()