Makes all global variables handled by the GLOB controller (#13152)

* Handlers converted, now to fix 3532 compile errors

* 3532 compile fixes later, got runtimes on startup

* Well the server loads now atleast

* Take 2

* Oops
This commit is contained in:
AffectedArc07
2020-03-20 21:56:37 -06:00
committed by GitHub
parent c8dbd0190e
commit 210f8badf4
667 changed files with 4243 additions and 4240 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
/*
This state checks that the user is an admin, end of story
*/
/var/global/datum/topic_state/admin_state/admin_state = new()
GLOBAL_DATUM_INIT(admin_state, /datum/topic_state/admin_state, new())
/datum/topic_state/admin_state/can_use_topic(var/src_object, var/mob/user)
return check_rights(R_ADMIN, 0, user) ? STATUS_INTERACTIVE : STATUS_CLOSE
+1 -1
View File
@@ -1,7 +1,7 @@
/*
This state only checks if user is conscious.
*/
/var/global/datum/topic_state/conscious_state/conscious_state = new()
GLOBAL_DATUM_INIT(conscious_state, /datum/topic_state/conscious_state, new())
/datum/topic_state/conscious_state/can_use_topic(var/src_object, var/mob/user)
return user.stat == CONSCIOUS ? STATUS_INTERACTIVE : STATUS_CLOSE
+1 -1
View File
@@ -1,7 +1,7 @@
/*
This state checks if user is somewhere within src_object, as well as the default NanoUI interaction.
*/
/var/global/datum/topic_state/contained_state/contained_state = new()
GLOBAL_DATUM_INIT(contained_state, /datum/topic_state/contained_state, new())
/datum/topic_state/contained_state/can_use_topic(var/atom/src_object, var/mob/user)
if(!src_object.contains(user))
+2 -2
View File
@@ -1,4 +1,4 @@
/var/global/datum/topic_state/default/default_state = new()
GLOBAL_DATUM_INIT(default_state, /datum/topic_state/default, new())
/datum/topic_state/default/href_list(var/mob/user)
return list()
@@ -51,7 +51,7 @@
// If we're installed in a chassi, rather than transfered to an inteliCard or other container, then check if we have camera view
if(is_in_chassis())
//stop AIs from leaving windows open and using then after they lose vision
if(cameranet && !cameranet.checkTurfVis(get_turf(src_object)))
if(GLOB.cameranet && !GLOB.cameranet.checkTurfVis(get_turf(src_object)))
return STATUS_CLOSE
return STATUS_INTERACTIVE
else if(get_dist(src_object, src) <= client.view) // View does not return what one would expect while installed in an inteliCard
+2 -2
View File
@@ -1,9 +1,9 @@
/*
This checks that the user is a ghost or alternatively an admin. Used for the mob spawner.
This checks that the user is a ghost or alternatively an admin. Used for the mob spawner.
We don't want any living people somehow getting the menu open and reincarnating while alive
*/
/var/global/datum/topic_state/ghost_state/ghost_state = new()
GLOBAL_DATUM_INIT(ghost_state, /datum/topic_state/ghost_state, new())
/datum/topic_state/ghost_state/can_use_topic(var/src_object, var/mob/user)
if(user.stat == DEAD)
+1 -1
View File
@@ -1,7 +1,7 @@
/*
This state checks that the src_object is somewhere in the user's first-level inventory (in hands, on ear, etc.), but not further down (such as in bags).
*/
/var/global/datum/topic_state/inventory_state/inventory_state = new()
GLOBAL_DATUM_INIT(inventory_state, /datum/topic_state/inventory_state, new())
/datum/topic_state/inventory_state/can_use_topic(var/src_object, var/mob/user)
if(!((src_object in user) || user.is_in_active_hand(src_object) || user.is_in_inactive_hand(src_object)))
@@ -1,7 +1,7 @@
/*
This state checks if src_object is contained anywhere in the user's inventory, including bags, etc.
*/
/var/global/datum/topic_state/deep_inventory_state/deep_inventory_state = new()
GLOBAL_DATUM_INIT(deep_inventory_state, /datum/topic_state/deep_inventory_state, new())
/datum/topic_state/deep_inventory_state/can_use_topic(var/src_object, var/mob/user)
if(!user.contains(src_object))
@@ -2,13 +2,12 @@
* This state only checks if the user isn't incapacitated
**/
/var/global/datum/topic_state/not_incapacitated_state/not_incapacitated_state = new()
GLOBAL_DATUM_INIT(not_incapacitated_state, /datum/topic_state/not_incapacitated_state, new())
/**
* This state checks if the user isn't incapacitated and that their loc is a turf
**/
/var/global/datum/topic_state/not_incapacitated_state/not_incapacitated_turf_state = new(no_turfs = TRUE)
GLOBAL_DATUM_INIT(not_incapacitated_turf_state, /datum/topic_state/not_incapacitated_state, new(no_turfs = TRUE))
/datum/topic_state/not_incapacitated_state
var/turf_check = FALSE
+1 -1
View File
@@ -1,4 +1,4 @@
/var/global/datum/topic_state/physical/physical_state = new()
GLOBAL_DATUM_INIT(physical_state, /datum/topic_state/physical, new())
/datum/topic_state/physical/can_use_topic(var/src_object, var/mob/user)
. = user.shared_nano_interaction(src_object)
+1 -1
View File
@@ -1,7 +1,7 @@
/*
This state checks that the src_object is the same the as user
*/
/var/global/datum/topic_state/self_state/self_state = new()
GLOBAL_DATUM_INIT(self_state, /datum/topic_state/self_state, new())
/datum/topic_state/self_state/can_use_topic(var/src_object, var/mob/user)
if(src_object != user)
+1 -1
View File
@@ -2,7 +2,7 @@
This state checks that the user is on the same Z-level as src_object
*/
/var/global/datum/topic_state/z_state/z_state = new()
GLOBAL_DATUM_INIT(z_state, /datum/topic_state/z_state, new())
/datum/topic_state/z_state/can_use_topic(var/src_object, var/mob/user)
var/turf/turf_obj = get_turf(src_object)