2022-09-15 16:51:10 +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.
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
2022-09-16 18:25:04 +08:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
2022-09-15 16:51:10 +08:00
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|
|
|
{
|
2022-09-22 17:50:19 +08:00
|
|
|
public class OsuArgonSkinTransformer : SkinTransformer
|
2022-09-15 16:51:10 +08:00
|
|
|
{
|
|
|
|
public OsuArgonSkinTransformer(ISkin skin)
|
2022-09-22 17:50:19 +08:00
|
|
|
: base(skin)
|
2022-09-15 16:51:10 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-11-09 15:04:56 +08:00
|
|
|
public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
|
2022-09-15 16:51:10 +08:00
|
|
|
{
|
2022-11-09 13:11:41 +08:00
|
|
|
switch (lookup)
|
2022-09-15 16:51:10 +08:00
|
|
|
{
|
2022-11-09 15:04:56 +08:00
|
|
|
case GameplaySkinComponentLookup<HitResult> resultComponent:
|
2024-01-25 17:23:25 +08:00
|
|
|
HitResult result = resultComponent.Component;
|
|
|
|
|
2022-12-24 03:35:44 +08:00
|
|
|
// This should eventually be moved to a skin setting, when supported.
|
2024-01-25 17:23:25 +08:00
|
|
|
if (Skin is ArgonProSkin && (result == HitResult.Great || result == HitResult.Perfect))
|
2022-12-24 03:35:44 +08:00
|
|
|
return Drawable.Empty();
|
|
|
|
|
2024-01-25 17:23:25 +08:00
|
|
|
switch (result)
|
|
|
|
{
|
|
|
|
case HitResult.IgnoreMiss:
|
|
|
|
case HitResult.LargeTickMiss:
|
|
|
|
return new ArgonJudgementPieceSliderTickMiss(result);
|
|
|
|
|
|
|
|
default:
|
|
|
|
return new ArgonJudgementPiece(result);
|
|
|
|
}
|
2022-09-16 18:25:04 +08:00
|
|
|
|
2022-11-09 15:04:56 +08:00
|
|
|
case OsuSkinComponentLookup osuComponent:
|
2022-10-04 15:17:38 +08:00
|
|
|
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
|
2022-09-16 18:25:04 +08:00
|
|
|
switch (osuComponent.Component)
|
|
|
|
{
|
|
|
|
case OsuSkinComponents.HitCircle:
|
2022-09-19 15:14:35 +08:00
|
|
|
return new ArgonMainCirclePiece(true);
|
|
|
|
|
2022-09-16 18:25:04 +08:00
|
|
|
case OsuSkinComponents.SliderHeadHitCircle:
|
2022-09-19 15:14:35 +08:00
|
|
|
return new ArgonMainCirclePiece(false);
|
2022-09-19 13:38:21 +08:00
|
|
|
|
|
|
|
case OsuSkinComponents.SliderBody:
|
|
|
|
return new ArgonSliderBody();
|
2022-09-19 13:58:27 +08:00
|
|
|
|
|
|
|
case OsuSkinComponents.SliderBall:
|
|
|
|
return new ArgonSliderBall();
|
|
|
|
|
2022-09-19 15:07:13 +08:00
|
|
|
case OsuSkinComponents.SliderFollowCircle:
|
|
|
|
return new ArgonFollowCircle();
|
|
|
|
|
2022-09-19 13:58:27 +08:00
|
|
|
case OsuSkinComponents.SliderScorePoint:
|
|
|
|
return new ArgonSliderScorePoint();
|
2022-09-19 14:39:08 +08:00
|
|
|
|
2022-09-23 01:07:40 +08:00
|
|
|
case OsuSkinComponents.SpinnerBody:
|
|
|
|
return new ArgonSpinner();
|
|
|
|
|
2022-09-19 14:39:08 +08:00
|
|
|
case OsuSkinComponents.ReverseArrow:
|
|
|
|
return new ArgonReverseArrow();
|
2022-09-22 19:06:24 +08:00
|
|
|
|
|
|
|
case OsuSkinComponents.FollowPoint:
|
|
|
|
return new ArgonFollowPoint();
|
2022-09-22 19:39:46 +08:00
|
|
|
|
|
|
|
case OsuSkinComponents.Cursor:
|
|
|
|
return new ArgonCursor();
|
|
|
|
|
|
|
|
case OsuSkinComponents.CursorTrail:
|
|
|
|
return new ArgonCursorTrail();
|
2022-09-16 18:25:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2022-09-15 16:51:10 +08:00
|
|
|
}
|
|
|
|
|
2022-11-09 13:11:41 +08:00
|
|
|
return base.GetDrawableComponent(lookup);
|
2022-09-15 16:51:10 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|