Skip to content

HUD: Added Team name next to Role name#1726

Merged
TimGoll merged 9 commits intoTTT-2:masterfrom
milkwxter:master
Jan 21, 2025
Merged

HUD: Added Team name next to Role name#1726
TimGoll merged 9 commits intoTTT-2:masterfrom
milkwxter:master

Conversation

@milkwxter
Copy link
Contributor

Hello!

I have encountered a problem on my friends server where if we have many roles installed, some players who join will not know what every single role is, and they will become confused, especially with what team they are supposed to play on.

This new change will allow players to see what team they are on, immediately next to their role name. I know there is a team ICON next to the time remaining in the match on the top of the screen, but our players either never even noticed it, or did not know what it meant.

I have included a toggle in the F1 menu, under HUD Switcher so that players who feel like they don't need to see the team can turn it off and enjoy the game their way.

If you guys have any changes to be made I would love to hear it, I think this change will help new player retention!

Here are some previews of how it will look, including the F1 menu and an example with a long role name!
f1_menu
short_name
long_name

@TimGoll
Copy link
Member

TimGoll commented Jan 20, 2025

but our players either never even noticed it, or did not know what it meant.

I've noticed this as well. Quite a few YouTubers that played TTT2 for hours, did never notice any of the icons. Peter from PietSmiet was once confused what the red knife next to the corpse of a dead traitor means. I was taken aback, because this icon is shown as a team and role icon, ALL THE TIME.
The same holds true with the key bind info. They are always on the bottom right corner. Even with explanation when you hold tab. But still, I've seen them wondering how to interact with an item, while it is shown there.

I'm conflicted if we should make it more prominent like you did, or just find a way to teach players to use the UI.


Regarding your implementation: You have to support translations

@milkwxter
Copy link
Contributor Author

Regarding the translations, will Google Translate do? Or is there a better resource to use, since I only speak English?

@TimGoll
Copy link
Member

TimGoll commented Jan 20, 2025

Regarding the translations, will Google Translate do? Or is there a better resource to use, since I only speak English?

Sorry, I was unclear. The team name should be translated. That is already a feature in TTT2. just use LANG.TryTranslation(team), where team is the identifier such as "traitors" or "innocents"

@milkwxter
Copy link
Contributor Author

Awesome! I got the translation working I will show it below!

image

@TimGoll
Copy link
Member

TimGoll commented Jan 20, 2025

This is better, but the default team is probably not the best. You should probably get the team of the player (e.g. if you're a sidekick, your team won't be the default team). L[client:GetTeam()] should work here - I think

@milkwxter
Copy link
Contributor Author

Good catch, I did not think about roles like that!

@TimGoll
Copy link
Member

TimGoll commented Jan 20, 2025

Just a hint: we use spaces to indent.

And if you install stylua in VSCode it autoformats the file for you

@milkwxter
Copy link
Contributor Author

Haha I think I got it now thank you! I am used to tabs and I use notepad++ so it was a little confusing figuring out what was wrong

@TimGoll TimGoll merged commit 516bf08 into TTT-2:master Jan 21, 2025
4 checks passed
Histalek pushed a commit to WardenPotato/TTT2 that referenced this pull request Jan 31, 2025
Hello!

I have encountered a problem on my friends server where if we have many
roles installed, some players who join will not know what every single
role is, and they will become confused, especially with what team they
are supposed to play on.

This new change will allow players to see what team they are on,
immediately next to their role name. I know there is a team ICON next to
the time remaining in the match on the top of the screen, but our
players either never even noticed it, or did not know what it meant.

I have included a toggle in the F1 menu, under HUD Switcher so that
players who feel like they don't need to see the team can turn it off
and enjoy the game their way.

If you guys have any changes to be made I would love to hear it, I think
this change will help new player retention!

Here are some previews of how it will look, including the F1 menu and an
example with a long role name!

![f1_menu](https://github.com/user-attachments/assets/a67e867d-53e3-4d57-b2b4-d5af7b15060b)

![short_name](https://github.com/user-attachments/assets/12be0364-4b44-465c-83ab-aaf3855616ac)

![long_name](https://github.com/user-attachments/assets/fdd3e46e-edfd-4274-96aa-d2ac82da177c)

---------

Co-authored-by: Tim Goll <github@timgoll.de>
@Racpy
Copy link
Contributor

Racpy commented May 1, 2025

I encountered an issue with new players on the server where a setting is enabled by default, but it isn't actually active. We need to disable it and then re-enable it for it to work properly.

@TimGoll
Copy link
Member

TimGoll commented May 5, 2025

That's weird. This setting should be disabled by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants