Add helper methods for retrieving other skin hyper-dash colours

This commit is contained in:
Salman Ahmed 2020-04-04 19:09:52 +03:00
parent ee247e58c8
commit f3bcb0628c
2 changed files with 9 additions and 2 deletions

View File

@ -9,6 +9,13 @@ namespace osu.Game.Rulesets.Catch.Skinning
{ {
internal static class CatchSkinExtensions internal static class CatchSkinExtensions
{ {
public static IBindable<Color4> GetHyperDashCatcherColour(this ISkin skin)
=> skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash);
public static IBindable<Color4> GetHyperDashEndGlowColour(this ISkin skin)
=> skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashAfterImage) ??
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash);
public static IBindable<Color4> GetHyperDashFruitColour(this ISkin skin) public static IBindable<Color4> GetHyperDashFruitColour(this ISkin skin)
=> skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit) ?? => skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit) ??
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash); skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash);

View File

@ -389,9 +389,9 @@ namespace osu.Game.Rulesets.Catch.UI
{ {
base.SkinChanged(skin, allowFallback); base.SkinChanged(skin, allowFallback);
hyperDashColour = skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash)?.Value ?? DefaultHyperDashColour;
hyperDashEndGlowColour = skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashAfterImage)?.Value ?? hyperDashColour;
updateCatcherColour(); updateCatcherColour();
hyperDashColour = skin.GetHyperDashCatcherColour()?.Value ?? DefaultHyperDashColour;
hyperDashEndGlowColour = skin.GetHyperDashEndGlowColour()?.Value ?? DefaultHyperDashColour;
} }
protected override void Update() protected override void Update()