2019-06-12 20:23:01 +00:00
|
|
|
|
// 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 07:37:17 +00:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2019-06-12 20:23:01 +00:00
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
|
|
|
|
using osu.Framework.Allocation;
|
2022-06-29 09:51:07 +00:00
|
|
|
|
using osu.Framework.Logging;
|
2019-06-12 20:23:01 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets
|
|
|
|
|
{
|
|
|
|
|
public abstract class RulesetSelector : TabControl<RulesetInfo>
|
|
|
|
|
{
|
2019-06-26 08:52:25 +00:00
|
|
|
|
[Resolved]
|
|
|
|
|
protected RulesetStore Rulesets { get; private set; }
|
2019-06-12 20:23:01 +00:00
|
|
|
|
|
|
|
|
|
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2019-06-26 08:52:25 +00:00
|
|
|
|
private void load()
|
2019-06-12 20:23:01 +00:00
|
|
|
|
{
|
2019-06-26 08:52:25 +00:00
|
|
|
|
foreach (var r in Rulesets.AvailableRulesets)
|
2022-06-29 09:51:07 +00:00
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
AddItem(r);
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
Logger.Log($"Could not create ruleset icon for {r.Name}. Please check for an update.", level: LogLevel.Error);
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-06-12 20:23:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|