1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-06 19:07:19 +08:00
osu-lazer/osu.Game/Overlays/VersionManager.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

98 lines
3.2 KiB
C#
Raw Normal View History

// 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 18:19:50 +09:00
2022-06-17 16:37:17 +09:00
#nullable disable
2017-02-14 16:13:25 +09:00
using osu.Framework.Allocation;
2019-06-20 12:48:45 +09:00
using osu.Framework.Development;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2017-02-13 20:06:51 +09:00
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics;
2017-09-18 22:32:49 +09:00
using osu.Game.Graphics.Sprites;
2018-11-20 16:51:59 +09:00
using osuTK;
using osuTK.Graphics;
2018-04-13 18:19:50 +09:00
namespace osu.Game.Overlays
{
public class VersionManager : VisibilityContainer
{
[BackgroundDependencyLoader]
private void load(OsuColour colours, TextureStore textures, OsuGameBase game)
{
AutoSizeAxes = Axes.Both;
Anchor = Anchor.BottomCentre;
Origin = Anchor.BottomCentre;
2018-04-13 18:19:50 +09:00
2017-02-13 20:06:51 +09:00
Alpha = 0;
2018-04-13 18:19:50 +09:00
FillFlowContainer mainFill;
2017-02-13 20:06:51 +09:00
Children = new Drawable[]
{
mainFill = new FillFlowContainer
2017-02-13 20:06:51 +09:00
{
AutoSizeAxes = Axes.Both,
2017-03-04 11:00:17 +01:00
Direction = FillDirection.Vertical,
2017-02-13 20:06:51 +09:00
Children = new Drawable[]
{
2017-03-01 19:33:01 +01:00
new FillFlowContainer
2017-02-13 20:06:51 +09:00
{
AutoSizeAxes = Axes.Both,
2017-03-04 11:00:17 +01:00
Direction = FillDirection.Horizontal,
2017-03-01 19:33:01 +01:00
Spacing = new Vector2(5),
2017-02-13 20:06:51 +09:00
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Children = new Drawable[]
{
new OsuSpriteText
{
Font = OsuFont.GetFont(weight: FontWeight.Bold),
Text = game.Name
2017-02-13 20:06:51 +09:00
},
new OsuSpriteText
{
2019-06-20 12:48:45 +09:00
Colour = DebugUtils.IsDebugBuild ? colours.Red : Color4.White,
Text = game.Version
2017-02-13 20:06:51 +09:00
},
}
},
}
}
};
if (!game.IsDeployedBuild)
{
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"),
},
});
}
}
2018-04-13 18:19:50 +09:00
protected override void PopIn()
{
2018-12-27 19:22:24 +09:00
this.FadeIn(1400, Easing.OutQuint);
}
2018-04-13 18:19:50 +09:00
protected override void PopOut()
{
2018-12-27 19:22:24 +09:00
this.FadeOut(500, Easing.OutQuint);
}
}
}