Add current ship callsign highlight to chat - #4805
Open
TheMikina wants to merge 2 commits into
Open
Conversation
Contributor
|
Thanks for your work on this and welcome to the ss14 development community one thing to note, it looks like this is a frontier modification to a wizden file. Please see the procedure for marking changes in such files as specified in CONTRIBUTING.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About the PR
The PR adds chat highlight for your current ShuttleName and ShuttleNamePrefix, based ShuttleDeed on your currently equipped ID.
Why / Balance
It was an idea discussed on Discord. I've had several cases where I missed someone wanting to interact with me, because they only mentioned my ship name prefix, since that is the readily available information on a mass scanner. A highlight would help with making sure you do not miss any message addressed to you.
It can be also useful for Traffic Control or people doing medical dispatches, and in general being able to notice that someone is trying to talk to you is a plus.
I also wanted something easy to finally get into the codebase.
Technical details
The code is based on the approach used by antag role highlights, implementation of which can be seen here.
I have borrowed the code from CryoSleepSystem for getting the player's current ID (which required adding ClientInventorySystem to the ChatUIController) and then looked up the ShipDeedComponent that it can have. The data on the ShipDeed are then used to highlight keywords when any message is received.
We're highlighting ship name (i.e Searchlight), ship suffix (XX-123) and the suffix number (123).
This is my first time working with the SS14 codebase, so it's possible that something is terribly wrong or there is a better way how to do it. I have no idea how performance heavy the per-message lookup of Inventory is, but this approach was chosen so we do not have to do a lot of handling for various ways how can a ship name change - to be able to cache the name, we would have to listen to renames, selling, ID switches and the like. Simply polling it was way easier, but if it's unacceptable from performance standpoint I can look into other options, I mainly wanted to get something out to get started with the SS14 codebase and start with contributing.
How to test
Media
Requirements
Breaking changes
Changelog