Skip to content

Commit

Permalink
Fix tests + InspectCode
Browse files Browse the repository at this point in the history
  • Loading branch information
longnguyen2004 committed Apr 5, 2024
1 parent 0bafb29 commit 3b279fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneHoldNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public void TestTailOrigin()
AddStep("set tail origin to regular", () =>
{
foreach (var holdNote in CreatedDrawables.SelectMany(d => d.ChildrenOfType<DrawableHoldNote>()))
((Bindable<HoldNoteTailOrigin>)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<DrawableHoldNote>()))
((Bindable<HoldNoteTailOrigin>)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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ public partial class DrawableHoldNoteTail : DrawableNote

private HoldNoteTailOrigin tailOrigin = HoldNoteTailOrigin.Regular;

public HoldNoteTailOrigin TailOrigin => tailOrigin;
public HoldNoteTailOrigin TailOrigin
{
get => tailOrigin;
set
{
tailOrigin = value;
updateTailOrigin();
}
}

public DrawableHoldNoteTail()
: this(null)
Expand All @@ -38,11 +46,6 @@ public DrawableHoldNoteTail(TailNote tailNote)
Origin = Anchor.TopCentre;
}

protected override void LoadComplete()
{
base.LoadComplete();
}

public void UpdateResult() => base.UpdateResult(true);

protected override void CheckForResult(bool userTriggered, double timeOffset) =>
Expand Down Expand Up @@ -70,7 +73,6 @@ protected override void ApplySkin(ISkinSource skin, bool allowFallback)
{
base.ApplySkin(skin, allowFallback);
tailOrigin = skin.GetConfig<ManiaSkinConfigurationLookup, HoldNoteTailOrigin>(new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.HoldNoteTailOrigin))?.Value ?? HoldNoteTailOrigin.Regular;
updateTailOrigin();
}

protected override void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)
Expand Down

0 comments on commit 3b279fd

Please sign in to comment.