From 3b279fd4d274956cdc0c7c1d89b5d8b8cfcbf794 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Fri, 5 Apr 2024 19:45:16 +0700 Subject: [PATCH] Fix tests + InspectCode --- .../Skinning/TestSceneHoldNote.cs | 4 ++-- .../Objects/Drawables/DrawableHoldNoteTail.cs | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneHoldNote.cs b/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneHoldNote.cs index 68856cb11c..e5098054a3 100644 --- a/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneHoldNote.cs +++ b/osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneHoldNote.cs @@ -45,14 +45,14 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning AddStep("set tail origin to regular", () => { foreach (var holdNote in CreatedDrawables.SelectMany(d => d.ChildrenOfType())) - ((Bindable)holdNote.Tail.TailOrigin).Value = HoldNoteTailOrigin.Regular; + holdNote.Tail.TailOrigin = HoldNoteTailOrigin.Regular; }); AddStep("change direction to down", () => ScrollingInfo.Direction.Value = ScrollingDirection.Down); AddStep("change direction to up", () => ScrollingInfo.Direction.Value = ScrollingDirection.Up); AddStep("set tail origin to inverted", () => { foreach (var holdNote in CreatedDrawables.SelectMany(d => d.ChildrenOfType())) - ((Bindable)holdNote.Tail.TailOrigin).Value = HoldNoteTailOrigin.Inverted; + holdNote.Tail.TailOrigin = HoldNoteTailOrigin.Inverted; }); AddStep("change direction to down", () => ScrollingInfo.Direction.Value = ScrollingDirection.Down); AddStep("change direction to up", () => ScrollingInfo.Direction.Value = ScrollingDirection.Up); diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTail.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTail.cs index 4736e78b34..4db1e9c740 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTail.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTail.cs @@ -24,7 +24,15 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables private HoldNoteTailOrigin tailOrigin = HoldNoteTailOrigin.Regular; - public HoldNoteTailOrigin TailOrigin => tailOrigin; + public HoldNoteTailOrigin TailOrigin + { + get => tailOrigin; + set + { + tailOrigin = value; + updateTailOrigin(); + } + } public DrawableHoldNoteTail() : this(null) @@ -38,11 +46,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Origin = Anchor.TopCentre; } - protected override void LoadComplete() - { - base.LoadComplete(); - } - public void UpdateResult() => base.UpdateResult(true); protected override void CheckForResult(bool userTriggered, double timeOffset) => @@ -70,7 +73,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { base.ApplySkin(skin, allowFallback); tailOrigin = skin.GetConfig(new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.HoldNoteTailOrigin))?.Value ?? HoldNoteTailOrigin.Regular; - updateTailOrigin(); } protected override void OnDirectionChanged(ValueChangedEvent e)