mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Handle combo colour lookups in other skins
This commit is contained in:
parent
9be8d3f0d2
commit
78794935b4
@ -127,14 +127,8 @@ namespace osu.Game.Tests.Gameplay
|
||||
{
|
||||
switch (lookup)
|
||||
{
|
||||
case GlobalSkinColours global:
|
||||
switch (global)
|
||||
{
|
||||
case GlobalSkinColours.ComboColours:
|
||||
return SkinUtils.As<TValue>(new Bindable<IReadOnlyList<Color4>>(ComboColours));
|
||||
}
|
||||
|
||||
break;
|
||||
case SkinComboColourLookup comboColour:
|
||||
return SkinUtils.As<TValue>(new Bindable<Color4>(ComboColours[comboColour.ColourIndex % ComboColours.Count]));
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.OpenGL.Textures;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
@ -28,10 +29,10 @@ namespace osu.Game.Skinning
|
||||
|
||||
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
|
||||
{
|
||||
// todo: this code is pulled from LegacySkin and should not exist.
|
||||
// will likely change based on how databased storage of skin configuration goes.
|
||||
switch (lookup)
|
||||
{
|
||||
// todo: this code is pulled from LegacySkin and should not exist.
|
||||
// will likely change based on how databased storage of skin configuration goes.
|
||||
case GlobalSkinColours global:
|
||||
switch (global)
|
||||
{
|
||||
@ -40,9 +41,15 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SkinComboColourLookup comboColour:
|
||||
return SkinUtils.As<TValue>(new Bindable<Color4>(getComboColour(Configuration, comboColour.ColourIndex)));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Color4 getComboColour(IHasComboColours source, int colourIndex)
|
||||
=> source.ComboColours[colourIndex % source.ComboColours.Count];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user