Skip to content

Commit

Permalink
orbit menu is less cluttered (#3197)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request


https://github.com/shiptest-ss13/Shiptest/assets/86381784/d54fd938-9380-4406-be92-9aa06ef08c64


<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
add: Orbit menu is less cluttered and just shows the real name, hovering
over it shows their standard name.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
FalloutFalcon authored Jul 16, 2024
1 parent f1e6495 commit 38e9de9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
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 @@ -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.

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

0 comments on commit 38e9de9

Please sign in to comment.