1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 18:02:55 +08:00
osu-lazer/osu.Game/Screens/Ranking/RetryButton.cs

55 lines
1.4 KiB
C#
Raw Normal View History

2019-11-01 14:32:06 +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.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Play;
using osuTK;
2020-03-17 16:43:16 +08:00
namespace osu.Game.Screens.Ranking
2019-11-01 14:32:06 +08:00
{
2022-11-24 13:32:20 +08:00
public partial class RetryButton : OsuAnimatedButton
2019-11-01 14:32:06 +08:00
{
private readonly Box background;
2023-06-23 00:37:25 +08:00
[Resolved]
private Player? player { get; set; }
2019-11-01 14:32:06 +08:00
public RetryButton()
{
Size = new Vector2(50, 30);
Children = new Drawable[]
{
background = new Box
{
RelativeSizeAxes = Axes.Both,
Depth = float.MaxValue
},
new SpriteIcon
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(13),
Icon = FontAwesome.Solid.Redo,
2019-11-01 14:32:06 +08:00
},
};
2020-01-15 03:26:54 +08:00
TooltipText = "retry";
2019-11-01 14:32:06 +08:00
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
background.Colour = colours.Green;
if (player != null)
2019-11-01 14:51:10 +08:00
Action = () => player.Restart();
2019-11-01 14:32:06 +08:00
}
}
}