1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Force minimum cursor size for OsuResumeOverlay

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.
This commit is contained in:
rushiiMachine 2023-12-26 10:07:21 -08:00
parent 223e459f2d
commit c087578e01
No known key found for this signature in database
GPG Key ID: DCBE5952BB3B6420
2 changed files with 11 additions and 5 deletions

View File

@ -70,10 +70,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
};
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);
}
@ -81,10 +81,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
protected override void LoadComplete()
{
base.LoadComplete();
calculateCursorScale();
cursorScale.Value = CalculateCursorScale();
}
private void calculateCursorScale()
protected virtual float CalculateCursorScale()
{
float scale = userCursorScale.Value;
@ -94,7 +94,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
scale *= GetScaleForCircleSize(state.Beatmap.Difficulty.CircleSize);
}
cursorScale.Value = scale;
return scale;
}
protected override void SkinChanged(ISkinSource skin)

View File

@ -71,6 +71,12 @@ namespace osu.Game.Rulesets.Osu.UI
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();