1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 08:22:56 +08:00

Improve the visual of the missing sprite sprite

This commit is contained in:
Dean Herbert 2022-04-04 20:35:48 +09:00
parent de30a42558
commit 8185020f12
2 changed files with 26 additions and 8 deletions

View File

@ -7,7 +7,6 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using osu.Framework.Extensions;
using osu.Framework.IO.Stores;
using osu.Game.Database;

View File

@ -6,9 +6,11 @@ using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Configuration;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Settings;
using osuTK;
@ -55,13 +57,7 @@ namespace osu.Game.Skinning
var texture = textures.Get(component.LookupName);
if (texture == null)
{
return new SpriteIcon
{
Size = new Vector2(100),
Icon = FontAwesome.Solid.QuestionCircle
};
}
return new SpriteNotFound(component.LookupName);
return new Sprite { Texture = texture };
}
@ -98,5 +94,28 @@ namespace osu.Game.Skinning
Items = availableFiles;
}
}
public class SpriteNotFound : CompositeDrawable
{
public SpriteNotFound(string lookup)
{
AutoSizeAxes = Axes.Both;
InternalChildren = new Drawable[]
{
new SpriteIcon
{
Size = new Vector2(50),
Icon = FontAwesome.Solid.QuestionCircle
},
new OsuSpriteText
{
Position = new Vector2(25, 50),
Text = $"missing: {lookup}",
Origin = Anchor.TopCentre,
}
};
}
}
}
}