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

Speed up metronome in timing screen when pressing control key #31342

Merged
merged 4 commits into from
Dec 31, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use return value instead of field to force weight position update
  • Loading branch information
minetoblend committed Dec 30, 2024
commit 9ea7afb38edb455f07771191481bd47e53bf9c17
16 changes: 5 additions & 11 deletions osu.Game/Screens/Edit/Timing/MetronomeDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,22 +238,20 @@ private void load(AudioManager audio)

private bool spedUp;

private bool divisorChanged;

private void updateDivisor()
private bool updateDivisor()
{
int divisor = 1;

if (spedUp)
divisor = beatDivisor.Value % 3 == 0 ? 3 : 2;

if (divisor == Divisor)
return;

divisorChanged = true;
return false;

Divisor = divisor;
metronomeTick.Divisor = divisor;

return true;
}

protected override void LoadComplete()
Expand All @@ -274,9 +272,7 @@ protected override void Update()

timingPoint = BeatSyncSource.ControlPoints.TimingPointAt(BeatSyncSource.Clock.CurrentTime);

updateDivisor();

if (beatLength != timingPoint.BeatLength || divisorChanged)
if (updateDivisor() || beatLength != timingPoint.BeatLength)
bdach marked this conversation as resolved.
Show resolved Hide resolved
{
beatLength = timingPoint.BeatLength;

Expand Down Expand Up @@ -312,8 +308,6 @@ protected override void Update()
latchDelegate = Schedule(() => sampleLatch?.Play());
}
}

divisorChanged = false;
}

protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
Expand Down
Loading