Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions osu.Game/Graphics/Cursor/MenuCursorContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,18 @@ protected override void PopIn()
{
activeCursor.FadeTo(1, 250, Easing.OutQuint);
activeCursor.ScaleTo(1, 400, Easing.OutQuint);
activeCursor.RotateTo(0, 400, Easing.OutQuint);
dragRotationState = DragRotationState.NotDragging;

if (dragRotationState == DragRotationState.NotDragging)
activeCursor.RotateTo(0, 400, Easing.OutQuint);
}

protected override void PopOut()
{
activeCursor.FadeTo(0, 250, Easing.OutQuint);
activeCursor.ScaleTo(0.6f, 250, Easing.In);
activeCursor.RotateTo(0, 400, Easing.OutQuint);
dragRotationState = DragRotationState.NotDragging;

if (dragRotationState == DragRotationState.NotDragging)
activeCursor.RotateTo(0, 400, Easing.OutQuint);
}

private void playTapSample(double baseFrequency = 1f)
Expand Down
33 changes: 21 additions & 12 deletions osu.Game/Screens/SelectV2/SongSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace osu.Game.Screens.SelectV2
/// This will be gradually built upon and ultimately replace <see cref="Select.SongSelect"/> once everything is in place.
/// </summary>
[Cached(typeof(ISongSelect))]
public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalAction>, ISongSelect, IHandlePresentBeatmap
public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalAction>, ISongSelect, IHandlePresentBeatmap, IProvideCursor
{
/// <summary>
/// A debounce that governs how long after a panel is selected before the rest of song select (and the game at large)
Expand Down Expand Up @@ -119,6 +119,8 @@ public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBind
private Container mainContent = null!;
private SkinnableContainer skinnableContent = null!;

private GridContainer mainGridContainer = null!;

private NoResultsPlaceholder noResultsPlaceholder = null!;

public override bool? ApplyModTrackAdjustments => true;
Expand Down Expand Up @@ -812,7 +814,7 @@ private void updateBackgroundDim() => ApplyToBackground(backgroundModeBeatmap =>
// Probably needs more thought because this needs to be in every `ApplyToBackground` currently to restore sane defaults.
backgroundModeBeatmap.FadeColour(Color4.White, 250);

bool backgroundRevealActive = revealingBackground?.State == ScheduledDelegate.RunState.Running || revealingBackground?.State == ScheduledDelegate.RunState.Complete;
bool backgroundRevealActive = revealBackgroundDelegate?.State == ScheduledDelegate.RunState.Running || revealBackgroundDelegate?.State == ScheduledDelegate.RunState.Complete;
backgroundModeBeatmap.BlurAmount.Value = configBackgroundBlur.Value && !backgroundRevealActive ? 20 : 0f;
});

Expand Down Expand Up @@ -908,11 +910,14 @@ private void updateNoResultsPlaceholder()

#endregion

#region Input
#region Background reveal

private ScheduledDelegate? revealingBackground;
private ScheduledDelegate? revealBackgroundDelegate;

private GridContainer mainGridContainer = null!;
public CursorContainer? Cursor => null;
bool IProvideCursor.ProvidingUserCursor => revealBackgroundDelegate?.Completed == true;

protected override bool OnHover(HoverEvent e) => true;

protected override bool OnMouseDown(MouseDownEvent e)
{
Expand All @@ -927,13 +932,13 @@ protected override bool OnMouseDown(MouseDownEvent e)
// For simplicity, disable this functionality on mobile.
bool isTouchInput = e.CurrentState.Mouse.LastSource is ISourcedFromTouch;

if (!carousel.AbsoluteScrolling && !isTouchInput && mouseDownPriority && revealingBackground == null)
if (!carousel.AbsoluteScrolling && !isTouchInput && mouseDownPriority && revealBackgroundDelegate == null)
{
revealingBackground = Scheduler.AddDelayed(() =>
revealBackgroundDelegate = Scheduler.AddDelayed(() =>
{
if (containingInputManager.DraggedDrawable != null)
{
revealingBackground = null;
revealBackgroundDelegate = null;
return;
}

Expand Down Expand Up @@ -962,10 +967,10 @@ protected override void OnMouseUp(MouseUpEvent e)

private void restoreBackground()
{
if (revealingBackground == null)
if (revealBackgroundDelegate == null)
return;

if (revealingBackground.State == ScheduledDelegate.RunState.Complete)
if (revealBackgroundDelegate.State == ScheduledDelegate.RunState.Complete)
{
mainContent.ResizeWidthTo(1f, 500, Easing.OutQuint);
mainContent.ScaleTo(1, 500, Easing.OutQuint);
Expand All @@ -978,12 +983,16 @@ private void restoreBackground()
Footer?.Show();
}

revealingBackground.Cancel();
revealingBackground = null;
revealBackgroundDelegate.Cancel();
revealBackgroundDelegate = null;

updateBackgroundDim();
}

#endregion

#region Input

public virtual bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
if (!this.IsCurrentScreen()) return false;
Expand Down
Loading