mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 07:04:15 +08:00
Use new static IsDebug method
This commit is contained in:
parent
511874389a
commit
096f53d769
@ -6,6 +6,7 @@ using System.Diagnostics;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
|
using osu.Framework.Development;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.IO.Stores;
|
using osu.Framework.IO.Stores;
|
||||||
@ -59,25 +60,12 @@ namespace osu.Game
|
|||||||
|
|
||||||
public bool IsDeployedBuild => AssemblyName.Version.Major > 0;
|
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
|
public string Version
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (!IsDeployedBuild)
|
if (!IsDeployedBuild)
|
||||||
return @"local " + (IsDebug ? @"debug" : @"release");
|
return @"local " + (DebugUtils.IsDebug ? @"debug" : @"release");
|
||||||
|
|
||||||
var assembly = AssemblyName;
|
var assembly = AssemblyName;
|
||||||
return $@"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}";
|
return $@"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}";
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Development;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
@ -64,7 +65,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
TextSize = 14,
|
TextSize = 14,
|
||||||
Text = game.Version,
|
Text = game.Version,
|
||||||
Colour = game.IsDebug ? colours.Red : Color4.White,
|
Colour = DebugUtils.IsDebug ? colours.Red : Color4.White,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Development;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -68,7 +69,7 @@ namespace osu.Game.Overlays
|
|||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Colour = game.IsDebug ? colours.Red : Color4.White,
|
Colour = DebugUtils.IsDebug ? colours.Red : Color4.White,
|
||||||
Text = game.Version
|
Text = game.Version
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user