Skip to content

Commit

Permalink
Add conditions to match stable offset adjust limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Dec 23, 2023
1 parent 92b490f commit 72bec52
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ public partial class BeatmapOffsetControl : CompositeDrawable, IKeyBindingHandle
[Resolved]
private OsuColour colours { get; set; } = null!;

[Resolved]
private Player? player { get; set; }

[Resolved]
private IGameplayClock? gameplayClock { get; set; }

private double lastPlayAverage;
private double lastPlayBeatmapOffset;
private HitEventTimingDistributionGraph? lastPlayGraph;
Expand Down Expand Up @@ -227,6 +233,18 @@ protected override void Dispose(bool isDisposing)

public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
// General limitations to ensure players don't do anything too weird.
// These match stable for now.
if (player is SubmittingPlayer)
{
// TODO: the blocking conditions should probably display a message.
if (player?.IsBreakTime.Value == false && gameplayClock?.CurrentTime - gameplayClock?.StartTime > 10000)
return false;

if (gameplayClock?.IsPaused.Value == true)
return false;
}

// To match stable, this should adjust by 5 ms, or 1 ms when holding alt.
// But that is hard to make work with global actions due to the operating mode.
// Let's use the more precise as a default for now.
Expand Down

0 comments on commit 72bec52

Please sign in to comment.