diff --git a/UseLocalResources.ps1 b/UseLocalResources.ps1
new file mode 100644
index 0000000000..f9d9df01bb
--- /dev/null
+++ b/UseLocalResources.ps1
@@ -0,0 +1,12 @@
+$CSPROJ="osu.Game/osu.Game.csproj"
+$SLN="osu.sln"
+
+dotnet remove $CSPROJ package ppy.osu.Game.Resources;
+dotnet sln $SLN add ../osu-resources/osu.Game.Resources/osu.Game.Resources.csproj
+dotnet add $CSPROJ reference ../osu-resources/osu.Game.Resources/osu.Game.Resources.csproj
+
+$SLNF=Get-Content "osu.Desktop.slnf" | ConvertFrom-Json
+$TMP=New-TemporaryFile
+$SLNF.solution.projects += ("../osu-resources/osu.Game.Resources/osu.Game.Resources.csproj")
+ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8
+Move-Item -Path $TMP -Destination "osu.Desktop.slnf" -Force
diff --git a/UseLocalResources.sh b/UseLocalResources.sh
new file mode 100755
index 0000000000..6d9d2b6016
--- /dev/null
+++ b/UseLocalResources.sh
@@ -0,0 +1,11 @@
+CSPROJ="osu.Game/osu.Game.csproj"
+SLN="osu.sln"
+
+dotnet remove $CSPROJ package ppy.osu.Game.Resources;
+dotnet sln $SLN add ../osu-resources/osu.Game.Resources/osu.Game.Resources.csproj
+dotnet add $CSPROJ reference ../osu-resources/osu.Game.Resources/osu.Game.Resources.csproj
+
+SLNF="osu.Desktop.slnf"
+TMP=$(mktemp)
+jq '.solution.projects += ["../osu-resources/osu.Game.Resources/osu.Game.Resources.csproj"]' $SLNF > $TMP
+mv -f $TMP $SLNF
diff --git a/osu.Android.props b/osu.Android.props
index b6ddeeb41a..5f3fb858ee 100644
--- a/osu.Android.props
+++ b/osu.Android.props
@@ -51,8 +51,8 @@
-
-
+
+
diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatchSkinConfiguration.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatchSkinConfiguration.cs
index a4b2b26624..a2d4e7fb1e 100644
--- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatchSkinConfiguration.cs
+++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatchSkinConfiguration.cs
@@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Catch.Tests
public bool FlipCatcherPlate { get; set; }
public TestSkin()
- : base(null)
+ : base(null!)
{
}
diff --git a/osu.Game.Rulesets.Catch/CatchInputManager.cs b/osu.Game.Rulesets.Catch/CatchInputManager.cs
index 5b62154a34..0f76953003 100644
--- a/osu.Game.Rulesets.Catch/CatchInputManager.cs
+++ b/osu.Game.Rulesets.Catch/CatchInputManager.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System.ComponentModel;
using osu.Framework.Allocation;
using osu.Framework.Input.Bindings;
diff --git a/osu.Game.Rulesets.Catch/CatchSkinComponent.cs b/osu.Game.Rulesets.Catch/CatchSkinComponentLookup.cs
similarity index 73%
rename from osu.Game.Rulesets.Catch/CatchSkinComponent.cs
rename to osu.Game.Rulesets.Catch/CatchSkinComponentLookup.cs
index e79da667da..149aae1cb4 100644
--- a/osu.Game.Rulesets.Catch/CatchSkinComponent.cs
+++ b/osu.Game.Rulesets.Catch/CatchSkinComponentLookup.cs
@@ -1,15 +1,13 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Game.Skinning;
namespace osu.Game.Rulesets.Catch
{
- public class CatchSkinComponent : GameplaySkinComponent
+ public class CatchSkinComponentLookup : GameplaySkinComponentLookup
{
- public CatchSkinComponent(CatchSkinComponents component)
+ public CatchSkinComponentLookup(CatchSkinComponents component)
: base(component)
{
}
diff --git a/osu.Game.Rulesets.Catch/CatchSkinComponents.cs b/osu.Game.Rulesets.Catch/CatchSkinComponents.cs
index 7587de5803..371e901c69 100644
--- a/osu.Game.Rulesets.Catch/CatchSkinComponents.cs
+++ b/osu.Game.Rulesets.Catch/CatchSkinComponents.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
namespace osu.Game.Rulesets.Catch
{
public enum CatchSkinComponents
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/CaughtObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/CaughtObject.cs
index ddfbb34435..8ac5eac227 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawables/CaughtObject.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawables/CaughtObject.cs
@@ -37,8 +37,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
public override bool RemoveWhenNotAlive => true;
- protected CaughtObject(CatchSkinComponents skinComponent, Func defaultImplementation)
- : base(new CatchSkinComponent(skinComponent), defaultImplementation)
+ protected CaughtObject(CatchSkinComponents skinComponent, Func defaultImplementation)
+ : base(new CatchSkinComponentLookup(skinComponent), defaultImplementation)
{
Origin = Anchor.Centre;
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableBanana.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableBanana.cs
index b46a452bd0..80a4150d98 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableBanana.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableBanana.cs
@@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
private void load()
{
ScalingContainer.Child = new SkinnableDrawable(
- new CatchSkinComponent(CatchSkinComponents.Banana),
+ new CatchSkinComponentLookup(CatchSkinComponents.Banana),
_ => new BananaPiece());
}
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableDroplet.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableDroplet.cs
index d367ad0a00..a81d87480a 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableDroplet.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableDroplet.cs
@@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
private void load()
{
ScalingContainer.Child = new SkinnableDrawable(
- new CatchSkinComponent(CatchSkinComponents.Droplet),
+ new CatchSkinComponentLookup(CatchSkinComponents.Droplet),
_ => new DropletPiece());
}
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableFruit.cs
index ce4c7e5aff..d7fd79929b 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableFruit.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableFruit.cs
@@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
private void load()
{
ScalingContainer.Child = new SkinnableDrawable(
- new CatchSkinComponent(CatchSkinComponents.Fruit),
+ new CatchSkinComponentLookup(CatchSkinComponents.Fruit),
_ => new FruitPiece());
}
diff --git a/osu.Game.Rulesets.Catch/Skinning/Argon/CatchArgonSkinTransformer.cs b/osu.Game.Rulesets.Catch/Skinning/Argon/CatchArgonSkinTransformer.cs
index 8dae0a2b78..520c2de248 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Argon/CatchArgonSkinTransformer.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Argon/CatchArgonSkinTransformer.cs
@@ -13,11 +13,11 @@ namespace osu.Game.Rulesets.Catch.Skinning.Argon
{
}
- public override Drawable? GetDrawableComponent(ISkinComponent component)
+ public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
{
- switch (component)
+ switch (lookup)
{
- case CatchSkinComponent catchComponent:
+ case CatchSkinComponentLookup catchComponent:
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
switch (catchComponent.Component)
{
@@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Argon
break;
}
- return base.GetDrawableComponent(component);
+ return base.GetDrawableComponent(lookup);
}
}
}
diff --git a/osu.Game.Rulesets.Catch/Skinning/CatchSkinColour.cs b/osu.Game.Rulesets.Catch/Skinning/CatchSkinColour.cs
index d038ccb31c..4506111498 100644
--- a/osu.Game.Rulesets.Catch/Skinning/CatchSkinColour.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/CatchSkinColour.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
namespace osu.Game.Rulesets.Catch.Skinning
{
public enum CatchSkinColour
diff --git a/osu.Game.Rulesets.Catch/Skinning/CatchSkinConfiguration.cs b/osu.Game.Rulesets.Catch/Skinning/CatchSkinConfiguration.cs
index 65d6acd88d..ea8d742b1a 100644
--- a/osu.Game.Rulesets.Catch/Skinning/CatchSkinConfiguration.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/CatchSkinConfiguration.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
namespace osu.Game.Rulesets.Catch.Skinning
{
public enum CatchSkinConfiguration
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/BananaPulpFormation.cs b/osu.Game.Rulesets.Catch/Skinning/Default/BananaPulpFormation.cs
index ffeed80615..ee1cc68f7d 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/BananaPulpFormation.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/BananaPulpFormation.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osuTK;
namespace osu.Game.Rulesets.Catch.Skinning.Default
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/BorderPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Default/BorderPiece.cs
index 60a13bee59..8d8ee49af7 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/BorderPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/BorderPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Catch.Objects;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/CatchHitObjectPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Default/CatchHitObjectPiece.cs
index 3b8df6ee6f..e84e4d4ad2 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/CatchHitObjectPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/CatchHitObjectPiece.cs
@@ -1,10 +1,7 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
-using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -21,19 +18,17 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
public readonly Bindable IndexInBeatmap = new Bindable();
[Resolved]
- protected IHasCatchObjectState ObjectState { get; private set; }
+ protected IHasCatchObjectState ObjectState { get; private set; } = null!;
///
/// A part of this piece that will be faded out while falling in the playfield.
///
- [CanBeNull]
- protected virtual Drawable BorderPiece => null;
+ protected virtual Drawable? BorderPiece => null;
///
/// A part of this piece that will be only visible when is true.
///
- [CanBeNull]
- protected virtual Drawable HyperBorderPiece => null;
+ protected virtual Drawable? HyperBorderPiece => null;
protected override void LoadComplete()
{
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/DefaultCatcher.cs b/osu.Game.Rulesets.Catch/Skinning/Default/DefaultCatcher.cs
index 4148fed11c..e423f21b98 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/DefaultCatcher.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/DefaultCatcher.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/DefaultHitExplosion.cs b/osu.Game.Rulesets.Catch/Skinning/Default/DefaultHitExplosion.cs
index 7ea99b3ed9..2650ba765b 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/DefaultHitExplosion.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/DefaultHitExplosion.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
@@ -18,10 +16,10 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
{
public class DefaultHitExplosion : CompositeDrawable, IHitExplosion
{
- private CircularContainer largeFaint;
- private CircularContainer smallFaint;
- private CircularContainer directionalGlow1;
- private CircularContainer directionalGlow2;
+ private CircularContainer largeFaint = null!;
+ private CircularContainer smallFaint = null!;
+ private CircularContainer directionalGlow1 = null!;
+ private CircularContainer directionalGlow2 = null!;
[BackgroundDependencyLoader]
private void load()
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/DropletPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Default/DropletPiece.cs
index b8ae062382..59e74bff74 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/DropletPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/DropletPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.Objects;
using osuTK;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/FruitPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Default/FruitPiece.cs
index adee960c3c..3bd8032649 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/FruitPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/FruitPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.Objects;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/FruitPulpFormation.cs b/osu.Game.Rulesets.Catch/Skinning/Default/FruitPulpFormation.cs
index db51195f11..f097361d2a 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/FruitPulpFormation.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/FruitPulpFormation.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Bindables;
using osu.Game.Rulesets.Catch.Objects;
using osuTK;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/HyperBorderPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Default/HyperBorderPiece.cs
index 42b0b85495..c8895f32f4 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/HyperBorderPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/HyperBorderPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.UI;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/HyperDropletBorderPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Default/HyperDropletBorderPiece.cs
index 29cb339625..53a487b97f 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/HyperDropletBorderPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/HyperDropletBorderPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
namespace osu.Game.Rulesets.Catch.Skinning.Default
{
public class HyperDropletBorderPiece : HyperBorderPiece
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/Pulp.cs b/osu.Game.Rulesets.Catch/Skinning/Default/Pulp.cs
index 8ea54617d9..96c6233b41 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/Pulp.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/Pulp.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Default/PulpFormation.cs b/osu.Game.Rulesets.Catch/Skinning/Default/PulpFormation.cs
index aa5ef5fb66..8753aa4077 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Default/PulpFormation.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Default/PulpFormation.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Legacy/CatchLegacySkinTransformer.cs b/osu.Game.Rulesets.Catch/Skinning/Legacy/CatchLegacySkinTransformer.cs
index a73b34c9b6..08ac55508a 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Legacy/CatchLegacySkinTransformer.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Legacy/CatchLegacySkinTransformer.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System.Linq;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -27,14 +25,14 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
}
- public override Drawable GetDrawableComponent(ISkinComponent component)
+ public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
{
- if (component is SkinnableTargetComponent targetComponent)
+ if (lookup is GlobalSkinComponentLookup targetComponent)
{
- switch (targetComponent.Target)
+ switch (targetComponent.Lookup)
{
- case SkinnableTarget.MainHUDComponents:
- var components = base.GetDrawableComponent(component) as SkinnableTargetComponentsContainer;
+ case GlobalSkinComponentLookup.LookupType.MainHUDComponents:
+ var components = base.GetDrawableComponent(lookup) as SkinnableTargetComponentsContainer;
if (providesComboCounter && components != null)
{
@@ -48,7 +46,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
}
}
- if (component is CatchSkinComponent catchSkinComponent)
+ if (lookup is CatchSkinComponentLookup catchSkinComponent)
{
switch (catchSkinComponent.Component)
{
@@ -97,11 +95,11 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
return null;
default:
- throw new UnsupportedSkinComponentException(component);
+ throw new UnsupportedSkinComponentException(lookup);
}
}
- return base.GetDrawableComponent(component);
+ return base.GetDrawableComponent(lookup);
}
private bool hasOldStyleCatcherSprite() =>
@@ -112,12 +110,12 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
GetTexture(@"fruit-catcher-idle") != null
|| GetTexture(@"fruit-catcher-idle-0") != null;
- public override IBindable GetConfig(TLookup lookup)
+ public override IBindable? GetConfig(TLookup lookup)
{
switch (lookup)
{
case CatchSkinColour colour:
- var result = (Bindable)base.GetConfig(new SkinCustomColourLookup(colour));
+ var result = (Bindable?)base.GetConfig(new SkinCustomColourLookup(colour));
if (result == null)
return null;
@@ -129,7 +127,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
case CatchSkinConfiguration.FlipCatcherPlate:
// Don't flip catcher plate contents if the catcher is provided by this legacy skin.
- if (GetDrawableComponent(new CatchSkinComponent(CatchSkinComponents.Catcher)) != null)
+ if (GetDrawableComponent(new CatchSkinComponentLookup(CatchSkinComponents.Catcher)) != null)
return (IBindable)new Bindable();
break;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyBananaPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyBananaPiece.cs
index 9f64a2129e..310da8bf78 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyBananaPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyBananaPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics.Textures;
namespace osu.Game.Rulesets.Catch.Skinning.Legacy
@@ -13,8 +11,8 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
base.LoadComplete();
- Texture texture = Skin.GetTexture("fruit-bananas");
- Texture overlayTexture = Skin.GetTexture("fruit-bananas-overlay");
+ Texture? texture = Skin.GetTexture("fruit-bananas");
+ Texture? overlayTexture = Skin.GetTexture("fruit-bananas-overlay");
SetTexture(texture, overlayTexture);
}
diff --git a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatchHitObjectPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatchHitObjectPiece.cs
index 5a5288105d..1231ed6d5a 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatchHitObjectPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatchHitObjectPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -19,19 +17,20 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
public abstract class LegacyCatchHitObjectPiece : PoolableDrawable
{
- public readonly Bindable AccentColour = new Bindable();
- public readonly Bindable HyperDash = new Bindable();
- public readonly Bindable IndexInBeatmap = new Bindable();
+ protected readonly Bindable IndexInBeatmap = new Bindable();
+
+ private readonly Bindable accentColour = new Bindable();
+ private readonly Bindable hyperDash = new Bindable();
private readonly Sprite colouredSprite;
private readonly Sprite overlaySprite;
private readonly Sprite hyperSprite;
[Resolved]
- protected ISkinSource Skin { get; private set; }
+ protected ISkinSource Skin { get; private set; } = null!;
[Resolved]
- protected IHasCatchObjectState ObjectState { get; private set; }
+ protected IHasCatchObjectState ObjectState { get; private set; } = null!;
protected LegacyCatchHitObjectPiece()
{
@@ -65,26 +64,26 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
base.LoadComplete();
- AccentColour.BindTo(ObjectState.AccentColour);
- HyperDash.BindTo(ObjectState.HyperDash);
+ accentColour.BindTo(ObjectState.AccentColour);
+ hyperDash.BindTo(ObjectState.HyperDash);
IndexInBeatmap.BindTo(ObjectState.IndexInBeatmap);
hyperSprite.Colour = Skin.GetConfig(CatchSkinColour.HyperDashFruit)?.Value ??
Skin.GetConfig(CatchSkinColour.HyperDash)?.Value ??
Catcher.DEFAULT_HYPER_DASH_COLOUR;
- AccentColour.BindValueChanged(colour =>
+ accentColour.BindValueChanged(colour =>
{
colouredSprite.Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue);
}, true);
- HyperDash.BindValueChanged(hyper =>
+ hyperDash.BindValueChanged(hyper =>
{
hyperSprite.Alpha = hyper.NewValue ? 0.7f : 0;
}, true);
}
- protected void SetTexture(Texture texture, Texture overlayTexture)
+ protected void SetTexture(Texture? texture, Texture? overlayTexture)
{
colouredSprite.Texture = texture;
overlaySprite.Texture = overlayTexture;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatcherNew.cs b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatcherNew.cs
index 93d79f00d3..667622e6f2 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatcherNew.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatcherNew.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using System.Collections.Generic;
using System.Linq;
@@ -20,11 +18,11 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
public class LegacyCatcherNew : CompositeDrawable
{
[Resolved]
- private Bindable currentState { get; set; }
+ private Bindable currentState { get; set; } = null!;
private readonly Dictionary drawables = new Dictionary();
- private Drawable currentDrawable;
+ private Drawable currentDrawable = null!;
public LegacyCatcherNew()
{
@@ -51,7 +49,8 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
Drawable getDrawableFor(CatcherAnimationState state) =>
skin.GetAnimation(@$"fruit-catcher-{state.ToString().ToLowerInvariant()}", true, true, true) ??
- skin.GetAnimation(@"fruit-catcher-idle", true, true, true);
+ skin.GetAnimation(@"fruit-catcher-idle", true, true, true) ??
+ Empty();
}
protected override void LoadComplete()
diff --git a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatcherOld.cs b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatcherOld.cs
index 736e9cfddf..5f09d1e254 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatcherOld.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyCatcherOld.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@@ -21,7 +19,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
{
- InternalChild = skin.GetAnimation(@"fruit-ryuuta", true, true, true).With(d =>
+ InternalChild = (skin.GetAnimation(@"fruit-ryuuta", true, true, true) ?? Empty()).With(d =>
{
d.Anchor = Anchor.TopCentre;
d.Origin = Anchor.TopCentre;
diff --git a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyDropletPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyDropletPiece.cs
index f99cedab3f..7007f1cc29 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyDropletPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyDropletPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics.Textures;
using osuTK;
@@ -19,8 +17,8 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
base.LoadComplete();
- Texture texture = Skin.GetTexture("fruit-drop");
- Texture overlayTexture = Skin.GetTexture("fruit-drop-overlay");
+ Texture? texture = Skin.GetTexture("fruit-drop");
+ Texture? overlayTexture = Skin.GetTexture("fruit-drop-overlay");
SetTexture(texture, overlayTexture);
}
diff --git a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyFruitPiece.cs b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyFruitPiece.cs
index 125a96a446..f002bab219 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyFruitPiece.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyFruitPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Game.Rulesets.Catch.Objects;
namespace osu.Game.Rulesets.Catch.Skinning.Legacy
diff --git a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyHitExplosion.cs b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyHitExplosion.cs
index 8f46bdbe6e..393a1076af 100644
--- a/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyHitExplosion.cs
+++ b/osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyHitExplosion.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@@ -18,7 +16,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
public class LegacyHitExplosion : CompositeDrawable, IHitExplosion
{
[Resolved]
- private Catcher catcher { get; set; }
+ private Catcher catcher { get; set; } = null!;
private const float catch_margin = (1 - Catcher.ALLOWED_CATCH_RANGE) / 2;
diff --git a/osu.Game.Rulesets.Catch/UI/CatchComboDisplay.cs b/osu.Game.Rulesets.Catch/UI/CatchComboDisplay.cs
index a5b7d8d0af..03f0bc6a55 100644
--- a/osu.Game.Rulesets.Catch/UI/CatchComboDisplay.cs
+++ b/osu.Game.Rulesets.Catch/UI/CatchComboDisplay.cs
@@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Catch.UI
private readonly IBindable showCombo = new BindableBool(true);
public CatchComboDisplay()
- : base(new CatchSkinComponent(CatchSkinComponents.CatchComboCounter), _ => Empty())
+ : base(new CatchSkinComponentLookup(CatchSkinComponents.CatchComboCounter), _ => Empty())
{
}
diff --git a/osu.Game.Rulesets.Catch/UI/HitExplosion.cs b/osu.Game.Rulesets.Catch/UI/HitExplosion.cs
index 1ea188d463..9b32893efe 100644
--- a/osu.Game.Rulesets.Catch/UI/HitExplosion.cs
+++ b/osu.Game.Rulesets.Catch/UI/HitExplosion.cs
@@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.UI
Anchor = Anchor.BottomCentre;
Origin = Anchor.BottomCentre;
- InternalChild = skinnableExplosion = new SkinnableDrawable(new CatchSkinComponent(CatchSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
+ InternalChild = skinnableExplosion = new SkinnableDrawable(new CatchSkinComponentLookup(CatchSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
{
CentreComponent = false,
Anchor = Anchor.BottomCentre,
diff --git a/osu.Game.Rulesets.Catch/UI/SkinnableCatcher.cs b/osu.Game.Rulesets.Catch/UI/SkinnableCatcher.cs
index 25bbc814bf..fa6ccf6bd6 100644
--- a/osu.Game.Rulesets.Catch/UI/SkinnableCatcher.cs
+++ b/osu.Game.Rulesets.Catch/UI/SkinnableCatcher.cs
@@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Catch.UI
public readonly Bindable AnimationState = new Bindable();
public SkinnableCatcher()
- : base(new CatchSkinComponent(CatchSkinComponents.Catcher), _ => new DefaultCatcher())
+ : base(new CatchSkinComponentLookup(CatchSkinComponents.Catcher), _ => new DefaultCatcher())
{
Anchor = Anchor.TopCentre;
// Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
diff --git a/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneColumnBackground.cs b/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneColumnBackground.cs
index cd26e2a9de..3dece20308 100644
--- a/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneColumnBackground.cs
+++ b/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneColumnBackground.cs
@@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
{
RelativeSizeAxes = Axes.Both,
Width = 0.5f,
- Child = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
+ Child = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
{
RelativeSizeAxes = Axes.Both
}
@@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
{
RelativeSizeAxes = Axes.Both,
Width = 0.5f,
- Child = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
+ Child = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
{
RelativeSizeAxes = Axes.Both
}
diff --git a/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneStageBackground.cs b/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneStageBackground.cs
index 0744d7e2e7..5c8e038eed 100644
--- a/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneStageBackground.cs
+++ b/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneStageBackground.cs
@@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
[BackgroundDependencyLoader]
private void load()
{
- SetContents(_ => new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.StageBackground),
+ SetContents(_ => new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.StageBackground),
_ => new DefaultStageBackground())
{
Anchor = Anchor.Centre,
diff --git a/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneStageForeground.cs b/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneStageForeground.cs
index 979c90c802..f9c17ee7f4 100644
--- a/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneStageForeground.cs
+++ b/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneStageForeground.cs
@@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
[BackgroundDependencyLoader]
private void load()
{
- SetContents(_ => new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.StageForeground), _ => null)
+ SetContents(_ => new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.StageForeground), _ => null)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
diff --git a/osu.Game.Rulesets.Mania/ManiaSkinComponent.cs b/osu.Game.Rulesets.Mania/ManiaSkinComponentLookup.cs
similarity index 77%
rename from osu.Game.Rulesets.Mania/ManiaSkinComponent.cs
rename to osu.Game.Rulesets.Mania/ManiaSkinComponentLookup.cs
index f05edb4677..c9ee5af809 100644
--- a/osu.Game.Rulesets.Mania/ManiaSkinComponent.cs
+++ b/osu.Game.Rulesets.Mania/ManiaSkinComponentLookup.cs
@@ -1,19 +1,17 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Game.Skinning;
namespace osu.Game.Rulesets.Mania
{
- public class ManiaSkinComponent : GameplaySkinComponent
+ public class ManiaSkinComponentLookup : GameplaySkinComponentLookup
{
///
- /// Creates a new .
+ /// Creates a new .
///
/// The component.
- public ManiaSkinComponent(ManiaSkinComponents component)
+ public ManiaSkinComponentLookup(ManiaSkinComponents component)
: base(component)
{
}
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
index 14dbc432ff..c68eec610c 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
@@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
headContainer = new Container { RelativeSizeAxes = Axes.Both }
}
},
- bodyPiece = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HoldNoteBody), _ => new DefaultBodyPiece
+ bodyPiece = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.HoldNoteBody), _ => new DefaultBodyPiece
{
RelativeSizeAxes = Axes.Both,
})
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
index 3c8b1b53b7..cf3149b065 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
@@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
rulesetConfig?.BindWith(ManiaRulesetSetting.TimingBasedNoteColouring, configTimingBasedNoteColouring);
- AddInternal(headPiece = new SkinnableDrawable(new ManiaSkinComponent(Component), _ => new DefaultNotePiece())
+ AddInternal(headPiece = new SkinnableDrawable(new ManiaSkinComponentLookup(Component), _ => new DefaultNotePiece())
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y
diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs
index ae313e0b91..eb7f63fbe2 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs
@@ -22,14 +22,14 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
this.beatmap = (ManiaBeatmap)beatmap;
}
- public override Drawable? GetDrawableComponent(ISkinComponent component)
+ public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
{
- switch (component)
+ switch (lookup)
{
- case GameplaySkinComponent resultComponent:
+ case GameplaySkinComponentLookup resultComponent:
return new ArgonJudgementPiece(resultComponent.Component);
- case ManiaSkinComponent maniaComponent:
+ case ManiaSkinComponentLookup maniaComponent:
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
switch (maniaComponent.Component)
{
@@ -62,7 +62,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
break;
}
- return base.GetDrawableComponent(component);
+ return base.GetDrawableComponent(lookup);
}
public override IBindable? GetConfig(TLookup lookup)
diff --git a/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBodyPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBodyPiece.cs
index 7476af3c3c..f0e214b190 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBodyPiece.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBodyPiece.cs
@@ -1,10 +1,7 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
-using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
@@ -27,8 +24,8 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default
protected readonly Bindable AccentColour = new Bindable();
protected readonly IBindable IsHitting = new Bindable();
- protected Drawable Background { get; private set; }
- private Container foregroundContainer;
+ protected Drawable Background { get; private set; } = null!;
+ private Container foregroundContainer = null!;
public DefaultBodyPiece()
{
@@ -36,7 +33,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default
}
[BackgroundDependencyLoader(true)]
- private void load([CanBeNull] DrawableHitObject drawableObject)
+ private void load(DrawableHitObject? drawableObject)
{
InternalChildren = new[]
{
@@ -74,9 +71,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default
private readonly LayoutValue subtractionCache = new LayoutValue(Invalidation.DrawSize);
- private BufferedContainer foregroundBuffer;
- private BufferedContainer subtractionBuffer;
- private Container subtractionLayer;
+ private BufferedContainer foregroundBuffer = null!;
+ private BufferedContainer subtractionBuffer = null!;
+ private Container subtractionLayer = null!;
public ForegroundPiece()
{
diff --git a/osu.Game.Rulesets.Mania/Skinning/Default/DefaultNotePiece.cs b/osu.Game.Rulesets.Mania/Skinning/Default/DefaultNotePiece.cs
index 72bb05de49..569740deee 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Default/DefaultNotePiece.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Default/DefaultNotePiece.cs
@@ -1,9 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
-using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
@@ -53,7 +50,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default
}
[BackgroundDependencyLoader(true)]
- private void load([NotNull] IScrollingInfo scrollingInfo, [CanBeNull] DrawableHitObject drawableObject)
+ private void load(IScrollingInfo scrollingInfo, DrawableHitObject? drawableObject)
{
direction.BindTo(scrollingInfo.Direction);
direction.BindValueChanged(onDirectionChanged, true);
diff --git a/osu.Game.Rulesets.Mania/Skinning/Default/IHoldNoteBody.cs b/osu.Game.Rulesets.Mania/Skinning/Default/IHoldNoteBody.cs
index 9168a96b95..1f290f1f1c 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Default/IHoldNoteBody.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Default/IHoldNoteBody.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
namespace osu.Game.Rulesets.Mania.Skinning.Default
{
///
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/HitTargetInsetContainer.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/HitTargetInsetContainer.cs
index 362a265789..3c89e2c04a 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/HitTargetInsetContainer.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/HitTargetInsetContainer.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs
index 49ba503cb5..52bca2aaa0 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs
@@ -1,12 +1,10 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
-using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
+using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Animations;
using osu.Framework.Graphics.Textures;
@@ -20,7 +18,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
public class LegacyBodyPiece : LegacyManiaColumnElement
{
- private DrawableHoldNote holdNote;
+ private DrawableHoldNote holdNote = null!;
private readonly IBindable direction = new Bindable();
private readonly IBindable isHitting = new Bindable();
@@ -31,14 +29,11 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
///
private readonly Bindable missFadeTime = new Bindable();
- [CanBeNull]
- private Drawable bodySprite;
+ private Drawable? bodySprite;
- [CanBeNull]
- private Drawable lightContainer;
+ private Drawable? lightContainer;
- [CanBeNull]
- private Drawable light;
+ private Drawable? light;
public LegacyBodyPiece()
{
@@ -214,7 +209,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
base.Dispose(isDisposing);
- if (holdNote != null)
+ if (holdNote.IsNotNull())
holdNote.ApplyCustomUpdateState -= applyCustomUpdateState;
lightContainer?.Expire();
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyColumnBackground.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyColumnBackground.cs
index f35cedab08..0ed96cf6f1 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyColumnBackground.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyColumnBackground.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -21,8 +19,8 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
private readonly IBindable direction = new Bindable();
- private Container lightContainer;
- private Sprite light;
+ private Container lightContainer = null!;
+ private Sprite light = null!;
public LegacyColumnBackground()
{
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHitExplosion.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHitExplosion.cs
index 278cf0707c..6b0e1e5d8a 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHitExplosion.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHitExplosion.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@@ -23,7 +21,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
private readonly IBindable direction = new Bindable();
- private Drawable explosion;
+ private Drawable? explosion;
public LegacyHitExplosion()
{
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHitTarget.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHitTarget.cs
index 611dac30b3..ed78cb6086 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHitTarget.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHitTarget.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -20,7 +18,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
private readonly IBindable direction = new Bindable();
- private Container directionContainer;
+ private Container directionContainer = null!;
[BackgroundDependencyLoader]
private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHoldNoteHeadPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHoldNoteHeadPiece.cs
index a653e2ce36..c3ed0111be 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHoldNoteHeadPiece.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHoldNoteHeadPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics;
using osu.Game.Skinning;
@@ -10,7 +8,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
public class LegacyHoldNoteHeadPiece : LegacyNotePiece
{
- protected override Drawable GetAnimation(ISkinSource skin)
+ protected override Drawable? GetAnimation(ISkinSource skin)
{
// TODO: Should fallback to the head from default legacy skin instead of note.
return GetAnimationFromLookup(skin, LegacyManiaSkinConfigurationLookups.HoldNoteHeadImage)
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHoldNoteTailPiece.cs
index 7511b008f0..13edc6e495 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHoldNoteTailPiece.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHoldNoteTailPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Rulesets.UI.Scrolling;
@@ -20,7 +18,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
: new ValueChangedEvent(ScrollingDirection.Up, ScrollingDirection.Up));
}
- protected override Drawable GetAnimation(ISkinSource skin)
+ protected override Drawable? GetAnimation(ISkinSource skin)
{
// TODO: Should fallback to the head from default legacy skin instead of note.
return GetAnimationFromLookup(skin, LegacyManiaSkinConfigurationLookups.HoldNoteTailImage)
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyKeyArea.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyKeyArea.cs
index dfd5af89c1..e7dca3d946 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyKeyArea.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyKeyArea.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -21,12 +19,12 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
private readonly IBindable direction = new Bindable();
- private Container directionContainer;
- private Sprite upSprite;
- private Sprite downSprite;
+ private Container directionContainer = null!;
+ private Sprite upSprite = null!;
+ private Sprite downSprite = null!;
[Resolved]
- private Column column { get; set; }
+ private Column column { get; set; } = null!;
public LegacyKeyArea()
{
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaColumnElement.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaColumnElement.cs
index e227c80845..4ffef18781 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaColumnElement.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaColumnElement.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@@ -19,15 +17,15 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
public class LegacyManiaColumnElement : CompositeDrawable
{
[Resolved]
- protected Column Column { get; private set; }
+ protected Column Column { get; private set; } = null!;
[Resolved]
- private StageDefinition stage { get; set; }
+ private StageDefinition stage { get; set; } = null!;
///
/// The column type identifier to use for texture lookups, in the case of no user-provided configuration.
///
- protected string FallbackColumnIndex { get; private set; }
+ protected string FallbackColumnIndex { get; private set; } = null!;
[BackgroundDependencyLoader]
private void load()
@@ -41,7 +39,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
}
}
- protected IBindable GetColumnSkinConfig(ISkin skin, LegacyManiaSkinConfigurationLookups lookup)
+ protected IBindable? GetColumnSkinConfig(ISkin skin, LegacyManiaSkinConfigurationLookups lookup) where T : notnull
=> skin.GetManiaSkinConfig(lookup, Column.Index);
}
}
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaJudgementPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaJudgementPiece.cs
index d09a73a693..670a0aad6e 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaJudgementPiece.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaJudgementPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Animations;
@@ -41,21 +39,15 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
Y = scorePosition ?? 0;
- if (animation != null)
+ InternalChild = animation.With(d =>
{
- InternalChild = animation.With(d =>
- {
- d.Anchor = Anchor.Centre;
- d.Origin = Anchor.Centre;
- });
- }
+ d.Anchor = Anchor.Centre;
+ d.Origin = Anchor.Centre;
+ });
}
public void PlayAnimation()
{
- if (animation == null)
- return;
-
(animation as IFramedAnimation)?.GotoFrame(0);
this.FadeInFromZero(20, Easing.Out)
@@ -86,6 +78,6 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
}
}
- public Drawable GetAboveHitObjectsProxiedContent() => null;
+ public Drawable? GetAboveHitObjectsProxiedContent() => null;
}
}
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyNotePiece.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyNotePiece.cs
index 41e149ea2f..8c5a594b3b 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyNotePiece.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyNotePiece.cs
@@ -1,9 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
-using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -21,10 +18,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
private readonly IBindable direction = new Bindable();
- private Container directionContainer;
+ private Container directionContainer = null!;
- [CanBeNull]
- private Drawable noteAnimation;
+ private Drawable noteAnimation = null!;
private float? minimumColumnWidth;
@@ -55,7 +51,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
base.Update();
- Texture texture = null;
+ Texture? texture = null;
if (noteAnimation is Sprite sprite)
texture = sprite.Texture;
@@ -84,11 +80,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
}
}
- [CanBeNull]
- protected virtual Drawable GetAnimation(ISkinSource skin) => GetAnimationFromLookup(skin, LegacyManiaSkinConfigurationLookups.NoteImage);
+ protected virtual Drawable? GetAnimation(ISkinSource skin) => GetAnimationFromLookup(skin, LegacyManiaSkinConfigurationLookups.NoteImage);
- [CanBeNull]
- protected Drawable GetAnimationFromLookup(ISkin skin, LegacyManiaSkinConfigurationLookups lookup)
+ protected Drawable? GetAnimationFromLookup(ISkin skin, LegacyManiaSkinConfigurationLookups lookup)
{
string suffix = string.Empty;
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyStageForeground.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyStageForeground.cs
index f7c611d551..8e72e970ab 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyStageForeground.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyStageForeground.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -17,7 +15,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
private readonly IBindable direction = new Bindable();
- private Drawable sprite;
+ private Drawable? sprite;
public LegacyStageForeground()
{
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/ManiaClassicSkinTransformer.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/ManiaClassicSkinTransformer.cs
index e57927897c..be3372fe58 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/ManiaClassicSkinTransformer.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/ManiaClassicSkinTransformer.cs
@@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
}
- public override IBindable GetConfig(TLookup lookup)
+ public override IBindable? GetConfig(TLookup lookup)
{
if (lookup is ManiaSkinConfigurationLookup maniaLookup)
{
diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/ManiaLegacySkinTransformer.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/ManiaLegacySkinTransformer.cs
index a07dbea368..f8519beb22 100644
--- a/osu.Game.Rulesets.Mania/Skinning/Legacy/ManiaLegacySkinTransformer.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/ManiaLegacySkinTransformer.cs
@@ -74,14 +74,14 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
});
}
- public override Drawable GetDrawableComponent(ISkinComponent component)
+ public override Drawable GetDrawableComponent(ISkinComponentLookup lookup)
{
- switch (component)
+ switch (lookup)
{
- case GameplaySkinComponent resultComponent:
+ case GameplaySkinComponentLookup resultComponent:
return getResult(resultComponent.Component);
- case ManiaSkinComponent maniaComponent:
+ case ManiaSkinComponentLookup maniaComponent:
if (!isLegacySkin.Value || !hasKeyTexture.Value)
return null;
@@ -120,11 +120,11 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
return new LegacyStageForeground();
default:
- throw new UnsupportedSkinComponentException(component);
+ throw new UnsupportedSkinComponentException(lookup);
}
}
- return base.GetDrawableComponent(component);
+ return base.GetDrawableComponent(lookup);
}
private Drawable getResult(HitResult result)
diff --git a/osu.Game.Rulesets.Mania/Skinning/ManiaSkinConfigExtensions.cs b/osu.Game.Rulesets.Mania/Skinning/ManiaSkinConfigExtensions.cs
index e22bf63049..0f15bfe12b 100644
--- a/osu.Game.Rulesets.Mania/Skinning/ManiaSkinConfigExtensions.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/ManiaSkinConfigExtensions.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Bindables;
using osu.Game.Skinning;
@@ -16,8 +14,8 @@ namespace osu.Game.Rulesets.Mania.Skinning
/// The skin from which configuration is retrieved.
/// The value to retrieve.
/// If not null, denotes the index of the column to which the entry applies.
- public static IBindable GetManiaSkinConfig(this ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int? columnIndex = null)
- => skin.GetConfig(
- new ManiaSkinConfigurationLookup(lookup, columnIndex));
+ public static IBindable? GetManiaSkinConfig(this ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int? columnIndex = null)
+ where T : notnull
+ => skin.GetConfig(new ManiaSkinConfigurationLookup(lookup, columnIndex));
}
}
diff --git a/osu.Game.Rulesets.Mania/Skinning/ManiaSkinConfigurationLookup.cs b/osu.Game.Rulesets.Mania/Skinning/ManiaSkinConfigurationLookup.cs
index 59188f02f9..6c39ffdcc3 100644
--- a/osu.Game.Rulesets.Mania/Skinning/ManiaSkinConfigurationLookup.cs
+++ b/osu.Game.Rulesets.Mania/Skinning/ManiaSkinConfigurationLookup.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Skinning;
diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs
index 3d46bdaa7b..de7424773b 100644
--- a/osu.Game.Rulesets.Mania/UI/Column.cs
+++ b/osu.Game.Rulesets.Mania/UI/Column.cs
@@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Mania.UI
skin.SourceChanged += onSourceChanged;
onSourceChanged();
- Drawable background = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
+ Drawable background = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
{
RelativeSizeAxes = Axes.Both,
};
@@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Mania.UI
// For input purposes, the background is added at the highest depth, but is then proxied back below all other elements
background.CreateProxy(),
HitObjectArea,
- keyArea = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.KeyArea), _ => new DefaultKeyArea())
+ keyArea = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.KeyArea), _ => new DefaultKeyArea())
{
RelativeSizeAxes = Axes.Both,
},
diff --git a/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs b/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs
index b26b62f8a5..e5a9ca1e85 100644
--- a/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs
+++ b/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs
@@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Mania.UI.Components
RelativeSizeAxes = Axes.Both,
Depth = 2,
},
- hitTarget = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitTarget), _ => new DefaultHitTarget())
+ hitTarget = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.HitTarget), _ => new DefaultHitTarget())
{
RelativeSizeAxes = Axes.X,
Depth = 1
diff --git a/osu.Game.Rulesets.Mania/UI/PoolableHitExplosion.cs b/osu.Game.Rulesets.Mania/UI/PoolableHitExplosion.cs
index a7b94f9f22..8e5c8f9b75 100644
--- a/osu.Game.Rulesets.Mania/UI/PoolableHitExplosion.cs
+++ b/osu.Game.Rulesets.Mania/UI/PoolableHitExplosion.cs
@@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Mania.UI
[BackgroundDependencyLoader]
private void load()
{
- InternalChild = skinnableExplosion = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
+ InternalChild = skinnableExplosion = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
{
RelativeSizeAxes = Axes.Both
};
diff --git a/osu.Game.Rulesets.Mania/UI/Stage.cs b/osu.Game.Rulesets.Mania/UI/Stage.cs
index 1273cb3d32..8aeaa9cf35 100644
--- a/osu.Game.Rulesets.Mania/UI/Stage.cs
+++ b/osu.Game.Rulesets.Mania/UI/Stage.cs
@@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Mania.UI
AutoSizeAxes = Axes.X,
Children = new Drawable[]
{
- new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.StageBackground), _ => new DefaultStageBackground())
+ new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.StageBackground), _ => new DefaultStageBackground())
{
RelativeSizeAxes = Axes.Both
},
@@ -98,7 +98,7 @@ namespace osu.Game.Rulesets.Mania.UI
RelativeSizeAxes = Axes.Y,
}
},
- new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.StageForeground), _ => null)
+ new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.StageForeground), _ => null)
{
RelativeSizeAxes = Axes.Both
},
diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneCursorTrail.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneCursorTrail.cs
index d3e70a0a01..30f0891344 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestSceneCursorTrail.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestSceneCursorTrail.cs
@@ -96,7 +96,7 @@ namespace osu.Game.Rulesets.Osu.Tests
RelativeSizeAxes = Axes.Both;
}
- public Drawable GetDrawableComponent(ISkinComponent component) => null;
+ public Drawable GetDrawableComponent(ISkinComponentLookup lookup) => null;
public Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT)
{
diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneGameplayCursor.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneGameplayCursor.cs
index 360815afbf..628082c2a9 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestSceneGameplayCursor.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestSceneGameplayCursor.cs
@@ -116,7 +116,7 @@ namespace osu.Game.Rulesets.Osu.Tests
private class TopLeftCursorSkin : ISkin
{
- public Drawable GetDrawableComponent(ISkinComponent component) => null;
+ public Drawable GetDrawableComponent(ISkinComponentLookup lookup) => null;
public Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) => null;
public ISample GetSample(ISampleInfo sampleInfo) => null;
diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleArea.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleArea.cs
index 57734236da..20aed514db 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleArea.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleArea.cs
@@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.Tests
hitCircle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
- Child = new SkinProvidingContainer(new TrianglesSkin(null))
+ Child = new SkinProvidingContainer(new TrianglesSkin(null!))
{
RelativeSizeAxes = Axes.Both,
Child = drawableHitCircle = new DrawableHitCircle(hitCircle)
diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneLegacyBeatmapSkin.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneLegacyBeatmapSkin.cs
index 1767d25e77..bb28b2b217 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestSceneLegacyBeatmapSkin.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestSceneLegacyBeatmapSkin.cs
@@ -31,6 +31,8 @@ namespace osu.Game.Rulesets.Osu.Tests
{
config.BindWith(OsuSetting.BeatmapSkins, BeatmapSkins);
config.BindWith(OsuSetting.BeatmapColours, BeatmapColours);
+
+ config.SetValue(OsuSetting.ComboColourNormalisationAmount, 0f);
}
[TestCase(true, true)]
diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSkinFallbacks.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSkinFallbacks.cs
index 036f90b962..878150e467 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestSceneSkinFallbacks.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSkinFallbacks.cs
@@ -149,11 +149,11 @@ namespace osu.Game.Rulesets.Osu.Tests
this.identifier = identifier;
}
- public Drawable GetDrawableComponent(ISkinComponent component)
+ public Drawable GetDrawableComponent(ISkinComponentLookup lookup)
{
if (!enabled) return null;
- if (component is OsuSkinComponent osuComponent && osuComponent.Component == OsuSkinComponents.SliderBody)
+ if (lookup is OsuSkinComponentLookup osuComponent && osuComponent.Component == OsuSkinComponents.SliderBody)
return null;
return new OsuSpriteText
diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs
index 5fa4e24f5e..13ea46eadf 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs
@@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Osu.Tests
AddAssert("player score matching expected bonus score", () =>
{
// multipled by 2 to nullify the score multiplier. (autoplay mod selected)
- double totalScore = ((ScoreExposedPlayer)Player).ScoreProcessor.TotalScore.Value * 2;
+ long totalScore = ((ScoreExposedPlayer)Player).ScoreProcessor.TotalScore.Value * 2;
return totalScore == (int)(drawableSpinner.Result.RateAdjustedRotation / 360) * new SpinnerTick().CreateJudgement().MaxNumericResult;
});
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/HitCircles/Components/HitCircleOverlapMarker.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/HitCircles/Components/HitCircleOverlapMarker.cs
index 71cdbc276e..f16b6c138e 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/HitCircles/Components/HitCircleOverlapMarker.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/HitCircles/Components/HitCircleOverlapMarker.cs
@@ -4,9 +4,12 @@
#nullable disable
using osu.Framework.Allocation;
+using osu.Framework.Bindables;
using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
+using osu.Game.Configuration;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Skinning.Default;
@@ -27,31 +30,45 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components
private readonly RingPiece ring;
+ private readonly Container content;
+
[Resolved]
private EditorClock editorClock { get; set; }
+ private Bindable showHitMarkers;
+
public HitCircleOverlapMarker()
{
Origin = Anchor.Centre;
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
- InternalChildren = new Drawable[]
+ InternalChild = content = new Container
{
- new Circle
+ RelativeSizeAxes = Axes.Both,
+ Children = new Drawable[]
{
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- RelativeSizeAxes = Axes.Both,
- Colour = Color4.White,
- },
- ring = new RingPiece
- {
- BorderThickness = 4,
+ new Circle
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Colour = Color4.White,
+ },
+ ring = new RingPiece
+ {
+ BorderThickness = 4,
+ }
}
};
}
+ [BackgroundDependencyLoader]
+ private void load(OsuConfigManager config)
+ {
+ showHitMarkers = config.GetBindable(OsuSetting.EditorShowHitMarkers);
+ }
+
[Resolved]
private ISkinSource skin { get; set; }
@@ -68,21 +85,26 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components
double hitObjectTime = hitObject.StartTime;
bool hasReachedObject = editorTime >= hitObjectTime;
- if (hasReachedObject)
+ if (hasReachedObject && showHitMarkers.Value)
{
float alpha = Interpolation.ValueAt(editorTime, 0, 1f, hitObjectTime, hitObjectTime + FADE_OUT_EXTENSION, Easing.In);
float ringScale = MathHelper.Clamp(Interpolation.ValueAt(editorTime, 0, 1f, hitObjectTime, hitObjectTime + FADE_OUT_EXTENSION / 2, Easing.OutQuint), 0, 1);
ring.Scale = new Vector2(1 + 0.1f * ringScale);
- Alpha = 0.9f * (1 - alpha);
+ content.Alpha = 0.9f * (1 - alpha);
}
else
- Alpha = 0;
+ content.Alpha = 0;
+ }
+
+ public override void Show()
+ {
+ // intentional no op so SelectionBlueprint Selection/Deselection logic doesn't touch us.
}
public override void Hide()
{
- // intentional no op so we are not hidden when not selected.
+ // intentional no op so SelectionBlueprint Selection/Deselection logic doesn't touch us.
}
}
}
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/OsuSelectionBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/OsuSelectionBlueprint.cs
index 422287918e..11527c9537 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/OsuSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/OsuSelectionBlueprint.cs
@@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints
protected override bool AlwaysShowWhenSelected => true;
protected override bool ShouldBeAlive => base.ShouldBeAlive
- || (editorClock.CurrentTime >= Item.StartTime && editorClock.CurrentTime - Item.GetEndTime() < HitCircleOverlapMarker.FADE_OUT_EXTENSION);
+ || (ShowHitMarkers.Value && editorClock.CurrentTime >= Item.StartTime && editorClock.CurrentTime - Item.GetEndTime() < HitCircleOverlapMarker.FADE_OUT_EXTENSION);
protected OsuSelectionBlueprint(T hitObject)
: base(hitObject)
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
index 94655f3cf7..c7e3516d62 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
@@ -248,6 +248,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
break;
}
+ slider.Path.ExpectedDistance.Value = null;
piece.ControlPoint.Type = type;
}
diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModFreezeFrame.cs b/osu.Game.Rulesets.Osu/Mods/OsuModFreezeFrame.cs
index bea5d4f5d9..0a1aab9ef1 100644
--- a/osu.Game.Rulesets.Osu/Mods/OsuModFreezeFrame.cs
+++ b/osu.Game.Rulesets.Osu/Mods/OsuModFreezeFrame.cs
@@ -56,6 +56,8 @@ namespace osu.Game.Rulesets.Osu.Mods
{
switch (nested)
{
+ //Freezing the SliderTicks doesnt play well with snaking sliders
+ case SliderTick:
//SliderRepeat wont layer correctly if preempt is changed.
case SliderRepeat:
break;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs
index 36d8ba0189..8c95da9be1 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs
@@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
{
Origin = Anchor.Centre;
- InternalChild = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.FollowPoint), _ => new CircularContainer
+ InternalChild = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.FollowPoint), _ => new CircularContainer
{
Masking = true,
AutoSizeAxes = Axes.Both,
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
index 841a52da7b..6201199cc3 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
@@ -24,7 +24,7 @@ using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
- public class DrawableHitCircle : DrawableOsuHitObject, IHasMainCirclePiece, IHasApproachCircle
+ public class DrawableHitCircle : DrawableOsuHitObject, IHasApproachCircle
{
public OsuAction? HitAction => HitArea.HitAction;
protected virtual OsuSkinComponents CirclePieceComponent => OsuSkinComponents.HitCircle;
@@ -81,12 +81,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
- CirclePiece = new SkinnableDrawable(new OsuSkinComponent(CirclePieceComponent), _ => new MainCirclePiece())
+ CirclePiece = new SkinnableDrawable(new OsuSkinComponentLookup(CirclePieceComponent), _ => new MainCirclePiece())
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
- ApproachCircle = new ProxyableSkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.ApproachCircle), _ => new DefaultApproachCircle())
+ ApproachCircle = new ProxyableSkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.ApproachCircle), _ => new DefaultApproachCircle())
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@@ -278,8 +278,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
public override bool RemoveWhenNotAlive => false;
- public ProxyableSkinnableDrawable(ISkinComponent component, Func defaultImplementation = null, ConfineMode confineMode = ConfineMode.NoScaling)
- : base(component, defaultImplementation, confineMode)
+ public ProxyableSkinnableDrawable(ISkinComponentLookup lookup, Func defaultImplementation = null, ConfineMode confineMode = ConfineMode.NoScaling)
+ : base(lookup, defaultImplementation, confineMode)
{
}
}
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs
index e137a503a5..b4abdde911 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs
@@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Lighting.Alpha = 0;
- if (hitLightingEnabled && Lighting.Drawable != null)
+ if (hitLightingEnabled)
{
// todo: this animation changes slightly based on new/old legacy skin versions.
Lighting.ScaleTo(0.8f).ScaleTo(1.2f, 600, Easing.Out);
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
index 785d15c15b..a4745b365b 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
@@ -83,7 +83,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
- Body = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderBody), _ => new DefaultSliderBody(), confineMode: ConfineMode.NoScaling),
+ Body = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.SliderBody), _ => new DefaultSliderBody(), confineMode: ConfineMode.NoScaling),
tailContainer = new Container { RelativeSizeAxes = Axes.Both },
tickContainer = new Container { RelativeSizeAxes = Axes.Both },
repeatContainer = new Container { RelativeSizeAxes = Axes.Both },
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs
index 9966ad3a90..35d5c1f478 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs
@@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Children = new[]
{
- new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderFollowCircle), _ => new DefaultFollowCircle())
+ new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.SliderFollowCircle), _ => new DefaultFollowCircle())
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
@@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
RelativeSizeAxes = Axes.Both,
Masking = true
},
- ball = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderBall), _ => new DefaultSliderBall())
+ ball = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.SliderBall), _ => new DefaultSliderBall())
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs
index 7b9c0c7e40..08602e168c 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs
@@ -17,7 +17,7 @@ using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
- public class DrawableSliderRepeat : DrawableOsuHitObject, ITrackSnaking, IHasMainCirclePiece
+ public class DrawableSliderRepeat : DrawableOsuHitObject, ITrackSnaking
{
public new SliderRepeat HitObject => (SliderRepeat)base.HitObject;
@@ -60,7 +60,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Children = new Drawable[]
{
// no default for this; only visible in legacy skins.
- CirclePiece = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderTailHitCircle), _ => Empty())
+ CirclePiece = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.SliderTailHitCircle), _ => Empty())
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs
index 063d297f5a..a59cd92d62 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs
@@ -10,13 +10,12 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Objects.Types;
-using osu.Game.Rulesets.Osu.Skinning.Default;
using osu.Game.Skinning;
using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
- public class DrawableSliderTail : DrawableOsuHitObject, IRequireTracking, IHasMainCirclePiece
+ public class DrawableSliderTail : DrawableOsuHitObject, IRequireTracking
{
public new SliderTailCircle HitObject => (SliderTailCircle)base.HitObject;
@@ -68,7 +67,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Children = new Drawable[]
{
// no default for this; only visible in legacy skins.
- CirclePiece = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderTailHitCircle), _ => Empty())
+ CirclePiece = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.SliderTailHitCircle), _ => Empty())
}
},
});
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
index 4bd98fc8b2..563c7e85aa 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
@@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
Origin = Anchor.Centre;
- AddInternal(scaleContainer = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderScorePoint), _ => new CircularContainer
+ AddInternal(scaleContainer = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.SliderScorePoint), _ => new CircularContainer
{
Masking = true,
Origin = Anchor.Centre,
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
index 6ae9d5bc34..83a9408570 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
@@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
RelativeSizeAxes = Axes.Y,
Children = new Drawable[]
{
- Body = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBody), _ => new DefaultSpinner()),
+ Body = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.SpinnerBody), _ => new DefaultSpinner()),
RotationTracker = new SpinnerRotationTracker(this)
}
},
diff --git a/osu.Game.Rulesets.Osu/OsuSkinComponent.cs b/osu.Game.Rulesets.Osu/OsuSkinComponentLookup.cs
similarity index 73%
rename from osu.Game.Rulesets.Osu/OsuSkinComponent.cs
rename to osu.Game.Rulesets.Osu/OsuSkinComponentLookup.cs
index 0abaf2c924..81d5811f85 100644
--- a/osu.Game.Rulesets.Osu/OsuSkinComponent.cs
+++ b/osu.Game.Rulesets.Osu/OsuSkinComponentLookup.cs
@@ -1,15 +1,13 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Game.Skinning;
namespace osu.Game.Rulesets.Osu
{
- public class OsuSkinComponent : GameplaySkinComponent
+ public class OsuSkinComponentLookup : GameplaySkinComponentLookup
{
- public OsuSkinComponent(OsuSkinComponents component)
+ public OsuSkinComponentLookup(OsuSkinComponents component)
: base(component)
{
}
diff --git a/osu.Game.Rulesets.Osu/OsuSkinComponents.cs b/osu.Game.Rulesets.Osu/OsuSkinComponents.cs
index 4248cce55a..8fdf3821fa 100644
--- a/osu.Game.Rulesets.Osu/OsuSkinComponents.cs
+++ b/osu.Game.Rulesets.Osu/OsuSkinComponents.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
namespace osu.Game.Rulesets.Osu
{
public enum OsuSkinComponents
diff --git a/osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs b/osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs
index bf507db50c..86194d2c43 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs
@@ -14,14 +14,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
}
- public override Drawable? GetDrawableComponent(ISkinComponent component)
+ public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
{
- switch (component)
+ switch (lookup)
{
- case GameplaySkinComponent resultComponent:
+ case GameplaySkinComponentLookup resultComponent:
return new ArgonJudgementPiece(resultComponent.Component);
- case OsuSkinComponent osuComponent:
+ case OsuSkinComponentLookup osuComponent:
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
switch (osuComponent.Component)
{
@@ -62,7 +62,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
break;
}
- return base.GetDrawableComponent(component);
+ return base.GetDrawableComponent(lookup);
}
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/CirclePiece.cs b/osu.Game.Rulesets.Osu/Skinning/Default/CirclePiece.cs
index 40e9f69963..4a679cda2c 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/CirclePiece.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/CirclePiece.cs
@@ -1,9 +1,8 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
+using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@@ -17,9 +16,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
public class CirclePiece : CompositeDrawable
{
[Resolved]
- private DrawableHitObject drawableObject { get; set; }
+ private DrawableHitObject drawableObject { get; set; } = null!;
- private TrianglesPiece triangles;
+ private TrianglesPiece triangles = null!;
public CirclePiece()
{
@@ -72,7 +71,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
- if (drawableObject != null)
+ if (drawableObject.IsNotNull())
drawableObject.HitObjectApplied -= onHitObjectApplied;
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultApproachCircle.cs b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultApproachCircle.cs
index 251fd8d948..3a67ad526e 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultApproachCircle.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultApproachCircle.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -18,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private readonly IBindable accentColour = new Bindable();
[Resolved]
- private DrawableHitObject drawableObject { get; set; }
+ private DrawableHitObject drawableObject { get; set; } = null!;
public DefaultApproachCircle()
: base("Gameplay/osu/approachcircle")
@@ -37,9 +35,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
accentColour.BindValueChanged(colour => Colour = colour.NewValue, true);
}
- protected override Drawable CreateDefault(ISkinComponent component)
+ protected override Drawable CreateDefault(ISkinComponentLookup lookup)
{
- var drawable = base.CreateDefault(component);
+ var drawable = base.CreateDefault(lookup);
// Although this is a non-legacy component, osu-resources currently stores approach circle as a legacy-like texture.
// See LegacyApproachCircle for documentation as to why this is required.
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSpinner.cs b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSpinner.cs
index a215b3b1f0..a975030630 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSpinner.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSpinner.cs
@@ -1,12 +1,11 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using System.Globalization;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
+using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
@@ -18,12 +17,12 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public class DefaultSpinner : CompositeDrawable
{
- private DrawableSpinner drawableSpinner;
+ private DrawableSpinner drawableSpinner = null!;
- private OsuSpriteText bonusCounter;
+ private OsuSpriteText bonusCounter = null!;
- private Container spmContainer;
- private OsuSpriteText spmCounter;
+ private Container spmContainer = null!;
+ private OsuSpriteText spmCounter = null!;
public DefaultSpinner()
{
@@ -81,8 +80,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
});
}
- private IBindable gainedBonus;
- private IBindable spinsPerMinute;
+ private IBindable gainedBonus = null!;
+ private IBindable spinsPerMinute = null!;
protected override void LoadComplete()
{
@@ -135,7 +134,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
- if (drawableSpinner != null)
+ if (drawableSpinner.IsNotNull())
drawableSpinner.ApplyCustomUpdateState -= updateStateTransforms;
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSpinnerDisc.cs b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSpinnerDisc.cs
index 60489c1b22..b58daf7174 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSpinnerDisc.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSpinnerDisc.cs
@@ -1,12 +1,11 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
+using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Utils;
@@ -21,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public class DefaultSpinnerDisc : CompositeDrawable
{
- private DrawableSpinner drawableSpinner;
+ private DrawableSpinner drawableSpinner = null!;
private const float initial_scale = 1.3f;
private const float idle_alpha = 0.2f;
@@ -30,15 +29,15 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private Color4 normalColour;
private Color4 completeColour;
- private SpinnerTicks ticks;
+ private SpinnerTicks ticks = null!;
private int wholeRotationCount;
private readonly BindableBool complete = new BindableBool();
- private SpinnerFill fill;
- private Container mainContainer;
- private SpinnerCentreLayer centre;
- private SpinnerBackgroundLayer background;
+ private SpinnerFill fill = null!;
+ private Container mainContainer = null!;
+ private SpinnerCentreLayer centre = null!;
+ private SpinnerBackgroundLayer background = null!;
public DefaultSpinnerDisc()
{
@@ -214,7 +213,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
- if (drawableSpinner != null)
+ if (drawableSpinner.IsNotNull())
drawableSpinner.ApplyCustomUpdateState -= updateStateTransforms;
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/DrawableSliderPath.cs b/osu.Game.Rulesets.Osu/Skinning/Default/DrawableSliderPath.cs
index e3a83a9280..883524f334 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/DrawableSliderPath.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/DrawableSliderPath.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics.Lines;
using osuTK.Graphics;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/ExplodePiece.cs b/osu.Game.Rulesets.Osu/Skinning/Default/ExplodePiece.cs
index 6ee8a12132..f8010a9971 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/ExplodePiece.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/ExplodePiece.cs
@@ -1,9 +1,8 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
+using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
@@ -15,9 +14,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
public class ExplodePiece : Container
{
[Resolved]
- private DrawableHitObject drawableObject { get; set; }
+ private DrawableHitObject drawableObject { get; set; } = null!;
- private TrianglesPiece triangles;
+ private TrianglesPiece triangles = null!;
public ExplodePiece()
{
@@ -56,7 +55,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
- if (drawableObject != null)
+ if (drawableObject.IsNotNull())
drawableObject.HitObjectApplied -= onHitObjectApplied;
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/FlashPiece.cs b/osu.Game.Rulesets.Osu/Skinning/Default/FlashPiece.cs
index 98a8b39f6f..06ee64d8b3 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/FlashPiece.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/FlashPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/GlowPiece.cs b/osu.Game.Rulesets.Osu/Skinning/Default/GlowPiece.cs
index 2360bc2238..f5e01b802e 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/GlowPiece.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/GlowPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/IHasMainCirclePiece.cs b/osu.Game.Rulesets.Osu/Skinning/Default/IHasMainCirclePiece.cs
deleted file mode 100644
index 0ba7998d43..0000000000
--- a/osu.Game.Rulesets.Osu/Skinning/Default/IHasMainCirclePiece.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
-// See the LICENCE file in the repository root for full licence text.
-
-#nullable disable
-
-using osu.Game.Skinning;
-
-namespace osu.Game.Rulesets.Osu.Skinning.Default
-{
- public interface IHasMainCirclePiece
- {
- SkinnableDrawable CirclePiece { get; }
- }
-}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/KiaiFlash.cs b/osu.Game.Rulesets.Osu/Skinning/Default/KiaiFlash.cs
index a1cfd170a6..506f679836 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/KiaiFlash.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/KiaiFlash.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/MainCirclePiece.cs b/osu.Game.Rulesets.Osu/Skinning/Default/MainCirclePiece.cs
index 4acc406ae1..6d56d21349 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/MainCirclePiece.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/MainCirclePiece.cs
@@ -1,10 +1,9 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
+using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
@@ -46,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private readonly IBindable indexInCurrentCombo = new Bindable();
[Resolved]
- private DrawableHitObject drawableObject { get; set; }
+ private DrawableHitObject drawableObject { get; set; } = null!;
[BackgroundDependencyLoader]
private void load()
@@ -113,7 +112,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
- if (drawableObject != null)
+ if (drawableObject.IsNotNull())
drawableObject.ApplyCustomUpdateState -= updateStateTransforms;
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/ManualSliderBody.cs b/osu.Game.Rulesets.Osu/Skinning/Default/ManualSliderBody.cs
index 8d8d9e0d94..d73c94eb9b 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/ManualSliderBody.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/ManualSliderBody.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System.Collections.Generic;
using osuTK;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/NumberPiece.cs b/osu.Game.Rulesets.Osu/Skinning/Default/NumberPiece.cs
index f6759c1093..60cfecfb5a 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/NumberPiece.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/NumberPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@@ -41,7 +39,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
Colour = Color4.White.Opacity(0.5f),
},
},
- number = new SkinnableSpriteText(new OsuSkinComponent(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
+ number = new SkinnableSpriteText(new OsuSkinComponentLookup(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
{
Font = OsuFont.Numeric.With(size: 40),
UseFullGlyphHeight = false,
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/PlaySliderBody.cs b/osu.Game.Rulesets.Osu/Skinning/Default/PlaySliderBody.cs
index 6c422cf127..96af59abe2 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/PlaySliderBody.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/PlaySliderBody.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Rulesets.Objects.Drawables;
@@ -20,10 +18,10 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
protected IBindable AccentColourBindable { get; private set; } = null!;
- private IBindable pathVersion;
+ private IBindable pathVersion = null!;
[Resolved(CanBeNull = true)]
- private OsuRulesetConfigManager config { get; set; }
+ private OsuRulesetConfigManager? config { get; set; }
private readonly Bindable configSnakingOut = new Bindable();
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/ReverseArrowPiece.cs b/osu.Game.Rulesets.Osu/Skinning/Default/ReverseArrowPiece.cs
index 8f682d02f6..222e8d4348 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/ReverseArrowPiece.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/ReverseArrowPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
@@ -19,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
public class ReverseArrowPiece : BeatSyncedContainer
{
[Resolved]
- private DrawableHitObject drawableRepeat { get; set; }
+ private DrawableHitObject drawableRepeat { get; set; } = null!;
public ReverseArrowPiece()
{
@@ -31,7 +29,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
- Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.ReverseArrow), _ => new SpriteIcon
+ Child = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.ReverseArrow), _ => new SpriteIcon
{
RelativeSizeAxes = Axes.Both,
Blending = BlendingParameters.Additive,
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerBackgroundLayer.cs b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerBackgroundLayer.cs
index a9b7ddf86f..a1184a15cd 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerBackgroundLayer.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerBackgroundLayer.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Graphics;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerCentreLayer.cs b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerCentreLayer.cs
index ef7b4c2c96..3dd5aed6ae 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerCentreLayer.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerCentreLayer.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@@ -19,11 +17,11 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public class SpinnerCentreLayer : CompositeDrawable, IHasAccentColour
{
- private DrawableSpinner spinner;
+ private DrawableSpinner spinner = null!;
- private CirclePiece circle;
- private GlowPiece glow;
- private SpriteIcon symbol;
+ private CirclePiece circle = null!;
+ private GlowPiece glow = null!;
+ private SpriteIcon symbol = null!;
[BackgroundDependencyLoader]
private void load(DrawableHitObject drawableHitObject)
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerFill.cs b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerFill.cs
index b7ec9e9799..f574ae589e 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerFill.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerFill.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerRotationTracker.cs b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerRotationTracker.cs
index 97cebc3123..3a9f73404d 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerRotationTracker.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerRotationTracker.cs
@@ -1,11 +1,10 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
+using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;
@@ -23,6 +22,16 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private readonly DrawableSpinner drawableSpinner;
+ private Vector2 mousePosition;
+
+ private float lastAngle;
+ private float currentRotation;
+
+ private bool rotationTransferred;
+
+ [Resolved(canBeNull: true)]
+ private IGameplayClock? gameplayClock { get; set; }
+
public SpinnerRotationTracker(DrawableSpinner drawableSpinner)
{
this.drawableSpinner = drawableSpinner;
@@ -51,16 +60,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
return base.OnMouseMove(e);
}
- private Vector2 mousePosition;
-
- private float lastAngle;
- private float currentRotation;
-
- private bool rotationTransferred;
-
- [Resolved(canBeNull: true)]
- private IGameplayClock gameplayClock { get; set; }
-
protected override void Update()
{
base.Update();
@@ -126,7 +125,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
- if (drawableSpinner != null)
+ if (drawableSpinner.IsNotNull())
drawableSpinner.HitObjectApplied -= resetState;
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerSpmCalculator.cs b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerSpmCalculator.cs
index df72223214..9feaa0966a 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerSpmCalculator.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerSpmCalculator.cs
@@ -1,12 +1,11 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
+using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Rulesets.Objects.Drawables;
@@ -26,7 +25,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private readonly Bindable result = new BindableDouble();
[Resolved]
- private DrawableHitObject drawableSpinner { get; set; }
+ private DrawableHitObject drawableSpinner { get; set; } = null!;
protected override void LoadComplete()
{
@@ -66,7 +65,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
- if (drawableSpinner != null)
+ if (drawableSpinner.IsNotNull())
drawableSpinner.HitObjectApplied -= resetState;
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerTicks.cs b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerTicks.cs
index b66cbe41b6..e518ae1da8 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerTicks.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/SpinnerTicks.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using System.Linq;
using osu.Framework.Extensions.Color4Extensions;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/TrianglesPiece.cs b/osu.Game.Rulesets.Osu/Skinning/Default/TrianglesPiece.cs
index 7399ddbd1b..fa23c60d57 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/TrianglesPiece.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Default/TrianglesPiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Game.Graphics.Backgrounds;
namespace osu.Game.Rulesets.Osu.Skinning.Default
diff --git a/osu.Game.Rulesets.Osu/Skinning/IHasApproachCircle.cs b/osu.Game.Rulesets.Osu/Skinning/IHasApproachCircle.cs
index 8ebab97503..5ddca03fa1 100644
--- a/osu.Game.Rulesets.Osu/Skinning/IHasApproachCircle.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/IHasApproachCircle.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics;
namespace osu.Game.Rulesets.Osu.Skinning
@@ -15,6 +13,6 @@ namespace osu.Game.Rulesets.Osu.Skinning
///
/// The approach circle drawable.
///
- Drawable ApproachCircle { get; }
+ Drawable? ApproachCircle { get; }
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyApproachCircle.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyApproachCircle.cs
index 03406d37ff..4dd4f9562a 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyApproachCircle.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyApproachCircle.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -18,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
private readonly IBindable accentColour = new Bindable();
[Resolved]
- private DrawableHitObject drawableObject { get; set; }
+ private DrawableHitObject drawableObject { get; set; } = null!;
public LegacyApproachCircle()
: base("Gameplay/osu/approachcircle")
@@ -37,9 +35,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
accentColour.BindValueChanged(colour => Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue), true);
}
- protected override Drawable CreateDefault(ISkinComponent component)
+ protected override Drawable CreateDefault(ISkinComponentLookup lookup)
{
- var drawable = base.CreateDefault(component);
+ var drawable = base.CreateDefault(lookup);
// account for the sprite being used for the default approach circle being taken from stable,
// when hitcircles have 5px padding on each size. this should be removed if we update the sprite.
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursor.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursor.cs
index 4465f9c266..b2ffc171be 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursor.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursor.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Osu.UI.Cursor;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorParticles.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorParticles.cs
index ee75b8a857..a28b480753 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorParticles.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorParticles.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using System.Linq;
using osu.Framework.Allocation;
@@ -27,19 +25,19 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
public class LegacyCursorParticles : CompositeDrawable, IKeyBindingHandler
{
- public bool Active => breakSpewer?.Active.Value == true || kiaiSpewer?.Active.Value == true;
+ public bool Active => breakSpewer.Active.Value || kiaiSpewer.Active.Value;
- private LegacyCursorParticleSpewer breakSpewer;
- private LegacyCursorParticleSpewer kiaiSpewer;
+ private LegacyCursorParticleSpewer breakSpewer = null!;
+ private LegacyCursorParticleSpewer kiaiSpewer = null!;
[Resolved(canBeNull: true)]
- private Player player { get; set; }
+ private Player? player { get; set; }
[Resolved(canBeNull: true)]
- private OsuPlayfield playfield { get; set; }
+ private OsuPlayfield? playfield { get; set; }
[Resolved(canBeNull: true)]
- private GameplayState gameplayState { get; set; }
+ private GameplayState? gameplayState { get; set; }
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
@@ -79,7 +77,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
if (playfield == null || gameplayState == null) return;
- DrawableHitObject kiaiHitObject = null;
+ DrawableHitObject? kiaiHitObject = null;
// Check whether currently in a kiai section first. This is only done as an optimisation to avoid enumerating AliveObjects when not necessary.
if (gameplayState.Beatmap.ControlPointInfo.EffectPointAt(Time.Current).KiaiMode)
@@ -152,7 +150,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
protected override bool CanSpawnParticles => base.CanSpawnParticles && cursorScreenPosition.HasValue;
protected override float ParticleGravity => 240;
- public LegacyCursorParticleSpewer(Texture texture, int perSecond)
+ public LegacyCursorParticleSpewer(Texture? texture, int perSecond)
: base(texture, perSecond, particle_duration_max)
{
Active.BindValueChanged(_ => resetVelocityCalculation());
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorTrail.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorTrail.cs
index e62754c6ce..9a59fd73b2 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorTrail.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorTrail.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@@ -22,7 +20,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
private bool disjointTrail;
private double lastTrailTime;
- private IBindable cursorSize;
+
+ private IBindable cursorSize = null!;
private Vector2? currentPosition;
@@ -34,6 +33,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
+ cursorSize = config.GetBindable(OsuSetting.GameplayCursorSize).GetBoundCopy();
+
Texture = skin.GetTexture("cursortrail");
disjointTrail = skin.GetTexture("cursormiddle") == null;
@@ -54,8 +55,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
// stable "magic ratio". see OsuPlayfieldAdjustmentContainer for full explanation.
Texture.ScaleAdjust *= 1.6f;
}
-
- cursorSize = config.GetBindable(OsuSetting.GameplayCursorSize).GetBoundCopy();
}
protected override double FadeDuration => disjointTrail ? 150 : 500;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs
index a6e62b83e4..e155c1b816 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs
@@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
if (hasNumber)
{
- OverlayLayer.Add(hitCircleText = new SkinnableSpriteText(new OsuSkinComponent(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
+ OverlayLayer.Add(hitCircleText = new SkinnableSpriteText(new OsuSkinComponentLookup(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
{
Font = OsuFont.Numeric.With(size: 40),
UseFullGlyphHeight = false,
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyNewStyleSpinner.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyNewStyleSpinner.cs
index 71c3e4c9f0..f950d3e43e 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyNewStyleSpinner.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyNewStyleSpinner.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@@ -23,15 +21,15 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
///
public class LegacyNewStyleSpinner : LegacySpinner
{
- private Sprite glow;
- private Sprite discBottom;
- private Sprite discTop;
- private Sprite spinningMiddle;
- private Sprite fixedMiddle;
+ private Sprite glow = null!;
+ private Sprite discBottom = null!;
+ private Sprite discTop = null!;
+ private Sprite spinningMiddle = null!;
+ private Sprite fixedMiddle = null!;
private readonly Color4 glowColour = new Color4(3, 151, 255, 255);
- private Container scaleContainer;
+ private Container scaleContainer = null!;
[BackgroundDependencyLoader]
private void load(ISkinSource source)
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyOldStyleSpinner.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyOldStyleSpinner.cs
index a5a765fc02..e5efb668bc 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyOldStyleSpinner.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyOldStyleSpinner.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@@ -23,9 +21,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
///
public class LegacyOldStyleSpinner : LegacySpinner
{
- private Sprite disc;
- private Sprite metreSprite;
- private Container metre;
+ private Sprite disc = null!;
+ private Sprite metreSprite = null!;
+ private Container metre = null!;
private bool spinnerBlink;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyReverseArrow.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyReverseArrow.cs
index ff384ee7fc..773cc7ae3c 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyReverseArrow.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyReverseArrow.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@@ -16,16 +14,16 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
public class LegacyReverseArrow : CompositeDrawable
{
[Resolved(canBeNull: true)]
- private DrawableHitObject drawableHitObject { get; set; }
+ private DrawableHitObject? drawableHitObject { get; set; }
- private Drawable proxy;
+ private Drawable proxy = null!;
[BackgroundDependencyLoader]
private void load(ISkinSource skinSource)
{
AutoSizeAxes = Axes.Both;
- string lookupName = new OsuSkinComponent(OsuSkinComponents.ReverseArrow).LookupName;
+ string lookupName = new OsuSkinComponentLookup(OsuSkinComponents.ReverseArrow).LookupName;
var skin = skinSource.FindProvider(s => s.GetTexture(lookupName) != null);
InternalChild = skin?.GetAnimation(lookupName, true, true) ?? Empty();
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderBody.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderBody.cs
index dbfec14eb2..29a0745193 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderBody.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderBody.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Extensions.Color4Extensions;
using osu.Game.Rulesets.Osu.Objects;
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderHeadHitCircle.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderHeadHitCircle.cs
index ab39d7c6ef..08b579697c 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderHeadHitCircle.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderHeadHitCircle.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@@ -14,9 +12,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
public class LegacySliderHeadHitCircle : LegacyMainCirclePiece
{
[Resolved(canBeNull: true)]
- private DrawableHitObject drawableHitObject { get; set; }
+ private DrawableHitObject? drawableHitObject { get; set; }
- private Drawable proxiedOverlayLayer;
+ private Drawable proxiedOverlayLayer = null!;
public LegacySliderHeadHitCircle()
: base("sliderstartcircle")
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySpinner.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySpinner.cs
index a817e5f2b7..66b195962b 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySpinner.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySpinner.cs
@@ -1,12 +1,11 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using System.Globalization;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
+using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@@ -32,17 +31,17 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
private const float spm_hide_offset = 50f;
- protected DrawableSpinner DrawableSpinner { get; private set; }
+ protected DrawableSpinner DrawableSpinner { get; private set; } = null!;
- public Drawable ApproachCircle { get; protected set; }
+ public Drawable? ApproachCircle { get; protected set; }
- private Sprite spin;
- private Sprite clear;
+ private Sprite spin = null!;
+ private Sprite clear = null!;
- private LegacySpriteText bonusCounter;
+ private LegacySpriteText bonusCounter = null!;
- private Sprite spmBackground;
- private LegacySpriteText spmCounter;
+ private Sprite spmBackground = null!;
+ private LegacySpriteText spmCounter = null!;
[BackgroundDependencyLoader]
private void load(DrawableHitObject drawableHitObject, ISkinSource source)
@@ -108,8 +107,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
});
}
- private IBindable gainedBonus;
- private IBindable spinsPerMinute;
+ private IBindable gainedBonus = null!;
+ private IBindable spinsPerMinute = null!;
private readonly Bindable completed = new Bindable();
@@ -207,7 +206,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
base.Dispose(isDisposing);
- if (DrawableSpinner != null)
+ if (DrawableSpinner.IsNotNull())
DrawableSpinner.ApplyCustomUpdateState -= UpdateStateTransforms;
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs
index 856ccb5044..620540b8ef 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@@ -30,17 +28,17 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
hasHitCircle = new Lazy(() => GetTexture("hitcircle") != null);
}
- public override Drawable GetDrawableComponent(ISkinComponent component)
+ public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
{
- if (component is OsuSkinComponent osuComponent)
+ if (lookup is OsuSkinComponentLookup osuComponent)
{
switch (osuComponent.Component)
{
case OsuSkinComponents.FollowPoint:
- return this.GetAnimation(component.LookupName, true, true, true, startAtCurrentTime: false);
+ return this.GetAnimation("followpoint", true, true, true, startAtCurrentTime: false);
case OsuSkinComponents.SliderScorePoint:
- return this.GetAnimation(component.LookupName, false, false);
+ return this.GetAnimation("sliderscorepoint", false, false);
case OsuSkinComponents.SliderFollowCircle:
var followCircleContent = this.GetAnimation("sliderfollowcircle", true, true, true);
@@ -138,14 +136,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
return new LegacyApproachCircle();
default:
- throw new UnsupportedSkinComponentException(component);
+ throw new UnsupportedSkinComponentException(lookup);
}
}
- return base.GetDrawableComponent(component);
+ return base.GetDrawableComponent(lookup);
}
- public override IBindable GetConfig(TLookup lookup)
+ public override IBindable? GetConfig(TLookup lookup)
{
switch (lookup)
{
diff --git a/osu.Game.Rulesets.Osu/Skinning/NonPlayfieldSprite.cs b/osu.Game.Rulesets.Osu/Skinning/NonPlayfieldSprite.cs
index 0b45c770ba..2a13f07cdb 100644
--- a/osu.Game.Rulesets.Osu/Skinning/NonPlayfieldSprite.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/NonPlayfieldSprite.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Rulesets.UI;
@@ -15,7 +13,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
///
public class NonPlayfieldSprite : Sprite
{
- public override Texture Texture
+ public override Texture? Texture
{
get => base.Texture;
set
diff --git a/osu.Game.Rulesets.Osu/Skinning/OsuSkinColour.cs b/osu.Game.Rulesets.Osu/Skinning/OsuSkinColour.cs
index 5d8a2ff606..24f9217a5f 100644
--- a/osu.Game.Rulesets.Osu/Skinning/OsuSkinColour.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/OsuSkinColour.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
namespace osu.Game.Rulesets.Osu.Skinning
{
public enum OsuSkinColour
diff --git a/osu.Game.Rulesets.Osu/Skinning/OsuSkinConfiguration.cs b/osu.Game.Rulesets.Osu/Skinning/OsuSkinConfiguration.cs
index 1c0a62454b..77fea9d8f7 100644
--- a/osu.Game.Rulesets.Osu/Skinning/OsuSkinConfiguration.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/OsuSkinConfiguration.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
namespace osu.Game.Rulesets.Osu.Skinning
{
public enum OsuSkinConfiguration
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/SliderBody.cs b/osu.Game.Rulesets.Osu/Skinning/SliderBody.cs
similarity index 97%
rename from osu.Game.Rulesets.Osu/Skinning/Default/SliderBody.cs
rename to osu.Game.Rulesets.Osu/Skinning/SliderBody.cs
index 9841cc7cdf..1411b27c09 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/SliderBody.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/SliderBody.cs
@@ -8,10 +8,11 @@ using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Lines;
+using osu.Game.Rulesets.Osu.Skinning.Default;
using osuTK;
using osuTK.Graphics;
-namespace osu.Game.Rulesets.Osu.Skinning.Default
+namespace osu.Game.Rulesets.Osu.Skinning
{
public abstract class SliderBody : CompositeDrawable
{
diff --git a/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs b/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs
index 46c8e7c02a..66d74ae13e 100644
--- a/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs
@@ -49,15 +49,16 @@ namespace osu.Game.Rulesets.Osu.Skinning
private const float max_rotation = 0.25f;
public IShader? TextureShader { get; private set; }
- public IShader? RoundedTextureShader { get; private set; }
protected Texture? Texture { get; set; }
- private float radius => Texture?.DisplayWidth * 0.165f ?? 3;
+ private float height => Texture?.DisplayHeight * 0.165f ?? 3;
+
+ private float width => Texture?.DisplayWidth * 0.165f ?? 3;
protected readonly List SmokePoints = new List();
- private float pointInterval => radius * 7f / 8;
+ private float pointInterval => width * 7f / 8;
private double smokeStartTime { get; set; } = double.MinValue;
@@ -69,7 +70,6 @@ namespace osu.Game.Rulesets.Osu.Skinning
[BackgroundDependencyLoader]
private void load(ShaderManager shaders)
{
- RoundedTextureShader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);
TextureShader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE);
}
@@ -181,7 +181,8 @@ namespace osu.Game.Rulesets.Osu.Skinning
private readonly List points = new List();
private IVertexBatch? quadBatch;
- private float radius;
+ private float width;
+ private float height;
private Vector2 drawSize;
private Texture? texture;
private int rotationSeed;
@@ -204,7 +205,8 @@ namespace osu.Game.Rulesets.Osu.Skinning
{
base.ApplyState();
- radius = Source.radius;
+ width = Source.width;
+ height = Source.height;
drawSize = Source.DrawSize;
texture = Source.Texture;
@@ -247,18 +249,16 @@ namespace osu.Game.Rulesets.Osu.Skinning
texture ??= renderer.WhitePixel;
RectangleF textureRect = texture.GetTextureRect();
- var shader = GetAppropriateShader(renderer);
-
renderer.SetBlend(BlendingParameters.Additive);
renderer.PushLocalMatrix(DrawInfo.Matrix);
- shader.Bind();
+ TextureShader.Bind();
texture.Bind();
for (int i = 0; i < points.Count; i++)
drawPointQuad(points[i], textureRect, i + firstVisiblePointIndex);
- shader.Unbind();
+ TextureShader.Unbind();
renderer.PopLocalMatrix();
}
@@ -338,11 +338,13 @@ namespace osu.Game.Rulesets.Osu.Skinning
var dir = PointDirection(point, index);
var ortho = dir.PerpendicularLeft;
+ dir *= scale * width;
+ ortho *= scale * height;
- var localTopLeft = point.Position + (radius * scale * (-ortho - dir));
- var localTopRight = point.Position + (radius * scale * (-ortho + dir));
- var localBotLeft = point.Position + (radius * scale * (ortho - dir));
- var localBotRight = point.Position + (radius * scale * (ortho + dir));
+ var localTopLeft = point.Position - ortho - dir;
+ var localTopRight = point.Position - ortho + dir;
+ var localBotLeft = point.Position + ortho - dir;
+ var localBotRight = point.Position + ortho + dir;
quadBatch.Add(new TexturedVertex2D
{
diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/SnakingSliderBody.cs b/osu.Game.Rulesets.Osu/Skinning/SnakingSliderBody.cs
similarity index 95%
rename from osu.Game.Rulesets.Osu/Skinning/Default/SnakingSliderBody.cs
rename to osu.Game.Rulesets.Osu/Skinning/SnakingSliderBody.cs
index 86dd5f5c74..8ba9e75d19 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Default/SnakingSliderBody.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/SnakingSliderBody.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
@@ -14,7 +12,7 @@ using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osuTK;
-namespace osu.Game.Rulesets.Osu.Skinning.Default
+namespace osu.Game.Rulesets.Osu.Skinning
{
///
/// A which changes its curve depending on the snaking progress.
@@ -55,7 +53,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
///
private Vector2 snakedPathOffset;
- private DrawableSlider drawableSlider;
+ private DrawableSlider drawableSlider = null!;
[BackgroundDependencyLoader]
private void load(DrawableHitObject drawableObject)
@@ -67,7 +65,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
public void UpdateProgress(double completionProgress)
{
- if (drawableSlider?.HitObject == null)
+ if (drawableSlider.HitObject == null)
return;
Slider slider = drawableSlider.HitObject;
@@ -96,7 +94,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
public void Refresh()
{
- if (drawableSlider?.HitObject == null)
+ if (drawableSlider.HitObject == null)
return;
// Generate the entire curve
diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs
index 15ef7e538b..6d435f01b0 100644
--- a/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs
+++ b/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs
@@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
RelativeSizeAxes = Axes.Both,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
- Child = cursorSprite = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.Cursor), _ => new DefaultCursor(), confineMode: ConfineMode.NoScaling)
+ Child = cursorSprite = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.Cursor), _ => new DefaultCursor(), confineMode: ConfineMode.NoScaling)
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs b/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs
index 533db3ddfe..26fe08972e 100644
--- a/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs
+++ b/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs
@@ -47,8 +47,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
RelativeSizeAxes = Axes.Both,
Children = new[]
{
- cursorTrail = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.CursorTrail), _ => new DefaultCursorTrail(), confineMode: ConfineMode.NoScaling),
- new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.CursorParticles), confineMode: ConfineMode.NoScaling),
+ cursorTrail = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.CursorTrail), _ => new DefaultCursorTrail(), confineMode: ConfineMode.NoScaling),
+ new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.CursorParticles), confineMode: ConfineMode.NoScaling),
}
};
}
diff --git a/osu.Game.Rulesets.Osu/UI/SmokeContainer.cs b/osu.Game.Rulesets.Osu/UI/SmokeContainer.cs
index beba834e88..bf5618dc90 100644
--- a/osu.Game.Rulesets.Osu/UI/SmokeContainer.cs
+++ b/osu.Game.Rulesets.Osu/UI/SmokeContainer.cs
@@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Osu.UI
{
if (e.Action == OsuAction.Smoke)
{
- AddInternal(currentSegmentSkinnable = new SmokeSkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.CursorSmoke), _ => new DefaultSmokeSegment()));
+ AddInternal(currentSegmentSkinnable = new SmokeSkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.CursorSmoke), _ => new DefaultSmokeSegment()));
// Add initial position immediately.
addPosition();
@@ -68,8 +68,8 @@ namespace osu.Game.Rulesets.Osu.UI
public override double LifetimeStart => Drawable.LifetimeStart;
public override double LifetimeEnd => Drawable.LifetimeEnd;
- public SmokeSkinnableDrawable(ISkinComponent component, Func? defaultImplementation = null, ConfineMode confineMode = ConfineMode.NoScaling)
- : base(component, defaultImplementation, confineMode)
+ public SmokeSkinnableDrawable(ISkinComponentLookup lookup, Func? defaultImplementation = null, ConfineMode confineMode = ConfineMode.NoScaling)
+ : base(lookup, defaultImplementation, confineMode)
{
}
}
diff --git a/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableBarLine.cs b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableBarLine.cs
index ad6f08dbd4..a4aa0e1fad 100644
--- a/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableBarLine.cs
+++ b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableBarLine.cs
@@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
var cont = new Container
{
RelativeSizeAxes = Axes.Both,
- Height = 0.8f,
+ Height = 0.2f,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
@@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
var cont = new Container
{
RelativeSizeAxes = Axes.Both,
- Height = 0.8f,
+ Height = 0.2f,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
@@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
var barLine = new BarLine
{
Major = major,
- StartTime = Time.Current + 2000,
+ StartTime = Time.Current + 5000,
};
var cpi = new ControlPointInfo();
diff --git a/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableSwell.cs b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableSwell.cs
new file mode 100644
index 0000000000..b8c0f6f11e
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableSwell.cs
@@ -0,0 +1,39 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using NUnit.Framework;
+using osu.Framework.Graphics;
+using osu.Game.Beatmaps;
+using osu.Game.Beatmaps.ControlPoints;
+using osu.Game.Rulesets.Taiko.Objects;
+using osu.Game.Rulesets.Taiko.Objects.Drawables;
+
+namespace osu.Game.Rulesets.Taiko.Tests.Skinning
+{
+ [TestFixture]
+ public class TestSceneDrawableSwell : TaikoSkinnableTestScene
+ {
+ [Test]
+ public void TestHits()
+ {
+ AddStep("Centre hit", () => SetContents(_ => new DrawableSwell(createHitAtCurrentTime())
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ }));
+ }
+
+ private Swell createHitAtCurrentTime()
+ {
+ var hit = new Swell
+ {
+ StartTime = Time.Current + 3000,
+ EndTime = Time.Current + 6000,
+ };
+
+ hit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
+
+ return hit;
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoPlayfield.cs
index 52d24b567f..eff9f58751 100644
--- a/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoPlayfield.cs
+++ b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoPlayfield.cs
@@ -4,6 +4,7 @@
#nullable disable
using System;
+using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
@@ -25,11 +26,10 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
TimeRange = { Value = 5000 },
};
- public TestSceneTaikoPlayfield()
+ [SetUpSteps]
+ public void SetUpSteps()
{
TaikoBeatmap beatmap;
- bool kiai = false;
-
AddStep("set beatmap", () =>
{
Beatmap.Value = CreateWorkingBeatmap(beatmap = new TaikoBeatmap());
@@ -41,12 +41,28 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
AddStep("Load playfield", () => SetContents(_ => new TaikoPlayfield
{
+ Height = 0.2f,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
- Height = 0.6f,
}));
+ }
+ [Test]
+ public void TestBasic()
+ {
+ AddStep("do nothing", () => { });
+ }
+
+ [Test]
+ public void TestHeightChanges()
+ {
AddRepeatStep("change height", () => this.ChildrenOfType().ForEach(p => p.Height = Math.Max(0.2f, (p.Height + 0.2f) % 1f)), 50);
+ }
+
+ [Test]
+ public void TestKiai()
+ {
+ bool kiai = false;
AddStep("Toggle kiai", () =>
{
diff --git a/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoScroller.cs b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoScroller.cs
index 954b4be7f3..a9304b01ad 100644
--- a/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoScroller.cs
+++ b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoScroller.cs
@@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
public TestSceneTaikoScroller()
{
AddStep("Load scroller", () => SetContents(_ =>
- new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.Scroller), _ => Empty())
+ new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.Scroller), _ => Empty())
{
Clock = new FramedClock(clock),
Height = 0.4f,
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs
index e4806c4a12..2405d5b73f 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs
@@ -1,17 +1,12 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
-using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
-using osu.Framework.Graphics.Containers;
-using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Objects;
-using osuTK;
using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Taiko.Skinning.Default;
using osu.Game.Skinning;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
@@ -28,35 +23,15 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
///
private const float tracker_width = 2f;
- ///
- /// The vertical offset of the triangles from the line tracker.
- ///
- private const float triangle_offset = 10f;
-
- ///
- /// The size of the triangles.
- ///
- private const float triangle_size = 20f;
-
- ///
- /// The visual line tracker.
- ///
- private SkinnableDrawable line;
-
- ///
- /// Container with triangles. Only visible for major lines.
- ///
- private Container triangleContainer;
-
- private readonly Bindable major = new Bindable();
+ public readonly Bindable Major = new Bindable();
public DrawableBarLine()
: this(null)
{
}
- public DrawableBarLine([CanBeNull] BarLine barLine)
- : base(barLine)
+ public DrawableBarLine(BarLine? barLine)
+ : base(barLine!)
{
}
@@ -69,69 +44,23 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
RelativeSizeAxes = Axes.Y;
Width = tracker_width;
- AddRangeInternal(new Drawable[]
+ AddInternal(new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.BarLine), _ => new DefaultBarLine())
{
- line = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.BarLine), _ => new Box
- {
- RelativeSizeAxes = Axes.Both,
- EdgeSmoothness = new Vector2(0.5f, 0),
- })
- {
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- },
- triangleContainer = new Container
- {
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- RelativeSizeAxes = Axes.Both,
- Children = new[]
- {
- new EquilateralTriangle
- {
- Name = "Top",
- Anchor = Anchor.TopCentre,
- Origin = Anchor.TopCentre,
- Position = new Vector2(0, -triangle_offset),
- Size = new Vector2(-triangle_size),
- EdgeSmoothness = new Vector2(1),
- },
- new EquilateralTriangle
- {
- Name = "Bottom",
- Anchor = Anchor.BottomCentre,
- Origin = Anchor.TopCentre,
- Position = new Vector2(0, triangle_offset),
- Size = new Vector2(triangle_size),
- EdgeSmoothness = new Vector2(1),
- }
- }
- }
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
});
}
- protected override void LoadComplete()
- {
- base.LoadComplete();
- major.BindValueChanged(updateMajor, true);
- }
-
- private void updateMajor(ValueChangedEvent major)
- {
- line.Alpha = major.NewValue ? 1f : 0.75f;
- triangleContainer.Alpha = major.NewValue ? 1 : 0;
- }
-
protected override void OnApply()
{
base.OnApply();
- major.BindTo(HitObject.MajorBindable);
+ Major.BindTo(HitObject.MajorBindable);
}
protected override void OnFree()
{
base.OnFree();
- major.UnbindFrom(HitObject.MajorBindable);
+ Major.UnbindFrom(HitObject.MajorBindable);
}
protected override void UpdateHitStateTransforms(ArmedState state)
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
index 98dad96cf6..0bb14c791e 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
@@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
return base.CreateNestedHitObject(hitObject);
}
- protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.DrumRollBody),
+ protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.DrumRollBody),
_ => new ElongatedCirclePiece());
public override bool OnPressed(KeyBindingPressEvent e) => false;
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs
index 451c5a793b..b01adc880a 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs
@@ -5,6 +5,7 @@
using System;
using JetBrains.Annotations;
+using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Objects;
@@ -16,6 +17,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
public class DrawableDrumRollTick : DrawableTaikoStrongableHitObject
{
+ public BindableBool IsFirstTick = new BindableBool();
+
///
/// The hit type corresponding to the that the user pressed to hit this .
///
@@ -32,14 +35,17 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
FillMode = FillMode.Fit;
}
- protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.DrumRollTick),
- _ => new TickPiece
- {
- Filled = HitObject.FirstTick
- });
+ protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.DrumRollTick), _ => new TickPiece());
public override double MaximumJudgementOffset => HitObject.HitWindow;
+ protected override void OnApply()
+ {
+ base.OnApply();
+
+ IsFirstTick.Value = HitObject.FirstTick;
+ }
+
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
if (!userTriggered)
@@ -68,7 +74,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
switch (state)
{
case ArmedState.Hit:
- this.ScaleTo(0, 100, Easing.OutQuint);
+ this.ScaleTo(1.4f, 200, Easing.OutQuint);
+ this.FadeOut(200, Easing.OutQuint);
break;
}
}
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs
index 484f125a09..59c9640beb 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs
@@ -90,8 +90,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
}
protected override SkinnableDrawable CreateMainPiece() => HitObject.Type == HitType.Centre
- ? new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.CentreHit), _ => new CentreHitCirclePiece(), confineMode: ConfineMode.ScaleToFit)
- : new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.RimHit), _ => new RimHitCirclePiece(), confineMode: ConfineMode.ScaleToFit);
+ ? new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.CentreHit), _ => new CentreHitCirclePiece(), confineMode: ConfineMode.ScaleToFit)
+ : new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.RimHit), _ => new RimHitCirclePiece(), confineMode: ConfineMode.ScaleToFit);
public override IEnumerable GetSamples()
{
@@ -201,12 +201,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
break;
case ArmedState.Hit:
- // If we're far enough away from the left stage, we should bring outselves in front of it
+ // If we're far enough away from the left stage, we should bring ourselves in front of it
ProxyContent();
- var flash = (MainPiece.Drawable as CirclePiece)?.FlashBox;
- flash?.FadeTo(0.9f).FadeOut(300);
-
const float gravity_time = 300;
const float gravity_travel_height = 200;
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs
index a6f6edba09..753f85f23f 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs
@@ -125,7 +125,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
targetRing.BorderColour = colours.YellowDark.Opacity(0.25f);
}
- protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.Swell),
+ protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.Swell),
_ => new SwellCirclePiece
{
// to allow for rotation transform
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs
index b2a54176fb..5d44fce254 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs
@@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public override bool OnPressed(KeyBindingPressEvent e) => false;
- protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.DrumRollTick),
+ protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.DrumRollTick),
_ => new TickPiece());
}
}
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs
index c0c80eaa4a..400c2f40b1 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs
@@ -133,6 +133,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
protected override void OnApply()
{
base.OnApply();
+
+ // TODO: THIS CANNOT BE HERE, it makes pooling pointless (see https://github.com/ppy/osu/issues/21072).
RecreatePieces();
}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonBarLine.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonBarLine.cs
new file mode 100644
index 0000000000..402e88b64d
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonBarLine.cs
@@ -0,0 +1,83 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Framework.Bindables;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Taiko.Objects.Drawables;
+using osuTK;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonBarLine : CompositeDrawable
+ {
+ private Container majorEdgeContainer = null!;
+
+ private Bindable major = null!;
+
+ [BackgroundDependencyLoader]
+ private void load(DrawableHitObject drawableHitObject)
+ {
+ RelativeSizeAxes = Axes.Both;
+
+ const float line_offset = 8;
+ var majorPieceSize = new Vector2(6, 20);
+
+ InternalChildren = new Drawable[]
+ {
+ line = new Box
+ {
+ RelativeSizeAxes = Axes.Both,
+ EdgeSmoothness = new Vector2(0.5f, 0),
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ },
+ majorEdgeContainer = new Container
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Children = new[]
+ {
+ new Circle
+ {
+ Name = "Top line",
+ Anchor = Anchor.TopCentre,
+ Origin = Anchor.BottomCentre,
+ Size = majorPieceSize,
+ Y = -line_offset,
+ },
+ new Circle
+ {
+ Name = "Bottom line",
+ Anchor = Anchor.BottomCentre,
+ Origin = Anchor.TopCentre,
+ Size = majorPieceSize,
+ Y = line_offset,
+ },
+ }
+ }
+ };
+
+ major = ((DrawableBarLine)drawableHitObject).Major.GetBoundCopy();
+ }
+
+ protected override void LoadComplete()
+ {
+ base.LoadComplete();
+ major.BindValueChanged(updateMajor, true);
+ }
+
+ private Box line = null!;
+
+ private void updateMajor(ValueChangedEvent major)
+ {
+ line.Alpha = major.NewValue ? 1f : 0.5f;
+ line.Width = major.NewValue ? 1 : 0.5f;
+ majorEdgeContainer.Alpha = major.NewValue ? 1 : 0;
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCentreCirclePiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCentreCirclePiece.cs
new file mode 100644
index 0000000000..551a5af078
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCentreCirclePiece.cs
@@ -0,0 +1,34 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Colour;
+using osu.Framework.Graphics.Sprites;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonCentreCirclePiece : ArgonCirclePiece
+ {
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ AccentColour = ColourInfo.GradientVertical(
+ new Color4(241, 0, 0, 255),
+ new Color4(167, 0, 0, 255)
+ );
+
+ AddInternal(new SpriteIcon
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Icon = FontAwesome.Solid.AngleLeft,
+ Size = new Vector2(ICON_SIZE),
+ Scale = new Vector2(0.8f, 1)
+ });
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCirclePiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCirclePiece.cs
new file mode 100644
index 0000000000..c22c0e9e79
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCirclePiece.cs
@@ -0,0 +1,116 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Framework.Audio.Track;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Colour;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Beatmaps.ControlPoints;
+using osu.Game.Graphics.Containers;
+using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Taiko.Objects;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public abstract class ArgonCirclePiece : BeatSyncedContainer
+ {
+ public const float ICON_SIZE = 20 / 70f;
+
+ private const double pre_beat_transition_time = 80;
+
+ private const float flash_opacity = 0.3f;
+
+ private ColourInfo accentColour;
+
+ ///
+ /// The colour of the inner circle and outer glows.
+ ///
+ public ColourInfo AccentColour
+ {
+ get => accentColour;
+ set
+ {
+ accentColour = value;
+
+ ring.Colour = AccentColour.MultiplyAlpha(0.5f);
+ ring2.Colour = AccentColour;
+ }
+ }
+
+ [Resolved]
+ private DrawableHitObject drawableHitObject { get; set; } = null!;
+
+ private readonly Drawable flash;
+
+ private readonly RingPiece ring;
+ private readonly RingPiece ring2;
+
+ protected ArgonCirclePiece()
+ {
+ RelativeSizeAxes = Axes.Both;
+
+ EarlyActivationMilliseconds = pre_beat_transition_time;
+
+ AddRangeInternal(new[]
+ {
+ new Circle
+ {
+ RelativeSizeAxes = Axes.Both,
+ Colour = new Color4(0, 0, 0, 190)
+ },
+ ring = new RingPiece(20 / 70f),
+ ring2 = new RingPiece(5 / 70f),
+ flash = new Circle
+ {
+ Name = "Flash layer",
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Blending = BlendingParameters.Additive,
+ Alpha = 0,
+ },
+ });
+ }
+
+ protected override void LoadComplete()
+ {
+ base.LoadComplete();
+
+ drawableHitObject.ApplyCustomUpdateState += updateStateTransforms;
+ updateStateTransforms(drawableHitObject, drawableHitObject.State.Value);
+ }
+
+ private void updateStateTransforms(DrawableHitObject h, ArmedState state)
+ {
+ if (h.HitObject is not Hit)
+ return;
+
+ switch (state)
+ {
+ case ArmedState.Hit:
+ using (BeginAbsoluteSequence(h.HitStateUpdateTime))
+ {
+ flash.FadeTo(0.9f).FadeOut(500, Easing.OutQuint);
+ }
+
+ break;
+ }
+ }
+
+ protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
+ {
+ if (!effectPoint.KiaiMode)
+ return;
+
+ if (drawableHitObject.State.Value == ArmedState.Idle)
+ {
+ flash
+ .FadeTo(flash_opacity)
+ .Then()
+ .FadeOut(timingPoint.BeatLength * 0.75, Easing.OutSine);
+ }
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonElongatedCirclePiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonElongatedCirclePiece.cs
new file mode 100644
index 0000000000..f86f181b2e
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonElongatedCirclePiece.cs
@@ -0,0 +1,33 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Colour;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonElongatedCirclePiece : ArgonCirclePiece
+ {
+ public ArgonElongatedCirclePiece()
+ {
+ RelativeSizeAxes = Axes.Y;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ AccentColour = ColourInfo.GradientVertical(
+ new Color4(241, 161, 0, 255),
+ new Color4(167, 111, 0, 255)
+ );
+ }
+
+ protected override void Update()
+ {
+ base.Update();
+ Width = Parent.DrawSize.X + DrawHeight;
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonHitExplosion.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonHitExplosion.cs
new file mode 100644
index 0000000000..05bb9bcb9a
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonHitExplosion.cs
@@ -0,0 +1,87 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Extensions.Color4Extensions;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Colour;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Effects;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Taiko.Objects;
+using osu.Game.Rulesets.Taiko.UI;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonHitExplosion : CompositeDrawable, IAnimatableHitExplosion
+ {
+ private readonly TaikoSkinComponents component;
+ private readonly Circle outer;
+
+ public ArgonHitExplosion(TaikoSkinComponents component)
+ {
+ this.component = component;
+
+ RelativeSizeAxes = Axes.Both;
+
+ InternalChildren = new Drawable[]
+ {
+ outer = new Circle
+ {
+ Name = "Outer circle",
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Colour = ColourInfo.GradientVertical(
+ new Color4(255, 227, 236, 255),
+ new Color4(255, 198, 211, 255)
+ ),
+ Masking = true,
+ },
+ new Circle
+ {
+ Name = "Inner circle",
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Colour = Color4.White,
+ Size = new Vector2(0.85f),
+ EdgeEffect = new EdgeEffectParameters
+ {
+ Type = EdgeEffectType.Glow,
+ Colour = new Color4(255, 132, 191, 255).Opacity(0.5f),
+ Radius = 45,
+ },
+ Masking = true,
+ },
+ };
+ }
+
+ public void Animate(DrawableHitObject drawableHitObject)
+ {
+ this.FadeOut();
+
+ switch (component)
+ {
+ case TaikoSkinComponents.TaikoExplosionGreat:
+ this.FadeIn(30, Easing.In)
+ .Then()
+ .FadeOut(450, Easing.OutQuint);
+ break;
+
+ case TaikoSkinComponents.TaikoExplosionOk:
+ this.FadeTo(0.2f, 30, Easing.In)
+ .Then()
+ .FadeOut(200, Easing.OutQuint);
+ break;
+ }
+ }
+
+ public void AnimateSecondHit()
+ {
+ outer.ResizeTo(new Vector2(TaikoStrongableHitObject.STRONG_SCALE), 500, Easing.OutQuint);
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonHitTarget.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonHitTarget.cs
new file mode 100644
index 0000000000..ec2eccd595
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonHitTarget.cs
@@ -0,0 +1,72 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Rulesets.Taiko.Objects;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonHitTarget : CompositeDrawable
+ {
+ ///
+ /// Thickness of all drawn line pieces.
+ ///
+ public ArgonHitTarget()
+ {
+ RelativeSizeAxes = Axes.Both;
+ Masking = true;
+
+ const float border_thickness = 4f;
+
+ InternalChildren = new Drawable[]
+ {
+ new Circle
+ {
+ Name = "Bar Upper",
+ Anchor = Anchor.TopCentre,
+ Origin = Anchor.TopCentre,
+ Y = -border_thickness,
+ RelativeSizeAxes = Axes.Y,
+ Size = new Vector2(border_thickness, (1 - TaikoStrongableHitObject.DEFAULT_STRONG_SIZE)),
+ },
+ new Circle
+ {
+ Name = "Outer circle",
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Colour = Color4.White,
+ Blending = BlendingParameters.Additive,
+ Alpha = 0.1f,
+ Size = new Vector2(TaikoHitObject.DEFAULT_SIZE),
+ Masking = true,
+ },
+ new Circle
+ {
+ Name = "Inner circle",
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Colour = Color4.White,
+ Blending = BlendingParameters.Additive,
+ Alpha = 0.1f,
+ Size = new Vector2(TaikoHitObject.DEFAULT_SIZE * 0.85f),
+ Masking = true,
+ },
+ new Circle
+ {
+ Name = "Bar Lower",
+ Anchor = Anchor.BottomCentre,
+ Origin = Anchor.BottomCentre,
+ RelativeSizeAxes = Axes.Y,
+ Y = border_thickness,
+ Size = new Vector2(border_thickness, (1 - TaikoStrongableHitObject.DEFAULT_STRONG_SIZE)),
+ },
+ };
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonInputDrum.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonInputDrum.cs
new file mode 100644
index 0000000000..528e75aabb
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonInputDrum.cs
@@ -0,0 +1,218 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using System;
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Colour;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Effects;
+using osu.Framework.Graphics.Shapes;
+using osu.Framework.Input.Bindings;
+using osu.Framework.Input.Events;
+using osu.Game.Graphics;
+using osu.Game.Screens.Ranking;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonInputDrum : AspectContainer
+ {
+ private const float rim_size = 0.3f;
+
+ public ArgonInputDrum()
+ {
+ RelativeSizeAxes = Axes.Y;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ const float middle_split = 6;
+
+ InternalChild = new Container
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Scale = new Vector2(0.9f),
+ Children = new Drawable[]
+ {
+ new TaikoHalfDrum(false)
+ {
+ Name = "Left Half",
+ Anchor = Anchor.Centre,
+ Origin = Anchor.CentreRight,
+ RelativeSizeAxes = Axes.Both,
+ RimAction = TaikoAction.LeftRim,
+ CentreAction = TaikoAction.LeftCentre
+ },
+ new TaikoHalfDrum(true)
+ {
+ Name = "Right Half",
+ Anchor = Anchor.Centre,
+ Origin = Anchor.CentreLeft,
+ RelativeSizeAxes = Axes.Both,
+ RimAction = TaikoAction.RightRim,
+ CentreAction = TaikoAction.RightCentre
+ },
+ new CircularContainer
+ {
+ RelativeSizeAxes = Axes.Both,
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ Masking = true,
+ Children = new Drawable[]
+ {
+ new Box
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ Colour = OsuColour.Gray(38 / 255f),
+ Width = middle_split,
+ RelativeSizeAxes = Axes.Y,
+ },
+ new Box
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ Colour = OsuColour.Gray(48 / 255f),
+ Width = middle_split,
+ Height = 1 - rim_size,
+ RelativeSizeAxes = Axes.Y,
+ },
+ },
+ }
+ }
+ };
+ }
+
+ ///
+ /// A half-drum. Contains one centre and one rim hit.
+ ///
+ private class TaikoHalfDrum : CompositeDrawable, IKeyBindingHandler
+ {
+ ///
+ /// The key to be used for the rim of the half-drum.
+ ///
+ public TaikoAction RimAction;
+
+ ///
+ /// The key to be used for the centre of the half-drum.
+ ///
+ public TaikoAction CentreAction;
+
+ private readonly Drawable rimHit;
+ private readonly Drawable centreHit;
+
+ public TaikoHalfDrum(bool flipped)
+ {
+ Anchor anchor = flipped ? Anchor.CentreLeft : Anchor.CentreRight;
+
+ Masking = true;
+
+ Anchor = anchor;
+ Origin = anchor;
+
+ RelativeSizeAxes = Axes.Both;
+ // Extend maskable region for glow.
+ Height = 2f;
+
+ InternalChildren = new Drawable[]
+ {
+ new Container
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Height = 0.5f,
+ Children = new[]
+ {
+ new Circle
+ {
+ Anchor = anchor,
+ Colour = OsuColour.Gray(51 / 255f),
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both
+ },
+ rimHit = new Circle
+ {
+ Anchor = anchor,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Colour = ColourInfo.GradientHorizontal(
+ new Color4(227, 248, 255, 255),
+ new Color4(198, 245, 255, 255)
+ ),
+ EdgeEffect = new EdgeEffectParameters
+ {
+ Type = EdgeEffectType.Glow,
+ Colour = new Color4(126, 215, 253, 170),
+ Radius = 50,
+ },
+ Alpha = 0,
+ },
+ new Circle
+ {
+ Anchor = anchor,
+ Origin = Anchor.Centre,
+ Colour = OsuColour.Gray(64 / 255f),
+ RelativeSizeAxes = Axes.Both,
+ Size = new Vector2(1 - rim_size)
+ },
+ centreHit = new Circle
+ {
+ Anchor = anchor,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Colour = ColourInfo.GradientHorizontal(
+ new Color4(255, 227, 236, 255),
+ new Color4(255, 198, 211, 255)
+ ),
+ EdgeEffect = new EdgeEffectParameters
+ {
+ Type = EdgeEffectType.Glow,
+ Colour = new Color4(255, 147, 199, 255),
+ Radius = 50,
+ },
+ Size = new Vector2(1 - rim_size),
+ Alpha = 0,
+ }
+ },
+ },
+ };
+ }
+
+ public bool OnPressed(KeyBindingPressEvent e)
+ {
+ Drawable? target = null;
+
+ if (e.Action == CentreAction)
+ target = centreHit;
+ else if (e.Action == RimAction)
+ target = rimHit;
+
+ if (target != null)
+ {
+ const float alpha_amount = 0.5f;
+
+ const float down_time = 40;
+ const float up_time = 750;
+
+ target.Animate(
+ t => t.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, Easing.OutQuint)
+ ).Then(
+ t => t.FadeOut(up_time, Easing.OutQuint)
+ );
+ }
+
+ return false;
+ }
+
+ public void OnReleased(KeyBindingReleaseEvent e)
+ {
+ }
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonJudgementPiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonJudgementPiece.cs
new file mode 100644
index 0000000000..baaf9e41e2
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonJudgementPiece.cs
@@ -0,0 +1,198 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using System;
+using osu.Framework.Allocation;
+using osu.Framework.Extensions;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osu.Framework.Graphics.Sprites;
+using osu.Framework.Utils;
+using osu.Game.Graphics;
+using osu.Game.Graphics.Sprites;
+using osu.Game.Rulesets.Judgements;
+using osu.Game.Rulesets.Scoring;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonJudgementPiece : CompositeDrawable, IAnimatableJudgement
+ {
+ protected readonly HitResult Result;
+
+ protected SpriteText JudgementText { get; private set; } = null!;
+
+ private RingExplosion? ringExplosion;
+
+ [Resolved]
+ private OsuColour colours { get; set; } = null!;
+
+ public ArgonJudgementPiece(HitResult result)
+ {
+ Result = result;
+ RelativePositionAxes = Axes.Both;
+ RelativeSizeAxes = Axes.Both;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ InternalChildren = new Drawable[]
+ {
+ JudgementText = new OsuSpriteText
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ Text = Result.GetDescription().ToUpperInvariant(),
+ Colour = colours.ForHitResult(Result),
+ Blending = BlendingParameters.Additive,
+ Spacing = new Vector2(10, 0),
+ RelativePositionAxes = Axes.Both,
+ Font = OsuFont.Default.With(size: 20, weight: FontWeight.Regular),
+ },
+ };
+
+ if (Result.IsHit())
+ {
+ AddInternal(ringExplosion = new RingExplosion(Result)
+ {
+ Colour = colours.ForHitResult(Result),
+ RelativePositionAxes = Axes.Y,
+ });
+ }
+ }
+
+ ///
+ /// Plays the default animation for this judgement piece.
+ ///
+ ///
+ /// The base implementation only handles fade (for all result types) and misses.
+ /// Individual rulesets are recommended to implement their appropriate hit animations.
+ ///
+ public virtual void PlayAnimation()
+ {
+ const double duration = 800;
+
+ switch (Result)
+ {
+ default:
+ JudgementText.MoveToY(-0.6f)
+ .MoveToY(-1.0f, duration, Easing.OutQuint);
+
+ JudgementText
+ .ScaleTo(Vector2.One)
+ .ScaleTo(new Vector2(1.4f), duration, Easing.OutQuint);
+ break;
+
+ case HitResult.Miss:
+ this.ScaleTo(1.6f);
+ this.ScaleTo(1, 100, Easing.In);
+
+ JudgementText.MoveTo(Vector2.Zero);
+ JudgementText.MoveToOffset(new Vector2(0, 100), duration, Easing.InQuint);
+
+ this.RotateTo(0);
+ this.RotateTo(40, duration, Easing.InQuint);
+ break;
+ }
+
+ this.FadeOutFromOne(duration, Easing.OutQuint);
+
+ ringExplosion?.PlayAnimation();
+ }
+
+ public Drawable? GetAboveHitObjectsProxiedContent() => null;
+
+ private class RingExplosion : CompositeDrawable
+ {
+ private readonly float travel = 58;
+
+ public RingExplosion(HitResult result)
+ {
+ const float thickness = 4;
+
+ const float small_size = 9;
+ const float large_size = 14;
+
+ Anchor = Anchor.Centre;
+ Origin = Anchor.Centre;
+
+ Blending = BlendingParameters.Additive;
+
+ int countSmall = 0;
+ int countLarge = 0;
+
+ switch (result)
+ {
+ case HitResult.Meh:
+ countSmall = 3;
+ travel *= 0.3f;
+ break;
+
+ case HitResult.Ok:
+ case HitResult.Good:
+ countSmall = 4;
+ travel *= 0.6f;
+ break;
+
+ case HitResult.Great:
+ case HitResult.Perfect:
+ countSmall = 4;
+ countLarge = 4;
+ break;
+ }
+
+ for (int i = 0; i < countSmall; i++)
+ AddInternal(new RingPiece(thickness) { Size = new Vector2(small_size) });
+
+ for (int i = 0; i < countLarge; i++)
+ AddInternal(new RingPiece(thickness) { Size = new Vector2(large_size) });
+ }
+
+ public void PlayAnimation()
+ {
+ foreach (var c in InternalChildren)
+ {
+ const float start_position_ratio = 0.6f;
+
+ float direction = RNG.NextSingle(0, 360);
+ float distance = RNG.NextSingle(travel / 2, travel);
+
+ c.MoveTo(new Vector2(
+ MathF.Cos(direction) * distance * start_position_ratio,
+ MathF.Sin(direction) * distance * start_position_ratio
+ ));
+
+ c.MoveTo(new Vector2(
+ MathF.Cos(direction) * distance,
+ MathF.Sin(direction) * distance
+ ), 600, Easing.OutQuint);
+ }
+
+ this.FadeOutFromOne(1000, Easing.OutQuint);
+ }
+
+ public class RingPiece : CircularContainer
+ {
+ public RingPiece(float thickness = 9)
+ {
+ Anchor = Anchor.Centre;
+ Origin = Anchor.Centre;
+
+ Masking = true;
+ BorderThickness = thickness;
+ BorderColour = Color4.White;
+
+ Child = new Box
+ {
+ AlwaysPresent = true,
+ Alpha = 0,
+ RelativeSizeAxes = Axes.Both
+ };
+ }
+ }
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonPlayfieldBackgroundLeft.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonPlayfieldBackgroundLeft.cs
new file mode 100644
index 0000000000..ebde83b607
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonPlayfieldBackgroundLeft.cs
@@ -0,0 +1,27 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonPlayfieldBackgroundLeft : CompositeDrawable
+ {
+ public ArgonPlayfieldBackgroundLeft()
+ {
+ RelativeSizeAxes = Axes.Both;
+
+ InternalChildren = new Drawable[]
+ {
+ new Box
+ {
+ Colour = Color4.Black,
+ RelativeSizeAxes = Axes.Both,
+ },
+ };
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonPlayfieldBackgroundRight.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonPlayfieldBackgroundRight.cs
new file mode 100644
index 0000000000..bd0f3ab276
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonPlayfieldBackgroundRight.cs
@@ -0,0 +1,28 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonPlayfieldBackgroundRight : CompositeDrawable
+ {
+ public ArgonPlayfieldBackgroundRight()
+ {
+ RelativeSizeAxes = Axes.Both;
+
+ InternalChildren = new Drawable[]
+ {
+ new Box
+ {
+ Colour = Color4.Black,
+ Alpha = 0.7f,
+ RelativeSizeAxes = Axes.Both,
+ },
+ };
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonRimCirclePiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonRimCirclePiece.cs
new file mode 100644
index 0000000000..fd81221be3
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonRimCirclePiece.cs
@@ -0,0 +1,34 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Colour;
+using osu.Framework.Graphics.Sprites;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonRimCirclePiece : ArgonCirclePiece
+ {
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ AccentColour = ColourInfo.GradientVertical(
+ new Color4(0, 161, 241, 255),
+ new Color4(0, 111, 167, 255)
+ );
+
+ AddInternal(new SpriteIcon
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Icon = FontAwesome.Solid.AngleLeft,
+ Size = new Vector2(ICON_SIZE),
+ Scale = new Vector2(0.8f, 1)
+ });
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonSwellCirclePiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonSwellCirclePiece.cs
new file mode 100644
index 0000000000..82a6e34128
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonSwellCirclePiece.cs
@@ -0,0 +1,34 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Colour;
+using osu.Framework.Graphics.Sprites;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonSwellCirclePiece : ArgonCirclePiece
+ {
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ AccentColour = ColourInfo.GradientVertical(
+ new Color4(240, 201, 0, 255),
+ new Color4(167, 139, 0, 255)
+ );
+
+ AddInternal(new SpriteIcon
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Icon = FontAwesome.Solid.Asterisk,
+ Size = new Vector2(ICON_SIZE),
+ Scale = new Vector2(0.8f, 1)
+ });
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonTickPiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonTickPiece.cs
new file mode 100644
index 0000000000..df63d4948e
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonTickPiece.cs
@@ -0,0 +1,68 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Framework.Bindables;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osu.Framework.Graphics.Sprites;
+using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Taiko.Objects;
+using osu.Game.Rulesets.Taiko.Objects.Drawables;
+using osuTK;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class ArgonTickPiece : CompositeDrawable
+ {
+ private readonly Bindable isFirstTick = new Bindable();
+
+ public ArgonTickPiece()
+ {
+ const float tick_size = 1 / TaikoHitObject.DEFAULT_SIZE * ArgonCirclePiece.ICON_SIZE;
+
+ Anchor = Anchor.Centre;
+ Origin = Anchor.Centre;
+
+ RelativeSizeAxes = Axes.Both;
+ FillMode = FillMode.Fit;
+ Size = new Vector2(tick_size);
+ }
+
+ [Resolved]
+ private DrawableHitObject drawableHitObject { get; set; } = null!;
+
+ protected override void LoadComplete()
+ {
+ base.LoadComplete();
+
+ if (drawableHitObject is DrawableDrumRollTick drumRollTick)
+ isFirstTick.BindTo(drumRollTick.IsFirstTick);
+
+ isFirstTick.BindValueChanged(first =>
+ {
+ if (first.NewValue)
+ {
+ InternalChild = new Circle
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both
+ };
+ }
+ else
+ {
+ InternalChild = new SpriteIcon
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Icon = FontAwesome.Solid.AngleLeft,
+ Scale = new Vector2(0.8f, 1)
+ };
+ }
+ }, true);
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/RingPiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/RingPiece.cs
new file mode 100644
index 0000000000..534a1c71a3
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/RingPiece.cs
@@ -0,0 +1,40 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osuTK.Graphics;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class RingPiece : CircularContainer
+ {
+ private readonly float relativeBorderThickness;
+
+ public RingPiece(float relativeBorderThickness)
+ {
+ this.relativeBorderThickness = relativeBorderThickness;
+ RelativeSizeAxes = Axes.Both;
+
+ Anchor = Anchor.Centre;
+ Origin = Anchor.Centre;
+
+ Masking = true;
+ BorderColour = Color4.White;
+
+ Child = new Box
+ {
+ AlwaysPresent = true,
+ Alpha = 0,
+ RelativeSizeAxes = Axes.Both
+ };
+ }
+
+ protected override void Update()
+ {
+ base.Update();
+ BorderThickness = relativeBorderThickness * DrawSize.Y;
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/TaikoArgonSkinTransformer.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/TaikoArgonSkinTransformer.cs
new file mode 100644
index 0000000000..a5d091a1c8
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/TaikoArgonSkinTransformer.cs
@@ -0,0 +1,74 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Graphics;
+using osu.Game.Rulesets.Scoring;
+using osu.Game.Skinning;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Argon
+{
+ public class TaikoArgonSkinTransformer : SkinTransformer
+ {
+ public TaikoArgonSkinTransformer(ISkin skin)
+ : base(skin)
+ {
+ }
+
+ public override Drawable? GetDrawableComponent(ISkinComponentLookup component)
+ {
+ switch (component)
+ {
+ case GameplaySkinComponentLookup resultComponent:
+ return new ArgonJudgementPiece(resultComponent.Component);
+
+ case TaikoSkinComponentLookup taikoComponent:
+ // TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
+ switch (taikoComponent.Component)
+ {
+ case TaikoSkinComponents.CentreHit:
+ return new ArgonCentreCirclePiece();
+
+ case TaikoSkinComponents.RimHit:
+ return new ArgonRimCirclePiece();
+
+ case TaikoSkinComponents.PlayfieldBackgroundLeft:
+ return new ArgonPlayfieldBackgroundLeft();
+
+ case TaikoSkinComponents.PlayfieldBackgroundRight:
+ return new ArgonPlayfieldBackgroundRight();
+
+ case TaikoSkinComponents.InputDrum:
+ return new ArgonInputDrum();
+
+ case TaikoSkinComponents.HitTarget:
+ return new ArgonHitTarget();
+
+ case TaikoSkinComponents.BarLine:
+ return new ArgonBarLine();
+
+ case TaikoSkinComponents.DrumRollBody:
+ return new ArgonElongatedCirclePiece();
+
+ case TaikoSkinComponents.DrumRollTick:
+ return new ArgonTickPiece();
+
+ case TaikoSkinComponents.TaikoExplosionKiai:
+ // the drawable needs to expire as soon as possible to avoid accumulating empty drawables on the playfield.
+ return Drawable.Empty().With(d => d.Expire());
+
+ case TaikoSkinComponents.TaikoExplosionGreat:
+ case TaikoSkinComponents.TaikoExplosionMiss:
+ case TaikoSkinComponents.TaikoExplosionOk:
+ return new ArgonHitExplosion(taikoComponent.Component);
+
+ case TaikoSkinComponents.Swell:
+ return new ArgonSwellCirclePiece();
+ }
+
+ break;
+ }
+
+ return base.GetDrawableComponent(component);
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Default/CentreHitCirclePiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Default/CentreHitCirclePiece.cs
index 958f4b3a17..339ab35795 100644
--- a/osu.Game.Rulesets.Taiko/Skinning/Default/CentreHitCirclePiece.cs
+++ b/osu.Game.Rulesets.Taiko/Skinning/Default/CentreHitCirclePiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Default/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Skinning/Default/CirclePiece.cs
index 6b5a9ae6d2..7ddc413d98 100644
--- a/osu.Game.Rulesets.Taiko/Skinning/Default/CirclePiece.cs
+++ b/osu.Game.Rulesets.Taiko/Skinning/Default/CirclePiece.cs
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
-
using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
using osu.Framework.Extensions.Color4Extensions;
@@ -36,6 +34,9 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
private const float flash_opacity = 0.3f;
+ [Resolved]
+ private DrawableHitObject drawableHitObject { get; set; } = null!;
+
private Color4 accentColour;
///
@@ -76,7 +77,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
private readonly Container background;
- public Box FlashBox;
+ private readonly Box flashBox;
protected CirclePiece()
{
@@ -122,7 +123,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
Masking = true,
Children = new[]
{
- FlashBox = new Box
+ flashBox = new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@@ -144,6 +145,28 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
});
}
+ protected override void LoadComplete()
+ {
+ base.LoadComplete();
+
+ drawableHitObject.ApplyCustomUpdateState += updateStateTransforms;
+ updateStateTransforms(drawableHitObject, drawableHitObject.State.Value);
+ }
+
+ private void updateStateTransforms(DrawableHitObject h, ArmedState state)
+ {
+ if (h.HitObject is not Hit)
+ return;
+
+ switch (state)
+ {
+ case ArmedState.Hit:
+ using (BeginAbsoluteSequence(h.HitStateUpdateTime))
+ flashBox.FadeTo(0.9f).FadeOut(300);
+ break;
+ }
+ }
+
private const float edge_alpha_kiai = 0.5f;
private void resetEdgeEffects()
@@ -156,9 +179,6 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
};
}
- [Resolved]
- private DrawableHitObject drawableHitObject { get; set; }
-
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
{
if (!effectPoint.KiaiMode)
@@ -166,7 +186,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
if (drawableHitObject.State.Value == ArmedState.Idle)
{
- FlashBox
+ flashBox
.FadeTo(flash_opacity)
.Then()
.FadeOut(timingPoint.BeatLength * 0.75, Easing.OutSine);
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultBarLine.cs b/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultBarLine.cs
new file mode 100644
index 0000000000..973e685bc7
--- /dev/null
+++ b/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultBarLine.cs
@@ -0,0 +1,94 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Framework.Bindables;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Taiko.Objects.Drawables;
+using osuTK;
+
+namespace osu.Game.Rulesets.Taiko.Skinning.Default
+{
+ public class DefaultBarLine : CompositeDrawable
+ {
+ ///
+ /// The vertical offset of the triangles from the line tracker.
+ ///
+ private const float triangle_offset = 10f;
+
+ ///
+ /// The size of the triangles.
+ ///
+ private const float triangle_size = 20f;
+
+ ///
+ /// Container with triangles. Only visible for major lines.
+ ///
+ private Container triangleContainer = null!;
+
+ private Bindable major = null!;
+
+ [BackgroundDependencyLoader]
+ private void load(DrawableHitObject drawableHitObject)
+ {
+ RelativeSizeAxes = Axes.Both;
+
+ InternalChildren = new Drawable[]
+ {
+ line = new Box
+ {
+ RelativeSizeAxes = Axes.Both,
+ EdgeSmoothness = new Vector2(0.5f, 0),
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ },
+ triangleContainer = new Container
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ Children = new[]
+ {
+ new EquilateralTriangle
+ {
+ Name = "Top",
+ Anchor = Anchor.TopCentre,
+ Origin = Anchor.TopCentre,
+ Position = new Vector2(0, -triangle_offset),
+ Size = new Vector2(-triangle_size),
+ EdgeSmoothness = new Vector2(1),
+ },
+ new EquilateralTriangle
+ {
+ Name = "Bottom",
+ Anchor = Anchor.BottomCentre,
+ Origin = Anchor.TopCentre,
+ Position = new Vector2(0, triangle_offset),
+ Size = new Vector2(triangle_size),
+ EdgeSmoothness = new Vector2(1),
+ }
+ }
+ }
+ };
+
+ major = ((DrawableBarLine)drawableHitObject).Major.GetBoundCopy();
+ }
+
+ protected override void LoadComplete()
+ {
+ base.LoadComplete();
+ major.BindValueChanged(updateMajor, true);
+ }
+
+ private Box line = null!;
+
+ private void updateMajor(ValueChangedEvent major)
+ {
+ line.Alpha = major.NewValue ? 1f : 0.75f;
+ triangleContainer.Alpha = major.NewValue ? 1 : 0;
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultHitExplosion.cs b/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultHitExplosion.cs
index b7ba76effa..2e76396a4d 100644
--- a/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultHitExplosion.cs
+++ b/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultHitExplosion.cs
@@ -10,6 +10,7 @@ using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.UI;
+using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Taiko.Skinning.Default
@@ -74,6 +75,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
public void AnimateSecondHit()
{
+ this.ResizeTo(new Vector2(TaikoStrongableHitObject.STRONG_SCALE), 50);
}
}
}
diff --git a/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultInputDrum.cs b/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultInputDrum.cs
index fa60d209e7..3d0578dbc0 100644
--- a/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultInputDrum.cs
+++ b/osu.Game.Rulesets.Taiko/Skinning/Default/DefaultInputDrum.cs
@@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-#nullable disable
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@@ -135,8 +134,8 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
public bool OnPressed(KeyBindingPressEvent