1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Merge pull request #28127 from peppy/random-menu-image

Randomise which menu content is shown on arriving at the menu
This commit is contained in:
Dan Balasescu 2024-05-07 18:32:27 +09:00 committed by GitHub
commit 1f1fc87fb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Events;
using osu.Framework.Threading;
using osu.Framework.Utils;
using osu.Game.Graphics.Containers;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
@ -111,7 +112,9 @@ namespace osu.Game.Screens.Menu
content.AddRange(loaded);
displayIndex = -1;
// Many users don't spend much time at the main menu, so let's randomise where in the
// carousel of available images we start at to give each a fair chance.
displayIndex = RNG.Next(0, images.NewValue.Images.Length) - 1;
showNext();
}, (cancellationTokenSource ??= new CancellationTokenSource()).Token);
}