mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:07:44 +08:00
Improve the visual of the missing sprite sprite
This commit is contained in:
parent
de30a42558
commit
8185020f12
@ -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;
|
||||
|
@ -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,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user