From 38e9de9cf5a72e4fbf754ad18a78593b76c2e29f Mon Sep 17 00:00:00 2001 From: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Date: Tue, 16 Jul 2024 03:53:40 -0500 Subject: [PATCH] orbit menu is less cluttered (#3197) ## About The Pull Request https://github.com/shiptest-ss13/Shiptest/assets/86381784/d54fd938-9380-4406-be92-9aa06ef08c64 ## Why It's Good For The Game ## Changelog :cl: add: Orbit menu is less cluttered and just shows the real name, hovering over it shows their standard name. /:cl: --- code/__HELPERS/unsorted.dm | 9 +++++++-- code/modules/mob/dead/observer/observer.dm | 1 - code/modules/mob/dead/observer/orbit.dm | 4 +++- tgui/packages/tgui/interfaces/Orbit.js | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index c8c7b63d0a09..d6b048de4289 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -295,7 +295,7 @@ Turf and target are separate in case you want to teleport some distance from a t return "[pick("!","@","#","$","%","^","&")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")]" //Returns a list of all items of interest with their name -/proc/getpois(mobs_only = FALSE, skip_mindless = FALSE, specify_dead_role = TRUE) +/proc/getpois(mobs_only = FALSE, skip_mindless = FALSE, specify_dead_role = TRUE, only_realname = FALSE) var/list/mobs = sortmobs() var/list/namecounts = list() var/list/pois = list() @@ -305,7 +305,11 @@ Turf and target are separate in case you want to teleport some distance from a t continue if(M.client && M.client.holder && M.client.holder.fakekey) //stealthmins continue - var/name = avoid_assoc_duplicate_keys(M.name, namecounts) + M.get_realname_string() + var/name = "" + if(only_realname) + name = avoid_assoc_duplicate_keys(M.real_name, namecounts) + else + name = avoid_assoc_duplicate_keys(M.name, namecounts) + M.get_realname_string() if(M.stat == DEAD && specify_dead_role) if(isobserver(M)) @@ -321,6 +325,7 @@ Turf and target are separate in case you want to teleport some distance from a t pois[avoid_assoc_duplicate_keys(A.name, namecounts)] = A return pois + //Orders mobs by type then by name /proc/sortmobs() var/list/moblist = list() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index c15c4a1af835..4a768fc1c501 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -495,7 +495,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(isobserver(usr)) //Make sure they're an observer! - var/list/dest = list() //List of possible destinations (mobs) var/target = null //Chosen target. diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm index 86d54577538c..da3bc7c2dfb5 100644 --- a/code/modules/mob/dead/observer/orbit.dm +++ b/code/modules/mob/dead/observer/orbit.dm @@ -57,7 +57,7 @@ var/list/misc = list() var/list/npcs = list() - var/list/pois = getpois(skip_mindless = TRUE, specify_dead_role = FALSE) + var/list/pois = getpois(skip_mindless = TRUE, specify_dead_role = FALSE, only_realname = TRUE) for (var/name in pois) var/list/serialized = list() serialized["name"] = name @@ -67,6 +67,8 @@ serialized["ref"] = REF(poi) var/mob/M = poi + + serialized["fake_name"] = M.name if (istype(M)) if (isobserver(M)) ghosts += list(serialized) diff --git a/tgui/packages/tgui/interfaces/Orbit.js b/tgui/packages/tgui/interfaces/Orbit.js index 91bf9d1f7929..c34dccacf367 100644 --- a/tgui/packages/tgui/interfaces/Orbit.js +++ b/tgui/packages/tgui/interfaces/Orbit.js @@ -54,6 +54,7 @@ const BasicSection = (props, context) => { {things.map((thing) => (