More TGUI Hotfixes (#22632)

changes:
- bugfix: "Fixes LateJoin and Manifest interfaces not displaying
department colors by creating a shared component for both interfaces to
use."
- bugfix: "Fixes the Manifest interface not displaying colors for crew
status."
  - bugfix: "Fixes status composer not allowing AIs to view TGUIs."
  - bugfix: "Fixes inline icons in alt-click atom viewer."
  - bugfix: "Fixes PDA light toggle icon not appearing."
  - bugfix: "Fixes autolathe category view not filtering items."

---------

Signed-off-by: Batrachophreno <Batrochophreno@gmail.com>
This commit is contained in:
Batrachophreno
2026-06-05 23:22:00 +00:00
committed by GitHub
parent 3cf0d1607e
commit cbd3ab0da2
7 changed files with 83 additions and 14 deletions
+9 -1
View File
@@ -18,6 +18,13 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
/mob/proc/default_can_use_topic(src_object)
return UI_CLOSE // Don't allow interaction by default.
/mob/abstract/eye/freelook/aiEye/default_can_use_topic(src_object)
if(!isAI(owner))
return UI_CLOSE
var/mob/living/silicon/ai/ai = owner
return ai.default_can_use_topic(src_object)
/mob/living/default_can_use_topic(src_object)
. = shared_ui_interaction(src_object)
if(. > UI_CLOSE && loc) //must not be in nullspace.
@@ -45,7 +52,8 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
return UI_INTERACTIVE
// The AI can interact with anything it can see nearby, or with cameras while wireless control is enabled.
if(!control_disabled && can_see(src_object))
var/atom/interaction_source = eyeobj || src
if(!control_disabled && can_see(interaction_source, src_object))
return UI_INTERACTIVE
return UI_CLOSE
+25 -3
View File
@@ -11,6 +11,16 @@
)
)
/// Returns the silicon mob represented by a TGUI user, including an AI using its camera eye.
/proc/tgui_silicon_user(mob/user)
if(issilicon(user))
return user
if(istype(user, /mob/abstract/eye/freelook/aiEye))
var/mob/abstract/eye/freelook/aiEye/eye = user
if(issilicon(eye.owner))
return eye.owner
/// Returns a UI status such that users adjacent to source will be able to interact,
/// far away users will be able to see, and anyone farther won't see anything.
/// Dead users will receive updates no matter what, though you likely want to add
@@ -24,6 +34,9 @@
/// Returns a UI status such that the dead will be able to watch, but not interact.
/proc/ui_status_only_living(mob/user, source)
if(tgui_silicon_user(user))
return UI_INTERACTIVE
if (isliving(user))
return UI_INTERACTIVE
@@ -49,25 +62,33 @@
/// Being dead will disable UI, being incapacitated will continue updating it,
/// and anything else will make it interactive.
/proc/ui_status_user_is_abled(mob/user, atom/source)
var/mob/living/silicon/silicon_user = tgui_silicon_user(user)
if(silicon_user && silicon_user != user)
return silicon_user.shared_ui_interaction(source)
return user.shared_ui_interaction(source)
/// Returns a UI status such that those without blocked hands will be able to interact,
/// but everyone else can only watch.
/proc/ui_status_user_has_free_hands(mob/user, atom/source)
if(tgui_silicon_user(user))
return UI_INTERACTIVE
return user.use_check() ? UI_UPDATE : UI_INTERACTIVE
/// Returns a UI status such that advanced tool users will be able to interact,
/// but everyone else can only watch.
/proc/ui_status_user_is_advanced_tool_user(mob/user)
var/mob/living/silicon/silicon_user = tgui_silicon_user(user)
if(silicon_user)
return silicon_user.IsAdvancedToolUser() ? UI_INTERACTIVE : UI_UPDATE
return user.IsAdvancedToolUser() ? UI_INTERACTIVE : UI_UPDATE
/// Returns a UI status such that silicons will be able to interact with whatever
/// they would have access to if this was a machine. For example, AIs can
/// interact if there's cameras with wireless control is enabled.
/proc/ui_status_silicon_has_access(mob/user, atom/source)
if (!issilicon(user))
var/mob/living/silicon/silicon_user = tgui_silicon_user(user)
if(!silicon_user)
return UI_CLOSE
var/mob/living/silicon/silicon_user = user
return silicon_user.get_ui_access(source)
/// Returns a UI status representing this silicon's capability to access
@@ -87,7 +108,8 @@
return UI_INTERACTIVE
// The AI can interact with anything it can see nearby, or with cameras while wireless control is enabled.
if(!control_disabled && can_see(source))
var/atom/interaction_source = eyeobj || src
if(!control_disabled && can_see(interaction_source, source))
return UI_INTERACTIVE
return UI_CLOSE