mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 17:33:22 +08:00
Centralise implementation of cancel button logic
This commit is contained in:
parent
b248b2e5e3
commit
1bb3c609ae
18
osu.Game/Graphics/UserInterface/DangerousTriangleButton.cs
Normal file
18
osu.Game/Graphics/UserInterface/DangerousTriangleButton.cs
Normal file
@ -0,0 +1,18 @@
|
||||
// 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;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class DangerousTriangleButton : TriangleButton
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
BackgroundColour = colours.PinkDark;
|
||||
Triangles.ColourDark = colours.PinkDarker;
|
||||
Triangles.ColourLight = colours.Pink;
|
||||
}
|
||||
}
|
||||
}
|
@ -339,22 +339,13 @@ namespace osu.Game.Overlays.KeyBinding
|
||||
}
|
||||
}
|
||||
|
||||
public class ClearButton : TriangleButton
|
||||
public class ClearButton : DangerousTriangleButton
|
||||
{
|
||||
public ClearButton()
|
||||
{
|
||||
Text = "Clear";
|
||||
Size = new Vector2(80, 20);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
BackgroundColour = colours.Pink;
|
||||
|
||||
Triangles.ColourDark = colours.PinkDark;
|
||||
Triangles.ColourLight = colours.PinkLight;
|
||||
}
|
||||
}
|
||||
|
||||
public class KeyButton : Container
|
||||
|
@ -11,7 +11,6 @@ using osu.Game.Input;
|
||||
using osu.Game.Overlays.Settings;
|
||||
using osu.Game.Rulesets;
|
||||
using osuTK;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.KeyBinding
|
||||
{
|
||||
@ -55,10 +54,10 @@ namespace osu.Game.Overlays.KeyBinding
|
||||
}
|
||||
}
|
||||
|
||||
public class ResetButton : TriangleButton
|
||||
public class ResetButton : DangerousTriangleButton
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load()
|
||||
{
|
||||
Text = "Reset all bindings in section";
|
||||
RelativeSizeAxes = Axes.X;
|
||||
@ -66,10 +65,6 @@ namespace osu.Game.Overlays.KeyBinding
|
||||
Height = 20;
|
||||
|
||||
Content.CornerRadius = 5;
|
||||
|
||||
BackgroundColour = colours.PinkDark;
|
||||
Triangles.ColourDark = colours.PinkDarker;
|
||||
Triangles.ColourLight = colours.Pink;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user