-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Add text highlighting #31442
base: master
Are you sure you want to change the base?
Add text highlighting #31442
Conversation
the true hero |
Will some highlights be on by default depending on job? Or always have to be customzied between rounds? |
i suggest another implementation for this, as you suggested in #30092 (comment) |
I was thinking about adding default highlightings (eg. for Quartermaster: QM, Cargo) including the person's name. But I didn't add it because I couldn't figure out how to make it work when changing IDs (should it consider the ID you're currently wearing or the character you're controlling?). |
Personally, based on ID seems fine, but then it would kinda have to be based on the permissions of the ID since those change more often than JUST the ID |
imo it's fine with empty by default |
I think empty by default is fine but if that would be the case at some point i would just stop filling it in because it would be annoying |
Either way, a small Resync button that updates your highlights based on your ID and possibly permissions it has, I think thatd be great |
Yes, I currently have a separate branch where I'm trying to make a similar UI panel but I'm having some issues with the xaml files (I'm really bad at writing UI code). For now, I limited myself to copying the /tg/'s fancy chat settings with a single LineEdit. |
Also regarding the LineEdit being empty by default, I understand that it can feel repetitive to insert it every round so I found some solutions:
I personally think number 3 is the best solution as it's (relatively) easy to implement and it's also the way /tg/ station handles the text highlighting to my knowledge. I'll be waiting for any maintainer's approval but in the meantime, I'll go about trying to implement these solutions, thanks for the feedback :D |
If third solution is possible to save them depending on the job/department you have, because if you change jobs often you'd have to still update it a lot. |
I've been eagerly awaiting this for a long time, I have a ton of trouble keeping an eye on the chat, especially on high pop. But if it's empty by default I doubt I'd end up using it. If it's easier I'd prefer it just stick with your roundstart job, then on the rare chance I decide to ditch my department it's up to me to update it myself |
A short update about the PR. I also found out that the game already stores the player's name and role (as can be seen in the Character Info panel). So I will be working on matching the user role to a list of predefined highlights (eg. for HoS: HoS, Head of Security, Security, Sec; or for Paramedic: Medical, med, para, etc). This feature will be able to be activated in the settings as "Autofill Highlights" or a similar name. If all goes well these features will be committed in a matter of a week or less. |
Is it possible to make the color configurable? At least for accessibility purposes. |
It's a very cool thing ! Just for a new role - AI, it will be great! |
It hasn't been started yet, but I'm planning on adding a color picker in the settings's accessibility tab. |
Since autofill adds Command if youre a command role, will it highlight [Command] whenever someone uses the respective radio channel? |
No, the 'InjectTagAroundString' function has a check to make sure words inside brackets don't get picked up. |
Perfect, really hoping this gets merged soon! |
Oh right, and does it conflict in any way with codewords? Or do these two act independently? |
Thank you!
I just ran a test and can confirm the codewords don't get highlighted since the highlights get overwritten by them. |
Perfect, finally the chat will be comprehensible |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
1 similar comment
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Hopefully this is on someone's radar! Text highlighting was very useful back in SS13, and I imagine it will be the same in this! |
The dream. Maybe if/when the chat refactor happens... |
What is currently blocking on this? It seems like a great feature, and even if all functionality can't be implemented until the chat refactor, it would still be top-notch QOL to have the basic functionality. Personally, I worry about an outstanding feature not being merged into the game because we are waiting on new-chat which just like new-atmos, new-salv, new-sci, and new-med are all just two weeks away. |
I see that you thumbs-upped my last comment @VitusVeit, so I'm gonna @ you. I am unsure if you have been talking on the Discord about this, but if you haven't, I would recommend you @ Errant-4 here if you believe this is ready for a merge. It's been two months since they last commented, and even though Maintainer discussion can take a while, at this point I would check in and make sure it was still being discussed. Best of luck getting this merged, this will be a game changer! Sincerely, |
Thanks man, I appreciate it. I didn't manage to check much on the discord but from the looks of it, this PR is sadly postponed until the chat refactor is merged. I was wondering though @Errant-4 if we could include this in a playtest/staging branch or test merge it for a bit to get some feedback and players' opinions until the chat refactor gets merged? Since the code has been reviewed and pulled in some other forks successfully. |
Just wondering why it is waiting until the chat refactor? I guess I don't really follow from the conversation why this needs the chat refactor to add as it currently is. From what I can see, the chat refactor is needed for future features, but I don't follow how it is needed for this to be implemented now. If the feature is ready, and you would like some testing, I know Harmony has added upstream features early in the past, and if it is alright with you, I could make a PR to move it over there. I have done this in the past so that the RPD could be used on Harmony. It would still need admin and maintainer approval, but if it's ok with you, I can move your commits downstream for testing. |
Well, it was some maintainer/s decision but I presume it is to (understandably) let the update on the chat code go through before accepting new PRs who, including this one, are using small patches instead of fixing the problem. But as you said, this PR can be (and is) able to run without the refactor.
Honestly, that would be really nice, go for it! |
Text Highlighting my beloved |
About the PR
This PR adds text highlighting to the ChatBox, the user can now input a series of newline-separated words that will be highlighted on the chat box and bubbles.
A new option is also available that tries to fill in the highlights depending on the player's role and name (disabled by default, can be found in the accessibility options tab, where is also possible to change the highlights color).
The words to be highlighted can also be wrapped in ", making them space-sensitive (or whole-words).
For example when writing "det":
Why / Balance
Already present in many SS13 servers, this feature greatly improves the readability of the comms and helps departments and individuals know when they are called/needed on the radio.
Resolves #16841
Technical details
This PR is based on #30092, it uses the newly added function "InjectTagAroundString" to change the colors from a list of keywords. The words to be highlighted can be inserted through a TextEdit in the filter panel and will be saved when exiting the game.
Regarding the auto-filling of the highlights, the autofill map is currently being saved in a localization "highlights.ftl" file since adding a new highlights.yml file would need a change in the engine part (as far as I know).
The ChatUIController now uses the CharacterInfoSystem along its "OnCharacterUpdate" event to update the highlights (when the autofill-highlights option is enabled and the player is attached/detached). Then, it uses the info from the character to find the best list of highlights relative to the character's role and name.
Media
Requirements
Breaking changes
Changelog
🆑 TheCactus