Skip to content

Commit

Permalink
Fixes searching with the orbit menu (shiptest-ss13#3629)
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

This PR modifies the search algorithm for points of interests so that
the real name of a character, e.g. "Kristina Dryden" is what gets passed
to the search function, instead of a character's "full name", e.g. "calm
human woman".


![vf7sJJ034D](https://github.com/user-attachments/assets/59b9381b-f49d-4564-a8b7-e33653706693)

The sorting algorithm seems to take jobs as the sorting parameter,
instead of real names. As of right now, the portion of code that causes
this to occur still eludes me.

## Why It's Good For The Game

This felt like a minor oversight to me. It feels clunky to search for a
character's name and have the search return no results because the
search function had been looking for a character's _attributes_ instead.

## Changelog

:cl:
fix: fixed the orbit menu search function so that names work again
/: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
zimon9 committed Oct 29, 2024
1 parent a55552e commit d8d5b79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/Orbit/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ export const isJobOrNameMatch = (
): boolean => {
if (!searchQuery) return true;

const { full_name, job } = observable;
const { name, job } = observable;

return (
full_name?.toLowerCase().includes(searchQuery?.toLowerCase()) ||
name?.toLowerCase().includes(searchQuery?.toLowerCase()) ||
job?.toLowerCase().includes(searchQuery?.toLowerCase()) ||
false
);
Expand Down

0 comments on commit d8d5b79

Please sign in to comment.