mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +08:00
Fix positioning and rewinding support for ripples
This commit is contained in:
parent
c994adfc22
commit
6a62949fcd
@ -21,6 +21,11 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
|
||||
private readonly DrawablePool<CursorRipple> ripplePool = new DrawablePool<CursorRipple>(20);
|
||||
|
||||
public CursorRippleVisualiser()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuRulesetConfigManager? rulesetConfig)
|
||||
{
|
||||
@ -30,7 +35,12 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
public bool OnPressed(KeyBindingPressEvent<OsuAction> e)
|
||||
{
|
||||
if (showRipples.Value)
|
||||
AddInternal(ripplePool.Get());
|
||||
{
|
||||
AddInternal(ripplePool.Get(r =>
|
||||
{
|
||||
r.Position = e.MousePosition;
|
||||
}));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -66,7 +76,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
.ScaleTo(0.5f, 700, Easing.Out)
|
||||
.FadeTo(0.2f)
|
||||
.FadeOut(700)
|
||||
.Expire();
|
||||
.Expire(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,6 +85,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new RingPiece(3)
|
||||
|
Loading…
Reference in New Issue
Block a user