mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Move version-related properties to OsuGameBase.
This commit is contained in:
@ -32,8 +32,6 @@ namespace osu.Game
|
||||
{
|
||||
public class OsuGame : OsuGameBase
|
||||
{
|
||||
public virtual bool IsDeployedBuild => false;
|
||||
|
||||
public Toolbar Toolbar;
|
||||
|
||||
private ChatOverlay chat;
|
||||
|
@ -1,6 +1,8 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
@ -37,6 +39,40 @@ namespace osu.Game
|
||||
|
||||
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
protected AssemblyName AssemblyName => Assembly.GetEntryAssembly().GetName();
|
||||
|
||||
public bool IsDeployedBuild => AssemblyName.Version.Major > 0;
|
||||
|
||||
public bool IsDebug
|
||||
{
|
||||
get
|
||||
{
|
||||
bool isDebug = false;
|
||||
Debug.Assert(isDebug = true);
|
||||
return isDebug;
|
||||
}
|
||||
}
|
||||
|
||||
public string Version
|
||||
{
|
||||
get
|
||||
{
|
||||
bool isDebug = false;
|
||||
Debug.Assert(isDebug = true);
|
||||
|
||||
if (!IsDeployedBuild)
|
||||
return @"local " + (isDebug ? @"debug" : @"release");
|
||||
|
||||
var assembly = AssemblyName;
|
||||
return $@"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}";
|
||||
}
|
||||
}
|
||||
|
||||
public OsuGameBase()
|
||||
{
|
||||
Name = @"osu!lazer";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
|
Reference in New Issue
Block a user