mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 12:42:54 +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)
|
switch (lookup)
|
||||||
{
|
{
|
||||||
case GlobalSkinColours global:
|
case SkinComboColourLookup comboColour:
|
||||||
switch (global)
|
return SkinUtils.As<TValue>(new Bindable<Color4>(ComboColours[comboColour.ColourIndex % ComboColours.Count]));
|
||||||
{
|
|
||||||
case GlobalSkinColours.ComboColours:
|
|
||||||
return SkinUtils.As<TValue>(new Bindable<IReadOnlyList<Color4>>(ComboColours));
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.OpenGL.Textures;
|
using osu.Framework.Graphics.OpenGL.Textures;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
|
using osu.Game.Beatmaps.Formats;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
@ -28,10 +29,10 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
|
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)
|
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:
|
case GlobalSkinColours global:
|
||||||
switch (global)
|
switch (global)
|
||||||
{
|
{
|
||||||
@ -40,9 +41,15 @@ namespace osu.Game.Skinning
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SkinComboColourLookup comboColour:
|
||||||
|
return SkinUtils.As<TValue>(new Bindable<Color4>(getComboColour(Configuration, comboColour.ColourIndex)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Color4 getComboColour(IHasComboColours source, int colourIndex)
|
||||||
|
=> source.ComboColours[colourIndex % source.ComboColours.Count];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user