mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:35:10 +08:00
Move default colour fallback to the extension methods itself
This commit is contained in:
parent
1b76a53d32
commit
7f3ad6d5be
@ -1,7 +1,9 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Rulesets.Catch.UI;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -9,8 +11,10 @@ namespace osu.Game.Rulesets.Catch.Skinning
|
||||
{
|
||||
internal static class CatchSkinExtensions
|
||||
{
|
||||
[NotNull]
|
||||
public static IBindable<Color4> GetHyperDashFruitColour(this ISkin skin)
|
||||
=> skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit) ??
|
||||
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash);
|
||||
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash) ??
|
||||
new Bindable<Color4>(Catcher.DefaultHyperDashColour);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Rulesets.Catch.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Catch.UI;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
@ -57,7 +56,7 @@ namespace osu.Game.Rulesets.Catch.Skinning
|
||||
var hyperDash = new Sprite
|
||||
{
|
||||
Texture = skin.GetTexture(lookupName),
|
||||
Colour = skin.GetHyperDashFruitColour()?.Value ?? Catcher.DefaultHyperDashColour,
|
||||
Colour = skin.GetHyperDashFruitColour().Value,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Blending = BlendingParameters.Additive,
|
||||
|
Loading…
Reference in New Issue
Block a user