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-06 13:51:17 +08:00
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
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
|
|
|
|
{
|
2022-10-06 13:51:17 +08:00
|
|
|
private readonly ManiaBeatmap beatmap;
|
|
|
|
|
|
|
|
public ManiaArgonSkinTransformer(ISkin skin, IBeatmap beatmap)
|
2022-09-27 17:52:21 +08:00
|
|
|
: base(skin)
|
|
|
|
{
|
2022-10-06 13:51:17 +08:00
|
|
|
this.beatmap = (ManiaBeatmap)beatmap;
|
2022-09-27 17:52:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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-10-06 17:12:55 +08:00
|
|
|
case ManiaSkinComponents.StageBackground:
|
|
|
|
return new ArgonStageBackground();
|
|
|
|
|
|
|
|
case ManiaSkinComponents.ColumnBackground:
|
|
|
|
return new ArgonColumnBackground();
|
|
|
|
|
2022-10-06 15:54:47 +08:00
|
|
|
case ManiaSkinComponents.HoldNoteBody:
|
|
|
|
return new ArgonHoldBodyPiece();
|
|
|
|
|
|
|
|
case ManiaSkinComponents.HoldNoteTail:
|
|
|
|
return new ArgonHoldNoteTailPiece();
|
|
|
|
|
2022-10-06 15:54:08 +08:00
|
|
|
case ManiaSkinComponents.HoldNoteHead:
|
|
|
|
case ManiaSkinComponents.Note:
|
|
|
|
return new ArgonNotePiece();
|
|
|
|
|
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();
|
2022-10-06 19:51:28 +08:00
|
|
|
|
|
|
|
case ManiaSkinComponents.HitExplosion:
|
|
|
|
return new ArgonHitExplosion();
|
2022-09-27 17:52:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2022-10-06 16:46:54 +08:00
|
|
|
int column = maniaLookup.ColumnIndex ?? 0;
|
|
|
|
var stage = beatmap.GetStageForColumnIndex(column);
|
|
|
|
|
2022-10-04 18:42:43 +08:00
|
|
|
switch (maniaLookup.Lookup)
|
|
|
|
{
|
2022-10-06 17:03:48 +08:00
|
|
|
case LegacyManiaSkinConfigurationLookups.StagePaddingBottom:
|
|
|
|
case LegacyManiaSkinConfigurationLookups.StagePaddingTop:
|
|
|
|
return SkinUtils.As<TValue>(new Bindable<float>(30));
|
|
|
|
|
2022-10-06 16:46:54 +08:00
|
|
|
case LegacyManiaSkinConfigurationLookups.ColumnWidth:
|
|
|
|
return SkinUtils.As<TValue>(new Bindable<float>(
|
|
|
|
stage.IsSpecialColumn(column) ? 80 : 60
|
|
|
|
));
|
|
|
|
|
2022-10-04 18:42:43 +08:00
|
|
|
case LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour:
|
2022-10-06 13:51:17 +08:00
|
|
|
|
2022-10-06 15:54:32 +08:00
|
|
|
Color4 colour;
|
|
|
|
|
2022-10-06 13:51:17 +08:00
|
|
|
if (stage.IsSpecialColumn(column))
|
2022-10-06 15:54:32 +08:00
|
|
|
colour = new Color4(159, 101, 255, 255);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (column % 8)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
colour = new Color4(240, 216, 0, 255);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
colour = new Color4(240, 101, 0, 255);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
colour = new Color4(240, 0, 130, 255);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
colour = new Color4(192, 0, 240, 255);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
colour = new Color4(178, 0, 240, 255);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
colour = new Color4(0, 96, 240, 255);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
colour = new Color4(0, 226, 240, 255);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
colour = new Color4(0, 240, 96, 255);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2022-10-04 18:42:43 +08:00
|
|
|
|
2022-10-06 15:54:32 +08:00
|
|
|
return SkinUtils.As<TValue>(new Bindable<Color4>(colour));
|
2022-10-04 18:42:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return base.GetConfig<TLookup, TValue>(lookup);
|
|
|
|
}
|
2022-09-27 17:52:21 +08:00
|
|
|
}
|
|
|
|
}
|