mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add hotkey to select random skin
This commit is contained in:
@ -9,7 +9,6 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Skinning;
|
||||
@ -103,7 +102,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
{
|
||||
if (skin.NewValue == random_skin_info)
|
||||
{
|
||||
randomizeSkin();
|
||||
skins.SelectRandomSkin();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -111,20 +110,6 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
});
|
||||
}
|
||||
|
||||
private void randomizeSkin()
|
||||
{
|
||||
// choose from only user skins, removing the current selection to ensure a new one is chosen.
|
||||
var randomChoices = skinItems.Where(s => s.ID > 0 && s.ID != configBindable.Value).ToArray();
|
||||
|
||||
if (randomChoices.Length == 0)
|
||||
{
|
||||
configBindable.Value = SkinInfo.Default.ID;
|
||||
return;
|
||||
}
|
||||
|
||||
configBindable.Value = randomChoices.ElementAt(RNG.Next(0, randomChoices.Length)).ID;
|
||||
}
|
||||
|
||||
private void updateItems()
|
||||
{
|
||||
skinItems = skins.GetAllUsableSkins();
|
||||
|
Reference in New Issue
Block a user