From 096f53d769f578bbe5e3517c83f8269e1211282c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Sep 2017 13:29:50 +0900 Subject: [PATCH] Use new static IsDebug method --- osu.Game/OsuGameBase.cs | 16 ++-------------- osu.Game/Overlays/Settings/SettingsFooter.cs | 3 ++- osu.Game/Overlays/VersionManager.cs | 3 ++- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 79e03a8141..9f831b58fb 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -6,6 +6,7 @@ using System.Reflection; using osu.Framework.Allocation; using osu.Framework.Configuration; +using osu.Framework.Development; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.IO.Stores; @@ -59,25 +60,12 @@ public class OsuGameBase : Framework.Game, IOnlineComponent public bool IsDeployedBuild => AssemblyName.Version.Major > 0; - public bool IsDebug - { - get - { - // ReSharper disable once RedundantAssignment - bool isDebug = false; - // Debug.Assert conditions are only evaluated in debug mode - Debug.Assert(isDebug = true); - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - return isDebug; - } - } - public string Version { get { if (!IsDeployedBuild) - return @"local " + (IsDebug ? @"debug" : @"release"); + return @"local " + (DebugUtils.IsDebug ? @"debug" : @"release"); var assembly = AssemblyName; return $@"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}"; diff --git a/osu.Game/Overlays/Settings/SettingsFooter.cs b/osu.Game/Overlays/Settings/SettingsFooter.cs index aef9f071db..cb1c861ee7 100644 --- a/osu.Game/Overlays/Settings/SettingsFooter.cs +++ b/osu.Game/Overlays/Settings/SettingsFooter.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using osu.Framework.Allocation; +using osu.Framework.Development; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; @@ -64,7 +65,7 @@ private void load(OsuGameBase game, OsuColour colours, RulesetStore rulesets) Origin = Anchor.TopCentre, TextSize = 14, Text = game.Version, - Colour = game.IsDebug ? colours.Red : Color4.White, + Colour = DebugUtils.IsDebug ? colours.Red : Color4.White, }, }; } diff --git a/osu.Game/Overlays/VersionManager.cs b/osu.Game/Overlays/VersionManager.cs index 447dc50af9..7b0b3520cb 100644 --- a/osu.Game/Overlays/VersionManager.cs +++ b/osu.Game/Overlays/VersionManager.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Net.Http; using osu.Framework.Allocation; +using osu.Framework.Development; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; @@ -68,7 +69,7 @@ private void load(NotificationOverlay notification, OsuColour colours, TextureSt }, new OsuSpriteText { - Colour = game.IsDebug ? colours.Red : Color4.White, + Colour = DebugUtils.IsDebug ? colours.Red : Color4.White, Text = game.Version }, }