mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:07:52 +08:00
Fix classic skin colours sourcing from triangles defaults
This commit is contained in:
parent
6b79f16461
commit
4a127f5d81
@ -74,6 +74,9 @@ namespace osu.Game.Rulesets.Mania
|
||||
case ArgonSkin:
|
||||
return new ManiaArgonSkinTransformer(skin);
|
||||
|
||||
case DefaultLegacySkin:
|
||||
return new ManiaClassicSkinTransformer(skin, beatmap);
|
||||
|
||||
case LegacySkin:
|
||||
return new ManiaLegacySkinTransformer(skin, beatmap);
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
// 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.Beatmaps;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
||||
{
|
||||
public class ManiaClassicSkinTransformer : ManiaLegacySkinTransformer
|
||||
{
|
||||
public ManiaClassicSkinTransformer(ISkin skin, IBeatmap beatmap)
|
||||
: base(skin, beatmap)
|
||||
{
|
||||
}
|
||||
|
||||
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
|
||||
{
|
||||
if (lookup is ManiaSkinConfigurationLookup maniaLookup)
|
||||
{
|
||||
var baseLookup = base.GetConfig<TLookup, TValue>(lookup);
|
||||
|
||||
if (baseLookup != null)
|
||||
return baseLookup;
|
||||
|
||||
// default provisioning.
|
||||
switch (maniaLookup.Lookup)
|
||||
{
|
||||
case LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour:
|
||||
return SkinUtils.As<TValue>(new Bindable<Color4>(Color4.Black));
|
||||
}
|
||||
}
|
||||
|
||||
return base.GetConfig<TLookup, TValue>(lookup);
|
||||
}
|
||||
}
|
||||
}
|
@ -8,12 +8,14 @@ using System.Collections.Generic;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||
using osu.Game.Rulesets.Objects.Legacy;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
||||
{
|
||||
@ -149,7 +151,20 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
||||
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
|
||||
{
|
||||
if (lookup is ManiaSkinConfigurationLookup maniaLookup)
|
||||
return base.GetConfig<LegacyManiaSkinConfigurationLookup, TValue>(new LegacyManiaSkinConfigurationLookup(beatmap.TotalColumns, maniaLookup.Lookup, maniaLookup.ColumnIndex));
|
||||
{
|
||||
var legacyLookup =
|
||||
base.GetConfig<LegacyManiaSkinConfigurationLookup, TValue>(new LegacyManiaSkinConfigurationLookup(beatmap.TotalColumns, maniaLookup.Lookup, maniaLookup.ColumnIndex));
|
||||
|
||||
if (legacyLookup != null)
|
||||
return legacyLookup;
|
||||
|
||||
// default legacy fallback.
|
||||
switch (maniaLookup.Lookup)
|
||||
{
|
||||
case LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour:
|
||||
return SkinUtils.As<TValue>(new Bindable<Color4>(Color4.Black));
|
||||
}
|
||||
}
|
||||
|
||||
return base.GetConfig<TLookup, TValue>(lookup);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user