mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Cleanup
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
/datum/proc/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
// If UI is not interactive or usr calling Topic is not the UI user, bail.
|
||||
if(!ui || ui.status != STATUS_INTERACTIVE)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* public
|
||||
@@ -135,15 +135,15 @@
|
||||
* Called by UIs when they are closed.
|
||||
* Must be a verb so winset() can call it.
|
||||
*
|
||||
* required uiref ref The UI that was closed.
|
||||
* required uiref uid The UI that was closed.
|
||||
*/
|
||||
/client/verb/uiclose(ref as text)
|
||||
/client/verb/uiclose(uid as text)
|
||||
// Name the verb, and hide it from the user panel.
|
||||
set name = "uiclose"
|
||||
set hidden = 1
|
||||
set hidden = TRUE
|
||||
|
||||
// Get the UI based on the ref.
|
||||
var/datum/tgui/ui = locateUID(ref)
|
||||
// Get the UI based on the UID.
|
||||
var/datum/tgui/ui = locateUID(uid)
|
||||
|
||||
// If we found the UI, close it.
|
||||
if(istype(ui))
|
||||
|
||||
@@ -10,11 +10,3 @@ GLOBAL_DATUM_INIT(contained_state, /datum/ui_state/contained_state, new)
|
||||
if(!src_object.contains(user))
|
||||
return STATUS_CLOSE
|
||||
return user.shared_ui_interaction(src_object)
|
||||
|
||||
/atom/proc/contains(atom/location)
|
||||
if(!location)
|
||||
return FALSE
|
||||
if(location == src)
|
||||
return TRUE
|
||||
|
||||
return contains(location.loc)
|
||||
|
||||
@@ -45,6 +45,9 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
|
||||
return STATUS_INTERACTIVE
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/living/simple_animal/revenant/default_can_use_topic(src_object)
|
||||
return STATUS_UPDATE
|
||||
|
||||
/mob/living/simple_animal/default_can_use_topic(src_object)
|
||||
. = shared_ui_interaction(src_object)
|
||||
if(. > STATUS_CLOSE)
|
||||
@@ -56,3 +59,8 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
|
||||
return STATUS_INTERACTIVE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/dead/observer/default_can_use_topic()
|
||||
if(can_admin_interact())
|
||||
return STATUS_INTERACTIVE // Admins are more equal
|
||||
return STATUS_UPDATE // Ghosts can view updates
|
||||
|
||||
@@ -19,6 +19,9 @@ GLOBAL_DATUM_INIT(hands_state, /datum/ui_state/hands_state, new)
|
||||
return STATUS_INTERACTIVE
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/living/simple_animal/revenant/hands_can_use_topic(src_object)
|
||||
return STATUS_UPDATE
|
||||
|
||||
/mob/living/silicon/robot/hands_can_use_topic(src_object)
|
||||
if(activated(src_object))
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
@@ -14,6 +14,9 @@ GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new)
|
||||
/mob/proc/physical_can_use_topic(src_object)
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/living/simple_animal/revenant/physical_can_use_topic(src_object)
|
||||
return STATUS_UPDATE
|
||||
|
||||
/mob/living/physical_can_use_topic(src_object)
|
||||
return shared_living_ui_distance(src_object)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user