1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-27 07:53:06 +08:00
osu-lazer/osu.Game/Rulesets/RulesetSelector.cs

36 lines
1.0 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2022-06-17 15:37:17 +08:00
#nullable disable
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Allocation;
using osu.Framework.Logging;
namespace osu.Game.Rulesets
{
public abstract class RulesetSelector : TabControl<RulesetInfo>
{
2019-06-26 16:52:25 +08:00
[Resolved]
protected RulesetStore Rulesets { get; private set; }
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
[BackgroundDependencyLoader]
2019-06-26 16:52:25 +08:00
private void load()
{
2022-06-29 17:56:15 +08:00
foreach (var ruleset in Rulesets.AvailableRulesets)
{
try
{
2022-06-29 17:56:15 +08:00
AddItem(ruleset);
}
catch
{
2022-06-29 17:56:15 +08:00
Logger.Log($"Could not create ruleset icon for {ruleset.Name}. Please check for an update from the developer.", level: LogLevel.Error);
}
}
}
}
}