From c60f13dd92133d8d7359450cf1e3284bbfda2bc3 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 31 Aug 2023 17:30:27 +0900 Subject: [PATCH] Remove mania hold note ticks --- .../TestSceneHoldNoteInput.cs | 57 --------- .../Objects/Drawables/DrawableHoldNote.cs | 17 --- .../Objects/Drawables/DrawableHoldNoteTick.cs | 110 ------------------ osu.Game.Rulesets.Mania/Objects/HoldNote.cs | 34 ------ .../Objects/HoldNoteTick.cs | 19 --- osu.Game.Rulesets.Mania/UI/Column.cs | 1 - osu.Game.Rulesets.Mania/UI/Stage.cs | 4 - 7 files changed, 242 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs delete mode 100644 osu.Game.Rulesets.Mania/Objects/HoldNoteTick.cs diff --git a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs index ebf25d7a9b..1bf768012e 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs @@ -54,7 +54,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Miss); - assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.Miss); assertNoteJudgement(HitResult.IgnoreMiss); } @@ -73,7 +72,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Perfect); - assertTickJudgement(HitResult.LargeTickHit); assertTailJudgement(HitResult.Perfect); assertNoteJudgement(HitResult.IgnoreHit); } @@ -92,7 +90,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Perfect); - assertTickJudgement(HitResult.LargeTickHit); assertTailJudgement(HitResult.Miss); assertNoteJudgement(HitResult.IgnoreMiss); } @@ -111,7 +108,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Miss); - assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.Miss); } @@ -129,7 +125,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Miss); - assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.Miss); } @@ -149,7 +144,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Perfect); - assertTickJudgement(HitResult.LargeTickHit); assertTailJudgement(HitResult.Miss); } @@ -169,7 +163,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Perfect); - assertTickJudgement(HitResult.LargeTickHit); assertTailJudgement(HitResult.Perfect); } @@ -188,7 +181,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Perfect); - assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.Miss); } @@ -227,7 +219,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Perfect); - assertTickJudgement(HitResult.LargeTickHit); assertTailJudgement(HitResult.Miss); } @@ -247,7 +238,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Perfect); - assertTickJudgement(HitResult.LargeTickHit); assertTailJudgement(HitResult.Meh); } @@ -265,7 +255,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Miss); - assertTickJudgement(HitResult.LargeTickHit); assertTailJudgement(HitResult.Miss); } @@ -283,7 +272,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Miss); - assertTickJudgement(HitResult.LargeTickHit); assertTailJudgement(HitResult.Meh); } @@ -377,7 +365,6 @@ namespace osu.Game.Rulesets.Mania.Tests }, beatmap); assertHeadJudgement(HitResult.Miss); - assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.Miss); assertHitObjectJudgement(note, HitResult.Good); @@ -424,7 +411,6 @@ namespace osu.Game.Rulesets.Mania.Tests }, beatmap); assertHeadJudgement(HitResult.Miss); - assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.Miss); assertHitObjectJudgement(note, HitResult.Great); @@ -444,7 +430,6 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Miss); - assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.Meh); } @@ -495,42 +480,6 @@ namespace osu.Game.Rulesets.Mania.Tests .All(j => j.Type.IsHit())); } - [Test] - public void TestHitTailBeforeLastTick() - { - const int tick_rate = 8; - const double tick_spacing = TimingControlPoint.DEFAULT_BEAT_LENGTH / tick_rate; - const double time_last_tick = time_head + tick_spacing * (int)((time_tail - time_head) / tick_spacing - 1); - - var beatmap = new Beatmap - { - HitObjects = - { - new HoldNote - { - StartTime = time_head, - Duration = time_tail - time_head, - Column = 0, - } - }, - BeatmapInfo = - { - Difficulty = new BeatmapDifficulty { SliderTickRate = tick_rate }, - Ruleset = new ManiaRuleset().RulesetInfo - }, - }; - - performTest(new List - { - new ManiaReplayFrame(time_head, ManiaAction.Key1), - new ManiaReplayFrame(time_last_tick - 5) - }, beatmap); - - assertHeadJudgement(HitResult.Perfect); - assertLastTickJudgement(HitResult.LargeTickMiss); - assertTailJudgement(HitResult.Ok); - } - [Test] public void TestZeroLength() { @@ -570,12 +519,6 @@ namespace osu.Game.Rulesets.Mania.Tests private void assertNoteJudgement(HitResult result) => AddAssert($"hold note judged as {result}", () => judgementResults.Single(j => j.HitObject is HoldNote).Type, () => Is.EqualTo(result)); - private void assertTickJudgement(HitResult result) - => AddAssert($"any tick judged as {result}", () => judgementResults.Where(j => j.HitObject is HoldNoteTick).Select(j => j.Type), () => Does.Contain(result)); - - private void assertLastTickJudgement(HitResult result) - => AddAssert($"last tick judged as {result}", () => judgementResults.Last(j => j.HitObject is HoldNoteTick).Type, () => Is.EqualTo(result)); - private ScoreAccessibleReplayPlayer currentPlayer = null!; private void performTest(List frames, Beatmap? beatmap = null) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index c3fec92b92..3032a3ee39 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -38,7 +38,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables private Container headContainer; private Container tailContainer; - private Container tickContainer; private PausableSkinnableSound slidingSample; @@ -110,7 +109,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { RelativeSizeAxes = Axes.X }, - tickContainer = new Container { RelativeSizeAxes = Axes.Both }, tailContainer = new Container { RelativeSizeAxes = Axes.Both }, slidingSample = new PausableSkinnableSound { Looping = true } }); @@ -118,7 +116,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables maskedContents.AddRange(new[] { bodyPiece.CreateProxy(), - tickContainer.CreateProxy(), tailContainer.CreateProxy(), }); } @@ -153,10 +150,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables case DrawableHoldNoteTail tail: tailContainer.Child = tail; break; - - case DrawableHoldNoteTick tick: - tickContainer.Add(tick); - break; } } @@ -165,7 +158,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables base.ClearNestedHitObjects(); headContainer.Clear(false); tailContainer.Clear(false); - tickContainer.Clear(false); } protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject) @@ -177,9 +169,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables case HeadNote head: return new DrawableHoldNoteHead(head); - - case HoldNoteTick tick: - return new DrawableHoldNoteTick(tick); } return base.CreateNestedHitObject(hitObject); @@ -266,12 +255,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { if (Tail.AllJudged) { - foreach (var tick in tickContainer) - { - if (!tick.Judged) - tick.MissForcefully(); - } - if (Tail.IsHit) ApplyResult(r => r.Type = r.Judgement.MaxResult); else diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs deleted file mode 100644 index ce6a83f79f..0000000000 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ /dev/null @@ -1,110 +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 System; -using System.Diagnostics; -using osu.Framework.Allocation; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Effects; -using osu.Framework.Graphics.Shapes; - -namespace osu.Game.Rulesets.Mania.Objects.Drawables -{ - /// - /// Visualises a hit object. - /// - public partial class DrawableHoldNoteTick : DrawableManiaHitObject - { - /// - /// References the time at which the user started holding the hold note. - /// - private Func holdStartTime; - - private Container glowContainer; - - public DrawableHoldNoteTick() - : this(null) - { - } - - public DrawableHoldNoteTick(HoldNoteTick hitObject) - : base(hitObject) - { - Anchor = Anchor.TopCentre; - Origin = Anchor.TopCentre; - - RelativeSizeAxes = Axes.X; - } - - [BackgroundDependencyLoader] - private void load() - { - AddInternal(glowContainer = new CircularContainer - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Both, - Masking = true, - Children = new[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true - } - } - }); - } - - protected override void LoadComplete() - { - base.LoadComplete(); - - AccentColour.BindValueChanged(colour => - { - glowContainer.EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Glow, - Radius = 2f, - Roundness = 15f, - Colour = colour.NewValue.Opacity(0.3f) - }; - }, true); - } - - protected override void OnApply() - { - base.OnApply(); - - Debug.Assert(ParentHitObject != null); - - var holdNote = (DrawableHoldNote)ParentHitObject; - holdStartTime = () => holdNote.HoldStartTime; - } - - protected override void OnFree() - { - base.OnFree(); - - holdStartTime = null; - } - - protected override void CheckForResult(bool userTriggered, double timeOffset) - { - if (Time.Current < HitObject.StartTime) - return; - - double? startTime = holdStartTime?.Invoke(); - - if (startTime == null || startTime > HitObject.StartTime) - ApplyResult(r => r.Type = r.Judgement.MinResult); - else - ApplyResult(r => r.Type = r.Judgement.MaxResult); - } - } -} diff --git a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs index c367886efe..333912dd0c 100644 --- a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs @@ -6,8 +6,6 @@ using System.Collections.Generic; using System.Threading; using osu.Game.Audio; -using osu.Game.Beatmaps; -using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; @@ -83,25 +81,10 @@ namespace osu.Game.Rulesets.Mania.Objects public override double MaximumJudgementOffset => Tail.MaximumJudgementOffset; - /// - /// The time between ticks of this hold. - /// - private double tickSpacing = 50; - - protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty) - { - base.ApplyDefaultsToSelf(controlPointInfo, difficulty); - - TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime); - tickSpacing = timingPoint.BeatLength / difficulty.SliderTickRate; - } - protected override void CreateNestedHitObjects(CancellationToken cancellationToken) { base.CreateNestedHitObjects(cancellationToken); - createTicks(cancellationToken); - AddNested(Head = new HeadNote { StartTime = StartTime, @@ -117,23 +100,6 @@ namespace osu.Game.Rulesets.Mania.Objects }); } - private void createTicks(CancellationToken cancellationToken) - { - if (tickSpacing == 0) - return; - - for (double t = StartTime + tickSpacing; t <= EndTime - tickSpacing; t += tickSpacing) - { - cancellationToken.ThrowIfCancellationRequested(); - - AddNested(new HoldNoteTick - { - StartTime = t, - Column = Column - }); - } - } - public override Judgement CreateJudgement() => new IgnoreJudgement(); protected override HitWindows CreateHitWindows() => HitWindows.Empty; diff --git a/osu.Game.Rulesets.Mania/Objects/HoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/HoldNoteTick.cs deleted file mode 100644 index e5c5260a49..0000000000 --- a/osu.Game.Rulesets.Mania/Objects/HoldNoteTick.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Mania.Judgements; -using osu.Game.Rulesets.Scoring; - -namespace osu.Game.Rulesets.Mania.Objects -{ - /// - /// A scoring tick of a hold note. - /// - public class HoldNoteTick : ManiaHitObject - { - public override Judgement CreateJudgement() => new HoldNoteTickJudgement(); - - protected override HitWindows CreateHitWindows() => HitWindows.Empty; - } -} diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index f38571a6d3..1c4f0462ec 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -112,7 +112,6 @@ namespace osu.Game.Rulesets.Mania.UI RegisterPool(10, 50); RegisterPool(10, 50); RegisterPool(10, 50); - RegisterPool(50, 250); } private void onSourceChanged() diff --git a/osu.Game.Rulesets.Mania/UI/Stage.cs b/osu.Game.Rulesets.Mania/UI/Stage.cs index 4382f8e84a..fa9af6d157 100644 --- a/osu.Game.Rulesets.Mania/UI/Stage.cs +++ b/osu.Game.Rulesets.Mania/UI/Stage.cs @@ -195,10 +195,6 @@ namespace osu.Game.Rulesets.Mania.UI if (!judgedObject.DisplayResult || !DisplayJudgements.Value) return; - // Tick judgements should not display text. - if (judgedObject is DrawableHoldNoteTick) - return; - judgements.Clear(false); judgements.Add(judgementPool.Get(j => {