Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orbit menu is less cluttered #3197

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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))
Expand All @@ -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()
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,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.

Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/dead/observer/orbit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions tgui/packages/tgui/interfaces/Orbit.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const BasicSection = (props, context) => {
{things.map((thing) => (
<Button
key={thing.name}
tooltip={thing.fake_name}
content={thing.name}
onClick={() =>
act('orbit', {
Expand All @@ -74,6 +75,7 @@ const OrbitedButton = (props, context) => {
return (
<Button
color={color}
tooltip={thing.fake_name}
onClick={() =>
act('orbit', {
ref: thing.ref,
Expand Down
Loading