Skip to content
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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel

### Added
- Added a new font in default_skin.lua to fit the localization (by @Satton2)
- Added `ttt_enforce_playercolor (default: 1)` convar
- can be turned off to stop ttt2 from overriding playermodel colors on (re)spawn

### Changed

Expand Down
4 changes: 4 additions & 0 deletions gamemodes/terrortown/gamemode/server/sv_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ CreateConVar("ttt2_confirm_killlist", "1", {FCVAR_NOTIFY, FCVAR_ARCHIVE}, "Confi
-- @realm server
CreateConVar("ttt_enforce_playermodel", "1", {FCVAR_NOTIFY, FCVAR_ARCHIVE}, "Whether or not to enforce terrorist playermodels. Set to 0 for compatibility with Enhanced Playermodel Selector")

---
-- @realm server
CreateConVar("ttt_enforce_playercolor", "1", {FCVAR_NOTIFY, FCVAR_ARCHIVE}, "Whether or not to enforce terrorist playercolor. Set to 0 to not reset color on (re)spawn")

---
-- @realm server
local ttt_dbgwin = CreateConVar("ttt_debug_preventwin", "0", {FCVAR_NOTIFY, FCVAR_ARCHIVE})
Expand Down
3 changes: 3 additions & 0 deletions gamemodes/terrortown/gamemode/server/sv_player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ end
-- @hook
-- @realm server
function GM:TTTPlayerSetColor(ply)

if not GetConVar("ttt_enforce_playercolor"):GetBool() then return end

local c = COLOR_WHITE

if GAMEMODE.playercolor then
Expand Down
7 changes: 6 additions & 1 deletion lua/terrortown/lang/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1859,4 +1859,9 @@ L.label_roles_credits_kill_award = "Aktiviere Ausrüstungspunktebelohnung für M
--L.sb_rank_tooltip_heroes = "TTT2 Heroes"
--L.sb_rank_tooltip_team = "Team"

--L.tbut_adminarea = "ADMIN AREA:"
--L.tbut_adminarea = "ADMIN AREA:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
8 changes: 7 additions & 1 deletion lua/terrortown/lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1859,4 +1859,10 @@ L.sb_rank_tooltip_streamer = "Streamer"
L.sb_rank_tooltip_heroes = "TTT2 Heroes"
L.sb_rank_tooltip_team = "Team"

L.tbut_adminarea = "ADMIN AREA:"
L.tbut_adminarea = "ADMIN AREA:"

-- 2023-03-09
L.help_enforce_playercolor = [[
This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.

If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
7 changes: 6 additions & 1 deletion lua/terrortown/lang/es.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1859,4 +1859,9 @@ L.desc_event_kill_other_using = "{victim} ({vrole} / {vteam}) fue asesinado por
--L.sb_rank_tooltip_heroes = "TTT2 Heroes"
--L.sb_rank_tooltip_team = "Team"

--L.tbut_adminarea = "ADMIN AREA:"
--L.tbut_adminarea = "ADMIN AREA:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
7 changes: 6 additions & 1 deletion lua/terrortown/lang/fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1859,4 +1859,9 @@ L.karma_unknown_tooltip = "Inconnu"
--L.sb_rank_tooltip_heroes = "TTT2 Heroes"
--L.sb_rank_tooltip_team = "Team"

--L.tbut_adminarea = "ADMIN AREA:"
--L.tbut_adminarea = "ADMIN AREA:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
7 changes: 6 additions & 1 deletion lua/terrortown/lang/it.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1859,4 +1859,9 @@ L.desc_event_kill_other_using = "{victim} ({vrole} / {vteam}) è stata ucciso da
--L.sb_rank_tooltip_heroes = "TTT2 Heroes"
--L.sb_rank_tooltip_team = "Team"

--L.tbut_adminarea = "ADMIN AREA:"
--L.tbut_adminarea = "ADMIN AREA:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
7 changes: 6 additions & 1 deletion lua/terrortown/lang/ja.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1855,4 +1855,9 @@ L.help_falldmg_exponent = [[
--L.sb_rank_tooltip_heroes = "TTT2 Heroes"
--L.sb_rank_tooltip_team = "Team"

--L.tbut_adminarea = "ADMIN AREA:"
--L.tbut_adminarea = "ADMIN AREA:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
7 changes: 6 additions & 1 deletion lua/terrortown/lang/pl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1859,4 +1859,9 @@ L.none = "Brak Roli"
--L.sb_rank_tooltip_heroes = "TTT2 Heroes"
--L.sb_rank_tooltip_team = "Team"

--L.tbut_adminarea = "ADMIN AREA:"
--L.tbut_adminarea = "ADMIN AREA:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
7 changes: 6 additions & 1 deletion lua/terrortown/lang/pt_br.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1887,4 +1887,9 @@ L.xfer_team_indicator = "Time"
--L.sb_rank_tooltip_heroes = "TTT2 Heroes"
--L.sb_rank_tooltip_team = "Team"

--L.tbut_adminarea = "ADMIN AREA:"
--L.tbut_adminarea = "ADMIN AREA:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
7 changes: 6 additions & 1 deletion lua/terrortown/lang/ru.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1862,4 +1862,9 @@ L.sb_rank_tooltip_streamer = "Стример"
L.sb_rank_tooltip_heroes = "Герои TTT2"
L.sb_rank_tooltip_team = "Команда"

L.tbut_adminarea = "Администраторская зона:"
L.tbut_adminarea = "Администраторская зона:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
7 changes: 6 additions & 1 deletion lua/terrortown/lang/zh_hans.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1865,4 +1865,9 @@ L.sb_rank_tooltip_streamer = "主播"
L.sb_rank_tooltip_heroes = "TTT2 英雄"
L.sb_rank_tooltip_team = "阵营"

L.tbut_adminarea = "管理区:"
L.tbut_adminarea = "管理区:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
7 changes: 6 additions & 1 deletion lua/terrortown/lang/zh_tw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1864,4 +1864,9 @@ L.sb_rank_tooltip_streamer = "主播"
L.sb_rank_tooltip_heroes = "TTT2 英雄"
L.sb_rank_tooltip_team = "陣營"

L.tbut_adminarea = "管理區:"
L.tbut_adminarea = "管理區:"

-- 2023-03-09
--L.help_enforce_playercolor = [[
--This sets all players to the same color on (re)spawn to prevent any distinction between playermodels and therefore the respective players.
--If disabled this should allow colors from custom colorable playermodels to stick. Be aware that this might break (with) some appearance changing equipment e.g. make a disguise pretty obvious.]]
9 changes: 9 additions & 0 deletions lua/terrortown/menus/gamemode/administration/playermodels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ function CLGAMEMODESUBMENU:Populate(parent)
serverConvar = "ttt_enforce_playermodel"
})

form:MakeHelp({
label = "help_enforce_playercolor"
})

form:MakeCheckBox({
label = "label_enforce_playercolor",
serverConvar = "ttt_enforce_playercolor"
})

form:MakeHelp({
label = "help_prefer_map_models"
})
Expand Down