2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2017-02-14 15:13:25 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2019-06-20 11:48:45 +08:00
|
|
|
|
using osu.Framework.Development;
|
2017-02-12 13:54:56 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-02-13 19:06:51 +08:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Framework.Graphics.Textures;
|
|
|
|
|
using osu.Game.Graphics;
|
2017-09-18 21:32:49 +08:00
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-01-16 02:42:38 +08:00
|
|
|
|
namespace osu.Game.Overlays
|
2017-02-12 13:54:56 +08:00
|
|
|
|
{
|
2019-10-15 07:37:54 +08:00
|
|
|
|
public class VersionManager : VisibilityContainer
|
2017-02-12 13:54:56 +08:00
|
|
|
|
{
|
|
|
|
|
[BackgroundDependencyLoader]
|
2019-09-24 17:03:01 +08:00
|
|
|
|
private void load(OsuColour colours, TextureStore textures, OsuGameBase game)
|
2017-02-12 13:54:56 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
Anchor = Anchor.BottomCentre;
|
|
|
|
|
Origin = Anchor.BottomCentre;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-02-13 19:06:51 +08:00
|
|
|
|
Alpha = 0;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-01-06 22:20:26 +08:00
|
|
|
|
FillFlowContainer mainFill;
|
|
|
|
|
|
2017-02-13 19:06:51 +08:00
|
|
|
|
Children = new Drawable[]
|
2017-02-12 13:54:56 +08:00
|
|
|
|
{
|
2021-01-06 22:20:26 +08:00
|
|
|
|
mainFill = new FillFlowContainer
|
2017-02-13 19:06:51 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
2017-03-04 18:00:17 +08:00
|
|
|
|
Direction = FillDirection.Vertical,
|
2017-02-13 19:06:51 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2017-03-02 02:33:01 +08:00
|
|
|
|
new FillFlowContainer
|
2017-02-13 19:06:51 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
2017-03-04 18:00:17 +08:00
|
|
|
|
Direction = FillDirection.Horizontal,
|
2017-03-02 02:33:01 +08:00
|
|
|
|
Spacing = new Vector2(5),
|
2017-02-13 19:06:51 +08:00
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
2019-02-12 12:04:46 +08:00
|
|
|
|
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
2017-03-06 16:09:48 +08:00
|
|
|
|
Text = game.Name
|
2017-02-13 19:06:51 +08:00
|
|
|
|
},
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
2019-06-20 11:48:45 +08:00
|
|
|
|
Colour = DebugUtils.IsDebugBuild ? colours.Red : Color4.White,
|
2017-03-06 16:09:48 +08:00
|
|
|
|
Text = game.Version
|
2017-02-13 19:06:51 +08:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2021-01-06 22:20:26 +08:00
|
|
|
|
|
2021-01-06 22:30:54 +08:00
|
|
|
|
if (!game.IsDeployedBuild)
|
2021-01-06 22:20:26 +08:00
|
|
|
|
{
|
|
|
|
|
mainFill.AddRange(new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Font = OsuFont.Numeric.With(size: 12),
|
|
|
|
|
Colour = colours.Yellow,
|
|
|
|
|
Text = @"Development Build"
|
|
|
|
|
},
|
|
|
|
|
new Sprite
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Texture = textures.Get(@"Menu/dev-build-footer"),
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
2017-02-12 13:54:56 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-02-12 13:54:56 +08:00
|
|
|
|
protected override void PopIn()
|
|
|
|
|
{
|
2018-12-27 18:22:24 +08:00
|
|
|
|
this.FadeIn(1400, Easing.OutQuint);
|
2017-02-12 13:54:56 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-02-12 13:54:56 +08:00
|
|
|
|
protected override void PopOut()
|
|
|
|
|
{
|
2018-12-27 18:22:24 +08:00
|
|
|
|
this.FadeOut(500, Easing.OutQuint);
|
2017-02-12 13:54:56 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|