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
1 changed files with 10 additions and 7 deletions

View File

@ -162,17 +162,20 @@ void updateOffset()
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;
}
});
}
}