Add helper method to make direct casts be used

This commit is contained in:
smoogipoo
2019-09-05 16:39:58 +09:00
parent c0bcbfd892
commit bda21998c4
4 changed files with 41 additions and 4 deletions

View File

@ -62,16 +62,16 @@ namespace osu.Game.Skinning
switch (global)
{
case GlobalSkinConfiguration.ComboColours:
return new Bindable<List<Color4>>(Configuration.ComboColours) as IBindable<TValue>;
return SkinUtils.As<TValue>(new Bindable<List<Color4>>(Configuration.ComboColours));
}
break;
case GlobalSkinColour colour:
return getCustomColour(colour.ToString()) as IBindable<TValue>;
return SkinUtils.As<TValue>(getCustomColour(colour.ToString()));
case SkinCustomColourLookup customColour:
return getCustomColour(customColour.Lookup.ToString()) as IBindable<TValue>;
return SkinUtils.As<TValue>(getCustomColour(customColour.Lookup.ToString()));
default:
try