mirror of
https://github.com/ppy/osu
synced 2025-01-20 04:50:50 +00:00
Add a skin extension for simplifying falling back on hyper-dash colours
This commit is contained in:
parent
16a4525a9c
commit
7e82f5740b
@ -64,8 +64,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
|||||||
});
|
});
|
||||||
|
|
||||||
var hyperDashColour =
|
var hyperDashColour =
|
||||||
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit)?.Value ??
|
skin.GetHyperDashFruitColour()?.Value ??
|
||||||
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash)?.Value ??
|
|
||||||
Catcher.DefaultHyperDashColour;
|
Catcher.DefaultHyperDashColour;
|
||||||
|
|
||||||
if (hitObject.HyperDash)
|
if (hitObject.HyperDash)
|
||||||
|
16
osu.Game.Rulesets.Catch/Skinning/CatchSkinExtensions.cs
Normal file
16
osu.Game.Rulesets.Catch/Skinning/CatchSkinExtensions.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// 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 osu.Framework.Bindables;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
using osuTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Skinning
|
||||||
|
{
|
||||||
|
internal static class CatchSkinExtensions
|
||||||
|
{
|
||||||
|
public static IBindable<Color4> GetHyperDashFruitColour(this ISkin skin)
|
||||||
|
=> skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit) ??
|
||||||
|
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash);
|
||||||
|
}
|
||||||
|
}
|
@ -54,15 +54,10 @@ namespace osu.Game.Rulesets.Catch.Skinning
|
|||||||
|
|
||||||
if (drawableCatchObject.HitObject.HyperDash)
|
if (drawableCatchObject.HitObject.HyperDash)
|
||||||
{
|
{
|
||||||
var hyperDashColour =
|
|
||||||
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit)?.Value ??
|
|
||||||
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash)?.Value ??
|
|
||||||
Catcher.DefaultHyperDashColour;
|
|
||||||
|
|
||||||
var hyperDash = new Sprite
|
var hyperDash = new Sprite
|
||||||
{
|
{
|
||||||
Texture = skin.GetTexture(lookupName),
|
Texture = skin.GetTexture(lookupName),
|
||||||
Colour = hyperDashColour,
|
Colour = skin.GetHyperDashFruitColour()?.Value ?? Catcher.DefaultHyperDashColour,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Blending = BlendingParameters.Additive,
|
Blending = BlendingParameters.Additive,
|
||||||
|
Loading…
Reference in New Issue
Block a user