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

Fix ruleset skins incorrectly providing configuration defaults

This commit is contained in:
Dean Herbert 2019-08-31 12:33:29 +09:00
parent 49fb21ffa9
commit 12eeec36fc
4 changed files with 36 additions and 11 deletions

View File

@ -13,7 +13,7 @@ namespace osu.Game.Skinning
public DefaultSkin()
: base(SkinInfo.Default)
{
Configuration = new SkinConfiguration();
Configuration = new DefaultSkinConfiguration();
}
public override Drawable GetDrawableComponent(string componentName) => null;

View File

@ -0,0 +1,28 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osuTK.Graphics;
namespace osu.Game.Skinning
{
/// <summary>
/// A skin configuration pre-populated with sane defaults.
/// </summary>
public class DefaultSkinConfiguration : SkinConfiguration
{
public DefaultSkinConfiguration()
{
HitCircleFont = "default";
ComboColours.AddRange(new[]
{
new Color4(17, 136, 170, 255),
new Color4(102, 136, 0, 255),
new Color4(204, 102, 0, 255),
new Color4(121, 9, 13, 255)
});
CursorExpand = true;
}
}
}

View File

@ -34,7 +34,7 @@ namespace osu.Game.Skinning
using (StreamReader reader = new StreamReader(stream))
Configuration = new LegacySkinDecoder().Decode(reader);
else
Configuration = new SkinConfiguration();
Configuration = new DefaultSkinConfiguration();
Samples = audioManager.GetSampleStore(storage);
Textures = new TextureStore(new TextureLoaderStore(storage));

View File

@ -7,21 +7,18 @@ using osuTK.Graphics;
namespace osu.Game.Skinning
{
/// <summary>
/// An empty skin configuration.
/// </summary>
public class SkinConfiguration : IHasComboColours, IHasCustomColours
{
public readonly SkinInfo SkinInfo = new SkinInfo();
public List<Color4> ComboColours { get; set; } = new List<Color4>
{
new Color4(17, 136, 170, 255),
new Color4(102, 136, 0, 255),
new Color4(204, 102, 0, 255),
new Color4(121, 9, 13, 255)
};
public List<Color4> ComboColours { get; set; } = new List<Color4>();
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
public string HitCircleFont { get; set; } = "default";
public string HitCircleFont { get; set; }
public int HitCircleOverlap { get; set; }
@ -29,6 +26,6 @@ namespace osu.Game.Skinning
public float? SliderPathRadius { get; set; }
public bool? CursorExpand { get; set; } = true;
public bool? CursorExpand { get; set; }
}
}