mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 08:52:55 +08:00
Merge pull request #31854 from peppy/editor-test-button-scale-disable
Disable scale animation when holding editor "test" button
This commit is contained in:
commit
58d040112b
@ -4,6 +4,7 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
@ -14,6 +15,9 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
|
||||
{
|
||||
public partial class TestGameplayButton : OsuButton
|
||||
{
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; } = null!;
|
||||
|
||||
protected override SpriteText CreateText() => new OsuSpriteText
|
||||
{
|
||||
Depth = -1,
|
||||
@ -24,7 +28,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
|
||||
};
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours, OverlayColourProvider colourProvider)
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
BackgroundColour = colours.Orange1;
|
||||
SpriteText.Colour = colourProvider.Background6;
|
||||
@ -33,5 +37,18 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
|
||||
|
||||
Text = EditorStrings.TestBeatmap;
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
Background.FadeColour(colours.Orange0, 500, Easing.OutQuint);
|
||||
// don't call base in order to block scale animation
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void OnMouseUp(MouseUpEvent e)
|
||||
{
|
||||
Background.FadeColour(colours.Orange1, 300, Easing.OutQuint);
|
||||
// don't call base in order to block scale animation
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user