mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 20:47:22 +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.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.IO.Stores;
|
using osu.Framework.IO.Stores;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
|
@ -6,9 +6,11 @@ using System.Linq;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -55,13 +57,7 @@ namespace osu.Game.Skinning
|
|||||||
var texture = textures.Get(component.LookupName);
|
var texture = textures.Get(component.LookupName);
|
||||||
|
|
||||||
if (texture == null)
|
if (texture == null)
|
||||||
{
|
return new SpriteNotFound(component.LookupName);
|
||||||
return new SpriteIcon
|
|
||||||
{
|
|
||||||
Size = new Vector2(100),
|
|
||||||
Icon = FontAwesome.Solid.QuestionCircle
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Sprite { Texture = texture };
|
return new Sprite { Texture = texture };
|
||||||
}
|
}
|
||||||
@ -98,5 +94,28 @@ namespace osu.Game.Skinning
|
|||||||
Items = availableFiles;
|
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…
x
Reference in New Issue
Block a user