1
0
mirror of https://github.com/ppy/osu.git synced 2024-05-14 05:51:16 +08:00

Merge pull request #24290 from peppy/beatmap-offset-all-difficulties

Change offset calibration control to adjust for all difficulties of the current beatmap set
This commit is contained in:
Bartłomiej Dach 2023-07-19 22:31:38 +02:00 committed by GitHub
commit 285a232cc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,17 +162,20 @@ namespace osu.Game.Screens.Play.PlayerSettings
realmWriteTask = realm.WriteAsync(r =>
{
var settings = r.Find<BeatmapInfo>(beatmap.Value.BeatmapInfo.ID)?.UserSettings;
var setInfo = r.Find<BeatmapSetInfo>(beatmap.Value.BeatmapSetInfo.ID);
if (settings == null) // only the case for tests.
if (setInfo == null) // only the case for tests.
return;
double val = Current.Value;
// Apply to all difficulties in a beatmap set for now (they generally always share timing).
foreach (var b in setInfo.Beatmaps)
{
BeatmapUserSettings settings = b.UserSettings;
double val = Current.Value;
if (settings.Offset == val)
return;
settings.Offset = val;
if (settings.Offset != val)
settings.Offset = val;
}
});
}
}