mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Return default combo colours if none provided
This commit is contained in:
@ -77,8 +77,6 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool hasComboColours;
|
|
||||||
|
|
||||||
private void handleColours(T output, string line)
|
private void handleColours(T output, string line)
|
||||||
{
|
{
|
||||||
var pair = SplitKeyVal(line);
|
var pair = SplitKeyVal(line);
|
||||||
@ -105,13 +103,6 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
if (!(output is IHasComboColours tHasComboColours)) return;
|
if (!(output is IHasComboColours tHasComboColours)) return;
|
||||||
|
|
||||||
if (!hasComboColours)
|
|
||||||
{
|
|
||||||
// remove default colours.
|
|
||||||
tHasComboColours.ComboColours.Clear();
|
|
||||||
hasComboColours = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
tHasComboColours.ComboColours.Add(colour);
|
tHasComboColours.ComboColours.Add(colour);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -9,6 +9,9 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
public class LegacyBeatmapSkin : LegacySkin
|
public class LegacyBeatmapSkin : LegacySkin
|
||||||
{
|
{
|
||||||
|
// Null should be returned in the case of no colours provided to fallback into current skin's colours.
|
||||||
|
protected override bool AllowDefaultColoursFallback => false;
|
||||||
|
|
||||||
public LegacyBeatmapSkin(BeatmapInfo beatmap, IResourceStore<byte[]> storage, AudioManager audioManager)
|
public LegacyBeatmapSkin(BeatmapInfo beatmap, IResourceStore<byte[]> storage, AudioManager audioManager)
|
||||||
: base(createSkinInfo(beatmap), new LegacySkinResourceStore<BeatmapSetFileInfo>(beatmap.BeatmapSet, storage), audioManager, beatmap.Path)
|
: base(createSkinInfo(beatmap), new LegacySkinResourceStore<BeatmapSetFileInfo>(beatmap.BeatmapSet, storage), audioManager, beatmap.Path)
|
||||||
{
|
{
|
||||||
|
@ -26,6 +26,11 @@ namespace osu.Game.Skinning
|
|||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
protected IResourceStore<SampleChannel> Samples;
|
protected IResourceStore<SampleChannel> Samples;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether to allow default combo colours as fallback if none provided in this skin.
|
||||||
|
/// </summary>
|
||||||
|
protected virtual bool AllowDefaultColoursFallback => true;
|
||||||
|
|
||||||
public LegacySkin(SkinInfo skin, IResourceStore<byte[]> storage, AudioManager audioManager)
|
public LegacySkin(SkinInfo skin, IResourceStore<byte[]> storage, AudioManager audioManager)
|
||||||
: this(skin, new LegacySkinResourceStore<SkinFileInfo>(skin, storage), audioManager, "skin.ini")
|
: this(skin, new LegacySkinResourceStore<SkinFileInfo>(skin, storage), audioManager, "skin.ini")
|
||||||
{
|
{
|
||||||
@ -63,7 +68,12 @@ namespace osu.Game.Skinning
|
|||||||
switch (global)
|
switch (global)
|
||||||
{
|
{
|
||||||
case GlobalSkinConfiguration.ComboColours:
|
case GlobalSkinConfiguration.ComboColours:
|
||||||
return SkinUtils.As<TValue>(new Bindable<List<Color4>>(Configuration.ComboColours));
|
if (Configuration.ComboColours.Any())
|
||||||
|
return SkinUtils.As<TValue>(new Bindable<List<Color4>>(Configuration.ComboColours));
|
||||||
|
else if (AllowDefaultColoursFallback)
|
||||||
|
return SkinUtils.As<TValue>(new Bindable<List<Color4>>(new DefaultSkinConfiguration().ComboColours));
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user