Skip to content

Commit

Permalink
Force minimum cursor size for OsuResumeOverlay
Browse files Browse the repository at this point in the history
On cursor sizes below 0.3x it becomes exceedingly difficult to quickly locate and then accurately click the resume cursor on the pause overlay as it could as big as a handful of pixels. This clamps the minimum cursor size to 1x for the resume overlay, which is way more comfortable and more closely resembles stable.
  • Loading branch information
rushiiMachine committed Dec 26, 2023
1 parent 223e459 commit c087578
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 5 additions & 5 deletions osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ private void load()
};

userCursorScale = config.GetBindable<float>(OsuSetting.GameplayCursorSize);
userCursorScale.ValueChanged += _ => calculateCursorScale();
userCursorScale.ValueChanged += _ => cursorScale.Value = CalculateCursorScale();

autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
autoCursorScale.ValueChanged += _ => calculateCursorScale();
autoCursorScale.ValueChanged += _ => cursorScale.Value = CalculateCursorScale();

cursorScale.BindValueChanged(e => cursorScaleContainer.Scale = new Vector2(e.NewValue), true);
}

protected override void LoadComplete()
{
base.LoadComplete();
calculateCursorScale();
cursorScale.Value = CalculateCursorScale();
}

private void calculateCursorScale()
protected virtual float CalculateCursorScale()
{
float scale = userCursorScale.Value;

Expand All @@ -94,7 +94,7 @@ private void calculateCursorScale()
scale *= GetScaleForCircleSize(state.Beatmap.Difficulty.CircleSize);
}

cursorScale.Value = scale;
return scale;
}

protected override void SkinChanged(ISkinSource skin)
Expand Down
6 changes: 6 additions & 0 deletions osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ public OsuClickToResumeCursor()
RelativePositionAxes = Axes.Both;
}

protected override float CalculateCursorScale()
{
// Force minimum cursor size so it's easily clickable
return Math.Max(1f, base.CalculateCursorScale());
}

protected override bool OnHover(HoverEvent e)
{
updateColour();
Expand Down

0 comments on commit c087578

Please sign in to comment.