2023-06-23 00:37:25 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2021-06-09 03:57:08 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.Backgrounds
|
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
internal partial class SkinBackground : Background
|
2021-06-09 03:57:08 +08:00
|
|
|
|
{
|
|
|
|
|
private readonly Skin skin;
|
|
|
|
|
|
|
|
|
|
public SkinBackground(Skin skin, string fallbackTextureName)
|
|
|
|
|
: base(fallbackTextureName)
|
|
|
|
|
{
|
|
|
|
|
this.skin = skin;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
|
|
|
|
Sprite.Texture = skin.GetTexture("menu-background") ?? Sprite.Texture;
|
|
|
|
|
}
|
2021-06-09 04:26:15 +08:00
|
|
|
|
|
2023-10-17 16:48:51 +08:00
|
|
|
|
public override bool Equals(Background? other)
|
2021-06-09 04:26:15 +08:00
|
|
|
|
{
|
|
|
|
|
if (ReferenceEquals(null, other)) return false;
|
|
|
|
|
if (ReferenceEquals(this, other)) return true;
|
|
|
|
|
|
|
|
|
|
return other.GetType() == GetType()
|
|
|
|
|
&& ((SkinBackground)other).skin.SkinInfo.Equals(skin.SkinInfo);
|
|
|
|
|
}
|
2021-06-09 03:57:08 +08:00
|
|
|
|
}
|
|
|
|
|
}
|