add Game.ForceVoice and Game.ForceLocalVoice

guess what i am going to use this for
This commit is contained in:
Evil Factory
2022-06-16 20:34:31 -03:00
parent 1136342b60
commit 916fd7522e
2 changed files with 5 additions and 0 deletions
@@ -228,9 +228,11 @@ namespace Barotrauma.Networking
if (GameMain.WindowActive && SettingsMenu.Instance is null) if (GameMain.WindowActive && SettingsMenu.Instance is null)
{ {
bool pttDown = PlayerInput.KeyDown(InputType.Voice) && GUI.KeyboardDispatcher.Subscriber == null; bool pttDown = PlayerInput.KeyDown(InputType.Voice) && GUI.KeyboardDispatcher.Subscriber == null;
if (GameMain.LuaCs.Game.ForceVoice != null) { pttDown = GameMain.LuaCs.Game.ForceVoice.Value; }
if (pttDown || captureTimer <= 0) if (pttDown || captureTimer <= 0)
{ {
ForceLocal = GameMain.ActiveChatMode == ChatMode.Local; ForceLocal = GameMain.ActiveChatMode == ChatMode.Local;
if (GameMain.LuaCs.Game.ForceLocalVoice != null) { ForceLocal = GameMain.LuaCs.Game.ForceLocalVoice.Value; }
} }
if (GameSettings.CurrentConfig.Audio.VoiceSetting == VoiceMode.Activity) if (GameSettings.CurrentConfig.Audio.VoiceSetting == VoiceMode.Activity)
{ {
@@ -48,6 +48,9 @@ namespace Barotrauma
return GameMain.LightManager; return GameMain.LightManager;
} }
} }
public bool? ForceVoice = null;
public bool? ForceLocalVoice = null;
#else #else
public bool IsDedicated public bool IsDedicated