1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-12 23:07:26 +08:00

Add safeties against attempting to apply previous play while offset adjust is not allowed

This should theoretically not be possible, but while we are sharing this
control's implementation between gameplay and non-gameplay usages, let's
ensure nothing weird can occur.
This commit is contained in:
Dean Herbert 2025-01-24 15:33:39 +09:00
parent 7aceb2e349
commit 6a74f9f902
No known key found for this signature in database

View File

@ -245,6 +245,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
Text = BeatmapOffsetControlStrings.CalibrateUsingLastPlay,
Action = () =>
{
if (Current.Disabled)
return;
Current.Value = lastPlayBeatmapOffset - lastPlayAverage;
lastAppliedScore.Value = ReferenceScore.Value;
},
@ -277,6 +280,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
protected override void Update()
{
base.Update();
if (useAverageButton != null)
useAverageButton.Enabled.Value = allowOffsetAdjust;
Current.Disabled = !allowOffsetAdjust;
}