Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force minimum cursor size for OsuResumeOverlay #26148

Merged
merged 1 commit into from
Dec 28, 2023
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: 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
Loading