Unstable 0.17.3.0

This commit is contained in:
Juan Pablo Arce
2022-03-22 14:44:12 -03:00
parent cefac171f5
commit 4206f6db42
100 changed files with 1380 additions and 655 deletions
@@ -10,6 +10,7 @@ using System.Xml.Linq;
using Barotrauma.IO;
#if CLIENT
using Barotrauma.ClientSource.Settings;
using Barotrauma.Networking;
using Microsoft.Xna.Framework.Input;
#endif
@@ -453,8 +454,12 @@ namespace Barotrauma
bool languageChanged = currentConfig.Language != newConfig.Language;
bool audioOutputChanged = currentConfig.Audio.AudioOutputDevice != newConfig.Audio.AudioOutputDevice;
bool voiceCaptureChanged = currentConfig.Audio.VoiceCaptureDevice != newConfig.Audio.VoiceCaptureDevice;
bool textScaleChanged = Math.Abs(currentConfig.Graphics.TextScale - newConfig.Graphics.TextScale) > MathF.Pow(2.0f, -7);
currentConfig = newConfig;
#warning TODO: Implement program state updates;
#if CLIENT
if (setGraphicsMode)
@@ -462,6 +467,24 @@ namespace Barotrauma
GameMain.Instance.ApplyGraphicsSettings();
}
if (audioOutputChanged)
{
GameMain.SoundManager?.InitializeAlcDevice(currentConfig.Audio.AudioOutputDevice);
}
if (voiceCaptureChanged)
{
VoipCapture.ChangeCaptureDevice(currentConfig.Audio.VoiceCaptureDevice);
}
if (textScaleChanged)
{
foreach (var font in GUIStyle.Fonts.Values)
{
font.Prefabs.ForEach(p => p.LoadFont());
}
}
GameMain.SoundManager?.ApplySettings();
#endif
if (languageChanged) { TextManager.ClearCache(); }