1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Catch a second location

This commit is contained in:
Dean Herbert 2022-06-29 18:56:15 +09:00
parent b092e6937a
commit 6c64cea057
2 changed files with 19 additions and 11 deletions

View File

@ -8,6 +8,7 @@ using osu.Framework.Allocation;
using osu.Framework.Development; using osu.Framework.Development;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Logging;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
@ -32,16 +33,23 @@ namespace osu.Game.Overlays.Settings
foreach (var ruleset in rulesets.AvailableRulesets) foreach (var ruleset in rulesets.AvailableRulesets)
{ {
var icon = new ConstrainedIconContainer try
{ {
Anchor = Anchor.TopCentre, var icon = new ConstrainedIconContainer
Origin = Anchor.TopCentre, {
Icon = ruleset.CreateInstance().CreateIcon(), Anchor = Anchor.TopCentre,
Colour = Color4.Gray, Origin = Anchor.TopCentre,
Size = new Vector2(20), Icon = ruleset.CreateInstance().CreateIcon(),
}; Colour = Color4.Gray,
Size = new Vector2(20),
};
modes.Add(icon); modes.Add(icon);
}
catch
{
Logger.Log($"Could not create ruleset icon for {ruleset.Name}. Please check for an update from the developer.", level: LogLevel.Error);
}
} }
Children = new Drawable[] Children = new Drawable[]

View File

@ -19,15 +19,15 @@ namespace osu.Game.Rulesets
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
foreach (var r in Rulesets.AvailableRulesets) foreach (var ruleset in Rulesets.AvailableRulesets)
{ {
try try
{ {
AddItem(r); AddItem(ruleset);
} }
catch catch
{ {
Logger.Log($"Could not create ruleset icon for {r.Name}. Please check for an update.", level: LogLevel.Error); Logger.Log($"Could not create ruleset icon for {ruleset.Name}. Please check for an update from the developer.", level: LogLevel.Error);
} }
} }
} }