This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: admin_state
|
||||
*
|
||||
* Checks that the user is an admin, end-of-story.
|
||||
**/
|
||||
/**
|
||||
* tgui state: admin_state
|
||||
*
|
||||
* Checks that the user is an admin, end-of-story.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(admin_state, /datum/ui_state/admin_state, new)
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
/**
|
||||
* tgui state: always_state
|
||||
*
|
||||
* Always grants the user UI_INTERACTIVE. Period.
|
||||
**/
|
||||
/**
|
||||
* tgui state: always_state
|
||||
*
|
||||
* Always grants the user UI_INTERACTIVE. Period.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(always_state, /datum/ui_state/always_state, new)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: conscious_state
|
||||
*
|
||||
* Only checks if the user is conscious.
|
||||
**/
|
||||
/**
|
||||
* tgui state: conscious_state
|
||||
*
|
||||
* Only checks if the user is conscious.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(conscious_state, /datum/ui_state/conscious_state, new)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: contained_state
|
||||
*
|
||||
* Checks that the user is inside the src_object.
|
||||
**/
|
||||
/**
|
||||
* tgui state: contained_state
|
||||
*
|
||||
* Checks that the user is inside the src_object.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(contained_state, /datum/ui_state/contained_state, new)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: deep_inventory_state
|
||||
*
|
||||
* Checks that the src_object is in the user's deep (backpack, box, toolbox, etc) inventory.
|
||||
**/
|
||||
/**
|
||||
* tgui state: deep_inventory_state
|
||||
*
|
||||
* Checks that the src_object is in the user's deep (backpack, box, toolbox, etc) inventory.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(deep_inventory_state, /datum/ui_state/deep_inventory_state, new)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: default_state
|
||||
*
|
||||
* Checks a number of things -- mostly physical distance for humans and view for robots.
|
||||
**/
|
||||
/**
|
||||
* tgui state: default_state
|
||||
*
|
||||
* Checks a number of things -- mostly physical distance for humans and view for robots.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: hands_state
|
||||
*
|
||||
* Checks that the src_object is in the user's hands.
|
||||
**/
|
||||
/**
|
||||
* tgui state: hands_state
|
||||
*
|
||||
* Checks that the src_object is in the user's hands.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(hands_state, /datum/ui_state/hands_state, new)
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
/**
|
||||
* tgui state: human_adjacent_state
|
||||
*
|
||||
* In addition to default checks, only allows interaction for a
|
||||
* human adjacent user.
|
||||
**/
|
||||
/**
|
||||
* tgui state: human_adjacent_state
|
||||
*
|
||||
* In addition to default checks, only allows interaction for a
|
||||
* human adjacent user.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(human_adjacent_state, /datum/ui_state/human_adjacent_state, new)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: inventory_state
|
||||
*
|
||||
* Checks that the src_object is in the user's top-level (hand, ear, pocket, belt, etc) inventory.
|
||||
**/
|
||||
/**
|
||||
* tgui state: inventory_state
|
||||
*
|
||||
* Checks that the src_object is in the user's top-level (hand, ear, pocket, belt, etc) inventory.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(inventory_state, /datum/ui_state/inventory_state, new)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* tgui state: language_menu_state
|
||||
*/
|
||||
/**
|
||||
* tgui state: language_menu_state
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(language_menu_state, /datum/ui_state/language_menu, new)
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/**
|
||||
* tgui state: not_incapacitated_state
|
||||
*
|
||||
* Checks that the user isn't incapacitated
|
||||
**/
|
||||
/**
|
||||
* tgui state: not_incapacitated_state
|
||||
*
|
||||
* Checks that the user isn't incapacitated
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(not_incapacitated_state, /datum/ui_state/not_incapacitated_state, new)
|
||||
|
||||
/**
|
||||
* tgui state: not_incapacitated_turf_state
|
||||
*
|
||||
* Checks that the user isn't incapacitated and that their loc is a turf
|
||||
**/
|
||||
/**
|
||||
* tgui state: not_incapacitated_turf_state
|
||||
*
|
||||
* Checks that the user isn't incapacitated and that their loc is a turf
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(not_incapacitated_turf_state, /datum/ui_state/not_incapacitated_state, new(no_turfs = TRUE))
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: notcontained_state
|
||||
*
|
||||
* Checks that the user is not inside src_object, and then makes the default checks.
|
||||
**/
|
||||
/**
|
||||
* tgui state: notcontained_state
|
||||
*
|
||||
* Checks that the user is not inside src_object, and then makes the default checks.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(notcontained_state, /datum/ui_state/notcontained_state, new)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: observer_state
|
||||
*
|
||||
* Checks that the user is an observer/ghost.
|
||||
**/
|
||||
/**
|
||||
* tgui state: observer_state
|
||||
*
|
||||
* Checks that the user is an observer/ghost.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(observer_state, /datum/ui_state/observer_state, new)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: physical_state
|
||||
*
|
||||
* Short-circuits the default state to only check physical distance.
|
||||
**/
|
||||
/**
|
||||
* tgui state: physical_state
|
||||
*
|
||||
* Short-circuits the default state to only check physical distance.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new)
|
||||
|
||||
@@ -22,3 +22,29 @@ GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new)
|
||||
|
||||
/mob/living/silicon/ai/physical_can_use_topic(src_object)
|
||||
return UI_UPDATE // AIs are not physical.
|
||||
|
||||
|
||||
/**
|
||||
* tgui state: physical_obscured_state
|
||||
*
|
||||
* Short-circuits the default state to only check physical distance, being in view doesn't matter
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(physical_obscured_state, /datum/ui_state/physical_obscured_state, new)
|
||||
|
||||
/datum/ui_state/physical_obscured_state/can_use_topic(src_object, mob/user)
|
||||
. = user.shared_ui_interaction(src_object)
|
||||
if(. > UI_CLOSE)
|
||||
return min(., user.physical_obscured_can_use_topic(src_object))
|
||||
|
||||
/mob/proc/physical_obscured_can_use_topic(src_object)
|
||||
return UI_CLOSE
|
||||
|
||||
/mob/living/physical_obscured_can_use_topic(src_object)
|
||||
return shared_living_ui_distance(src_object, viewcheck = FALSE)
|
||||
|
||||
/mob/living/silicon/physical_obscured_can_use_topic(src_object)
|
||||
return max(UI_UPDATE, shared_living_ui_distance(src_object, viewcheck = FALSE)) // Silicons can always see.
|
||||
|
||||
/mob/living/silicon/ai/physical_obscured_can_use_topic(src_object)
|
||||
return UI_UPDATE // AIs are not physical.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: self_state
|
||||
*
|
||||
* Only checks that the user and src_object are the same.
|
||||
**/
|
||||
/**
|
||||
* tgui state: self_state
|
||||
*
|
||||
* Only checks that the user and src_object are the same.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(self_state, /datum/ui_state/self_state, new)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tgui state: z_state
|
||||
*
|
||||
* Only checks that the Z-level of the user and src_object are the same.
|
||||
**/
|
||||
/**
|
||||
* tgui state: z_state
|
||||
*
|
||||
* Only checks that the Z-level of the user and src_object are the same.
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(z_state, /datum/ui_state/z_state, new)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user