1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 20:33:21 +08:00

Document ready button enable state with some comments

This commit is contained in:
Tim Schumacher 2024-11-30 23:02:22 +01:00
parent f4e155bfa6
commit 164b809c89

View File

@ -88,13 +88,15 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
private bool enoughTimeLeft()
{
// this doesn't consider mods which apply variable rates, yet.
// TODO: This doesn't consider mods which apply variable rates, yet.
double rate = ModUtils.CalculateRateWithMods(mods.Value);
double hitLength = Math.Round(gameBeatmap.Value.Track.Length / rate);
// We want to avoid users not being able to submit scores if they chose to not skip,
// so track length is chosen over playable length.
double trackLength = Math.Round(gameBeatmap.Value.Track.Length / rate);
// This should probably consider the length of the currently selected item, rather than a constant 30 seconds.
return room.EndDate != null && DateTimeOffset.UtcNow.AddSeconds(30).AddMilliseconds(hitLength) < room.EndDate;
// Additional 30 second delay added to account for load and/or submit time.
return room.EndDate != null && DateTimeOffset.UtcNow.AddSeconds(30).AddMilliseconds(trackLength) < room.EndDate;
}
protected override void Dispose(bool isDisposing)