diff --git a/osu.Game/Skinning/DefaultSkinConfiguration.cs b/osu.Game/Skinning/DefaultSkinConfiguration.cs index cd5975edac..8e89ab25b2 100644 --- a/osu.Game/Skinning/DefaultSkinConfiguration.cs +++ b/osu.Game/Skinning/DefaultSkinConfiguration.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osuTK.Graphics; - namespace osu.Game.Skinning { /// @@ -12,13 +10,7 @@ namespace osu.Game.Skinning { public DefaultSkinConfiguration() { - ComboColours.AddRange(new[] - { - new Color4(255, 192, 0, 255), - new Color4(0, 202, 0, 255), - new Color4(18, 124, 255, 255), - new Color4(242, 24, 57, 255), - }); + ComboColours = DefaultComboColours; } } } diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index bc12c00cd8..ff1e501a06 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -46,6 +46,8 @@ namespace osu.Game.Skinning else Configuration = new SkinConfiguration(); + Configuration.AllowDefaultColoursFallback = AllowDefaultColoursFallback; + if (storage != null) { Samples = audioManager?.GetSampleStore(storage); @@ -68,10 +70,9 @@ namespace osu.Game.Skinning switch (global) { case GlobalSkinConfiguration.ComboColours: - if (Configuration.ComboColours.Any()) - return SkinUtils.As(new Bindable>(Configuration.ComboColours)); - else if (AllowDefaultColoursFallback) - return SkinUtils.As(new Bindable>(new DefaultSkinConfiguration().ComboColours)); + var comboColours = Configuration.ComboColours; + if (comboColours != null) + return SkinUtils.As(new Bindable>(comboColours)); break; } diff --git a/osu.Game/Skinning/SkinConfiguration.cs b/osu.Game/Skinning/SkinConfiguration.cs index 54aac86e3c..57b969be33 100644 --- a/osu.Game/Skinning/SkinConfiguration.cs +++ b/osu.Game/Skinning/SkinConfiguration.cs @@ -14,7 +14,32 @@ namespace osu.Game.Skinning { public readonly SkinInfo SkinInfo = new SkinInfo(); - public List ComboColours { get; set; } = new List(); + internal bool AllowDefaultColoursFallback; + + public static List DefaultComboColours = new List + { + new Color4(255, 192, 0, 255), + new Color4(0, 202, 0, 255), + new Color4(18, 124, 255, 255), + new Color4(242, 24, 57, 255), + }; + + private List comboColours = new List(); + + public List ComboColours + { + get + { + if (comboColours.Count > 0) + return comboColours; + + if (AllowDefaultColoursFallback) + return DefaultComboColours; + + return null; + } + set => comboColours = value; + } public Dictionary CustomColours { get; set; } = new Dictionary();