2022-09-27 09:52:21 +00: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-10 04:12:12 +00:00
|
|
|
using System;
|
2022-10-04 10:42:43 +00:00
|
|
|
using osu.Framework.Bindables;
|
2022-09-27 09:52:21 +00:00
|
|
|
using osu.Framework.Graphics;
|
2022-10-06 05:51:17 +00:00
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
2022-10-06 12:39:29 +00:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
2022-09-27 09:52:21 +00:00
|
|
|
using osu.Game.Skinning;
|
2022-10-04 10:42:43 +00:00
|
|
|
using osuTK.Graphics;
|
2022-09-27 09:52:21 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
|
|
|
{
|
|
|
|
public class ManiaArgonSkinTransformer : SkinTransformer
|
|
|
|
{
|
2022-10-06 05:51:17 +00:00
|
|
|
private readonly ManiaBeatmap beatmap;
|
|
|
|
|
|
|
|
public ManiaArgonSkinTransformer(ISkin skin, IBeatmap beatmap)
|
2022-09-27 09:52:21 +00:00
|
|
|
: base(skin)
|
|
|
|
{
|
2022-10-06 05:51:17 +00:00
|
|
|
this.beatmap = (ManiaBeatmap)beatmap;
|
2022-09-27 09:52:21 +00:00
|
|
|
}
|
|
|
|
|
2022-11-09 07:04:56 +00:00
|
|
|
public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
|
2022-09-27 09:52:21 +00:00
|
|
|
{
|
2022-11-09 05:11:41 +00:00
|
|
|
switch (lookup)
|
2022-09-27 09:52:21 +00:00
|
|
|
{
|
2022-11-09 07:04:56 +00:00
|
|
|
case GameplaySkinComponentLookup<HitResult> resultComponent:
|
2022-12-23 19:35:44 +00:00
|
|
|
// This should eventually be moved to a skin setting, when supported.
|
|
|
|
if (Skin is ArgonProSkin && resultComponent.Component >= HitResult.Great)
|
|
|
|
return Drawable.Empty();
|
|
|
|
|
2022-10-06 12:39:29 +00:00
|
|
|
return new ArgonJudgementPiece(resultComponent.Component);
|
|
|
|
|
2022-11-09 07:04:56 +00:00
|
|
|
case ManiaSkinComponentLookup maniaComponent:
|
2022-10-04 07:17:38 +00:00
|
|
|
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
|
2022-09-27 09:52:21 +00:00
|
|
|
switch (maniaComponent.Component)
|
|
|
|
{
|
2022-10-06 09:12:55 +00:00
|
|
|
case ManiaSkinComponents.StageBackground:
|
|
|
|
return new ArgonStageBackground();
|
|
|
|
|
|
|
|
case ManiaSkinComponents.ColumnBackground:
|
|
|
|
return new ArgonColumnBackground();
|
|
|
|
|
2022-10-06 07:54:47 +00:00
|
|
|
case ManiaSkinComponents.HoldNoteBody:
|
|
|
|
return new ArgonHoldBodyPiece();
|
|
|
|
|
|
|
|
case ManiaSkinComponents.HoldNoteTail:
|
|
|
|
return new ArgonHoldNoteTailPiece();
|
|
|
|
|
2022-10-06 07:54:08 +00:00
|
|
|
case ManiaSkinComponents.HoldNoteHead:
|
|
|
|
case ManiaSkinComponents.Note:
|
|
|
|
return new ArgonNotePiece();
|
|
|
|
|
2022-09-27 10:48:27 +00:00
|
|
|
case ManiaSkinComponents.HitTarget:
|
|
|
|
return new ArgonHitTarget();
|
|
|
|
|
2022-09-27 09:52:21 +00:00
|
|
|
case ManiaSkinComponents.KeyArea:
|
|
|
|
return new ArgonKeyArea();
|
2022-10-06 11:51:28 +00:00
|
|
|
|
|
|
|
case ManiaSkinComponents.HitExplosion:
|
|
|
|
return new ArgonHitExplosion();
|
2022-09-27 09:52:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-11-09 05:11:41 +00:00
|
|
|
return base.GetDrawableComponent(lookup);
|
2022-09-27 09:52:21 +00:00
|
|
|
}
|
2022-10-04 10:42:43 +00:00
|
|
|
|
|
|
|
public override IBindable<TValue>? GetConfig<TLookup, TValue>(TLookup lookup)
|
|
|
|
{
|
|
|
|
if (lookup is ManiaSkinConfigurationLookup maniaLookup)
|
|
|
|
{
|
2022-10-06 08:46:54 +00:00
|
|
|
int column = maniaLookup.ColumnIndex ?? 0;
|
|
|
|
var stage = beatmap.GetStageForColumnIndex(column);
|
|
|
|
|
2022-10-04 10:42:43 +00:00
|
|
|
switch (maniaLookup.Lookup)
|
|
|
|
{
|
2022-10-07 09:44:29 +00:00
|
|
|
case LegacyManiaSkinConfigurationLookups.ColumnSpacing:
|
|
|
|
return SkinUtils.As<TValue>(new Bindable<float>(2));
|
|
|
|
|
2022-10-06 09:03:48 +00:00
|
|
|
case LegacyManiaSkinConfigurationLookups.StagePaddingBottom:
|
|
|
|
case LegacyManiaSkinConfigurationLookups.StagePaddingTop:
|
|
|
|
return SkinUtils.As<TValue>(new Bindable<float>(30));
|
|
|
|
|
2022-10-06 08:46:54 +00:00
|
|
|
case LegacyManiaSkinConfigurationLookups.ColumnWidth:
|
|
|
|
return SkinUtils.As<TValue>(new Bindable<float>(
|
2022-10-06 12:46:02 +00:00
|
|
|
stage.IsSpecialColumn(column) ? 120 : 60
|
2022-10-06 08:46:54 +00:00
|
|
|
));
|
|
|
|
|
2022-10-04 10:42:43 +00:00
|
|
|
case LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour:
|
2022-10-06 05:51:17 +00:00
|
|
|
|
2022-10-06 07:54:32 +00:00
|
|
|
Color4 colour;
|
|
|
|
|
2022-10-10 04:12:12 +00:00
|
|
|
const int total_colours = 7;
|
|
|
|
|
2022-10-06 05:51:17 +00:00
|
|
|
if (stage.IsSpecialColumn(column))
|
2022-10-06 07:54:32 +00:00
|
|
|
colour = new Color4(159, 101, 255, 255);
|
|
|
|
else
|
|
|
|
{
|
2022-10-10 04:12:12 +00:00
|
|
|
switch (column % total_colours)
|
2022-10-06 07:54:32 +00:00
|
|
|
{
|
2022-10-10 04:12:12 +00:00
|
|
|
case 0:
|
2022-10-06 07:54:32 +00:00
|
|
|
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(0, 96, 240, 255);
|
|
|
|
break;
|
|
|
|
|
2022-10-10 04:12:12 +00:00
|
|
|
case 5:
|
2022-10-06 07:54:32 +00:00
|
|
|
colour = new Color4(0, 226, 240, 255);
|
|
|
|
break;
|
|
|
|
|
2022-10-10 04:12:12 +00:00
|
|
|
case 6:
|
2022-10-06 07:54:32 +00:00
|
|
|
colour = new Color4(0, 240, 96, 255);
|
|
|
|
break;
|
2022-10-10 04:12:12 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
throw new ArgumentOutOfRangeException();
|
2022-10-06 07:54:32 +00:00
|
|
|
}
|
|
|
|
}
|
2022-10-04 10:42:43 +00:00
|
|
|
|
2022-10-06 07:54:32 +00:00
|
|
|
return SkinUtils.As<TValue>(new Bindable<Color4>(colour));
|
2022-10-04 10:42:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return base.GetConfig<TLookup, TValue>(lookup);
|
|
|
|
}
|
2022-09-27 09:52:21 +00:00
|
|
|
}
|
|
|
|
}
|