diff --git a/code/game/atom/atom_examine.dm b/code/game/atom/atom_examine.dm index 8df52eb9cb0..8d952ae5bfa 100644 --- a/code/game/atom/atom_examine.dm +++ b/code/game/atom/atom_examine.dm @@ -113,5 +113,6 @@ return name_chaser /// Used by mobs to determine the name for someone wearing a mask, or with a disfigured or missing face. By default just returns the atom's name. add_id_name will control whether or not we append "(as [id_name])". -/atom/proc/get_visible_name(add_id_name) +/// force_real_name will always return real_name and add (as face_name/id_name) if it doesn't match their appearance +/atom/proc/get_visible_name(add_id_name, force_real_name) return name diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm index ee0b4528995..bdb0b7ce37e 100644 --- a/code/modules/mob/dead/observer/orbit.dm +++ b/code/modules/mob/dead/observer/orbit.dm @@ -211,14 +211,26 @@ GLOBAL_DATUM_INIT(orbit_menu, /datum/orbit_menu, new) if(issilicon(player)) serialized["job"] = player.job serialized["icon"] = "borg" - else - var/obj/item/card/id/id_card = player.get_idcard(hand_first = FALSE) - serialized["job"] = id_card?.get_trim_assignment() - serialized["icon"] = id_card?.get_trim_sechud_icon_state() + return serialized + var/obj/item/card/id/id_card = player.get_idcard(hand_first = FALSE) + serialized["job"] = id_card?.get_trim_assignment() + serialized["icon"] = id_card?.get_trim_sechud_icon_state() + + var/datum/job/job = player.mind?.assigned_role + if (isnull(job)) + return serialized + + serialized["mind_job"] = job.title + var/datum/outfit/outfit = job.get_outfit() + if (isnull(outfit)) + return serialized + + var/datum/id_trim/trim = outfit.id_trim + if (!isnull(trim)) + serialized["mind_icon"] = trim::sechud_icon_state return serialized - /// Gets a list: Misc data and whether it's critical. Handles all snowflakey type cases /datum/orbit_menu/proc/get_misc_data(atom/movable/atom_poi) as /list var/list/misc = list() diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 728ff63c03c..8541f4f7424 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -57,15 +57,27 @@ return if_no_id //repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a separate proc as it'll be useful elsewhere -/mob/living/carbon/human/get_visible_name(add_id_name = TRUE) - if(HAS_TRAIT(src, TRAIT_UNKNOWN)) - return "Unknown" +/mob/living/carbon/human/get_visible_name(add_id_name = TRUE, force_real_name = FALSE) var/list/identity = list(null, null) SEND_SIGNAL(src, COMSIG_HUMAN_GET_VISIBLE_NAME, identity) var/signal_face = LAZYACCESS(identity, VISIBLE_NAME_FACE) var/signal_id = LAZYACCESS(identity, VISIBLE_NAME_ID) var/face_name = !isnull(signal_face) ? signal_face : get_face_name("") var/id_name = !isnull(signal_id) ? signal_id : get_id_name("") + if (force_real_name) + var/fake_name + if (face_name && face_name != real_name) + fake_name = face_name + if(add_id_name && id_name && id_name != real_name) + if (!isnull(fake_name) && id_name != face_name) + fake_name = "[fake_name]/[id_name]" + else + fake_name = id_name + if (HAS_TRAIT(src, TRAIT_UNKNOWN) || (!face_name && !id_name)) + fake_name = "Unknown" + return "[real_name][fake_name ? " (as [fake_name])" : ""]" + if(HAS_TRAIT(src, TRAIT_UNKNOWN)) + return "Unknown" if(face_name) if(add_id_name && id_name && (id_name != face_name)) return "[face_name] (as [id_name])" diff --git a/tgui/packages/tgui/interfaces/Orbit/JobIcon.tsx b/tgui/packages/tgui/interfaces/Orbit/JobIcon.tsx index 2d584bfc6b1..713d82eacee 100644 --- a/tgui/packages/tgui/interfaces/Orbit/JobIcon.tsx +++ b/tgui/packages/tgui/interfaces/Orbit/JobIcon.tsx @@ -4,6 +4,7 @@ import { Antagonist, Observable } from './types'; type Props = { item: Observable | Antagonist; + realNameDisplay: boolean; }; type IconSettings = { @@ -22,7 +23,7 @@ const antagIcon: IconSettings = { }; export function JobIcon(props: Props) { - const { item } = props; + const { item, realNameDisplay } = props; let iconSettings: IconSettings; if ('antag' in item) { @@ -32,16 +33,18 @@ export function JobIcon(props: Props) { } // We don't need to cast here but typescript isn't smart enough to know that - const { icon = '', job = '' } = item; + const { icon = '', job = '', mind_icon = '', mind_job = '' } = item; + const usedIcon = realNameDisplay ? mind_icon || icon : icon; + const usedJob = realNameDisplay ? mind_job || job : job; return (
{icon === 'borg' ? ( - + ) : ( (); const { orbiting } = data; - const { setBladeOpen } = useContext(OrbitContext); + const { setBladeOpen, realNameDisplay, setRealNameDisplay } = + useContext(OrbitContext); return ( @@ -44,6 +45,24 @@ export function OrbitBlade(props) { + +
setRealNameDisplay(!realNameDisplay)} + /> + } + color="label" + title="Real Name Display" + > + Real Name mode will display actual character names and their + roundstart jobs insteas of being based on their worn ID. If the person + lacks a roundstart job, it will still display their ID job icon. +
+
{!!orbiting && ( @@ -115,7 +134,7 @@ function OrbitInfo(props) { - + {job} diff --git a/tgui/packages/tgui/interfaces/Orbit/OrbitCollapsible.tsx b/tgui/packages/tgui/interfaces/Orbit/OrbitCollapsible.tsx index fa5e78bd1f7..bc436d46204 100644 --- a/tgui/packages/tgui/interfaces/Orbit/OrbitCollapsible.tsx +++ b/tgui/packages/tgui/interfaces/Orbit/OrbitCollapsible.tsx @@ -25,7 +25,8 @@ type Props = { export function OrbitCollapsible(props: Props) { const { color, section = [], title } = props; - const { autoObserve, searchQuery, viewMode } = useContext(OrbitContext); + const { autoObserve, realNameDisplay, searchQuery, viewMode } = + useContext(OrbitContext); const filteredSection = section.filter((observable) => isJobOrNameMatch(observable, searchQuery), @@ -53,6 +54,7 @@ export function OrbitCollapsible(props: Props) { const content = ( } + content={} key={item.ref} position="bottom-start" > diff --git a/tgui/packages/tgui/interfaces/Orbit/OrbitItem.tsx b/tgui/packages/tgui/interfaces/Orbit/OrbitItem.tsx index 992904988ec..b2490c0b3c4 100644 --- a/tgui/packages/tgui/interfaces/Orbit/OrbitItem.tsx +++ b/tgui/packages/tgui/interfaces/Orbit/OrbitItem.tsx @@ -9,13 +9,14 @@ import { Antagonist, Observable, OrbitData, ViewMode } from './types'; type Props = { item: Observable | Antagonist; autoObserve: boolean; + realNameDisplay: boolean; viewMode: ViewMode; color: string | undefined; }; /** Each button on the observable section */ export function OrbitItem(props: Props) { - const { item, autoObserve, viewMode, color } = props; + const { item, autoObserve, realNameDisplay, viewMode, color } = props; const { full_name, icon, job, name, orbiters, ref } = item; const { act, data } = useBackend(); @@ -33,7 +34,7 @@ export function OrbitItem(props: Props) { display: 'flex', }} > - {validIcon && } + {validIcon && }