From bf7677154b52f828358b40e5e1b6661c7d82a186 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 23 Jul 2017 20:11:34 +0300 Subject: [PATCH] Disabled debug logging of the loading coroutine when verbose logging isn't enabled --- .../BarotraumaClient/Source/GUI/LoadingScreen.cs | 5 ++++- Barotrauma/BarotraumaClient/Source/GameMain.cs | 10 ++++++++-- Barotrauma/BarotraumaShared/Source/Items/ItemPrefab.cs | 10 ++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/GUI/LoadingScreen.cs b/Barotrauma/BarotraumaClient/Source/GUI/LoadingScreen.cs index f5b7e1ac4..45acc973d 100644 --- a/Barotrauma/BarotraumaClient/Source/GUI/LoadingScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/GUI/LoadingScreen.cs @@ -41,7 +41,10 @@ namespace Barotrauma set { loadState = value; - DebugConsole.NewMessage("Loading: " + value.ToString() + "%",Color.Yellow); + if (GameSettings.VerboseLogging) + { + DebugConsole.NewMessage("Loading: " + value.ToString() + "%", Color.Yellow); + } DrawLoadingText = true; } } diff --git a/Barotrauma/BarotraumaClient/Source/GameMain.cs b/Barotrauma/BarotraumaClient/Source/GameMain.cs index a22e302fa..16451c2d7 100644 --- a/Barotrauma/BarotraumaClient/Source/GameMain.cs +++ b/Barotrauma/BarotraumaClient/Source/GameMain.cs @@ -199,7 +199,10 @@ namespace Barotrauma private IEnumerable Load() { - DebugConsole.NewMessage("LOADING COROUTINE", Color.Lime); + if (GameSettings.VerboseLogging) + { + DebugConsole.NewMessage("LOADING COROUTINE", Color.Lime); + } GUI.GraphicsDevice = base.GraphicsDevice; GUI.Init(Content); @@ -283,7 +286,10 @@ namespace Barotrauma TitleScreen.LoadState = 100.0f; hasLoaded = true; - DebugConsole.NewMessage("LOADING COROUTINE FINISHED", Color.Lime); + if (GameSettings.VerboseLogging) + { + DebugConsole.NewMessage("LOADING COROUTINE FINISHED", Color.Lime); + } yield return CoroutineStatus.Success; } diff --git a/Barotrauma/BarotraumaShared/Source/Items/ItemPrefab.cs b/Barotrauma/BarotraumaShared/Source/Items/ItemPrefab.cs index fd61e63fe..4021f62ad 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/ItemPrefab.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/ItemPrefab.cs @@ -208,11 +208,17 @@ namespace Barotrauma public static void LoadAll(List filePaths) { - DebugConsole.Log("Loading item prefabs: "); + if (GameSettings.VerboseLogging) + { + DebugConsole.Log("Loading item prefabs: "); + } foreach (string filePath in filePaths) { - DebugConsole.Log("*** "+filePath+" ***"); + if (GameSettings.VerboseLogging) + { + DebugConsole.Log("*** " + filePath + " ***"); + } XDocument doc = ToolBox.TryLoadXml(filePath); if (doc == null) return;