-
Notifications
You must be signed in to change notification settings - Fork 81
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
playermodels: Add option to disable resetting player color via ttt_enforce_playercolor
convar
#1027
base: master
Are you sure you want to change the base?
Conversation
…nforce_playercolor` convar This is mostly done to enhance compatibility with colourable playermodels. Before this change coloured playermodels would be set to `COLOR_WHITE´ or `GAMEMODE.playercolor` on (re)spawn to prevent players from being distinguished by different colours. After this change this behaviour is not changed unless `ttt_enforce_playercolor` is set to 0. In that case we return early in the `GM:TTTPlayerSetColor` hook and do nothing. This does NOT however prevent other addons from hooking into the `TTTPlayerSetColor` hook nor does it prevent other addons from setting the playercolor somewhere else.
[1] TTT2/gamemodes/terrortown/gamemode/shared/sh_main.lua Lines 355 to 378 in fd45084
|
I tested this with the latest version and it works good, had to get enhanced playermodel selector to pick a color but like the color got kept between rounds and stuff, i think if there was a way to open the color selector from like the default ttt2 f1 menu then this would be a cool little overhaul to the color system. One thing I noticed with colors though is they aren't applied to the like playermodel display in the search menu so if you ever work on this again that would be a good addition, would also be neat if like there was a setting to make the colors it selects from without the color selector randomized per player rather than 1 color randomly selected for everyone |
Thanks for testing this! I originally got stuck on this because i wasn't able to properly test if this was the only reset for the color and how this would interact with different addons. So i appreciate you testing this!
What happened if you did not do that? Did that break something or was it undesirable in some other way? |
oh without playermodel selector I would be stuck as white but once I used playermodel selector to set a color onto myself it would persist and not get replaced by one of the randomized colors, without enforce playercolor thing the color set would reset every round and have to be reapplied, thats why I was talking about like a built in color selector |
This is mostly done to enhance compatibility with colourable
playermodels.
Before this change coloured playermodels would be set to
COLOR_WHITE
orGAMEMODE.playercolor
on (re)spawn to prevent players from beingdistinguished by different colours.
After this change this behaviour is not changed unless
ttt_enforce_playercolor
is set to 0.In that case we return early in the
GM:TTTPlayerSetColor
hook and donothing.
This does NOT however prevent other addons from hooking into the
TTTPlayerSetColor
hook nordoes it prevent other addons from setting the playercolor somewhere else.
NOTE: This is also not tested yet, hence draft status