(4ca668169) Fixed: Conflict

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:58:48 +03:00
parent 0a67590572
commit cb83984e80
80 changed files with 2036 additions and 1859 deletions
+25 -16
View File
@@ -178,7 +178,6 @@ namespace Barotrauma
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
PerformanceCounter = new PerformanceCounter();
IsFixedTimeStep = false;
@@ -271,15 +270,17 @@ namespace Barotrauma
WaterRenderer.Instance = new WaterRenderer(base.GraphicsDevice, Content);
loadingScreenOpen = true;
TitleScreen = new LoadingScreen(GraphicsDevice);
TitleScreen.WaitForLanguageSelection = Config.ShowLanguageSelectionPrompt;
TitleScreen = new LoadingScreen(GraphicsDevice)
{
WaitForLanguageSelection = Config.ShowLanguageSelectionPrompt
};
bool canLoadInSeparateThread = false;
#if WINDOWS
canLoadInSeparateThread = true;
#endif
loadingCoroutine = CoroutineManager.StartCoroutine(Load(), "", canLoadInSeparateThread);
loadingCoroutine = CoroutineManager.StartCoroutine(Load(canLoadInSeparateThread), "", canLoadInSeparateThread);
}
private void InitUserStats()
@@ -323,6 +324,11 @@ namespace Barotrauma
DebugConsole.NewMessage("LOADING COROUTINE", Color.Lime);
}
while (TitleScreen.WaitForLanguageSelection)
{
yield return CoroutineStatus.Running;
}
SoundManager = new Sounds.SoundManager();
SoundManager.SetCategoryGainMultiplier("default", Config.SoundVolume);
SoundManager.SetCategoryGainMultiplier("ui", Config.SoundVolume);
@@ -331,16 +337,21 @@ namespace Barotrauma
SoundManager.SetCategoryGainMultiplier("voip", Config.VoiceChatVolume);
if (Config.EnableSplashScreen)
{
try
var pendingSplashScreens = TitleScreen.PendingSplashScreens;
pendingSplashScreens?.Enqueue(new Pair<string, Point>("Content/Splash_UTG.mp4", new Point(1280, 720)));
pendingSplashScreens?.Enqueue(new Pair<string, Point>("Content/Splash_FF.mp4", new Point(1280, 720)));
pendingSplashScreens?.Enqueue(new Pair<string, Point>("Content/Splash_Daedalic.mp4", new Point(1920, 1080)));
}
//if not loading in a separate thread, wait for the splash screens to finish before continuing the loading
//otherwise the videos will look extremely choppy
if (!isSeparateThread)
{
while (TitleScreen.PlayingSplashScreen || TitleScreen.PendingSplashScreens.Count > 0)
{
(TitleScreen as LoadingScreen).SplashScreen = new Video(base.GraphicsDevice, SoundManager, "Content/splashscreen.mp4", 1280, 720);
yield return CoroutineStatus.Running;
}
catch (Exception e)
{
Config.EnableSplashScreen = false;
DebugConsole.ThrowError("Playing the splash screen failed.", e);
}
}
}
GUI.Init(Window, Config.SelectedContentPackages, GraphicsDevice);
DebugConsole.Init();
@@ -371,11 +382,9 @@ namespace Barotrauma
InitUserStats();
yield return CoroutineStatus.Running;
LightManager = new Lights.LightManager(base.GraphicsDevice, Content);
WaterRenderer.Instance = new WaterRenderer(base.GraphicsDevice, Content);
TitleScreen.LoadState = 1.0f;
yield return CoroutineStatus.Running;
@@ -526,7 +535,7 @@ namespace Barotrauma
protected override void UnloadContent()
{
Video.Close();
SoundManager.Dispose();
SoundManager?.Dispose();
}
/// <summary>