Skip to content

Commit 7ee2866

Browse files
authored
VoiceChat: Added option for team proximity voicechat (#1811)
This adds a new convar/menu option to enable/disable proximity voice chat for the team voice chat. This tackles #1810 I was NOT yet able to test this! For me it seems 100% fine but if anyone can/wants to test it before merging, please do so.
1 parent 7157941 commit 7ee2866

File tree

18 files changed

+33
-1
lines changed

18 files changed

+33
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
2929
- Added 2 new sprint settings (by @wgetJane)
3030
- Stamina cooldown time before stamina begins regenerating after sprinting, 0.8 seconds by default
3131
- Option to require forward key to be held to sprint, enabled by default
32+
- Added option to enable/disable proximity voice chat for the team voice chat (by @NickCloudAT)
3233

3334
### Changed
3435

gamemodes/terrortown/gamemode/server/sv_voice.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ local cv_ttt_limit_spectator_voice =
2929
-- @realm server
3030
local loc_voice = CreateConVar("ttt_locational_voice", "0", { FCVAR_NOTIFY, FCVAR_ARCHIVE })
3131

32+
---
33+
-- @realm server
34+
local loc_voice_team =
35+
CreateConVar("ttt_locational_voice_team", "0", { FCVAR_NOTIFY, FCVAR_ARCHIVE })
36+
3237
---
3338
-- @realm server
3439
local loc_voice_prep =
@@ -44,6 +49,7 @@ local loc_voice_range_sq = loc_voice_range:GetInt() ^ 2
4449
hook.Add("TTT2SyncGlobals", "AddVoiceGlobals", function()
4550
SetGlobalBool(sv_voiceenable:GetName(), sv_voiceenable:GetBool())
4651
SetGlobalBool(loc_voice:GetName(), loc_voice:GetBool())
52+
SetGlobalBool(loc_voice_team:GetName(), loc_voice_team:GetBool())
4753
end)
4854

4955
cvars.AddChangeCallback(sv_voiceenable:GetName(), function(cv, old, new)
@@ -54,6 +60,10 @@ cvars.AddChangeCallback(loc_voice:GetName(), function(cv, old, new)
5460
SetGlobalBool(loc_voice:GetName(), tobool(tonumber(new)))
5561
end)
5662

63+
cvars.AddChangeCallback(loc_voice_team:GetName(), function(cv, old, new)
64+
SetGlobalBool(loc_voice_team:GetName(), tobool(tonumber(new)))
65+
end)
66+
5767
cvars.AddChangeCallback(loc_voice_range:GetName(), function(cv, old, new)
5868
loc_voice_range_sq = tonumber(new) ^ 2
5969
end)
@@ -99,7 +109,7 @@ local function PlayerCanHearTeam(listener, speaker, speakerTeam)
99109
return false, false
100110
end
101111

102-
return true, loc_voice:GetBool()
112+
return true, loc_voice:GetBool() and loc_voice_team:GetBool()
103113
end
104114

105115
local function PlayerIsMuted(listener, speaker)

lua/terrortown/lang/de.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,7 @@ L.label_voice_drain_normal = "Entladung pro Tick für normale Spieler"
16581658
L.label_voice_drain_admin = "Entladung pro Tick für Admins und öffentliche Ordnungsrollen"
16591659
L.label_voice_drain_recharge = "Aufladungsrate pro Tick wenn nicht gesprochen wird"
16601660
L.label_locational_voice = "Aktiviere Proximity Sprachchat für lebende Spieler"
1661+
L.label_locational_voice_team = "Aktiviere Proximity Team-Sprachat für lebende Spieler"
16611662
L.label_locational_voice_prep = "Aktiviere Proximity Sprachchat während der Vorbereitungszeit"
16621663
L.label_locational_voice_range = "Proximity Sprachchat Reichweite"
16631664
L.label_armor_on_spawn = "Spielerrüstung beim (Neu-)Spawnen"

lua/terrortown/lang/en.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,7 @@ L.label_voice_drain_normal = "Drain per tick for normal players"
16641664
L.label_voice_drain_admin = "Drain per tick for admins and public policing roles"
16651665
L.label_voice_drain_recharge = "Recharge rate per tick of not voice chatting"
16661666
L.label_locational_voice = "Enable proximity voice chat for living players"
1667+
L.label_locational_voice_team = "Enable proximity team voice chat for living players"
16671668
L.label_locational_voice_prep = "Enable proximity voice chat during preparing phase"
16681669
L.label_locational_voice_range = "Proximity voice chat range"
16691670
L.label_armor_on_spawn = "Player armor on (re-)spawn"

lua/terrortown/lang/es.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,7 @@ L.desc_event_kill_other_using = "{victim} ({vrole} / {vteam}) fue asesinado por
16641664
--L.label_voice_drain_admin = "Drain per tick for admins and public policing roles"
16651665
--L.label_voice_drain_recharge = "Recharge rate per tick of not voice chatting"
16661666
--L.label_locational_voice = "Enable proximity voice chat for living players"
1667+
--L.label_locational_voice_team = "Enable proximity team voice chat for living players"
16671668
--L.label_locational_voice_prep = "Enable proximity voice chat during preparing phase"
16681669
--L.label_locational_voice_range = "Proximity voice chat range"
16691670
--L.label_armor_on_spawn = "Player armor on (re-)spawn"

lua/terrortown/lang/fr.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,7 @@ L.label_voice_drain_normal = "Consommation par tick pour les joueurs"
16581658
L.label_voice_drain_admin = "Consommation par tick pour les admin et rôles de détective"
16591659
L.label_voice_drain_recharge = "Temps de recharge par tick"
16601660
L.label_locational_voice = "Activer le chat vocal de proximité pour les joueurs vivants"
1661+
--L.label_locational_voice_team = "Enable proximity team voice chat for living players"
16611662
L.label_locational_voice_prep = "Activer le chat vocal de proximité pendant la phase de préparation"
16621663
L.label_locational_voice_range = "Portée du chat vocal de proximité"
16631664
L.label_armor_on_spawn = "Armure du joueur lors d'une (ré)apparition"

lua/terrortown/lang/it.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,7 @@ L.desc_event_kill_other_using = "{victim} ({vrole} / {vteam}) è stata ucciso da
16641664
--L.label_voice_drain_admin = "Drain per tick for admins and public policing roles"
16651665
--L.label_voice_drain_recharge = "Recharge rate per tick of not voice chatting"
16661666
--L.label_locational_voice = "Enable proximity voice chat for living players"
1667+
--L.label_locational_voice_team = "Enable proximity team voice chat for living players"
16671668
--L.label_locational_voice_prep = "Enable proximity voice chat during preparing phase"
16681669
--L.label_locational_voice_range = "Proximity voice chat range"
16691670
--L.label_armor_on_spawn = "Player armor on (re-)spawn"

lua/terrortown/lang/ja.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,7 @@ L.label_voice_drain_normal = "通常プレイヤーのボイスチャットの
16591659
L.label_voice_drain_admin = "管理者および確白役職のボイスチャットのバッテリーのチックあたりの減少値"
16601660
L.label_voice_drain_recharge = "ボイスチャットをしていないティックあたりのリチャージ率"
16611661
L.label_locational_voice = "生存者同士における近接ボイスチャットの有効"
1662+
--L.label_locational_voice_team = "Enable proximity team voice chat for living players"
16621663
L.label_locational_voice_prep = "準備フェーズにおける近接ボイスチャットの有効"
16631664
L.label_locational_voice_range = "近接ボイスチャット範囲"
16641665
L.label_armor_on_spawn = "全プレイヤーアーマー装着"

lua/terrortown/lang/ko.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,7 @@ L.help_max_slots = "한 슬롯당 최대 무기 수를 설정합니다. '-1'은
16601660
--L.label_voice_drain_admin = "Drain per tick for admins and public policing roles"
16611661
--L.label_voice_drain_recharge = "Recharge rate per tick of not voice chatting"
16621662
--L.label_locational_voice = "Enable proximity voice chat for living players"
1663+
--L.label_locational_voice_team = "Enable proximity team voice chat for living players"
16631664
--L.label_locational_voice_prep = "Enable proximity voice chat during preparing phase"
16641665
--L.label_locational_voice_range = "Proximity voice chat range"
16651666
--L.label_armor_on_spawn = "Player armor on (re-)spawn"

lua/terrortown/lang/pl.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,7 @@ L.none = "Brak Roli"
16641664
--L.label_voice_drain_admin = "Drain per tick for admins and public policing roles"
16651665
--L.label_voice_drain_recharge = "Recharge rate per tick of not voice chatting"
16661666
--L.label_locational_voice = "Enable proximity voice chat for living players"
1667+
--L.label_locational_voice_team = "Enable proximity team voice chat for living players"
16671668
--L.label_locational_voice_prep = "Enable proximity voice chat during preparing phase"
16681669
--L.label_locational_voice_range = "Proximity voice chat range"
16691670
--L.label_armor_on_spawn = "Player armor on (re-)spawn"

0 commit comments

Comments
 (0)