1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-06 02:33:20 +08:00

Fix positioning and rewinding support for ripples

This commit is contained in:
Dean Herbert 2023-04-30 10:38:21 +09:00
parent c994adfc22
commit 6a62949fcd

View File

@ -21,6 +21,11 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
private readonly DrawablePool<CursorRipple> ripplePool = new DrawablePool<CursorRipple>(20); private readonly DrawablePool<CursorRipple> ripplePool = new DrawablePool<CursorRipple>(20);
public CursorRippleVisualiser()
{
RelativeSizeAxes = Axes.Both;
}
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(OsuRulesetConfigManager? rulesetConfig) private void load(OsuRulesetConfigManager? rulesetConfig)
{ {
@ -30,7 +35,12 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
public bool OnPressed(KeyBindingPressEvent<OsuAction> e) public bool OnPressed(KeyBindingPressEvent<OsuAction> e)
{ {
if (showRipples.Value) if (showRipples.Value)
AddInternal(ripplePool.Get()); {
AddInternal(ripplePool.Get(r =>
{
r.Position = e.MousePosition;
}));
}
return false; return false;
} }
@ -66,7 +76,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
.ScaleTo(0.5f, 700, Easing.Out) .ScaleTo(0.5f, 700, Easing.Out)
.FadeTo(0.2f) .FadeTo(0.2f)
.FadeOut(700) .FadeOut(700)
.Expire(); .Expire(true);
} }
} }
@ -75,6 +85,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
AutoSizeAxes = Axes.Both;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
new RingPiece(3) new RingPiece(3)