Merge remote-tracking branch 'upstream/master' into catch-legacy-skin-decoding

This commit is contained in:
Salman Ahmed
2020-05-14 07:22:01 +03:00
523 changed files with 13015 additions and 4017 deletions

View File

@ -65,6 +65,15 @@ namespace osu.Game.Rulesets.Catch.Skinning
public SampleChannel GetSample(ISampleInfo sample) => source.GetSample(sample);
public IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup) => source.GetConfig<TLookup, TValue>(lookup);
public IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
{
switch (lookup)
{
case CatchSkinColour colour:
return source.GetConfig<SkinCustomColourLookup, TValue>(new SkinCustomColourLookup(colour));
}
return source.GetConfig<TLookup, TValue>(lookup);
}
}
}

View File

@ -6,12 +6,12 @@ namespace osu.Game.Rulesets.Catch.Skinning
public enum CatchSkinColour
{
/// <summary>
/// The colour to be used for the catcher while on hyper-dashing state.
/// The colour to be used for the catcher while in hyper-dashing state.
/// </summary>
HyperDash,
/// <summary>
/// The colour to be used for hyper-dash fruits.
/// The colour to be used for fruits that grant the catcher the ability to hyper-dash.
/// </summary>
HyperDashFruit,

View File

@ -1,23 +0,0 @@
// 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> GetHyperDashCatcherColour(this ISkin skin)
=> skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash);
public static IBindable<Color4> GetHyperDashCatcherAfterImageColour(this ISkin skin)
=> skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashAfterImage) ??
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash);
public static IBindable<Color4> GetHyperDashFruitColour(this ISkin skin)
=> skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit) ??
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash);
}
}

View File

@ -56,14 +56,16 @@ namespace osu.Game.Rulesets.Catch.Skinning
{
var hyperDash = new Sprite
{
Texture = skin.GetTexture(lookupName),
Colour = skin.GetHyperDashFruitColour()?.Value ?? Catcher.DefaultHyperDashColour,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Blending = BlendingParameters.Additive,
Depth = 1,
Alpha = 0.7f,
Scale = new Vector2(1.2f)
Scale = new Vector2(1.2f),
Texture = skin.GetTexture(lookupName),
Colour = skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit)?.Value ??
skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDash)?.Value ??
Catcher.DEFAULT_HYPER_DASH_COLOUR,
};
AddInternal(hyperDash);