April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
* optional master_ui datum/tgui The parent UI.
|
||||
* optional state datum/ui_state The state used to determine status.
|
||||
**/
|
||||
/datum/proc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state)
|
||||
/datum/proc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
return -1 // Not implemented.
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Checks that the user is an admin, end-of-story.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/admin_state/admin_state = new()
|
||||
GLOBAL_DATUM_INIT(admin_state, /datum/ui_state/admin_state, new)
|
||||
|
||||
/datum/ui_state/admin_state/can_use_topic(src_object, mob/user)
|
||||
if(check_rights_for(user.client, R_ADMIN))
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Always grants the user UI_INTERACTIVE. Period.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/always_state/always_state = new()
|
||||
GLOBAL_DATUM_INIT(always_state, /datum/ui_state/always_state, new)
|
||||
|
||||
/datum/ui_state/always_state/can_use_topic(src_object, mob/user)
|
||||
return UI_INTERACTIVE
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Only checks if the user is conscious.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/conscious_state/conscious_state = new()
|
||||
GLOBAL_DATUM_INIT(conscious_state, /datum/ui_state/conscious_state, new)
|
||||
|
||||
/datum/ui_state/conscious_state/can_use_topic(src_object, mob/user)
|
||||
if(user.stat == CONSCIOUS)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Checks that the user is inside the src_object.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/contained_state/contained_state = new()
|
||||
GLOBAL_DATUM_INIT(contained_state, /datum/ui_state/contained_state, new)
|
||||
|
||||
/datum/ui_state/contained_state/can_use_topic(atom/src_object, mob/user)
|
||||
if(!src_object.contains(user))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Checks that the src_object is in the user's deep (backpack, box, toolbox, etc) inventory.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/deep_inventory_state/deep_inventory_state = new()
|
||||
GLOBAL_DATUM_INIT(deep_inventory_state, /datum/ui_state/deep_inventory_state, new)
|
||||
|
||||
/datum/ui_state/deep_inventory_state/can_use_topic(src_object, mob/user)
|
||||
if(!user.contains(src_object))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Checks a number of things -- mostly physical distance for humans and view for robots.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/default/default_state = new()
|
||||
GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
|
||||
|
||||
/datum/ui_state/default/can_use_topic(src_object, mob/user)
|
||||
return user.default_can_use_topic(src_object) // Call the individual mob-overriden procs.
|
||||
@@ -43,7 +43,7 @@
|
||||
return
|
||||
|
||||
// The AI can interact with anything it can see nearby, or with cameras.
|
||||
if((get_dist(src, src_object) <= client.view) || cameranet.checkTurfVis(get_turf_pixel(src_object)))
|
||||
if((get_dist(src, src_object) <= client.view) || GLOB.cameranet.checkTurfVis(get_turf_pixel(src_object)))
|
||||
return UI_INTERACTIVE
|
||||
return UI_CLOSE
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Checks that the src_object is in the user's hands.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/hands_state/hands_state = new()
|
||||
GLOBAL_DATUM_INIT(hands_state, /datum/ui_state/hands_state, new)
|
||||
|
||||
/datum/ui_state/hands_state/can_use_topic(src_object, mob/user)
|
||||
. = user.shared_ui_interaction(src_object)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* human adjacent user.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/human_adjacent_state/human_adjacent_state = new()
|
||||
GLOBAL_DATUM_INIT(human_adjacent_state, /datum/ui_state/human_adjacent_state, new)
|
||||
|
||||
/datum/ui_state/human_adjacent_state/can_use_topic(src_object, mob/user)
|
||||
. = user.default_can_use_topic(src_object)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Checks that the src_object is in the user's top-level (hand, ear, pocket, belt, etc) inventory.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/inventory_state/inventory_state = new()
|
||||
GLOBAL_DATUM_INIT(inventory_state, /datum/ui_state/inventory_state, new)
|
||||
|
||||
/datum/ui_state/inventory_state/can_use_topic(src_object, mob/user)
|
||||
if(!(src_object in user))
|
||||
|
||||
14
code/modules/tgui/states/language_menu.dm
Normal file
14
code/modules/tgui/states/language_menu.dm
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* tgui state: language_menu_state
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(language_menu_state, /datum/ui_state/language_menu, new)
|
||||
|
||||
/datum/ui_state/language_menu/can_use_topic(src_object, mob/user)
|
||||
. = UI_CLOSE
|
||||
if(check_rights_for(user.client, R_ADMIN))
|
||||
. = UI_INTERACTIVE
|
||||
else if(istype(src_object, /datum/language_menu))
|
||||
var/datum/language_menu/LM = src_object
|
||||
if(LM.owner == user)
|
||||
. = UI_INTERACTIVE
|
||||
@@ -4,7 +4,7 @@
|
||||
* Checks that the user isn't incapacitated
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/not_incapacitated_state/not_incapacitated_state = new()
|
||||
GLOBAL_DATUM_INIT(not_incapacitated_state, /datum/ui_state/not_incapacitated_state, new)
|
||||
|
||||
/**
|
||||
* tgui state: not_incapacitated_turf_state
|
||||
@@ -12,7 +12,7 @@
|
||||
* Checks that the user isn't incapacitated and that their loc is a turf
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/not_incapacitated_state/not_incapacitated_turf_state = new(no_turfs = TRUE)
|
||||
GLOBAL_DATUM_INIT(not_incapacitated_turf_state, /datum/ui_state/not_incapacitated_state, new(no_turfs = TRUE))
|
||||
|
||||
/datum/ui_state/not_incapacitated_state
|
||||
var/turf_check = FALSE
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Checks that the user is not inside src_object, and then makes the default checks.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/notcontained_state/notcontained_state = new()
|
||||
GLOBAL_DATUM_INIT(notcontained_state, /datum/ui_state/notcontained_state, new)
|
||||
|
||||
/datum/ui_state/notcontained_state/can_use_topic(atom/src_object, mob/user)
|
||||
. = user.shared_ui_interaction(src_object)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Checks that the user is an observer/ghost.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/observer_state/observer_state = new()
|
||||
GLOBAL_DATUM_INIT(observer_state, /datum/ui_state/observer_state, new)
|
||||
|
||||
/datum/ui_state/observer_state/can_use_topic(src_object, mob/user)
|
||||
if(isobserver(user))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Short-circuits the default state to only check physical distance.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/physical/physical_state = new()
|
||||
GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new)
|
||||
|
||||
/datum/ui_state/physical/can_use_topic(src_object, mob/user)
|
||||
. = user.shared_ui_interaction(src_object)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Only checks that the user and src_object are the same.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/self_state/self_state = new()
|
||||
GLOBAL_DATUM_INIT(self_state, /datum/ui_state/self_state, new)
|
||||
|
||||
/datum/ui_state/self_state/can_use_topic(src_object, mob/user)
|
||||
if(src_object != user)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Only checks that the Z-level of the user and src_object are the same.
|
||||
**/
|
||||
|
||||
/var/global/datum/ui_state/z_state/z_state = new()
|
||||
GLOBAL_DATUM_INIT(z_state, /datum/ui_state/z_state, new)
|
||||
|
||||
/datum/ui_state/z_state/can_use_topic(src_object, mob/user)
|
||||
var/turf/turf_obj = get_turf(src_object)
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
*
|
||||
* return datum/tgui The requested UI.
|
||||
**/
|
||||
/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state, browser_id = null)
|
||||
/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state, browser_id = null)
|
||||
src.user = user
|
||||
src.src_object = src_object
|
||||
src.ui_key = ui_key
|
||||
|
||||
Reference in New Issue
Block a user