2022-09-27 17:52:21 +08:00
|
|
|
// 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.
|
|
|
|
|
2022-10-04 18:42:43 +08:00
|
|
|
using osu.Framework.Bindables;
|
2022-09-27 17:52:21 +08:00
|
|
|
using osu.Framework.Graphics;
|
2022-10-04 18:42:43 +08:00
|
|
|
using osu.Framework.Utils;
|
2022-09-27 17:52:21 +08:00
|
|
|
using osu.Game.Skinning;
|
2022-10-04 18:42:43 +08:00
|
|
|
using osuTK.Graphics;
|
2022-09-27 17:52:21 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
|
|
|
{
|
|
|
|
public class ManiaArgonSkinTransformer : SkinTransformer
|
|
|
|
{
|
|
|
|
public ManiaArgonSkinTransformer(ISkin skin)
|
|
|
|
: base(skin)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public override Drawable? GetDrawableComponent(ISkinComponent component)
|
|
|
|
{
|
|
|
|
switch (component)
|
|
|
|
{
|
|
|
|
case ManiaSkinComponent maniaComponent:
|
2022-10-04 15:17:38 +08:00
|
|
|
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
|
2022-09-27 17:52:21 +08:00
|
|
|
switch (maniaComponent.Component)
|
|
|
|
{
|
2022-09-27 18:48:27 +08:00
|
|
|
case ManiaSkinComponents.HitTarget:
|
|
|
|
return new ArgonHitTarget();
|
|
|
|
|
2022-09-27 17:52:21 +08:00
|
|
|
case ManiaSkinComponents.KeyArea:
|
|
|
|
return new ArgonKeyArea();
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return base.GetDrawableComponent(component);
|
|
|
|
}
|
2022-10-04 18:42:43 +08:00
|
|
|
|
|
|
|
public override IBindable<TValue>? GetConfig<TLookup, TValue>(TLookup lookup)
|
|
|
|
{
|
|
|
|
if (lookup is ManiaSkinConfigurationLookup maniaLookup)
|
|
|
|
{
|
|
|
|
switch (maniaLookup.Lookup)
|
|
|
|
{
|
|
|
|
case LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour:
|
|
|
|
if (maniaLookup.StageDefinition.IsSpecialColumn(maniaLookup.ColumnIndex ?? 0))
|
|
|
|
return SkinUtils.As<TValue>(new Bindable<Color4>(Color4.Yellow));
|
|
|
|
|
|
|
|
// TODO: Add actual colours.
|
|
|
|
return SkinUtils.As<TValue>(new Bindable<Color4>(new Color4(RNG.NextSingle() * 0.5f, RNG.NextSingle() * 0.5f, RNG.NextSingle() * 0.5f, 1)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return base.GetConfig<TLookup, TValue>(lookup);
|
|
|
|
}
|
2022-09-27 17:52:21 +08:00
|
|
|
}
|
|
|
|
}
|