From d2775680e66129c34297246ce047914d2b94fd90 Mon Sep 17 00:00:00 2001 From: Chandler Stowell Date: Wed, 24 Jan 2024 13:13:45 -0500 Subject: [PATCH 01/86] use stack to pass action state when applying hit results this removes closure allocations --- .../Drawables/DrawableEmptyFreeformHitObject.cs | 2 +- .../Drawables/DrawablePippidonHitObject.cs | 7 ++++++- .../Drawables/DrawableEmptyScrollingHitObject.cs | 2 +- .../Drawables/DrawablePippidonHitObject.cs | 7 ++++++- .../Objects/Drawables/DrawableCatchHitObject.cs | 7 ++++++- .../Objects/Drawables/DrawableHoldNote.cs | 2 +- .../Objects/Drawables/DrawableHoldNoteBody.cs | 2 +- .../Objects/Drawables/DrawableManiaHitObject.cs | 2 +- .../Objects/Drawables/DrawableNote.cs | 4 ++-- .../Objects/Drawables/DrawableHitCircle.cs | 15 ++++++++------- .../Objects/Drawables/DrawableOsuHitObject.cs | 4 ++-- .../Objects/Drawables/DrawableSlider.cs | 13 ++++++++----- .../Objects/Drawables/DrawableSpinner.cs | 12 ++++++------ .../Objects/Drawables/DrawableSpinnerTick.cs | 2 +- .../Objects/Drawables/DrawableDrumRoll.cs | 7 +++++-- .../Objects/Drawables/DrawableDrumRollTick.cs | 11 +++++++---- .../Objects/Drawables/DrawableFlyingHit.cs | 2 +- .../Objects/Drawables/DrawableHit.cs | 12 ++++++------ .../Objects/Drawables/DrawableStrongNestedHit.cs | 2 +- .../Objects/Drawables/DrawableSwell.cs | 8 ++++++-- .../Objects/Drawables/DrawableSwellTick.cs | 5 ++++- .../Objects/Drawables/DrawableHitObject.cs | 13 +++++++++++-- 22 files changed, 91 insertions(+), 50 deletions(-) diff --git a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs index 744e207b57..e8f511bc4b 100644 --- a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs +++ b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.EmptyFreeform.Objects.Drawables { if (timeOffset >= 0) // todo: implement judgement logic - ApplyResult(r => r.Type = HitResult.Perfect); + ApplyResult(static r => r.Type = HitResult.Perfect); } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs index c5ada4288d..a8bb57ba18 100644 --- a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs +++ b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs @@ -49,7 +49,12 @@ namespace osu.Game.Rulesets.Pippidon.Objects.Drawables protected override void CheckForResult(bool userTriggered, double timeOffset) { if (timeOffset >= 0) - ApplyResult(r => r.Type = IsHovered ? HitResult.Perfect : HitResult.Miss); + { + ApplyResult(static (r, isHovered) => + { + r.Type = isHovered ? HitResult.Perfect : HitResult.Miss; + }, IsHovered); + } } protected override double InitialLifetimeOffset => time_preempt; diff --git a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs index a3c3b89105..070a802aea 100644 --- a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs +++ b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.EmptyScrolling.Objects.Drawables { if (timeOffset >= 0) // todo: implement judgement logic - ApplyResult(r => r.Type = HitResult.Perfect); + ApplyResult(static r => r.Type = HitResult.Perfect); } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs index d198fa81cb..9983ec20b0 100644 --- a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs +++ b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs @@ -49,7 +49,12 @@ namespace osu.Game.Rulesets.Pippidon.Objects.Drawables protected override void CheckForResult(bool userTriggered, double timeOffset) { if (timeOffset >= 0) - ApplyResult(r => r.Type = currentLane.Value == HitObject.Lane ? HitResult.Perfect : HitResult.Miss); + { + ApplyResult(static (r, pippidonHitObject) => + { + r.Type = pippidonHitObject.currentLane.Value == pippidonHitObject.HitObject.Lane ? HitResult.Perfect : HitResult.Miss; + }, this); + } } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs index 7f8c17861d..5a921f36f5 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs @@ -63,7 +63,12 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables if (CheckPosition == null) return; if (timeOffset >= 0 && Result != null) - ApplyResult(r => r.Type = CheckPosition.Invoke(HitObject) ? r.Judgement.MaxResult : r.Judgement.MinResult); + { + ApplyResult(static (r, state) => + { + r.Type = state.CheckPosition.Invoke(state.HitObject) ? r.Judgement.MaxResult : r.Judgement.MinResult; + }, this); + } } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 3490d50871..e5056d5167 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -265,7 +265,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (Tail.AllJudged) { if (Tail.IsHit) - ApplyResult(r => r.Type = r.Judgement.MaxResult); + ApplyResult(static r => r.Type = r.Judgement.MaxResult); else MissForcefully(); } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs index 1b2efbafdf..317da0580c 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { if (AllJudged) return; - ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult); + ApplyResult(static (r, hit) => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult, hit); } } } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs index 8498fd36de..dea0817869 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs @@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables /// /// Causes this to get missed, disregarding all conditions in implementations of . /// - public virtual void MissForcefully() => ApplyResult(r => r.Type = r.Judgement.MinResult); + public virtual void MissForcefully() => ApplyResult(static r => r.Type = r.Judgement.MinResult); } public abstract partial class DrawableManiaHitObject : DrawableManiaHitObject diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 680009bc4c..985007f905 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -89,7 +89,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static r => r.Type = r.Judgement.MinResult); return; } @@ -100,7 +100,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables result = GetCappedResult(result); - ApplyResult(r => r.Type = result); + ApplyResult(static (r, result) => r.Type = result, result); } /// diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 0d665cad0c..8284229d82 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -155,7 +155,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static r => r.Type = r.Judgement.MinResult); return; } @@ -169,19 +169,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (result == HitResult.None || clickAction != ClickAction.Hit) return; - ApplyResult(r => + ApplyResult(static (r, state) => { + var (hitCircle, hitResult) = state; var circleResult = (OsuHitCircleJudgementResult)r; // Todo: This should also consider misses, but they're a little more interesting to handle, since we don't necessarily know the position at the time of a miss. - if (result.IsHit()) + if (hitResult.IsHit()) { - var localMousePosition = ToLocalSpace(inputManager.CurrentState.Mouse.Position); - circleResult.CursorPositionAtHit = HitObject.StackedPosition + (localMousePosition - DrawSize / 2); + var localMousePosition = hitCircle.ToLocalSpace(hitCircle.inputManager.CurrentState.Mouse.Position); + circleResult.CursorPositionAtHit = hitCircle.HitObject.StackedPosition + (localMousePosition - hitCircle.DrawSize / 2); } - circleResult.Type = result; - }); + circleResult.Type = hitResult; + }, (this, result)); } /// diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 5b379a0d90..cc06d009c9 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -100,12 +100,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// /// Causes this to get hit, disregarding all conditions in implementations of . /// - public void HitForcefully() => ApplyResult(r => r.Type = r.Judgement.MaxResult); + public void HitForcefully() => ApplyResult(static r => r.Type = r.Judgement.MaxResult); /// /// Causes this to get missed, disregarding all conditions in implementations of . /// - public void MissForcefully() => ApplyResult(r => r.Type = r.Judgement.MinResult); + public void MissForcefully() => ApplyResult(static r => r.Type = r.Judgement.MinResult); private RectangleF parentScreenSpaceRectangle => ((DrawableOsuHitObject)ParentHitObject)?.parentScreenSpaceRectangle ?? Parent!.ScreenSpaceDrawQuad.AABBFloat; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index baec200107..3c298cc6af 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -292,10 +292,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (HitObject.ClassicSliderBehaviour) { // Classic behaviour means a slider is judged proportionally to the number of nested hitobjects hit. This is the classic osu!stable scoring. - ApplyResult(r => + ApplyResult(static (r, nestedHitObjects) => { - int totalTicks = NestedHitObjects.Count; - int hitTicks = NestedHitObjects.Count(h => h.IsHit); + int totalTicks = nestedHitObjects.Count; + int hitTicks = nestedHitObjects.Count(h => h.IsHit); if (hitTicks == totalTicks) r.Type = HitResult.Great; @@ -306,13 +306,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables double hitFraction = (double)hitTicks / totalTicks; r.Type = hitFraction >= 0.5 ? HitResult.Ok : HitResult.Meh; } - }); + }, NestedHitObjects); } else { // If only the nested hitobjects are judged, then the slider's own judgement is ignored for scoring purposes. // But the slider needs to still be judged with a reasonable hit/miss result for visual purposes (hit/miss transforms, etc). - ApplyResult(r => r.Type = NestedHitObjects.Any(h => h.Result.IsHit) ? r.Judgement.MaxResult : r.Judgement.MinResult); + ApplyResult(static (r, nestedHitObjects) => + { + r.Type = nestedHitObjects.Any(h => h.Result.IsHit) ? r.Judgement.MaxResult : r.Judgement.MinResult; + }, NestedHitObjects); } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index bf4b07eaab..d21d02c8ce 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -258,17 +258,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var tick in ticks.Where(t => !t.Result.HasResult)) tick.TriggerResult(false); - ApplyResult(r => + ApplyResult(static (r, spinner) => { - if (Progress >= 1) + if (spinner.Progress >= 1) r.Type = HitResult.Great; - else if (Progress > .9) + else if (spinner.Progress > .9) r.Type = HitResult.Ok; - else if (Progress > .75) + else if (spinner.Progress > .75) r.Type = HitResult.Meh; - else if (Time.Current >= HitObject.EndTime) + else if (spinner.Time.Current >= spinner.HitObject.EndTime) r.Type = r.Judgement.MinResult; - }); + }, this); } protected override void Update() diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs index 5b55533edd..1c3ff29118 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs @@ -35,6 +35,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// Apply a judgement result. /// /// Whether this tick was reached. - internal void TriggerResult(bool hit) => ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult); + internal void TriggerResult(bool hit) => ApplyResult(static (r, hit) => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult, hit); } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index 2bf0c04adf..d3fe363857 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (timeOffset < 0) return; - ApplyResult(r => r.Type = r.Judgement.MaxResult); + ApplyResult(static r => r.Type = r.Judgement.MaxResult); } protected override void UpdateHitStateTransforms(ArmedState state) @@ -192,7 +192,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!ParentHitObject.Judged) return; - ApplyResult(r => r.Type = ParentHitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult); + ApplyResult(static (r, parentHitObject) => + { + r.Type = parentHitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult; + }, ParentHitObject); } 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 c900165d34..de9a3a31c5 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -49,14 +49,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!userTriggered) { if (timeOffset > HitObject.HitWindow) - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static r => r.Type = r.Judgement.MinResult); return; } if (Math.Abs(timeOffset) > HitObject.HitWindow) return; - ApplyResult(r => r.Type = r.Judgement.MaxResult); + ApplyResult(static r => r.Type = r.Judgement.MaxResult); } public override void OnKilled() @@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables base.OnKilled(); if (Time.Current > HitObject.GetEndTime() && !Judged) - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static r => r.Type = r.Judgement.MinResult); } protected override void UpdateHitStateTransforms(ArmedState state) @@ -105,7 +105,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!ParentHitObject.Judged) return; - ApplyResult(r => r.Type = ParentHitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult); + ApplyResult(static (r, parentHitObject) => + { + r.Type = parentHitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult; + }, ParentHitObject); } public override bool OnPressed(KeyBindingPressEvent e) => false; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs index a039ce3407..1332b9e950 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables protected override void LoadComplete() { base.LoadComplete(); - ApplyResult(r => r.Type = r.Judgement.MaxResult); + ApplyResult(static r => r.Type = r.Judgement.MaxResult); } protected override void LoadSamples() diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 1ef426854e..c3bd76bf81 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static r => r.Type = r.Judgement.MinResult); return; } @@ -108,9 +108,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables return; if (!validActionPressed) - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static r => r.Type = r.Judgement.MinResult); else - ApplyResult(r => r.Type = result); + ApplyResult(static (r, result) => r.Type = result, result); } public override bool OnPressed(KeyBindingPressEvent e) @@ -209,19 +209,19 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!ParentHitObject.Result.IsHit) { - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static r => r.Type = r.Judgement.MinResult); return; } if (!userTriggered) { if (timeOffset - ParentHitObject.Result.TimeOffset > SECOND_HIT_WINDOW) - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static r => r.Type = r.Judgement.MinResult); return; } if (Math.Abs(timeOffset - ParentHitObject.Result.TimeOffset) <= SECOND_HIT_WINDOW) - ApplyResult(r => r.Type = r.Judgement.MaxResult); + ApplyResult(static r => r.Type = r.Judgement.MaxResult); } public override bool OnPressed(KeyBindingPressEvent e) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs index 724d59edcd..4080c14066 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs @@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables // it can happen that the hit window of the nested strong hit extends past the lifetime of the parent object. // this is a safety to prevent such cases from causing the nested hit to never be judged and as such prevent gameplay from completing. if (!Judged && Time.Current > ParentHitObject?.HitObject.GetEndTime()) - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static r => r.Type = r.Judgement.MinResult); } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index e4a083f218..d48b78283b 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -206,7 +206,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, Easing.OutQuint); if (numHits == HitObject.RequiredHits) - ApplyResult(r => r.Type = r.Judgement.MaxResult); + ApplyResult(static r => r.Type = r.Judgement.MaxResult); } else { @@ -227,7 +227,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables tick.TriggerResult(false); } - ApplyResult(r => r.Type = numHits == HitObject.RequiredHits ? r.Judgement.MaxResult : r.Judgement.MinResult); + ApplyResult(static (r, state) => + { + var (numHits, hitObject) = state; + r.Type = numHits == hitObject.RequiredHits ? r.Judgement.MaxResult : r.Judgement.MinResult; + }, (numHits, HitObject)); } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs index 3a5c006962..ad1d09bc7b 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs @@ -30,7 +30,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables public void TriggerResult(bool hit) { HitObject.StartTime = Time.Current; - ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult); + ApplyResult(static (r, hit) => + { + r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult; + }, hit); } protected override void CheckForResult(bool userTriggered, double timeOffset) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index bce28361cb..9acd7b3c0f 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -687,12 +687,14 @@ namespace osu.Game.Rulesets.Objects.Drawables /// the of the . /// /// The callback that applies changes to the . - protected void ApplyResult(Action application) + /// The state passed to the callback. + /// The type of the state information that is passed to the callback method. + protected void ApplyResult(Action application, TState state) { if (Result.HasResult) throw new InvalidOperationException("Cannot apply result on a hitobject that already has a result."); - application?.Invoke(Result); + application?.Invoke(Result, state); if (!Result.HasResult) throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}."); @@ -714,6 +716,13 @@ namespace osu.Game.Rulesets.Objects.Drawables OnNewResult?.Invoke(this, Result); } + /// + /// Applies the of this , notifying responders such as + /// the of the . + /// + /// The callback that applies changes to the . + protected void ApplyResult(Action application) => ApplyResult((r, _) => application?.Invoke(r), null); + /// /// Processes this , checking if a scoring result has occurred. /// From 93bd3ce5ae73eb6f00649e09ace1acd2224ecc95 Mon Sep 17 00:00:00 2001 From: Chandler Stowell Date: Thu, 25 Jan 2024 11:25:41 -0500 Subject: [PATCH 02/86] update `DrawableHitCircle.ApplyResult` to pass `this` to its callback --- .../DrawableEmptyFreeformHitObject.cs | 2 +- .../Drawables/DrawablePippidonHitObject.cs | 6 ++--- .../DrawableEmptyScrollingHitObject.cs | 2 +- .../Drawables/DrawablePippidonHitObject.cs | 5 ++-- .../Drawables/DrawableCatchHitObject.cs | 7 +++--- .../Objects/Drawables/DrawableHoldNote.cs | 2 +- .../Objects/Drawables/DrawableHoldNoteBody.cs | 9 ++++++- .../Drawables/DrawableManiaHitObject.cs | 2 +- .../Objects/Drawables/DrawableNote.cs | 16 +++++++++---- .../TestSceneHitCircle.cs | 2 +- .../TestSceneHitCircleLateFade.cs | 2 +- .../Objects/Drawables/DrawableHitCircle.cs | 19 ++++++++------- .../Objects/Drawables/DrawableOsuHitObject.cs | 4 ++-- .../Objects/Drawables/DrawableSlider.cs | 14 +++++------ .../Objects/Drawables/DrawableSpinner.cs | 5 ++-- .../Objects/Drawables/DrawableSpinnerTick.cs | 12 +++++++++- .../Objects/Drawables/DrawableDrumRoll.cs | 8 +++---- .../Objects/Drawables/DrawableDrumRollTick.cs | 13 +++++----- .../Objects/Drawables/DrawableFlyingHit.cs | 2 +- .../Objects/Drawables/DrawableHit.cs | 24 ++++++++++++------- .../Drawables/DrawableStrongNestedHit.cs | 2 +- .../Objects/Drawables/DrawableSwell.cs | 16 +++++++------ .../Objects/Drawables/DrawableSwellTick.cs | 10 +++++--- .../Gameplay/TestSceneDrawableHitObject.cs | 2 +- .../Gameplay/TestScenePoolingRuleset.cs | 8 +++---- .../Objects/Drawables/DrawableHitObject.cs | 13 ++-------- 26 files changed, 120 insertions(+), 87 deletions(-) diff --git a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs index e8f511bc4b..3ad8f06fb4 100644 --- a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs +++ b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.EmptyFreeform.Objects.Drawables { if (timeOffset >= 0) // todo: implement judgement logic - ApplyResult(static r => r.Type = HitResult.Perfect); + ApplyResult(static (r, hitObject) => r.Type = HitResult.Perfect); } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs index a8bb57ba18..925f2d04bf 100644 --- a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs +++ b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs @@ -50,10 +50,10 @@ namespace osu.Game.Rulesets.Pippidon.Objects.Drawables { if (timeOffset >= 0) { - ApplyResult(static (r, isHovered) => + ApplyResult(static (r, hitObject) => { - r.Type = isHovered ? HitResult.Perfect : HitResult.Miss; - }, IsHovered); + r.Type = hitObject.IsHovered ? HitResult.Perfect : HitResult.Miss; + }); } } diff --git a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs index 070a802aea..408bbea717 100644 --- a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs +++ b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.EmptyScrolling.Objects.Drawables { if (timeOffset >= 0) // todo: implement judgement logic - ApplyResult(static r => r.Type = HitResult.Perfect); + ApplyResult(static (r, hitObject) => r.Type = HitResult.Perfect); } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs index 9983ec20b0..2c9eac7f65 100644 --- a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs +++ b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs @@ -50,10 +50,11 @@ namespace osu.Game.Rulesets.Pippidon.Objects.Drawables { if (timeOffset >= 0) { - ApplyResult(static (r, pippidonHitObject) => + ApplyResult(static (r, hitObject) => { + var pippidonHitObject = (DrawablePippidonHitObject)hitObject; r.Type = pippidonHitObject.currentLane.Value == pippidonHitObject.HitObject.Lane ? HitResult.Perfect : HitResult.Miss; - }, this); + }); } } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs index 5a921f36f5..721c6aaa59 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs @@ -64,10 +64,11 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables if (timeOffset >= 0 && Result != null) { - ApplyResult(static (r, state) => + ApplyResult(static (r, hitObject) => { - r.Type = state.CheckPosition.Invoke(state.HitObject) ? r.Judgement.MaxResult : r.Judgement.MinResult; - }, this); + var catchHitObject = (DrawableCatchHitObject)hitObject; + r.Type = catchHitObject.CheckPosition!.Invoke(catchHitObject.HitObject) ? r.Judgement.MaxResult : r.Judgement.MinResult; + }); } } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index e5056d5167..6c70ab3526 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -265,7 +265,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (Tail.AllJudged) { if (Tail.IsHit) - ApplyResult(static r => r.Type = r.Judgement.MaxResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); else MissForcefully(); } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs index 317da0580c..731b1b6298 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs @@ -11,6 +11,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables public override bool DisplayResult => false; + private bool hit; + public DrawableHoldNoteBody() : this(null) { @@ -25,7 +27,12 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { if (AllJudged) return; - ApplyResult(static (r, hit) => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult, hit); + this.hit = hit; + ApplyResult(static (r, hitObject) => + { + var holdNoteBody = (DrawableHoldNoteBody)hitObject; + r.Type = holdNoteBody.hit ? r.Judgement.MaxResult : r.Judgement.MinResult; + }); } } } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs index dea0817869..2d10fa27cd 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs @@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables /// /// Causes this to get missed, disregarding all conditions in implementations of . /// - public virtual void MissForcefully() => ApplyResult(static r => r.Type = r.Judgement.MinResult); + public virtual void MissForcefully() => ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); } public abstract partial class DrawableManiaHitObject : DrawableManiaHitObject diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 985007f905..a70253798a 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -38,6 +38,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables private Drawable headPiece; + private HitResult hitResult; + public DrawableNote() : this(null) { @@ -89,18 +91,22 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - ApplyResult(static r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); return; } - var result = HitObject.HitWindows.ResultFor(timeOffset); - if (result == HitResult.None) + hitResult = HitObject.HitWindows.ResultFor(timeOffset); + if (hitResult == HitResult.None) return; - result = GetCappedResult(result); + hitResult = GetCappedResult(hitResult); - ApplyResult(static (r, result) => r.Type = result, result); + ApplyResult(static (r, hitObject) => + { + var note = (DrawableNote)hitObject; + r.Type = note.hitResult; + }); } /// diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs index 30b0451a3b..8d4145f2c1 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs @@ -136,7 +136,7 @@ namespace osu.Game.Rulesets.Osu.Tests if (auto && !userTriggered && timeOffset > hitOffset && CheckHittable?.Invoke(this, Time.Current, HitResult.Great) == ClickAction.Hit) { // force success - ApplyResult(r => r.Type = HitResult.Great); + ApplyResult(static (r, _) => r.Type = HitResult.Great); } else base.CheckForResult(userTriggered, timeOffset); diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleLateFade.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleLateFade.cs index 7824f26251..2d1e9c1270 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleLateFade.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleLateFade.cs @@ -208,7 +208,7 @@ namespace osu.Game.Rulesets.Osu.Tests if (shouldHit && !userTriggered && timeOffset >= 0) { // force success - ApplyResult(r => r.Type = HitResult.Great); + ApplyResult(static (r, _) => r.Type = HitResult.Great); } else base.CheckForResult(userTriggered, timeOffset); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 8284229d82..ce5422b180 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -44,6 +44,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private Container scaleContainer; private InputManager inputManager; + private HitResult hitResult; public DrawableHitCircle() : this(null) @@ -155,34 +156,34 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - ApplyResult(static r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); return; } - var result = ResultFor(timeOffset); - var clickAction = CheckHittable?.Invoke(this, Time.Current, result); + hitResult = ResultFor(timeOffset); + var clickAction = CheckHittable?.Invoke(this, Time.Current, hitResult); if (clickAction == ClickAction.Shake) Shake(); - if (result == HitResult.None || clickAction != ClickAction.Hit) + if (hitResult == HitResult.None || clickAction != ClickAction.Hit) return; - ApplyResult(static (r, state) => + ApplyResult(static (r, hitObject) => { - var (hitCircle, hitResult) = state; + var hitCircle = (DrawableHitCircle)hitObject; var circleResult = (OsuHitCircleJudgementResult)r; // Todo: This should also consider misses, but they're a little more interesting to handle, since we don't necessarily know the position at the time of a miss. - if (hitResult.IsHit()) + if (hitCircle.hitResult.IsHit()) { var localMousePosition = hitCircle.ToLocalSpace(hitCircle.inputManager.CurrentState.Mouse.Position); circleResult.CursorPositionAtHit = hitCircle.HitObject.StackedPosition + (localMousePosition - hitCircle.DrawSize / 2); } - circleResult.Type = hitResult; - }, (this, result)); + circleResult.Type = hitCircle.hitResult; + }); } /// diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index cc06d009c9..6de60a9d51 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -100,12 +100,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// /// Causes this to get hit, disregarding all conditions in implementations of . /// - public void HitForcefully() => ApplyResult(static r => r.Type = r.Judgement.MaxResult); + public void HitForcefully() => ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); /// /// Causes this to get missed, disregarding all conditions in implementations of . /// - public void MissForcefully() => ApplyResult(static r => r.Type = r.Judgement.MinResult); + public void MissForcefully() => ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); private RectangleF parentScreenSpaceRectangle => ((DrawableOsuHitObject)ParentHitObject)?.parentScreenSpaceRectangle ?? Parent!.ScreenSpaceDrawQuad.AABBFloat; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 3c298cc6af..c0ff258352 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -292,10 +292,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (HitObject.ClassicSliderBehaviour) { // Classic behaviour means a slider is judged proportionally to the number of nested hitobjects hit. This is the classic osu!stable scoring. - ApplyResult(static (r, nestedHitObjects) => + ApplyResult(static (r, hitObject) => { - int totalTicks = nestedHitObjects.Count; - int hitTicks = nestedHitObjects.Count(h => h.IsHit); + int totalTicks = hitObject.NestedHitObjects.Count; + int hitTicks = hitObject.NestedHitObjects.Count(h => h.IsHit); if (hitTicks == totalTicks) r.Type = HitResult.Great; @@ -306,16 +306,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables double hitFraction = (double)hitTicks / totalTicks; r.Type = hitFraction >= 0.5 ? HitResult.Ok : HitResult.Meh; } - }, NestedHitObjects); + }); } else { // If only the nested hitobjects are judged, then the slider's own judgement is ignored for scoring purposes. // But the slider needs to still be judged with a reasonable hit/miss result for visual purposes (hit/miss transforms, etc). - ApplyResult(static (r, nestedHitObjects) => + ApplyResult(static (r, hitObject) => { - r.Type = nestedHitObjects.Any(h => h.Result.IsHit) ? r.Judgement.MaxResult : r.Judgement.MinResult; - }, NestedHitObjects); + r.Type = hitObject.NestedHitObjects.Any(h => h.Result.IsHit) ? r.Judgement.MaxResult : r.Judgement.MinResult; + }); } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index d21d02c8ce..3679bc9775 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -258,8 +258,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var tick in ticks.Where(t => !t.Result.HasResult)) tick.TriggerResult(false); - ApplyResult(static (r, spinner) => + ApplyResult(static (r, hitObject) => { + var spinner = (DrawableSpinner)hitObject; if (spinner.Progress >= 1) r.Type = HitResult.Great; else if (spinner.Progress > .9) @@ -268,7 +269,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables r.Type = HitResult.Meh; else if (spinner.Time.Current >= spinner.HitObject.EndTime) r.Type = r.Judgement.MinResult; - }, this); + }); } protected override void Update() diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs index 1c3ff29118..628f07a281 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs @@ -11,6 +11,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { public override bool DisplayResult => false; + private bool hit; + public DrawableSpinnerTick() : this(null) { @@ -35,6 +37,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// Apply a judgement result. /// /// Whether this tick was reached. - internal void TriggerResult(bool hit) => ApplyResult(static (r, hit) => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult, hit); + internal void TriggerResult(bool hit) + { + this.hit = hit; + ApplyResult(static (r, hitObject) => + { + var spinnerTick = (DrawableSpinnerTick)hitObject; + r.Type = spinnerTick.hit ? r.Judgement.MaxResult : r.Judgement.MinResult; + }); + } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index d3fe363857..2e40875af1 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (timeOffset < 0) return; - ApplyResult(static r => r.Type = r.Judgement.MaxResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); } protected override void UpdateHitStateTransforms(ArmedState state) @@ -192,10 +192,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!ParentHitObject.Judged) return; - ApplyResult(static (r, parentHitObject) => + ApplyResult(static (r, hitObject) => { - r.Type = parentHitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult; - }, ParentHitObject); + r.Type = hitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult; + }); } 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 de9a3a31c5..aa678d7043 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -49,14 +49,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!userTriggered) { if (timeOffset > HitObject.HitWindow) - ApplyResult(static r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); return; } if (Math.Abs(timeOffset) > HitObject.HitWindow) return; - ApplyResult(static r => r.Type = r.Judgement.MaxResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); } public override void OnKilled() @@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables base.OnKilled(); if (Time.Current > HitObject.GetEndTime() && !Judged) - ApplyResult(static r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); } protected override void UpdateHitStateTransforms(ArmedState state) @@ -105,10 +105,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!ParentHitObject.Judged) return; - ApplyResult(static (r, parentHitObject) => + ApplyResult(static (r, hitObject) => { - r.Type = parentHitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult; - }, ParentHitObject); + var nestedHit = (StrongNestedHit)hitObject; + r.Type = nestedHit.ParentHitObject!.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult; + }); } public override bool OnPressed(KeyBindingPressEvent e) => false; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs index 1332b9e950..4349dff9f9 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables protected override void LoadComplete() { base.LoadComplete(); - ApplyResult(static r => r.Type = r.Judgement.MaxResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); } protected override void LoadSamples() diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index c3bd76bf81..cf8e4050ee 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -37,6 +37,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private double? lastPressHandleTime; + private HitResult hitResult; + private readonly Bindable type = new Bindable(); public DrawableHit() @@ -99,18 +101,24 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - ApplyResult(static r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); return; } - var result = HitObject.HitWindows.ResultFor(timeOffset); - if (result == HitResult.None) + hitResult = HitObject.HitWindows.ResultFor(timeOffset); + if (hitResult == HitResult.None) return; if (!validActionPressed) - ApplyResult(static r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); else - ApplyResult(static (r, result) => r.Type = result, result); + { + ApplyResult(static (r, hitObject) => + { + var drawableHit = (DrawableHit)hitObject; + r.Type = drawableHit.hitResult; + }); + } } public override bool OnPressed(KeyBindingPressEvent e) @@ -209,19 +217,19 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!ParentHitObject.Result.IsHit) { - ApplyResult(static r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); return; } if (!userTriggered) { if (timeOffset - ParentHitObject.Result.TimeOffset > SECOND_HIT_WINDOW) - ApplyResult(static r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); return; } if (Math.Abs(timeOffset - ParentHitObject.Result.TimeOffset) <= SECOND_HIT_WINDOW) - ApplyResult(static r => r.Type = r.Judgement.MaxResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); } public override bool OnPressed(KeyBindingPressEvent e) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs index 4080c14066..8f99538448 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs @@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables // it can happen that the hit window of the nested strong hit extends past the lifetime of the parent object. // this is a safety to prevent such cases from causing the nested hit to never be judged and as such prevent gameplay from completing. if (!Judged && Time.Current > ParentHitObject?.HitObject.GetEndTime()) - ApplyResult(static r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index d48b78283b..0781ea5e2a 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -41,6 +41,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private double? lastPressHandleTime; + private int numHits; + public override bool DisplayResult => false; public DrawableSwell() @@ -192,7 +194,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables nextTick?.TriggerResult(true); - int numHits = ticks.Count(r => r.IsHit); + numHits = ticks.Count(r => r.IsHit); float completion = (float)numHits / HitObject.RequiredHits; @@ -206,14 +208,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, Easing.OutQuint); if (numHits == HitObject.RequiredHits) - ApplyResult(static r => r.Type = r.Judgement.MaxResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); } else { if (timeOffset < 0) return; - int numHits = 0; + numHits = 0; foreach (var tick in ticks) { @@ -227,11 +229,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables tick.TriggerResult(false); } - ApplyResult(static (r, state) => + ApplyResult(static (r, hitObject) => { - var (numHits, hitObject) = state; - r.Type = numHits == hitObject.RequiredHits ? r.Judgement.MaxResult : r.Judgement.MinResult; - }, (numHits, HitObject)); + var swell = (DrawableSwell)hitObject; + r.Type = swell.numHits == swell.HitObject.RequiredHits ? r.Judgement.MaxResult : r.Judgement.MinResult; + }); } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs index ad1d09bc7b..557438e5e5 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs @@ -15,6 +15,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public override bool DisplayResult => false; + private bool hit; + public DrawableSwellTick() : this(null) { @@ -29,11 +31,13 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables public void TriggerResult(bool hit) { + this.hit = hit; HitObject.StartTime = Time.Current; - ApplyResult(static (r, hit) => + ApplyResult(static (r, hitObject) => { - r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult; - }, hit); + var swellTick = (DrawableSwellTick)hitObject; + r.Type = swellTick.hit ? r.Judgement.MaxResult : r.Judgement.MinResult; + }); } protected override void CheckForResult(bool userTriggered, double timeOffset) diff --git a/osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs b/osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs index 10dbede2e0..bf1e52aab5 100644 --- a/osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs +++ b/osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs @@ -216,7 +216,7 @@ namespace osu.Game.Tests.Gameplay LifetimeStart = LIFETIME_ON_APPLY; } - public void MissForcefully() => ApplyResult(r => r.Type = HitResult.Miss); + public void MissForcefully() => ApplyResult(static (r, _) => r.Type = HitResult.Miss); protected override void UpdateHitStateTransforms(ArmedState state) { diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePoolingRuleset.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePoolingRuleset.cs index fea7456472..00bd58e303 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestScenePoolingRuleset.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestScenePoolingRuleset.cs @@ -431,7 +431,7 @@ namespace osu.Game.Tests.Visual.Gameplay protected override void CheckForResult(bool userTriggered, double timeOffset) { if (timeOffset > HitObject.Duration) - ApplyResult(r => r.Type = r.Judgement.MaxResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); } protected override void UpdateHitStateTransforms(ArmedState state) @@ -468,7 +468,7 @@ namespace osu.Game.Tests.Visual.Gameplay public override void OnKilled() { base.OnKilled(); - ApplyResult(r => r.Type = r.Judgement.MinResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); } } @@ -547,7 +547,7 @@ namespace osu.Game.Tests.Visual.Gameplay { base.CheckForResult(userTriggered, timeOffset); if (timeOffset >= 0) - ApplyResult(r => r.Type = r.Judgement.MaxResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); } } @@ -596,7 +596,7 @@ namespace osu.Game.Tests.Visual.Gameplay { base.CheckForResult(userTriggered, timeOffset); if (timeOffset >= 0) - ApplyResult(r => r.Type = r.Judgement.MaxResult); + ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); } } diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 9acd7b3c0f..bffe174be1 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -687,14 +687,12 @@ namespace osu.Game.Rulesets.Objects.Drawables /// the of the . /// /// The callback that applies changes to the . - /// The state passed to the callback. - /// The type of the state information that is passed to the callback method. - protected void ApplyResult(Action application, TState state) + protected void ApplyResult(Action application) { if (Result.HasResult) throw new InvalidOperationException("Cannot apply result on a hitobject that already has a result."); - application?.Invoke(Result, state); + application?.Invoke(Result, this); if (!Result.HasResult) throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}."); @@ -716,13 +714,6 @@ namespace osu.Game.Rulesets.Objects.Drawables OnNewResult?.Invoke(this, Result); } - /// - /// Applies the of this , notifying responders such as - /// the of the . - /// - /// The callback that applies changes to the . - protected void ApplyResult(Action application) => ApplyResult((r, _) => application?.Invoke(r), null); - /// /// Processes this , checking if a scoring result has occurred. /// From 682dab5d8327e24b38914f0599d8822eddf05e93 Mon Sep 17 00:00:00 2001 From: Chandler Stowell Date: Thu, 25 Jan 2024 11:30:52 -0500 Subject: [PATCH 03/86] check if parent was hit in taiko's `DrawableDrumRoll.CheckForResult` --- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index 2e40875af1..f68198b967 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -194,7 +194,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables ApplyResult(static (r, hitObject) => { - r.Type = hitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult; + var drumRoll = (DrawableDrumRoll)hitObject; + r.Type = drumRoll.ParentHitObject!.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult; }); } From 347e88f59772f0dc0045f46dc1c8e060ed8b51b9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 26 Jan 2024 16:21:48 +0900 Subject: [PATCH 04/86] Add note about using `static` callback --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index bffe174be1..e30ce13f08 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -686,7 +686,7 @@ namespace osu.Game.Rulesets.Objects.Drawables /// Applies the of this , notifying responders such as /// the of the . /// - /// The callback that applies changes to the . + /// The callback that applies changes to the . Using a `static` delegate is recommended to avoid allocation overhead. protected void ApplyResult(Action application) { if (Result.HasResult) From 6cfd2813ede27126f002ace78e3def0e5f7b03f5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 26 Jan 2024 16:52:03 +0900 Subject: [PATCH 05/86] Fix incorrect cast --- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index f68198b967..e15298f3ca 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -194,7 +194,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables ApplyResult(static (r, hitObject) => { - var drumRoll = (DrawableDrumRoll)hitObject; + var drumRoll = (StrongNestedHit)hitObject; r.Type = drumRoll.ParentHitObject!.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult; }); } From 2ccd0e3692d66b9b1dcf29daa666a09a459d2fde Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 27 Jan 2024 01:45:22 +0300 Subject: [PATCH 06/86] Add visual and failing test cases --- .../Visual/Ranking/TestSceneResultsScreen.cs | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs index 866e20d063..dbbfac75f7 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs @@ -26,8 +26,10 @@ using osu.Game.Scoring; using osu.Game.Screens; using osu.Game.Screens.Play; using osu.Game.Screens.Ranking; +using osu.Game.Screens.Ranking.Expanded.Accuracy; using osu.Game.Screens.Ranking.Expanded.Statistics; using osu.Game.Screens.Ranking.Statistics; +using osu.Game.Skinning; using osu.Game.Tests.Resources; using osuTK; using osuTK.Input; @@ -44,6 +46,9 @@ namespace osu.Game.Tests.Visual.Ranking [Resolved] private RealmAccess realm { get; set; } + [Resolved] + private SkinManager skins { get; set; } + protected override void LoadComplete() { base.LoadComplete(); @@ -59,6 +64,9 @@ namespace osu.Game.Tests.Visual.Ranking }); } + [SetUp] + public void SetUp() => Schedule(() => skins.CurrentSkinInfo.SetDefault()); + [Test] public void TestScaling() { @@ -132,6 +140,46 @@ namespace osu.Game.Tests.Visual.Ranking AddAssert("retry overlay present", () => screen.RetryOverlay != null); } + [Test] + public void TestResultsWithFailingRank() + { + TestResultsScreen screen = null; + + loadResultsScreen(() => + { + var score = TestResources.CreateTestScoreInfo(); + + score.OnlineID = onlineScoreID++; + score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents(); + score.Rank = ScoreRank.F; + return screen = createResultsScreen(score); + }); + AddUntilStep("wait for loaded", () => screen.IsLoaded); + AddAssert("retry overlay present", () => screen.RetryOverlay != null); + AddAssert("no badges displayed", () => this.ChildrenOfType().All(b => !b.IsPresent)); + } + + [Test] + public void TestResultsWithFailingRankOnLegacySkin() + { + TestResultsScreen screen = null; + + AddStep("set legacy skin", () => skins.CurrentSkinInfo.Value = skins.DefaultClassicSkin.SkinInfo); + + loadResultsScreen(() => + { + var score = TestResources.CreateTestScoreInfo(); + + score.OnlineID = onlineScoreID++; + score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents(); + score.Rank = ScoreRank.F; + return screen = createResultsScreen(score); + }); + AddUntilStep("wait for loaded", () => screen.IsLoaded); + AddAssert("retry overlay present", () => screen.RetryOverlay != null); + AddAssert("no badges displayed", () => this.ChildrenOfType().All(b => !b.IsPresent)); + } + [Test] public void TestShowHideStatisticsViaOutsideClick() { From 47f0b860186c720619b24df1ab0581bafb80b1a1 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 27 Jan 2024 01:46:12 +0300 Subject: [PATCH 07/86] Fix results screen showing other rank badges on F rank --- .../Expanded/Accuracy/AccuracyCircle.cs | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs index 0aff98df2b..8cec79ad90 100644 --- a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs +++ b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs @@ -351,24 +351,28 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy int badgeNum = 0; - foreach (var badge in badges) + if (score.Rank != ScoreRank.F) { - if (badge.Accuracy > score.Accuracy) - continue; - - using (BeginDelayedSequence(inverseEasing(ACCURACY_TRANSFORM_EASING, Math.Min(accuracyX - virtual_ss_percentage, badge.Accuracy) / targetAccuracy) * ACCURACY_TRANSFORM_DURATION)) + foreach (var badge in badges) { - badge.Appear(); + if (badge.Accuracy > score.Accuracy) + continue; - if (withFlair) + using (BeginDelayedSequence( + inverseEasing(ACCURACY_TRANSFORM_EASING, Math.Min(accuracyX - virtual_ss_percentage, badge.Accuracy) / targetAccuracy) * ACCURACY_TRANSFORM_DURATION)) { - Schedule(() => - { - var dink = badgeNum < badges.Count - 1 ? badgeTickSound : badgeMaxSound; + badge.Appear(); - dink.FrequencyTo(1 + badgeNum++ * 0.05); - dink.Play(); - }); + if (withFlair) + { + Schedule(() => + { + var dink = badgeNum < badges.Count - 1 ? badgeTickSound : badgeMaxSound; + + dink.FrequencyTo(1 + badgeNum++ * 0.05); + dink.Play(); + }); + } } } } From d25262944ecd3a6a2d595b7ffc65c9cbb058e1f6 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 27 Jan 2024 01:46:43 +0300 Subject: [PATCH 08/86] Force results screen to play default D rank applause sound on fail (regardless of skin) --- .../Expanded/Accuracy/AccuracyCircle.cs | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs index 8cec79ad90..60c35e6203 100644 --- a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs +++ b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs @@ -10,6 +10,7 @@ using osu.Framework.Audio; using osu.Framework.Bindables; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; +using osu.Framework.Graphics.Audio; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; @@ -98,6 +99,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy private PoolableSkinnableSample swooshUpSound; private PoolableSkinnableSample rankImpactSound; private PoolableSkinnableSample rankApplauseSound; + private DrawableSample rankFailSound; private readonly Bindable tickPlaybackRate = new Bindable(); @@ -133,7 +135,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy } [BackgroundDependencyLoader] - private void load() + private void load(AudioManager audio) { InternalChildren = new Drawable[] { @@ -267,6 +269,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy badgeTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink")), badgeMaxSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink-max")), swooshUpSound = new PoolableSkinnableSample(new SampleInfo(@"Results/swoosh-up")), + rankFailSound = new DrawableSample(audio.Samples.Get(results_applause_d_sound)), }); } } @@ -396,8 +399,16 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy { Schedule(() => { - rankApplauseSound.VolumeTo(applause_volume); - rankApplauseSound.Play(); + if (score.Rank != ScoreRank.F) + { + rankApplauseSound.VolumeTo(applause_volume); + rankApplauseSound.Play(); + } + else + { + rankFailSound.VolumeTo(applause_volume); + rankFailSound.Play(); + } }); } } @@ -440,6 +451,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy } } + private const string results_applause_d_sound = @"Results/applause-d"; + private string applauseSampleName { get @@ -448,7 +461,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy { default: case ScoreRank.D: - return @"Results/applause-d"; + return results_applause_d_sound; case ScoreRank.C: return @"Results/applause-c"; From bb6c7a0a82f7a19da7445706698c67360968301d Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Fri, 26 Jan 2024 15:26:22 -0800 Subject: [PATCH 09/86] Fix edit mod preset popover buttons overflowing on some languages --- osu.Game/Overlays/Mods/EditPresetPopover.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/EditPresetPopover.cs b/osu.Game/Overlays/Mods/EditPresetPopover.cs index 8bce57c96a..9554ba8ce2 100644 --- a/osu.Game/Overlays/Mods/EditPresetPopover.cs +++ b/osu.Game/Overlays/Mods/EditPresetPopover.cs @@ -92,7 +92,7 @@ namespace osu.Game.Overlays.Mods { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Direction = FillDirection.Horizontal, + RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(7), Children = new Drawable[] From ee4fe1c0683a26bcb8559ac1918d52a88e6a1276 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 28 Jan 2024 23:11:42 +0300 Subject: [PATCH 10/86] Fix relax mod not handling objects close to a previous slider's follow area --- osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs b/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs index 40fadfb77e..3679425389 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs @@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Osu.Mods if (!slider.HeadCircle.IsHit) handleHitCircle(slider.HeadCircle); - requiresHold |= slider.SliderInputManager.IsMouseInFollowArea(true); + requiresHold |= slider.SliderInputManager.IsMouseInFollowArea(slider.Tracking.Value); break; case DrawableSpinner spinner: From 3aefc919675a855f6d13385d4d69ed326db2bc4f Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 31 Jan 2024 07:54:07 +0300 Subject: [PATCH 11/86] Make AliveDrawableMap public --- .../PooledDrawableWithLifetimeContainer.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs b/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs index 1b0176cae5..1ebdf48ae8 100644 --- a/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs +++ b/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs @@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Objects.Pooling /// /// The enumeration order is undefined. /// - public IEnumerable<(TEntry Entry, TDrawable Drawable)> AliveEntries => aliveDrawableMap.Select(x => (x.Key, x.Value)); + public IEnumerable<(TEntry Entry, TDrawable Drawable)> AliveEntries => AliveDrawableMap.Select(x => (x.Key, x.Value)); /// /// Whether to remove an entry when clock goes backward and crossed its . @@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Objects.Pooling /// internal double FutureLifetimeExtension { get; set; } - private readonly Dictionary aliveDrawableMap = new Dictionary(); + public readonly Dictionary AliveDrawableMap = new Dictionary(); private readonly HashSet allEntries = new HashSet(); private readonly LifetimeEntryManager lifetimeManager = new LifetimeEntryManager(); @@ -101,10 +101,10 @@ namespace osu.Game.Rulesets.Objects.Pooling private void entryBecameAlive(LifetimeEntry lifetimeEntry) { var entry = (TEntry)lifetimeEntry; - Debug.Assert(!aliveDrawableMap.ContainsKey(entry)); + Debug.Assert(!AliveDrawableMap.ContainsKey(entry)); TDrawable drawable = GetDrawable(entry); - aliveDrawableMap[entry] = drawable; + AliveDrawableMap[entry] = drawable; AddDrawable(entry, drawable); } @@ -119,10 +119,10 @@ namespace osu.Game.Rulesets.Objects.Pooling private void entryBecameDead(LifetimeEntry lifetimeEntry) { var entry = (TEntry)lifetimeEntry; - Debug.Assert(aliveDrawableMap.ContainsKey(entry)); + Debug.Assert(AliveDrawableMap.ContainsKey(entry)); - TDrawable drawable = aliveDrawableMap[entry]; - aliveDrawableMap.Remove(entry); + TDrawable drawable = AliveDrawableMap[entry]; + AliveDrawableMap.Remove(entry); RemoveDrawable(entry, drawable); } @@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Objects.Pooling foreach (var entry in Entries.ToArray()) Remove(entry); - Debug.Assert(aliveDrawableMap.Count == 0); + Debug.Assert(AliveDrawableMap.Count == 0); } protected override bool CheckChildrenLife() From 6b1de5446ad5dfd21a481ee8f484b92b42851be5 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 31 Jan 2024 07:54:28 +0300 Subject: [PATCH 12/86] Reduce allocaations in ScrollingHitObjectContainer --- osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 39ddb5c753..23ac4378e4 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -186,9 +186,9 @@ namespace osu.Game.Rulesets.UI.Scrolling // to prevent hit objects displayed in a wrong position for one frame. // Only AliveEntries need to be considered for layout (reduces overhead in the case of scroll speed changes). // We are not using AliveObjects directly to avoid selection/sorting overhead since we don't care about the order at which positions will be updated. - foreach (var entry in AliveEntries) + foreach (var entry in AliveDrawableMap) { - var obj = entry.Drawable; + var obj = entry.Value; updatePosition(obj, Time.Current); From 0642a0ee11f492345d373cd488479449df01bb28 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 31 Jan 2024 15:54:43 +0900 Subject: [PATCH 13/86] Adjust default min result of SliderTailHit, remove override --- osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs | 1 - osu.Game/Rulesets/Judgements/Judgement.cs | 4 +++- osu.Game/Rulesets/Scoring/HitResult.cs | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs b/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs index ceee513412..ee2490439f 100644 --- a/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs @@ -30,7 +30,6 @@ namespace osu.Game.Rulesets.Osu.Objects public class TailJudgement : SliderEndJudgement { public override HitResult MaxResult => HitResult.SliderTailHit; - public override HitResult MinResult => HitResult.IgnoreMiss; } } } diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index 93386de483..d4d06167f1 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -73,9 +73,11 @@ namespace osu.Game.Rulesets.Judgements return HitResult.SmallTickMiss; case HitResult.LargeTickHit: - case HitResult.SliderTailHit: return HitResult.LargeTickMiss; + case HitResult.SliderTailHit: + return HitResult.IgnoreMiss; + default: return HitResult.Miss; } diff --git a/osu.Game/Rulesets/Scoring/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs index 20ec3c4946..b6cfca58db 100644 --- a/osu.Game/Rulesets/Scoring/HitResult.cs +++ b/osu.Game/Rulesets/Scoring/HitResult.cs @@ -138,7 +138,8 @@ namespace osu.Game.Rulesets.Scoring ComboBreak, /// - /// A special judgement similar to that's used to increase the valuation of the final tick of a slider. + /// A special tick judgement to increase the valuation of the final tick of a slider. + /// The default minimum result is , but may be overridden to . /// [EnumMember(Value = "slider_tail_hit")] [Order(8)] From 66aa41e00162bcc2c32b48407a9d8dd999831f7c Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 31 Jan 2024 18:04:32 +0900 Subject: [PATCH 14/86] Fix tests --- .../Rulesets/Scoring/ScoreProcessorTest.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs b/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs index 73465fae08..a3f91fffba 100644 --- a/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs +++ b/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.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; @@ -31,8 +29,8 @@ namespace osu.Game.Tests.Rulesets.Scoring { public partial class ScoreProcessorTest { - private ScoreProcessor scoreProcessor; - private IBeatmap beatmap; + private ScoreProcessor scoreProcessor = null!; + private IBeatmap beatmap = null!; [SetUp] public void SetUp() @@ -86,7 +84,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(ScoringMode.Standardised, HitResult.SmallTickHit, HitResult.SmallTickHit, 493_652)] [TestCase(ScoringMode.Standardised, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)] [TestCase(ScoringMode.Standardised, HitResult.LargeTickHit, HitResult.LargeTickHit, 326_963)] - [TestCase(ScoringMode.Standardised, HitResult.SliderTailHit, HitResult.SliderTailHit, 326_963)] + [TestCase(ScoringMode.Standardised, HitResult.SliderTailHit, HitResult.SliderTailHit, 371_627)] [TestCase(ScoringMode.Standardised, HitResult.SmallBonus, HitResult.SmallBonus, 1_000_030)] [TestCase(ScoringMode.Standardised, HitResult.LargeBonus, HitResult.LargeBonus, 1_000_150)] [TestCase(ScoringMode.Classic, HitResult.Miss, HitResult.Great, 0)] @@ -99,7 +97,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(ScoringMode.Classic, HitResult.SmallTickHit, HitResult.SmallTickHit, 49_365)] [TestCase(ScoringMode.Classic, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)] [TestCase(ScoringMode.Classic, HitResult.LargeTickHit, HitResult.LargeTickHit, 32_696)] - [TestCase(ScoringMode.Classic, HitResult.SliderTailHit, HitResult.SliderTailHit, 32_696)] + [TestCase(ScoringMode.Classic, HitResult.SliderTailHit, HitResult.SliderTailHit, 37_163)] [TestCase(ScoringMode.Classic, HitResult.SmallBonus, HitResult.SmallBonus, 100_003)] [TestCase(ScoringMode.Classic, HitResult.LargeBonus, HitResult.LargeBonus, 100_015)] public void TestFourVariousResultsOneMiss(ScoringMode scoringMode, HitResult hitResult, HitResult maxResult, int expectedScore) @@ -171,7 +169,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(HitResult.Perfect, HitResult.Miss)] [TestCase(HitResult.SmallTickHit, HitResult.SmallTickMiss)] [TestCase(HitResult.LargeTickHit, HitResult.LargeTickMiss)] - [TestCase(HitResult.SliderTailHit, HitResult.LargeTickMiss)] + [TestCase(HitResult.SliderTailHit, HitResult.IgnoreMiss)] [TestCase(HitResult.SmallBonus, HitResult.IgnoreMiss)] [TestCase(HitResult.LargeBonus, HitResult.IgnoreMiss)] public void TestMinResults(HitResult hitResult, HitResult expectedMinResult) @@ -476,7 +474,7 @@ namespace osu.Game.Tests.Rulesets.Scoring public override IEnumerable GetModsFor(ModType type) => throw new NotImplementedException(); - public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList mods = null) => throw new NotImplementedException(); + public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList? mods = null) => throw new NotImplementedException(); public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => throw new NotImplementedException(); From e71c95f1fed41cf194d4c004c0d1b5a9e3620f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 31 Jan 2024 14:48:27 +0100 Subject: [PATCH 15/86] Reintroduce `IMod.Ranked` What goes around, comes around. --- osu.Game/Rulesets/Mods/IMod.cs | 5 +++++ osu.Game/Rulesets/Mods/Mod.cs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/osu.Game/Rulesets/Mods/IMod.cs b/osu.Game/Rulesets/Mods/IMod.cs index 744d02a4fa..3a33d14835 100644 --- a/osu.Game/Rulesets/Mods/IMod.cs +++ b/osu.Game/Rulesets/Mods/IMod.cs @@ -66,6 +66,11 @@ namespace osu.Game.Rulesets.Mods /// bool AlwaysValidForSubmission { get; } + /// + /// Whether scores with this mod active can give performance points. + /// + bool Ranked { get; } + /// /// Create a fresh instance based on this mod. /// diff --git a/osu.Game/Rulesets/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs index 0500b49513..50c867f41b 100644 --- a/osu.Game/Rulesets/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -167,6 +167,12 @@ namespace osu.Game.Rulesets.Mods [JsonIgnore] public virtual bool RequiresConfiguration => false; + /// + /// Whether scores with this mod active can give performance points. + /// + [JsonIgnore] + public virtual bool Ranked => false; + /// /// The mods this mod cannot be enabled with. /// From 0642d740149b2daf8876d76b3b55c15709cd6144 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 31 Jan 2024 22:52:57 +0900 Subject: [PATCH 16/86] Expose as ReadOnlyDictionary --- .../PooledDrawableWithLifetimeContainer.cs | 19 +++++++++++-------- .../UI/GameplaySampleTriggerSource.cs | 2 +- osu.Game/Rulesets/UI/HitObjectContainer.cs | 2 +- .../Scrolling/ScrollingHitObjectContainer.cs | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs b/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs index 1ebdf48ae8..aed608cf8f 100644 --- a/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs +++ b/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Diagnostics; using System.Linq; using osu.Framework.Graphics; @@ -35,7 +36,7 @@ namespace osu.Game.Rulesets.Objects.Pooling /// /// The enumeration order is undefined. /// - public IEnumerable<(TEntry Entry, TDrawable Drawable)> AliveEntries => AliveDrawableMap.Select(x => (x.Key, x.Value)); + public readonly ReadOnlyDictionary AliveEntries; /// /// Whether to remove an entry when clock goes backward and crossed its . @@ -53,7 +54,7 @@ namespace osu.Game.Rulesets.Objects.Pooling /// internal double FutureLifetimeExtension { get; set; } - public readonly Dictionary AliveDrawableMap = new Dictionary(); + private readonly Dictionary aliveDrawableMap = new Dictionary(); private readonly HashSet allEntries = new HashSet(); private readonly LifetimeEntryManager lifetimeManager = new LifetimeEntryManager(); @@ -63,6 +64,8 @@ namespace osu.Game.Rulesets.Objects.Pooling lifetimeManager.EntryBecameAlive += entryBecameAlive; lifetimeManager.EntryBecameDead += entryBecameDead; lifetimeManager.EntryCrossedBoundary += entryCrossedBoundary; + + AliveEntries = new ReadOnlyDictionary(aliveDrawableMap); } /// @@ -101,10 +104,10 @@ namespace osu.Game.Rulesets.Objects.Pooling private void entryBecameAlive(LifetimeEntry lifetimeEntry) { var entry = (TEntry)lifetimeEntry; - Debug.Assert(!AliveDrawableMap.ContainsKey(entry)); + Debug.Assert(!aliveDrawableMap.ContainsKey(entry)); TDrawable drawable = GetDrawable(entry); - AliveDrawableMap[entry] = drawable; + aliveDrawableMap[entry] = drawable; AddDrawable(entry, drawable); } @@ -119,10 +122,10 @@ namespace osu.Game.Rulesets.Objects.Pooling private void entryBecameDead(LifetimeEntry lifetimeEntry) { var entry = (TEntry)lifetimeEntry; - Debug.Assert(AliveDrawableMap.ContainsKey(entry)); + Debug.Assert(aliveDrawableMap.ContainsKey(entry)); - TDrawable drawable = AliveDrawableMap[entry]; - AliveDrawableMap.Remove(entry); + TDrawable drawable = aliveDrawableMap[entry]; + aliveDrawableMap.Remove(entry); RemoveDrawable(entry, drawable); } @@ -148,7 +151,7 @@ namespace osu.Game.Rulesets.Objects.Pooling foreach (var entry in Entries.ToArray()) Remove(entry); - Debug.Assert(AliveDrawableMap.Count == 0); + Debug.Assert(aliveDrawableMap.Count == 0); } protected override bool CheckChildrenLife() diff --git a/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs b/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs index b61e8d9674..177520f28f 100644 --- a/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs +++ b/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs @@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.UI // If required, we can make this lookup more efficient by adding support to get next-future-entry in LifetimeEntryManager. var candidate = // Use alive entries first as an optimisation. - hitObjectContainer.AliveEntries.Select(tuple => tuple.Entry).Where(e => !isAlreadyHit(e)).MinBy(e => e.HitObject.StartTime) + hitObjectContainer.AliveEntries.Keys.Where(e => !isAlreadyHit(e)).MinBy(e => e.HitObject.StartTime) ?? hitObjectContainer.Entries.Where(e => !isAlreadyHit(e)).MinBy(e => e.HitObject.StartTime); // In the case there are no non-judged objects, the last hit object should be used instead. diff --git a/osu.Game/Rulesets/UI/HitObjectContainer.cs b/osu.Game/Rulesets/UI/HitObjectContainer.cs index 099be486b3..c2879e6d87 100644 --- a/osu.Game/Rulesets/UI/HitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/HitObjectContainer.cs @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.UI { public IEnumerable Objects => InternalChildren.Cast().OrderBy(h => h.HitObject.StartTime); - public IEnumerable AliveObjects => AliveEntries.Select(pair => pair.Drawable).OrderBy(h => h.HitObject.StartTime); + public IEnumerable AliveObjects => AliveEntries.Values.OrderBy(h => h.HitObject.StartTime); /// /// Invoked when a is judged. diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 23ac4378e4..4e72291b9c 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -186,7 +186,7 @@ namespace osu.Game.Rulesets.UI.Scrolling // to prevent hit objects displayed in a wrong position for one frame. // Only AliveEntries need to be considered for layout (reduces overhead in the case of scroll speed changes). // We are not using AliveObjects directly to avoid selection/sorting overhead since we don't care about the order at which positions will be updated. - foreach (var entry in AliveDrawableMap) + foreach (var entry in AliveEntries) { var obj = entry.Value; From f89923aeaee5785aeb4b91b6aaa3dfdf8b8ad791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 31 Jan 2024 14:59:35 +0100 Subject: [PATCH 17/86] Annotate mods that give pp --- osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs | 1 + osu.Game.Rulesets.Mania/Mods/ManiaModHardRock.cs | 1 + osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs | 1 + osu.Game.Rulesets.Mania/Mods/ManiaModKey10.cs | 1 + osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs | 1 + osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs | 1 + osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs | 1 + osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs | 1 + osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs | 1 + osu.Game/Rulesets/Mods/ModDaycore.cs | 1 + osu.Game/Rulesets/Mods/ModDoubleTime.cs | 1 + osu.Game/Rulesets/Mods/ModEasy.cs | 1 + osu.Game/Rulesets/Mods/ModFlashlight.cs | 1 + osu.Game/Rulesets/Mods/ModHalfTime.cs | 1 + osu.Game/Rulesets/Mods/ModHardRock.cs | 1 + osu.Game/Rulesets/Mods/ModHidden.cs | 1 + osu.Game/Rulesets/Mods/ModMuted.cs | 1 + osu.Game/Rulesets/Mods/ModNightcore.cs | 1 + osu.Game/Rulesets/Mods/ModNoFail.cs | 1 + osu.Game/Rulesets/Mods/ModPerfect.cs | 1 + osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 1 + 21 files changed, 21 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs index 050b302bd8..88d6a19822 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs @@ -15,6 +15,7 @@ namespace osu.Game.Rulesets.Mania.Mods public abstract int KeyCount { get; } public override ModType Type => ModType.Conversion; public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier + public override bool Ranked => UsesDefaultConfiguration; public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter) { diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModHardRock.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModHardRock.cs index d9de06a811..189c4b3a5f 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModHardRock.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModHardRock.cs @@ -8,5 +8,6 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModHardRock : ModHardRock { public override double ScoreMultiplier => 1; + public override bool Ranked => false; } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs index 31f52610e9..7dd0c499da 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs @@ -11,5 +11,6 @@ namespace osu.Game.Rulesets.Mania.Mods public override string Name => "One Key"; public override string Acronym => "1K"; public override LocalisableString Description => @"Play with one key."; + public override bool Ranked => false; } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey10.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey10.cs index 67e65b887a..a6c57d4597 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKey10.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey10.cs @@ -11,5 +11,6 @@ namespace osu.Game.Rulesets.Mania.Mods public override string Name => "Ten Keys"; public override string Acronym => "10K"; public override LocalisableString Description => @"Play with ten keys."; + public override bool Ranked => false; } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs index 0f8148d252..0d04395a52 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs @@ -11,5 +11,6 @@ namespace osu.Game.Rulesets.Mania.Mods public override string Name => "Two Keys"; public override string Acronym => "2K"; public override LocalisableString Description => @"Play with two keys."; + public override bool Ranked => false; } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs index 0f8af7940c..c83b0979ee 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs @@ -11,5 +11,6 @@ namespace osu.Game.Rulesets.Mania.Mods public override string Name => "Three Keys"; public override string Acronym => "3K"; public override LocalisableString Description => @"Play with three keys."; + public override bool Ranked => false; } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs index f9690b4298..cc7e270dda 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs @@ -14,6 +14,7 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModMirror : ModMirror, IApplicableToBeatmap { public override LocalisableString Description => "Notes are flipped horizontally."; + public override bool Ranked => UsesDefaultConfiguration; public void ApplyToBeatmap(IBeatmap beatmap) { diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs b/osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs index f691731afe..df9544b71e 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs @@ -22,6 +22,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override LocalisableString Description => @"Spinners will be automatically completed."; public override double ScoreMultiplier => 0.9; public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(OsuModAutopilot), typeof(OsuModTargetPractice) }; + public override bool Ranked => UsesDefaultConfiguration; public void ApplyToDrawableHitObject(DrawableHitObject hitObject) { diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs index f1468d414e..917685cdad 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs @@ -10,5 +10,6 @@ namespace osu.Game.Rulesets.Osu.Mods public class OsuModTouchDevice : ModTouchDevice { public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); + public override bool Ranked => UsesDefaultConfiguration; } } diff --git a/osu.Game/Rulesets/Mods/ModDaycore.cs b/osu.Game/Rulesets/Mods/ModDaycore.cs index 09b35c249e..359f8a950c 100644 --- a/osu.Game/Rulesets/Mods/ModDaycore.cs +++ b/osu.Game/Rulesets/Mods/ModDaycore.cs @@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => null; public override ModType Type => ModType.DifficultyReduction; public override LocalisableString Description => "Whoaaaaa..."; + public override bool Ranked => UsesDefaultConfiguration; [SettingSource("Speed decrease", "The actual decrease to apply", SettingControlType = typeof(MultiplierSettingsSlider))] public override BindableNumber SpeedChange { get; } = new BindableDouble(0.75) diff --git a/osu.Game/Rulesets/Mods/ModDoubleTime.cs b/osu.Game/Rulesets/Mods/ModDoubleTime.cs index 789291772d..8e430da368 100644 --- a/osu.Game/Rulesets/Mods/ModDoubleTime.cs +++ b/osu.Game/Rulesets/Mods/ModDoubleTime.cs @@ -18,6 +18,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => OsuIcon.ModDoubleTime; public override ModType Type => ModType.DifficultyIncrease; public override LocalisableString Description => "Zoooooooooom..."; + public override bool Ranked => UsesDefaultConfiguration; [SettingSource("Speed increase", "The actual increase to apply", SettingControlType = typeof(MultiplierSettingsSlider))] public override BindableNumber SpeedChange { get; } = new BindableDouble(1.5) diff --git a/osu.Game/Rulesets/Mods/ModEasy.cs b/osu.Game/Rulesets/Mods/ModEasy.cs index 0f51e2a6d5..da43a6b294 100644 --- a/osu.Game/Rulesets/Mods/ModEasy.cs +++ b/osu.Game/Rulesets/Mods/ModEasy.cs @@ -16,6 +16,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyReduction; public override double ScoreMultiplier => 0.5; public override Type[] IncompatibleMods => new[] { typeof(ModHardRock), typeof(ModDifficultyAdjust) }; + public override bool Ranked => UsesDefaultConfiguration; public virtual void ReadFromDifficulty(BeatmapDifficulty difficulty) { diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs index dc2ad6f47e..9227af64b8 100644 --- a/osu.Game/Rulesets/Mods/ModFlashlight.cs +++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs @@ -33,6 +33,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => OsuIcon.ModFlashlight; public override ModType Type => ModType.DifficultyIncrease; public override LocalisableString Description => "Restricted view area."; + public override bool Ranked => UsesDefaultConfiguration; [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] public abstract BindableFloat SizeMultiplier { get; } diff --git a/osu.Game/Rulesets/Mods/ModHalfTime.cs b/osu.Game/Rulesets/Mods/ModHalfTime.cs index 8b5dd39584..59e40ee9cc 100644 --- a/osu.Game/Rulesets/Mods/ModHalfTime.cs +++ b/osu.Game/Rulesets/Mods/ModHalfTime.cs @@ -18,6 +18,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => OsuIcon.ModHalftime; public override ModType Type => ModType.DifficultyReduction; public override LocalisableString Description => "Less zoom..."; + public override bool Ranked => UsesDefaultConfiguration; [SettingSource("Speed decrease", "The actual decrease to apply", SettingControlType = typeof(MultiplierSettingsSlider))] public override BindableNumber SpeedChange { get; } = new BindableDouble(0.75) diff --git a/osu.Game/Rulesets/Mods/ModHardRock.cs b/osu.Game/Rulesets/Mods/ModHardRock.cs index 4b2d1d050e..1e99891b99 100644 --- a/osu.Game/Rulesets/Mods/ModHardRock.cs +++ b/osu.Game/Rulesets/Mods/ModHardRock.cs @@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyIncrease; public override LocalisableString Description => "Everything just got a bit harder..."; public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModDifficultyAdjust) }; + public override bool Ranked => UsesDefaultConfiguration; protected const float ADJUST_RATIO = 1.4f; diff --git a/osu.Game/Rulesets/Mods/ModHidden.cs b/osu.Game/Rulesets/Mods/ModHidden.cs index 8b25768575..5a1abf115f 100644 --- a/osu.Game/Rulesets/Mods/ModHidden.cs +++ b/osu.Game/Rulesets/Mods/ModHidden.cs @@ -14,6 +14,7 @@ namespace osu.Game.Rulesets.Mods public override string Acronym => "HD"; public override IconUsage? Icon => OsuIcon.ModHidden; public override ModType Type => ModType.DifficultyIncrease; + public override bool Ranked => UsesDefaultConfiguration; public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) { diff --git a/osu.Game/Rulesets/Mods/ModMuted.cs b/osu.Game/Rulesets/Mods/ModMuted.cs index 131f501630..3ecd9aa6a1 100644 --- a/osu.Game/Rulesets/Mods/ModMuted.cs +++ b/osu.Game/Rulesets/Mods/ModMuted.cs @@ -25,6 +25,7 @@ namespace osu.Game.Rulesets.Mods public override LocalisableString Description => "Can you still feel the rhythm without music?"; public override ModType Type => ModType.Fun; public override double ScoreMultiplier => 1; + public override bool Ranked => UsesDefaultConfiguration; } public abstract class ModMuted : ModMuted, IApplicableToDrawableRuleset, IApplicableToTrack, IApplicableToScoreProcessor diff --git a/osu.Game/Rulesets/Mods/ModNightcore.cs b/osu.Game/Rulesets/Mods/ModNightcore.cs index b42927256c..bb18940f8c 100644 --- a/osu.Game/Rulesets/Mods/ModNightcore.cs +++ b/osu.Game/Rulesets/Mods/ModNightcore.cs @@ -28,6 +28,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => OsuIcon.ModNightcore; public override ModType Type => ModType.DifficultyIncrease; public override LocalisableString Description => "Uguuuuuuuu..."; + public override bool Ranked => UsesDefaultConfiguration; [SettingSource("Speed increase", "The actual increase to apply", SettingControlType = typeof(MultiplierSettingsSlider))] public override BindableNumber SpeedChange { get; } = new BindableDouble(1.5) diff --git a/osu.Game/Rulesets/Mods/ModNoFail.cs b/osu.Game/Rulesets/Mods/ModNoFail.cs index cc451772b2..1aaef8eac4 100644 --- a/osu.Game/Rulesets/Mods/ModNoFail.cs +++ b/osu.Game/Rulesets/Mods/ModNoFail.cs @@ -20,6 +20,7 @@ namespace osu.Game.Rulesets.Mods public override LocalisableString Description => "You can't fail, no matter what."; public override double ScoreMultiplier => 0.5; public override Type[] IncompatibleMods => new[] { typeof(ModFailCondition), typeof(ModCinema) }; + public override bool Ranked => UsesDefaultConfiguration; private readonly Bindable showHealthBar = new Bindable(); diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index 0ba40ba070..f8f498ceb5 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -19,6 +19,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyIncrease; public override double ScoreMultiplier => 1; public override LocalisableString Description => "SS or quit."; + public override bool Ranked => UsesDefaultConfiguration; public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(ModSuddenDeath), typeof(ModAccuracyChallenge) }).ToArray(); diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index 4e4e8662e8..62579a168c 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -19,6 +19,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyIncrease; public override LocalisableString Description => "Miss and fail."; public override double ScoreMultiplier => 1; + public override bool Ranked => UsesDefaultConfiguration; public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModPerfect)).ToArray(); From 5bbaeb6836cd9280f7e09d946192ba9e3ad69ddf Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Thu, 1 Feb 2024 16:08:33 +0300 Subject: [PATCH 18/86] Play legacy applause sound only when rank is B or higher --- .../Expanded/Accuracy/AccuracyCircle.cs | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs index 60c35e6203..5de5ceb2a8 100644 --- a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs +++ b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs @@ -10,7 +10,6 @@ using osu.Framework.Audio; using osu.Framework.Bindables; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Audio; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; @@ -86,6 +85,9 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy /// public static readonly Easing ACCURACY_TRANSFORM_EASING = Easing.OutPow10; + [Resolved] + private SkinManager skins { get; set; } + private readonly ScoreInfo score; private CircularProgress accuracyCircle; @@ -99,7 +101,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy private PoolableSkinnableSample swooshUpSound; private PoolableSkinnableSample rankImpactSound; private PoolableSkinnableSample rankApplauseSound; - private DrawableSample rankFailSound; + private PoolableSkinnableSample rankLegacyApplauseSound; private readonly Bindable tickPlaybackRate = new Bindable(); @@ -264,12 +266,12 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy AddRangeInternal(new Drawable[] { rankImpactSound = new PoolableSkinnableSample(new SampleInfo(impactSampleName)), - rankApplauseSound = new PoolableSkinnableSample(new SampleInfo(@"applause", applauseSampleName)), + rankApplauseSound = new PoolableSkinnableSample(new SampleInfo(applauseSampleName)), + rankLegacyApplauseSound = new PoolableSkinnableSample(new SampleInfo("applause")), scoreTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/score-tick")), badgeTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink")), badgeMaxSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink-max")), swooshUpSound = new PoolableSkinnableSample(new SampleInfo(@"Results/swoosh-up")), - rankFailSound = new DrawableSample(audio.Samples.Get(results_applause_d_sound)), }); } } @@ -399,15 +401,19 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy { Schedule(() => { - if (score.Rank != ScoreRank.F) + if (skins.CurrentSkin.Value is LegacySkin) { - rankApplauseSound.VolumeTo(applause_volume); - rankApplauseSound.Play(); + // only play legacy "applause" sound if score rank is B or higher. + if (score.Rank >= ScoreRank.B) + { + rankLegacyApplauseSound.VolumeTo(applause_volume); + rankLegacyApplauseSound.Play(); + } } else { - rankFailSound.VolumeTo(applause_volume); - rankFailSound.Play(); + rankApplauseSound.VolumeTo(applause_volume); + rankApplauseSound.Play(); } }); } @@ -451,8 +457,6 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy } } - private const string results_applause_d_sound = @"Results/applause-d"; - private string applauseSampleName { get @@ -461,7 +465,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy { default: case ScoreRank.D: - return results_applause_d_sound; + return @"Results/applause-d"; case ScoreRank.C: return @"Results/applause-c"; From 6ab8960fdc630d4110734d206bd15c417b76d0f5 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Thu, 1 Feb 2024 16:08:48 +0300 Subject: [PATCH 19/86] Add step for toggling skins in results screen test scene --- osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs index 122149be44..2bda242de2 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs @@ -62,6 +62,12 @@ namespace osu.Game.Tests.Visual.Ranking if (beatmapInfo != null) Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmapInfo); }); + + AddToggleStep("toggle skin", v => + { + if (skins != null) + skins.CurrentSkinInfo.Value = v ? skins.DefaultClassicSkin.SkinInfo : skins.CurrentSkinInfo.Default; + }); } [SetUp] From b0f6a87a2b6119f82c6219f73363e6c6578d0d2d Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 1 Feb 2024 15:35:23 +0300 Subject: [PATCH 20/86] Add stress test in TestSceneDashboardOverlay --- .../Online/TestSceneDashboardOverlay.cs | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs index 9407941da6..b6a300322f 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs @@ -2,14 +2,15 @@ // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; +using osu.Framework.Allocation; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; namespace osu.Game.Tests.Visual.Online { public partial class TestSceneDashboardOverlay : OsuTestScene { - protected override bool UseOnlineAPI => true; - private readonly DashboardOverlay overlay; public TestSceneDashboardOverlay() @@ -17,6 +18,30 @@ namespace osu.Game.Tests.Visual.Online Add(overlay = new DashboardOverlay()); } + [BackgroundDependencyLoader] + private void load() + { + int supportLevel = 0; + + for (int i = 0; i < 1000; i++) + { + supportLevel++; + + if (supportLevel > 3) + supportLevel = 0; + + ((DummyAPIAccess)API).Friends.Add(new APIUser + { + Username = @"peppy", + Id = 2, + Colour = "99EB47", + CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg", + IsSupporter = supportLevel > 0, + SupportLevel = supportLevel + }); + } + } + [Test] public void TestShow() { From 2bd9dcf646127261c62e1a8c913768a9a59d0221 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 1 Feb 2024 16:13:36 +0300 Subject: [PATCH 21/86] Rework UserGridPanel to reduce containers nesting --- osu.Game/Users/UserGridPanel.cs | 138 ++++++++++++++------------------ 1 file changed, 62 insertions(+), 76 deletions(-) diff --git a/osu.Game/Users/UserGridPanel.cs b/osu.Game/Users/UserGridPanel.cs index fe3435c248..fce543415d 100644 --- a/osu.Game/Users/UserGridPanel.cs +++ b/osu.Game/Users/UserGridPanel.cs @@ -35,98 +35,84 @@ namespace osu.Game.Users { FillFlowContainer details; - var layout = new Container + var layout = new GridContainer { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(margin), - Child = new GridContainer + ColumnDimensions = new[] { - RelativeSizeAxes = Axes.Both, - ColumnDimensions = new[] + new Dimension(GridSizeMode.AutoSize), + new Dimension() + }, + RowDimensions = new[] + { + new Dimension(GridSizeMode.AutoSize), + new Dimension() + }, + Content = new[] + { + new Drawable[] { - new Dimension(GridSizeMode.AutoSize), - new Dimension() - }, - RowDimensions = new[] - { - new Dimension(GridSizeMode.AutoSize), - new Dimension(GridSizeMode.Absolute, margin), - new Dimension() - }, - Content = new[] - { - new Drawable[] + CreateAvatar().With(avatar => { - CreateAvatar().With(avatar => + avatar.Size = new Vector2(60); + avatar.Masking = true; + avatar.CornerRadius = 6; + avatar.Margin = new MarginPadding { Bottom = margin }; + }), + new GridContainer + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Left = margin, Bottom = margin }, + ColumnDimensions = new[] { - avatar.Size = new Vector2(60); - avatar.Masking = true; - avatar.CornerRadius = 6; - }), - new Container + new Dimension() + }, + RowDimensions = new[] { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Left = margin }, - Child = new GridContainer + new Dimension(GridSizeMode.AutoSize), + new Dimension() + }, + Content = new[] + { + new Drawable[] { - RelativeSizeAxes = Axes.Both, - ColumnDimensions = new[] + details = new FillFlowContainer { - new Dimension() - }, - RowDimensions = new[] - { - new Dimension(GridSizeMode.AutoSize), - new Dimension() - }, - Content = new[] - { - new Drawable[] + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(6), + Children = new Drawable[] { - details = new FillFlowContainer - { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Spacing = new Vector2(6), - Children = new Drawable[] - { - CreateFlag(), - // supporter icon is being added later - } - } - }, - new Drawable[] - { - CreateUsername().With(username => - { - username.Anchor = Anchor.CentreLeft; - username.Origin = Anchor.CentreLeft; - }) + CreateFlag(), + // supporter icon is being added later } } + }, + new Drawable[] + { + CreateUsername().With(username => + { + username.Anchor = Anchor.CentreLeft; + username.Origin = Anchor.CentreLeft; + }) } } - }, - new[] - { - // padding - Empty(), - Empty() - }, - new Drawable[] - { - CreateStatusIcon().With(icon => - { - icon.Anchor = Anchor.Centre; - icon.Origin = Anchor.Centre; - }), - CreateStatusMessage(false).With(message => - { - message.Anchor = Anchor.CentreLeft; - message.Origin = Anchor.CentreLeft; - message.Margin = new MarginPadding { Left = margin }; - }) } + }, + new Drawable[] + { + CreateStatusIcon().With(icon => + { + icon.Anchor = Anchor.Centre; + icon.Origin = Anchor.Centre; + }), + CreateStatusMessage(false).With(message => + { + message.Anchor = Anchor.CentreLeft; + message.Origin = Anchor.CentreLeft; + message.Margin = new MarginPadding { Left = margin }; + }) } } }; From 66350fd148f7189535b1c070af9d3321cc9704d3 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 1 Feb 2024 16:33:54 +0300 Subject: [PATCH 22/86] Refactor UserRankPanel layout --- osu.Game/Users/UserRankPanel.cs | 116 +++++++++++++------------------- 1 file changed, 47 insertions(+), 69 deletions(-) diff --git a/osu.Game/Users/UserRankPanel.cs b/osu.Game/Users/UserRankPanel.cs index a38962dfc7..84ff3114fc 100644 --- a/osu.Game/Users/UserRankPanel.cs +++ b/osu.Game/Users/UserRankPanel.cs @@ -81,117 +81,95 @@ namespace osu.Game.Users }, new GridContainer { - AutoSizeAxes = Axes.Y, - RelativeSizeAxes = Axes.X, + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding(padding), ColumnDimensions = new[] { - new Dimension(GridSizeMode.Absolute, padding), new Dimension(GridSizeMode.AutoSize), new Dimension(), - new Dimension(GridSizeMode.Absolute, padding), }, RowDimensions = new[] { - new Dimension(GridSizeMode.Absolute, padding), - new Dimension(GridSizeMode.AutoSize), + new Dimension() }, Content = new[] { - new[] + new Drawable[] { - // padding - Empty(), - Empty(), - Empty(), - Empty() - }, - new[] - { - Empty(), // padding CreateAvatar().With(avatar => { avatar.Size = new Vector2(60); avatar.Masking = true; avatar.CornerRadius = 6; }), - new Container + new GridContainer { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = padding }, - Child = new GridContainer + ColumnDimensions = new[] { - RelativeSizeAxes = Axes.Both, - ColumnDimensions = new[] + new Dimension() + }, + RowDimensions = new[] + { + new Dimension(GridSizeMode.AutoSize), + new Dimension() + }, + Content = new[] + { + new Drawable[] { - new Dimension() - }, - RowDimensions = new[] - { - new Dimension(GridSizeMode.AutoSize), - new Dimension() - }, - Content = new[] - { - new Drawable[] + details = new FillFlowContainer { - details = new FillFlowContainer + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(6), + Children = new Drawable[] { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Spacing = new Vector2(6), - Children = new Drawable[] - { - CreateFlag(), - // supporter icon is being added later - } + CreateFlag(), + // supporter icon is being added later } - }, - new Drawable[] - { - CreateUsername().With(username => - { - username.Anchor = Anchor.CentreLeft; - username.Origin = Anchor.CentreLeft; - }) } + }, + new Drawable[] + { + CreateUsername().With(username => + { + username.Anchor = Anchor.CentreLeft; + username.Origin = Anchor.CentreLeft; + }) } } - }, - Empty() // padding + } } } } } }, - new Container + new GridContainer { Name = "Bottom content", Margin = new MarginPadding { Top = main_content_height }, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Left = 80, Vertical = padding }, - Child = new GridContainer + ColumnDimensions = new[] { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - ColumnDimensions = new[] + new Dimension(), + new Dimension() + }, + RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) }, + Content = new[] + { + new Drawable[] { - new Dimension(), - new Dimension() - }, - RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) }, - Content = new[] - { - new Drawable[] + globalRankDisplay = new ProfileValueDisplay(true) { - globalRankDisplay = new ProfileValueDisplay(true) - { - Title = UsersStrings.ShowRankGlobalSimple, - }, - countryRankDisplay = new ProfileValueDisplay(true) - { - Title = UsersStrings.ShowRankCountrySimple, - } + Title = UsersStrings.ShowRankGlobalSimple, + }, + countryRankDisplay = new ProfileValueDisplay(true) + { + Title = UsersStrings.ShowRankCountrySimple, } } } From 966093f7cea7097e9095d5595cc8401e317b3fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 31 Jan 2024 15:50:43 +0100 Subject: [PATCH 23/86] Transform score multiplier display to also show ranked state --- .../TestSceneModSelectOverlay.cs | 8 +- ... => TestSceneRankingInformationDisplay.cs} | 18 ++-- .../Localisation/ModSelectOverlayStrings.cs | 20 ++++ osu.Game/Overlays/Mods/ModSelectOverlay.cs | 19 ++-- ...isplay.cs => RankingInformationDisplay.cs} | 95 ++++++++++++------- 5 files changed, 105 insertions(+), 55 deletions(-) rename osu.Game.Tests/Visual/UserInterface/{TestSceneScoreMultiplierDisplay.cs => TestSceneRankingInformationDisplay.cs} (50%) rename osu.Game/Overlays/Mods/{ScoreMultiplierDisplay.cs => RankingInformationDisplay.cs} (60%) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs index 046954db47..99a5897dff 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs @@ -119,7 +119,7 @@ namespace osu.Game.Tests.Visual.UserInterface AddAssert("mod multiplier correct", () => { double multiplier = SelectedMods.Value.Aggregate(1d, (m, mod) => m * mod.ScoreMultiplier); - return Precision.AlmostEquals(multiplier, modSelectOverlay.ChildrenOfType().Single().Current.Value); + return Precision.AlmostEquals(multiplier, modSelectOverlay.ChildrenOfType().Single().ModMultiplier.Value); }); assertCustomisationToggleState(disabled: false, active: false); AddAssert("setting items created", () => modSelectOverlay.ChildrenOfType().Any()); @@ -134,7 +134,7 @@ namespace osu.Game.Tests.Visual.UserInterface AddAssert("mod multiplier correct", () => { double multiplier = SelectedMods.Value.Aggregate(1d, (m, mod) => m * mod.ScoreMultiplier); - return Precision.AlmostEquals(multiplier, modSelectOverlay.ChildrenOfType().Single().Current.Value); + return Precision.AlmostEquals(multiplier, modSelectOverlay.ChildrenOfType().Single().ModMultiplier.Value); }); assertCustomisationToggleState(disabled: false, active: false); AddAssert("setting items created", () => modSelectOverlay.ChildrenOfType().Any()); @@ -846,7 +846,7 @@ namespace osu.Game.Tests.Visual.UserInterface InputManager.Click(MouseButton.Left); }); AddAssert("difficulty multiplier display shows correct value", - () => modSelectOverlay.ChildrenOfType().Single().Current.Value, () => Is.EqualTo(0.1).Within(Precision.DOUBLE_EPSILON)); + () => modSelectOverlay.ChildrenOfType().Single().ModMultiplier.Value, () => Is.EqualTo(0.1).Within(Precision.DOUBLE_EPSILON)); // this is highly unorthodox in a test, but because the `ModSettingChangeTracker` machinery heavily leans on events and object disposal and re-creation, // it is instrumental in the reproduction of the failure scenario that this test is supposed to cover. @@ -856,7 +856,7 @@ namespace osu.Game.Tests.Visual.UserInterface AddStep("reset half time speed to default", () => modSelectOverlay.ChildrenOfType().Single() .ChildrenOfType>().Single().TriggerClick()); AddUntilStep("difficulty multiplier display shows correct value", - () => modSelectOverlay.ChildrenOfType().Single().Current.Value, () => Is.EqualTo(0.3).Within(Precision.DOUBLE_EPSILON)); + () => modSelectOverlay.ChildrenOfType().Single().ModMultiplier.Value, () => Is.EqualTo(0.3).Within(Precision.DOUBLE_EPSILON)); } private void waitForColumnLoad() => AddUntilStep("all column content loaded", () => diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneScoreMultiplierDisplay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneRankingInformationDisplay.cs similarity index 50% rename from osu.Game.Tests/Visual/UserInterface/TestSceneScoreMultiplierDisplay.cs rename to osu.Game.Tests/Visual/UserInterface/TestSceneRankingInformationDisplay.cs index c2ddd814b7..42f243cc21 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneScoreMultiplierDisplay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneRankingInformationDisplay.cs @@ -11,7 +11,7 @@ using osu.Game.Overlays.Mods; namespace osu.Game.Tests.Visual.UserInterface { [TestFixture] - public partial class TestSceneScoreMultiplierDisplay : OsuTestScene + public partial class TestSceneRankingInformationDisplay : OsuTestScene { [Cached] private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Green); @@ -19,22 +19,24 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] public void TestBasic() { - ScoreMultiplierDisplay multiplierDisplay = null!; + RankingInformationDisplay onlinePropertiesDisplay = null!; - AddStep("create content", () => Child = multiplierDisplay = new ScoreMultiplierDisplay + AddStep("create content", () => Child = onlinePropertiesDisplay = new RankingInformationDisplay { Anchor = Anchor.Centre, Origin = Anchor.Centre }); - AddStep("set multiplier below 1", () => multiplierDisplay.Current.Value = 0.5); - AddStep("set multiplier to 1", () => multiplierDisplay.Current.Value = 1); - AddStep("set multiplier above 1", () => multiplierDisplay.Current.Value = 1.5); + AddToggleStep("toggle ranked", ranked => onlinePropertiesDisplay.Ranked.Value = ranked); + + AddStep("set multiplier below 1", () => onlinePropertiesDisplay.ModMultiplier.Value = 0.5); + AddStep("set multiplier to 1", () => onlinePropertiesDisplay.ModMultiplier.Value = 1); + AddStep("set multiplier above 1", () => onlinePropertiesDisplay.ModMultiplier.Value = 1.5); AddSliderStep("set multiplier", 0, 2, 1d, multiplier => { - if (multiplierDisplay.IsNotNull()) - multiplierDisplay.Current.Value = multiplier; + if (onlinePropertiesDisplay.IsNotNull()) + onlinePropertiesDisplay.ModMultiplier.Value = multiplier; }); } } diff --git a/osu.Game/Localisation/ModSelectOverlayStrings.cs b/osu.Game/Localisation/ModSelectOverlayStrings.cs index 86ebebd293..9513eacf02 100644 --- a/osu.Game/Localisation/ModSelectOverlayStrings.cs +++ b/osu.Game/Localisation/ModSelectOverlayStrings.cs @@ -49,6 +49,26 @@ namespace osu.Game.Localisation /// public static LocalisableString ScoreMultiplier => new TranslatableString(getKey(@"score_multiplier"), @"Score Multiplier"); + /// + /// "Ranked" + /// + public static LocalisableString Ranked => new TranslatableString(getKey(@"ranked"), @"Ranked"); + + /// + /// "Performance points can be granted for the active mods." + /// + public static LocalisableString RankedExplanation => new TranslatableString(getKey(@"ranked_explanation"), @"Performance points can be granted for the active mods."); + + /// + /// "Unranked" + /// + public static LocalisableString Unranked => new TranslatableString(getKey(@"unranked"), @"Unranked"); + + /// + /// "Performance points will not be granted due to active mods." + /// + public static LocalisableString UnrankedExplanation => new TranslatableString(getKey(@"ranked_explanation"), @"Performance points will not be granted due to active mods."); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 7271c53e7a..ddf96c1cb3 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -125,7 +125,7 @@ namespace osu.Game.Overlays.Mods private DeselectAllModsButton deselectAllModsButton = null!; private Container aboveColumnsContent = null!; - private ScoreMultiplierDisplay? multiplierDisplay; + private RankingInformationDisplay? rankingInformationDisplay; private BeatmapAttributesDisplay? beatmapAttributesDisplay; protected ShearedButton BackButton { get; private set; } = null!; @@ -185,7 +185,7 @@ namespace osu.Game.Overlays.Mods aboveColumnsContent = new Container { RelativeSizeAxes = Axes.X, - Height = ScoreMultiplierDisplay.HEIGHT, + Height = RankingInformationDisplay.HEIGHT, Padding = new MarginPadding { Horizontal = 100 }, Child = SearchTextBox = new ShearedSearchTextBox { @@ -200,7 +200,7 @@ namespace osu.Game.Overlays.Mods { Padding = new MarginPadding { - Top = ScoreMultiplierDisplay.HEIGHT + PADDING, + Top = RankingInformationDisplay.HEIGHT + PADDING, Bottom = PADDING }, RelativeSizeAxes = Axes.Both, @@ -269,7 +269,7 @@ namespace osu.Game.Overlays.Mods }, Children = new Drawable[] { - multiplierDisplay = new ScoreMultiplierDisplay + rankingInformationDisplay = new RankingInformationDisplay { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight @@ -315,7 +315,7 @@ namespace osu.Game.Overlays.Mods SelectedMods.BindValueChanged(_ => { - updateMultiplier(); + updateRankingInformation(); updateFromExternalSelection(); updateCustomisation(); @@ -328,7 +328,7 @@ namespace osu.Game.Overlays.Mods // // See https://github.com/ppy/osu/pull/23284#issuecomment-1529056988 modSettingChangeTracker = new ModSettingChangeTracker(SelectedMods.Value); - modSettingChangeTracker.SettingChanged += _ => updateMultiplier(); + modSettingChangeTracker.SettingChanged += _ => updateRankingInformation(); } }, true); @@ -450,9 +450,9 @@ namespace osu.Game.Overlays.Mods modState.ValidForSelection.Value = modState.Mod.Type != ModType.System && modState.Mod.HasImplementation && IsValidMod.Invoke(modState.Mod); } - private void updateMultiplier() + private void updateRankingInformation() { - if (multiplierDisplay == null) + if (rankingInformationDisplay == null) return; double multiplier = 1.0; @@ -460,7 +460,8 @@ namespace osu.Game.Overlays.Mods foreach (var mod in SelectedMods.Value) multiplier *= mod.ScoreMultiplier; - multiplierDisplay.Current.Value = multiplier; + rankingInformationDisplay.ModMultiplier.Value = multiplier; + rankingInformationDisplay.Ranked.Value = SelectedMods.Value.All(m => m.Ranked); } private void updateCustomisation() diff --git a/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs b/osu.Game/Overlays/Mods/RankingInformationDisplay.cs similarity index 60% rename from osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs rename to osu.Game/Overlays/Mods/RankingInformationDisplay.cs index a86eba81e4..494f8a377f 100644 --- a/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs +++ b/osu.Game/Overlays/Mods/RankingInformationDisplay.cs @@ -6,8 +6,8 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.UserInterface; using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; @@ -22,15 +22,13 @@ namespace osu.Game.Overlays.Mods /// /// On the mod select overlay, this provides a local updating view of the aggregate score multiplier coming from mods. /// - public partial class ScoreMultiplierDisplay : ModFooterInformationDisplay, IHasCurrentValue + public partial class RankingInformationDisplay : ModFooterInformationDisplay { public const float HEIGHT = 42; - public Bindable Current - { - get => current.Current; - set => current.Current = value; - } + public Bindable ModMultiplier = new BindableDouble(1); + + public Bindable Ranked { get; } = new BindableBool(true); private readonly BindableWithCurrent current = new BindableWithCurrent(); @@ -39,16 +37,11 @@ namespace osu.Game.Overlays.Mods private RollingCounter counter = null!; private Box flashLayer = null!; + private TextWithTooltip rankedText = null!; [Resolved] private OsuColour colours { get; set; } = null!; - public ScoreMultiplierDisplay() - { - Current.Default = 1d; - Current.Value = 1d; - } - [BackgroundDependencyLoader] private void load() { @@ -75,13 +68,20 @@ namespace osu.Game.Overlays.Mods LeftContent.AddRange(new Drawable[] { - new OsuSpriteText + new Container { + Width = 50, + RelativeSizeAxes = Axes.Y, + Margin = new MarginPadding(10), Anchor = Anchor.Centre, Origin = Anchor.Centre, - Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0), - Text = ModSelectOverlayStrings.ScoreMultiplier, - Font = OsuFont.Default.With(size: 17, weight: FontWeight.SemiBold) + Child = rankedText = new TextWithTooltip + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0), + Font = OsuFont.Default.With(size: 17, weight: FontWeight.SemiBold) + } } }); @@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Mods Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0), Anchor = Anchor.Centre, Origin = Anchor.Centre, - Current = { BindTarget = Current } + Current = { BindTarget = ModMultiplier } } }); } @@ -106,30 +106,22 @@ namespace osu.Game.Overlays.Mods { base.LoadComplete(); - Current.BindValueChanged(e => + ModMultiplier.BindValueChanged(e => { - if (e.NewValue > Current.Default) + if (e.NewValue > ModMultiplier.Default) { - MainBackground - .FadeColour(colours.ForModType(ModType.DifficultyIncrease), transition_duration, Easing.OutQuint); - counter.FadeColour(ColourProvider.Background5, transition_duration, Easing.OutQuint); + counter.FadeColour(colours.ForModType(ModType.DifficultyIncrease), transition_duration, Easing.OutQuint); } - else if (e.NewValue < Current.Default) + else if (e.NewValue < ModMultiplier.Default) { - MainBackground - .FadeColour(colours.ForModType(ModType.DifficultyReduction), transition_duration, Easing.OutQuint); - counter.FadeColour(ColourProvider.Background5, transition_duration, Easing.OutQuint); + counter.FadeColour(colours.ForModType(ModType.DifficultyReduction), transition_duration, Easing.OutQuint); } else { - MainBackground.FadeColour(ColourProvider.Background4, transition_duration, Easing.OutQuint); counter.FadeColour(Colour4.White, transition_duration, Easing.OutQuint); } - flashLayer - .FadeOutFromOne() - .FadeTo(0.15f, 60, Easing.OutQuint) - .Then().FadeOut(500, Easing.OutQuint); + flash(); const float move_amount = 4; if (e.NewValue > e.OldValue) @@ -140,10 +132,43 @@ namespace osu.Game.Overlays.Mods // required to prevent the counter initially rolling up from 0 to 1 // due to `Current.Value` having a nonstandard default value of 1. - counter.SetCountWithoutRolling(Current.Value); + counter.SetCountWithoutRolling(ModMultiplier.Value); + + Ranked.BindValueChanged(e => + { + flash(); + + if (e.NewValue) + { + rankedText.Text = ModSelectOverlayStrings.Ranked; + rankedText.TooltipText = ModSelectOverlayStrings.RankedExplanation; + rankedText.FadeColour(Colour4.White, transition_duration, Easing.OutQuint); + FrontBackground.FadeColour(ColourProvider.Background3, transition_duration, Easing.OutQuint); + } + else + { + rankedText.Text = ModSelectOverlayStrings.Unranked; + rankedText.TooltipText = ModSelectOverlayStrings.UnrankedExplanation; + rankedText.FadeColour(ColourProvider.Background5, transition_duration, Easing.OutQuint); + FrontBackground.FadeColour(colours.Orange1, transition_duration, Easing.OutQuint); + } + }, true); } - private partial class EffectCounter : RollingCounter + private void flash() + { + flashLayer + .FadeOutFromOne() + .FadeTo(0.15f, 60, Easing.OutQuint) + .Then().FadeOut(500, Easing.OutQuint); + } + + private partial class TextWithTooltip : OsuSpriteText, IHasTooltip + { + public LocalisableString TooltipText { get; set; } + } + + private partial class EffectCounter : RollingCounter, IHasTooltip { protected override double RollingDuration => 250; @@ -155,6 +180,8 @@ namespace osu.Game.Overlays.Mods Origin = Anchor.Centre, Font = OsuFont.Default.With(size: 17, weight: FontWeight.SemiBold) }; + + public LocalisableString TooltipText => ModSelectOverlayStrings.ScoreMultiplier; } } } From f87ab197318b08e91757b82ea5898de19487b495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 1 Feb 2024 21:22:36 +0100 Subject: [PATCH 24/86] Apply NRT to `FooterButtonMods` --- osu.Game/Screens/Select/FooterButtonMods.cs | 47 ++++++++++----------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/osu.Game/Screens/Select/FooterButtonMods.cs b/osu.Game/Screens/Select/FooterButtonMods.cs index 69782c25bb..57784dd6ca 100644 --- a/osu.Game/Screens/Select/FooterButtonMods.cs +++ b/osu.Game/Screens/Select/FooterButtonMods.cs @@ -1,15 +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 osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Screens.Play.HUD; using osu.Game.Rulesets.Mods; using System.Collections.Generic; using System.Linq; -using JetBrains.Annotations; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics.UserInterface; @@ -31,28 +28,14 @@ namespace osu.Game.Screens.Select set => modDisplay.Current = value; } - protected readonly OsuSpriteText MultiplierText; - private readonly ModDisplay modDisplay; + protected OsuSpriteText MultiplierText { get; private set; } = null!; + private ModDisplay modDisplay = null!; + + private ModSettingChangeTracker? modSettingChangeTracker; + private Color4 lowMultiplierColour; private Color4 highMultiplierColour; - public FooterButtonMods() - { - ButtonContentContainer.Add(modDisplay = new ModDisplay - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Scale = new Vector2(0.8f), - ExpansionMode = ExpansionMode.AlwaysContracted, - }); - ButtonContentContainer.Add(MultiplierText = new OsuSpriteText - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Font = OsuFont.GetFont(weight: FontWeight.Bold), - }); - } - [BackgroundDependencyLoader] private void load(OsuColour colours) { @@ -62,10 +45,24 @@ namespace osu.Game.Screens.Select highMultiplierColour = colours.Green; Text = @"mods"; Hotkey = GlobalAction.ToggleModSelection; - } - [CanBeNull] - private ModSettingChangeTracker modSettingChangeTracker; + ButtonContentContainer.AddRange(new Drawable[] + { + modDisplay = new ModDisplay + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Scale = new Vector2(0.8f), + ExpansionMode = ExpansionMode.AlwaysContracted, + }, + MultiplierText = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Font = OsuFont.GetFont(weight: FontWeight.Bold), + } + }); + } protected override void LoadComplete() { From 865f4d76fff5fe0cff3d7c2d6cf2aae95c99ffac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 1 Feb 2024 21:51:41 +0100 Subject: [PATCH 25/86] Add unranked indicator to song select footer too --- .../TestSceneFooterButtonMods.cs | 11 ++++ osu.Game/Screens/Select/FooterButtonMods.cs | 58 ++++++++++++++++--- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs index a95bb2c9e3..b79ce6c75f 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; +using osu.Framework.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Mods; @@ -67,6 +68,15 @@ namespace osu.Game.Tests.Visual.UserInterface AddAssert(@"Check empty multiplier", () => assertModsMultiplier(Array.Empty())); } + [Test] + public void TestUnrankedBadge() + { + AddStep(@"Add unranked mod", () => changeMods(new[] { new OsuModDeflate() })); + AddAssert("Unranked badge shown", () => footerButtonMods.UnrankedBadge.Alpha == 1); + AddStep(@"Clear selected mod", () => changeMods(Array.Empty())); + AddAssert("Unranked badge not shown", () => footerButtonMods.UnrankedBadge.Alpha == 0); + } + private void changeMods(IReadOnlyList mods) { footerButtonMods.Current.Value = mods; @@ -83,6 +93,7 @@ namespace osu.Game.Tests.Visual.UserInterface private partial class TestFooterButtonMods : FooterButtonMods { public new OsuSpriteText MultiplierText => base.MultiplierText; + public new Drawable UnrankedBadge => base.UnrankedBadge; } } } diff --git a/osu.Game/Screens/Select/FooterButtonMods.cs b/osu.Game/Screens/Select/FooterButtonMods.cs index 57784dd6ca..5685910c0a 100644 --- a/osu.Game/Screens/Select/FooterButtonMods.cs +++ b/osu.Game/Screens/Select/FooterButtonMods.cs @@ -9,6 +9,9 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Extensions.LocalisationExtensions; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; using osu.Game.Graphics; @@ -16,6 +19,7 @@ using osu.Game.Graphics.Sprites; using osuTK; using osuTK.Graphics; using osu.Game.Input.Bindings; +using osu.Game.Localisation; using osu.Game.Utils; namespace osu.Game.Screens.Select @@ -29,13 +33,27 @@ namespace osu.Game.Screens.Select } protected OsuSpriteText MultiplierText { get; private set; } = null!; - private ModDisplay modDisplay = null!; + protected Container UnrankedBadge { get; private set; } = null!; + + private readonly ModDisplay modDisplay; private ModSettingChangeTracker? modSettingChangeTracker; private Color4 lowMultiplierColour; private Color4 highMultiplierColour; + public FooterButtonMods() + { + // must be created in ctor for correct operation of `Current`. + modDisplay = new ModDisplay + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Scale = new Vector2(0.8f), + ExpansionMode = ExpansionMode.AlwaysContracted, + }; + } + [BackgroundDependencyLoader] private void load(OsuColour colours) { @@ -48,19 +66,38 @@ namespace osu.Game.Screens.Select ButtonContentContainer.AddRange(new Drawable[] { - modDisplay = new ModDisplay - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Scale = new Vector2(0.8f), - ExpansionMode = ExpansionMode.AlwaysContracted, - }, + modDisplay, MultiplierText = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.GetFont(weight: FontWeight.Bold), - } + }, + UnrankedBadge = new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Children = new Drawable[] + { + new Circle + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Colour = colours.Yellow, + RelativeSizeAxes = Axes.Both, + }, + new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Colour = colours.Gray2, + Padding = new MarginPadding(5), + UseFullGlyphHeight = false, + Text = ModSelectOverlayStrings.Unranked.ToLower() + } + } + }, }); } @@ -98,6 +135,9 @@ namespace osu.Game.Screens.Select modDisplay.FadeIn(); else modDisplay.FadeOut(); + + bool anyUnrankedMods = Current.Value?.Any(m => !m.Ranked) == true; + UnrankedBadge.FadeTo(anyUnrankedMods ? 1 : 0); }); } } From c114fd8f8963f28b06df951145486689ad0084db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 1 Feb 2024 22:28:49 +0100 Subject: [PATCH 26/86] Allow pp for Sudden Death and Perfect regardless of "restart on fail" setting Closes https://github.com/ppy/osu/issues/26844. --- osu.Game/Rulesets/Mods/ModPerfect.cs | 2 +- osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index f8f498ceb5..5bedf443da 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyIncrease; public override double ScoreMultiplier => 1; public override LocalisableString Description => "SS or quit."; - public override bool Ranked => UsesDefaultConfiguration; + public override bool Ranked => true; public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(ModSuddenDeath), typeof(ModAccuracyChallenge) }).ToArray(); diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index 62579a168c..d07ff6ce87 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyIncrease; public override LocalisableString Description => "Miss and fail."; public override double ScoreMultiplier => 1; - public override bool Ranked => UsesDefaultConfiguration; + public override bool Ranked => true; public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModPerfect)).ToArray(); From 96f66aaa2e4eaa44c167e32af51fde84ad1e6a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 1 Feb 2024 22:30:26 +0100 Subject: [PATCH 27/86] Allow pp for Accuracy Challenge Addresses https://github.com/ppy/osu/discussions/26919. --- osu.Game/Rulesets/Mods/ModAccuracyChallenge.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Rulesets/Mods/ModAccuracyChallenge.cs b/osu.Game/Rulesets/Mods/ModAccuracyChallenge.cs index 0072c21053..9570cddb0a 100644 --- a/osu.Game/Rulesets/Mods/ModAccuracyChallenge.cs +++ b/osu.Game/Rulesets/Mods/ModAccuracyChallenge.cs @@ -31,6 +31,8 @@ namespace osu.Game.Rulesets.Mods public override bool RequiresConfiguration => false; + public override bool Ranked => true; + public override string SettingDescription => base.SettingDescription.Replace(MinimumAccuracy.ToString(), MinimumAccuracy.Value.ToString("##%", NumberFormatInfo.InvariantInfo)); [SettingSource("Minimum accuracy", "Trigger a failure if your accuracy goes below this value.", SettingControlType = typeof(SettingsPercentageSlider))] From ea76f7a5d88a3060369db0529330c3c28ea35752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 1 Feb 2024 22:33:49 +0100 Subject: [PATCH 28/86] Allow pp for Double/Half Time's "adjust pitch" setting --- osu.Game/Rulesets/Mods/ModDoubleTime.cs | 2 +- osu.Game/Rulesets/Mods/ModHalfTime.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModDoubleTime.cs b/osu.Game/Rulesets/Mods/ModDoubleTime.cs index 8e430da368..fd5120a767 100644 --- a/osu.Game/Rulesets/Mods/ModDoubleTime.cs +++ b/osu.Game/Rulesets/Mods/ModDoubleTime.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => OsuIcon.ModDoubleTime; public override ModType Type => ModType.DifficultyIncrease; public override LocalisableString Description => "Zoooooooooom..."; - public override bool Ranked => UsesDefaultConfiguration; + public override bool Ranked => SpeedChange.IsDefault; [SettingSource("Speed increase", "The actual increase to apply", SettingControlType = typeof(MultiplierSettingsSlider))] public override BindableNumber SpeedChange { get; } = new BindableDouble(1.5) diff --git a/osu.Game/Rulesets/Mods/ModHalfTime.cs b/osu.Game/Rulesets/Mods/ModHalfTime.cs index 59e40ee9cc..efdf0d6358 100644 --- a/osu.Game/Rulesets/Mods/ModHalfTime.cs +++ b/osu.Game/Rulesets/Mods/ModHalfTime.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => OsuIcon.ModHalftime; public override ModType Type => ModType.DifficultyReduction; public override LocalisableString Description => "Less zoom..."; - public override bool Ranked => UsesDefaultConfiguration; + public override bool Ranked => SpeedChange.IsDefault; [SettingSource("Speed decrease", "The actual decrease to apply", SettingControlType = typeof(MultiplierSettingsSlider))] public override BindableNumber SpeedChange { get; } = new BindableDouble(0.75) From 4dbcb41dd1e8d46e2bdee4acc9c6f858f979dd79 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Fri, 2 Feb 2024 00:44:51 +0300 Subject: [PATCH 29/86] Remove unused parameter --- osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs index 5de5ceb2a8..e5ba9500ee 100644 --- a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs +++ b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs @@ -137,7 +137,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy } [BackgroundDependencyLoader] - private void load(AudioManager audio) + private void load() { InternalChildren = new Drawable[] { From e00e583bb4fbe58c8c26c847d5c2435d86f6a75d Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Fri, 2 Feb 2024 03:56:38 +0300 Subject: [PATCH 30/86] Fix DrawableManiaRuleset performing skin lookup every frame --- .../UI/DrawableManiaRuleset.cs | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs index bea536e4af..070021ef74 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs @@ -9,8 +9,10 @@ using osu.Framework.Allocation; using osu.Framework.Audio.Track; using osu.Framework.Bindables; using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; using osu.Framework.Input; +using osu.Framework.Threading; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Input.Handlers; @@ -59,8 +61,7 @@ namespace osu.Game.Rulesets.Mania.UI // Stores the current speed adjustment active in gameplay. private readonly Track speedAdjustmentTrack = new TrackVirtual(0); - [Resolved] - private ISkinSource skin { get; set; } + private ISkinSource currentSkin; public DrawableManiaRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList mods = null) : base(ruleset, beatmap, mods) @@ -72,8 +73,12 @@ namespace osu.Game.Rulesets.Mania.UI } [BackgroundDependencyLoader] - private void load() + private void load(ISkinSource source) { + currentSkin = source; + currentSkin.SourceChanged += onSkinChange; + skinChanged(); + foreach (var mod in Mods.OfType()) mod.ApplyToTrack(speedAdjustmentTrack); @@ -109,12 +114,28 @@ namespace osu.Game.Rulesets.Mania.UI updateTimeRange(); } + private ScheduledDelegate pendingSkinChange; + private float hitPosition; + + private void onSkinChange() + { + // schedule required to avoid calls after disposed. + // note that this has the side-effect of components only performing a skin change when they are alive. + pendingSkinChange?.Cancel(); + pendingSkinChange = Scheduler.Add(skinChanged); + } + + private void skinChanged() + { + hitPosition = currentSkin.GetConfig( + new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.HitPosition))?.Value + ?? Stage.HIT_TARGET_POSITION; + + pendingSkinChange = null; + } + private void updateTimeRange() { - float hitPosition = skin.GetConfig( - new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.HitPosition))?.Value - ?? Stage.HIT_TARGET_POSITION; - const float length_to_default_hit_position = 768 - LegacyManiaSkinConfiguration.DEFAULT_HIT_POSITION; float lengthToHitPosition = 768 - hitPosition; @@ -144,5 +165,13 @@ namespace osu.Game.Rulesets.Mania.UI protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new ManiaFramedReplayInputHandler(replay); protected override ReplayRecorder CreateReplayRecorder(Score score) => new ManiaReplayRecorder(score); + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + + if (currentSkin.IsNotNull()) + currentSkin.SourceChanged -= onSkinChange; + } } } From 7884e5808ad0407449d4895b6b06594755cc7b65 Mon Sep 17 00:00:00 2001 From: Loreos7 Date: Fri, 2 Feb 2024 04:47:13 +0300 Subject: [PATCH 31/86] localise remaining strings --- ...RunOverlayImportFromStableScreenStrings.cs | 30 +++++++++++++++++++ .../FirstRunSetup/ScreenImportFromStable.cs | 21 ++++++++----- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs b/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs index f0620245c3..bbd83d2395 100644 --- a/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs +++ b/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs @@ -51,6 +51,36 @@ namespace osu.Game.Localisation /// public static LocalisableString Items(int arg0) => new TranslatableString(getKey(@"items"), @"{0} item(s)", arg0); + /// + /// "Data migration will use "hard links". No extra disk space will be used, and you can delete either data folder at any point without affecting the other installation." + /// + public static LocalisableString DataMigrationNoExtraSpace => new TranslatableString(getKey(@"data_migration_no_extra_space"), @"Data migration will use ""hard links"". No extra disk space will be used, and you can delete either data folder at any point without affecting the other installation."); + + /// + /// "Learn more about how "hard links" work" + /// + public static LocalisableString LearnAboutHardLinks => new TranslatableString(getKey(@"learn_about_hard_links"), @"Learn more about how ""hard links"" work"); + + /// + /// "Lightweight linking of files is not supported on your operating system yet, so a copy of all files will be made during import." + /// + public static LocalisableString LightweightLinkingNotSupported => new TranslatableString(getKey(@"lightweight_linking_not_supported"), @"Lightweight linking of files is not supported on your operating system yet, so a copy of all files will be made during import."); + + /// + /// "A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install {0}." + /// + public static LocalisableString SecondCopyWillBeMade(LocalisableString extra) => new TranslatableString(getKey(@"second_copy_will_be_made"), @"A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install {0}.", extra); + + /// + /// "(and the file system is NTFS)" + /// + public static LocalisableString ToAvoidEnsureNtfs => new TranslatableString(getKey(@"to_avoid_ensure_ntfs"), @"(and the file system is NTFS)"); + + /// + /// "(and the file system supports hard links)" + /// + public static LocalisableString ToAvoidEnsureHardLinksSupport => new TranslatableString(getKey(@"to_avoid_ensure_hard_links_support"), @"(and the file system supports hard links)"); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs index 24ac5e72e8..0b2b750136 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs @@ -127,18 +127,16 @@ namespace osu.Game.Overlays.FirstRunSetup if (available) { - copyInformation.Text = - "Data migration will use \"hard links\". No extra disk space will be used, and you can delete either data folder at any point without affecting the other installation. "; - - copyInformation.AddLink("Learn more about how \"hard links\" work", LinkAction.OpenWiki, @"Client/Release_stream/Lazer/File_storage#via-hard-links"); + copyInformation.Text = FirstRunOverlayImportFromStableScreenStrings.DataMigrationNoExtraSpace; + copyInformation.AddLink(FirstRunOverlayImportFromStableScreenStrings.LearnAboutHardLinks, LinkAction.OpenWiki, @"Client/Release_stream/Lazer/File_storage#via-hard-links"); } else if (!RuntimeInfo.IsDesktop) - copyInformation.Text = "Lightweight linking of files is not supported on your operating system yet, so a copy of all files will be made during import."; + copyInformation.Text = FirstRunOverlayImportFromStableScreenStrings.LightweightLinkingNotSupported; else { copyInformation.Text = RuntimeInfo.OS == RuntimeInfo.Platform.Windows - ? "A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install (and the file system is NTFS). " - : "A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install (and the file system supports hard links). "; + ? FirstRunOverlayImportFromStableScreenStrings.SecondCopyWillBeMade(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureNtfs) + : FirstRunOverlayImportFromStableScreenStrings.SecondCopyWillBeMade(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureHardLinksSupport); copyInformation.AddLink(GeneralSettingsStrings.ChangeFolderLocation, () => { game?.PerformFromScreen(menu => menu.Push(new MigrationSelectScreen())); @@ -328,4 +326,13 @@ namespace osu.Game.Overlays.FirstRunSetup } } } + + public enum FileSystemAddition + { + [LocalisableDescription(typeof(FirstRunOverlayImportFromStableScreenStrings), nameof(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureNtfs))] + ToAvoidEnsureNtfs, + + [LocalisableDescription(typeof(FirstRunOverlayImportFromStableScreenStrings), nameof(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureHardLinksSupport))] + ToAvoidEnsureHardLinksSupport, + } } From 8dce158a13e05911273c5fb07f77555dc3d0b6ae Mon Sep 17 00:00:00 2001 From: Loreos7 Date: Fri, 2 Feb 2024 04:49:22 +0300 Subject: [PATCH 32/86] localise update-related strings --- osu.Game/Localisation/NotificationsStrings.cs | 22 +++++++++++++++++++ osu.Game/Updater/UpdateManager.cs | 9 ++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/osu.Game/Localisation/NotificationsStrings.cs b/osu.Game/Localisation/NotificationsStrings.cs index fb3dab032d..f4965e4ebe 100644 --- a/osu.Game/Localisation/NotificationsStrings.cs +++ b/osu.Game/Localisation/NotificationsStrings.cs @@ -113,6 +113,28 @@ Please try changing your audio device to a working setting."); /// public static LocalisableString MismatchingBeatmapForReplay => new TranslatableString(getKey(@"mismatching_beatmap_for_replay"), @"Your local copy of the beatmap for this replay appears to be different than expected. You may need to update or re-download it."); + /// + /// "You are now running osu! {version}. + /// Click to see what's new!" + /// + public static LocalisableString GameVersionAfterUpdate(string version) => new TranslatableString(getKey(@"game_version_after_update"), @"You are now running osu! {0}. +Click to see what's new!", version); + + /// + /// "Update ready to install. Click to restart!" + /// + public static LocalisableString UpdateReadyToInstall => new TranslatableString(getKey(@"update_ready_to_install"), @"Update ready to install. Click to restart!"); + + /// + /// "Downloading update..." + /// + public static LocalisableString DownloadingUpdate => new TranslatableString(getKey(@"downloading_update"), @"Downloading update..."); + + /// + /// "Installing update..." + /// + public static LocalisableString InstallingUpdate => new TranslatableString(getKey(@"installing_update"), @"Installing update..."); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Updater/UpdateManager.cs b/osu.Game/Updater/UpdateManager.cs index 190748137a..8f13e0f42a 100644 --- a/osu.Game/Updater/UpdateManager.cs +++ b/osu.Game/Updater/UpdateManager.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Localisation; using osu.Game.Overlays; using osu.Game.Overlays.Notifications; using osuTK; @@ -92,7 +93,7 @@ namespace osu.Game.Updater public UpdateCompleteNotification(string version) { this.version = version; - Text = $"You are now running osu! {version}.\nClick to see what's new!"; + Text = NotificationsStrings.GameVersionAfterUpdate(version); } [BackgroundDependencyLoader] @@ -114,7 +115,7 @@ namespace osu.Game.Updater { public UpdateApplicationCompleteNotification() { - Text = @"Update ready to install. Click to restart!"; + Text = NotificationsStrings.UpdateReadyToInstall; } } @@ -166,13 +167,13 @@ namespace osu.Game.Updater { State = ProgressNotificationState.Active; Progress = 0; - Text = @"Downloading update..."; + Text = NotificationsStrings.DownloadingUpdate; } public void StartInstall() { Progress = 0; - Text = @"Installing update..."; + Text = NotificationsStrings.InstallingUpdate; } public void FailDownload() From 6e4d52863c81e28a6b4389e844081d016a4cdee7 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 00:50:26 +0900 Subject: [PATCH 33/86] Upgrade to .NET 8 SDK --- .../osu.Game.Rulesets.EmptyFreeform.Tests.csproj | 2 +- .../osu.Game.Rulesets.EmptyFreeform.csproj | 2 +- .../osu.Game.Rulesets.Pippidon.Tests.csproj | 2 +- .../osu.Game.Rulesets.Pippidon.csproj | 2 +- .../osu.Game.Rulesets.EmptyScrolling.Tests.csproj | 2 +- .../osu.Game.Rulesets.EmptyScrolling.csproj | 2 +- .../osu.Game.Rulesets.Pippidon.Tests.csproj | 2 +- .../osu.Game.Rulesets.Pippidon.csproj | 2 +- global.json | 8 ++++---- osu.Android/osu.Android.csproj | 2 +- osu.Desktop/osu.Desktop.csproj | 2 +- osu.Game.Benchmarks/osu.Game.Benchmarks.csproj | 2 +- .../osu.Game.Rulesets.Catch.Tests.Android.csproj | 4 ++-- .../osu.Game.Rulesets.Catch.Tests.iOS.csproj | 2 +- .../osu.Game.Rulesets.Catch.Tests.csproj | 2 +- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 2 +- .../osu.Game.Rulesets.Mania.Tests.Android.csproj | 4 ++-- .../osu.Game.Rulesets.Mania.Tests.iOS.csproj | 2 +- .../osu.Game.Rulesets.Mania.Tests.csproj | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- .../osu.Game.Rulesets.Osu.Tests.Android.csproj | 4 ++-- .../osu.Game.Rulesets.Osu.Tests.iOS.csproj | 2 +- .../osu.Game.Rulesets.Osu.Tests.csproj | 2 +- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 2 +- .../osu.Game.Rulesets.Taiko.Tests.Android.csproj | 4 ++-- .../osu.Game.Rulesets.Taiko.Tests.iOS.csproj | 2 +- .../osu.Game.Rulesets.Taiko.Tests.csproj | 2 +- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 2 +- osu.Game.Tests.Android/osu.Game.Tests.Android.csproj | 2 +- osu.Game.Tests.iOS/osu.Game.Tests.iOS.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- .../osu.Game.Tournament.Tests.csproj | 2 +- osu.Game.Tournament/osu.Game.Tournament.csproj | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS/osu.iOS.csproj | 2 +- 35 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform.Tests/osu.Game.Rulesets.EmptyFreeform.Tests.csproj b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform.Tests/osu.Game.Rulesets.EmptyFreeform.Tests.csproj index 5babdb47ff..7d43eb2b05 100644 --- a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform.Tests/osu.Game.Rulesets.EmptyFreeform.Tests.csproj +++ b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform.Tests/osu.Game.Rulesets.EmptyFreeform.Tests.csproj @@ -18,7 +18,7 @@ WinExe - net6.0 + net8.0 osu.Game.Rulesets.EmptyFreeform.Tests diff --git a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj index d09e7647e0..89abd5665c 100644 --- a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj +++ b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 osu.Game.Rulesets.EmptyFreeform Library AnyCPU diff --git a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj index 5d64ca832a..7dc8a1336b 100644 --- a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj +++ b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj @@ -18,7 +18,7 @@ WinExe - net6.0 + net8.0 osu.Game.Rulesets.Pippidon.Tests diff --git a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj index 9c8867f4ef..165b6b6c6b 100644 --- a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj +++ b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 osu.Game.Rulesets.Pippidon Library AnyCPU diff --git a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling.Tests/osu.Game.Rulesets.EmptyScrolling.Tests.csproj b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling.Tests/osu.Game.Rulesets.EmptyScrolling.Tests.csproj index 6796a8962b..9c4c8217f0 100644 --- a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling.Tests/osu.Game.Rulesets.EmptyScrolling.Tests.csproj +++ b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling.Tests/osu.Game.Rulesets.EmptyScrolling.Tests.csproj @@ -18,7 +18,7 @@ WinExe - net6.0 + net8.0 osu.Game.Rulesets.EmptyScrolling.Tests diff --git a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj index 5bf3884f53..6d9565a6f2 100644 --- a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj +++ b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 osu.Game.Rulesets.EmptyScrolling Library AnyCPU diff --git a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj index 5d64ca832a..7dc8a1336b 100644 --- a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj +++ b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj @@ -18,7 +18,7 @@ WinExe - net6.0 + net8.0 osu.Game.Rulesets.Pippidon.Tests diff --git a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj index 9c8867f4ef..165b6b6c6b 100644 --- a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj +++ b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 osu.Game.Rulesets.Pippidon Library AnyCPU diff --git a/global.json b/global.json index 5dcd5f425a..da113e4cbd 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "6.0.100", - "rollForward": "latestFeature" + "version": "8.0.0", + "rollForward": "latestFeature", + "allowPrerelease": false } -} - +} \ No newline at end of file diff --git a/osu.Android/osu.Android.csproj b/osu.Android/osu.Android.csproj index 1507bfaa29..17e049a569 100644 --- a/osu.Android/osu.Android.csproj +++ b/osu.Android/osu.Android.csproj @@ -1,7 +1,7 @@  - net6.0-android + net8.0-android Exe osu.Android osu.Android diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index d6a11fa924..cf2ec6e681 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 WinExe true A free-to-win rhythm game. Rhythm is just a *click* away! diff --git a/osu.Game.Benchmarks/osu.Game.Benchmarks.csproj b/osu.Game.Benchmarks/osu.Game.Benchmarks.csproj index 47c93fbd02..64da5412a8 100644 --- a/osu.Game.Benchmarks/osu.Game.Benchmarks.csproj +++ b/osu.Game.Benchmarks/osu.Game.Benchmarks.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 Exe false diff --git a/osu.Game.Rulesets.Catch.Tests.Android/osu.Game.Rulesets.Catch.Tests.Android.csproj b/osu.Game.Rulesets.Catch.Tests.Android/osu.Game.Rulesets.Catch.Tests.Android.csproj index 4ee3219442..4b2e54be67 100644 --- a/osu.Game.Rulesets.Catch.Tests.Android/osu.Game.Rulesets.Catch.Tests.Android.csproj +++ b/osu.Game.Rulesets.Catch.Tests.Android/osu.Game.Rulesets.Catch.Tests.Android.csproj @@ -1,7 +1,7 @@  - net6.0-android + net8.0-android Exe osu.Game.Rulesets.Catch.Tests osu.Game.Rulesets.Catch.Tests.Android @@ -21,4 +21,4 @@ - \ No newline at end of file + diff --git a/osu.Game.Rulesets.Catch.Tests.iOS/osu.Game.Rulesets.Catch.Tests.iOS.csproj b/osu.Game.Rulesets.Catch.Tests.iOS/osu.Game.Rulesets.Catch.Tests.iOS.csproj index acf12bb0ac..9c262a752a 100644 --- a/osu.Game.Rulesets.Catch.Tests.iOS/osu.Game.Rulesets.Catch.Tests.iOS.csproj +++ b/osu.Game.Rulesets.Catch.Tests.iOS/osu.Game.Rulesets.Catch.Tests.iOS.csproj @@ -1,7 +1,7 @@  Exe - net6.0-ios + net8.0-ios 13.4 osu.Game.Rulesets.Catch.Tests osu.Game.Rulesets.Catch.Tests.iOS diff --git a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj index 0a77845343..619081c754 100644 --- a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj +++ b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj @@ -7,7 +7,7 @@ WinExe - net6.0 + net8.0 diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index ecce7c1b3f..a5138ffb39 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library true catch the fruit. to the beat. diff --git a/osu.Game.Rulesets.Mania.Tests.Android/osu.Game.Rulesets.Mania.Tests.Android.csproj b/osu.Game.Rulesets.Mania.Tests.Android/osu.Game.Rulesets.Mania.Tests.Android.csproj index 25335754d2..2866508a02 100644 --- a/osu.Game.Rulesets.Mania.Tests.Android/osu.Game.Rulesets.Mania.Tests.Android.csproj +++ b/osu.Game.Rulesets.Mania.Tests.Android/osu.Game.Rulesets.Mania.Tests.Android.csproj @@ -1,7 +1,7 @@  - net6.0-android + net8.0-android Exe osu.Game.Rulesets.Mania.Tests osu.Game.Rulesets.Mania.Tests.Android @@ -21,4 +21,4 @@ - \ No newline at end of file + diff --git a/osu.Game.Rulesets.Mania.Tests.iOS/osu.Game.Rulesets.Mania.Tests.iOS.csproj b/osu.Game.Rulesets.Mania.Tests.iOS/osu.Game.Rulesets.Mania.Tests.iOS.csproj index 51e07dd6c1..d51e541e95 100644 --- a/osu.Game.Rulesets.Mania.Tests.iOS/osu.Game.Rulesets.Mania.Tests.iOS.csproj +++ b/osu.Game.Rulesets.Mania.Tests.iOS/osu.Game.Rulesets.Mania.Tests.iOS.csproj @@ -1,7 +1,7 @@  Exe - net6.0-ios + net8.0-ios 13.4 osu.Game.Rulesets.Mania.Tests osu.Game.Rulesets.Mania.Tests.iOS diff --git a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj index 877b9c3ea4..eee06acdb8 100644 --- a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj +++ b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj @@ -7,7 +7,7 @@ WinExe - net6.0 + net8.0 diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 72f172188e..3bca938450 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library true smash the keys. to the beat. diff --git a/osu.Game.Rulesets.Osu.Tests.Android/osu.Game.Rulesets.Osu.Tests.Android.csproj b/osu.Game.Rulesets.Osu.Tests.Android/osu.Game.Rulesets.Osu.Tests.Android.csproj index e8a46a9828..b79de6d40b 100644 --- a/osu.Game.Rulesets.Osu.Tests.Android/osu.Game.Rulesets.Osu.Tests.Android.csproj +++ b/osu.Game.Rulesets.Osu.Tests.Android/osu.Game.Rulesets.Osu.Tests.Android.csproj @@ -1,7 +1,7 @@  - net6.0-android + net8.0-android Exe osu.Game.Rulesets.Osu.Tests osu.Game.Rulesets.Osu.Tests.Android @@ -24,4 +24,4 @@ - \ No newline at end of file + diff --git a/osu.Game.Rulesets.Osu.Tests.iOS/osu.Game.Rulesets.Osu.Tests.iOS.csproj b/osu.Game.Rulesets.Osu.Tests.iOS/osu.Game.Rulesets.Osu.Tests.iOS.csproj index 7d50deb8ba..cc0233d7fd 100644 --- a/osu.Game.Rulesets.Osu.Tests.iOS/osu.Game.Rulesets.Osu.Tests.iOS.csproj +++ b/osu.Game.Rulesets.Osu.Tests.iOS/osu.Game.Rulesets.Osu.Tests.iOS.csproj @@ -1,7 +1,7 @@  Exe - net6.0-ios + net8.0-ios 13.4 Exe osu.Game.Rulesets.Osu.Tests diff --git a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj index 9c248abd66..ea54c8d313 100644 --- a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj +++ b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj @@ -8,7 +8,7 @@ WinExe - net6.0 + net8.0 diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 75656e2976..518ab362ca 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library true click the circles. to the beat. diff --git a/osu.Game.Rulesets.Taiko.Tests.Android/osu.Game.Rulesets.Taiko.Tests.Android.csproj b/osu.Game.Rulesets.Taiko.Tests.Android/osu.Game.Rulesets.Taiko.Tests.Android.csproj index a639326ebd..ee973e8544 100644 --- a/osu.Game.Rulesets.Taiko.Tests.Android/osu.Game.Rulesets.Taiko.Tests.Android.csproj +++ b/osu.Game.Rulesets.Taiko.Tests.Android/osu.Game.Rulesets.Taiko.Tests.Android.csproj @@ -1,7 +1,7 @@  - net6.0-android + net8.0-android Exe osu.Game.Rulesets.Taiko.Tests osu.Game.Rulesets.Taiko.Tests.Android @@ -21,4 +21,4 @@ - \ No newline at end of file + diff --git a/osu.Game.Rulesets.Taiko.Tests.iOS/osu.Game.Rulesets.Taiko.Tests.iOS.csproj b/osu.Game.Rulesets.Taiko.Tests.iOS/osu.Game.Rulesets.Taiko.Tests.iOS.csproj index e648a11299..ee2d4d703e 100644 --- a/osu.Game.Rulesets.Taiko.Tests.iOS/osu.Game.Rulesets.Taiko.Tests.iOS.csproj +++ b/osu.Game.Rulesets.Taiko.Tests.iOS/osu.Game.Rulesets.Taiko.Tests.iOS.csproj @@ -1,7 +1,7 @@  Exe - net6.0-ios + net8.0-ios 13.4 osu.Game.Rulesets.Taiko.Tests osu.Game.Rulesets.Taiko.Tests.iOS diff --git a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj index 4eb6b0ab3d..26afd42445 100644 --- a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj +++ b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj @@ -7,7 +7,7 @@ WinExe - net6.0 + net8.0 diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index f0e1cb8e8f..cacba55c2a 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library true bash the drum. to the beat. diff --git a/osu.Game.Tests.Android/osu.Game.Tests.Android.csproj b/osu.Game.Tests.Android/osu.Game.Tests.Android.csproj index b745d91980..889f0a3583 100644 --- a/osu.Game.Tests.Android/osu.Game.Tests.Android.csproj +++ b/osu.Game.Tests.Android/osu.Game.Tests.Android.csproj @@ -1,7 +1,7 @@  - net6.0-android + net8.0-android Exe osu.Game.Tests osu.Game.Tests.Android diff --git a/osu.Game.Tests.iOS/osu.Game.Tests.iOS.csproj b/osu.Game.Tests.iOS/osu.Game.Tests.iOS.csproj index 79771fcd50..e4b9d2ba94 100644 --- a/osu.Game.Tests.iOS/osu.Game.Tests.iOS.csproj +++ b/osu.Game.Tests.iOS/osu.Game.Tests.iOS.csproj @@ -1,7 +1,7 @@  Exe - net6.0-ios + net8.0-ios 13.4 osu.Game.Tests osu.Game.Tests.iOS diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 7b08524240..c0bbdfb4ed 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -10,7 +10,7 @@ WinExe - net6.0 + net8.0 tests.ruleset diff --git a/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj index 3b00f103c4..8f1d7114b1 100644 --- a/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj +++ b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj @@ -10,7 +10,7 @@ WinExe - net6.0 + net8.0 diff --git a/osu.Game.Tournament/osu.Game.Tournament.csproj b/osu.Game.Tournament/osu.Game.Tournament.csproj index ab67e490cd..c8578ac464 100644 --- a/osu.Game.Tournament/osu.Game.Tournament.csproj +++ b/osu.Game.Tournament/osu.Game.Tournament.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library true tools for tournaments. diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a5d212bffe..caffebd063 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library true 10 diff --git a/osu.iOS/osu.iOS.csproj b/osu.iOS/osu.iOS.csproj index 2d61b73125..6e9449de95 100644 --- a/osu.iOS/osu.iOS.csproj +++ b/osu.iOS/osu.iOS.csproj @@ -1,6 +1,6 @@  - net6.0-ios + net8.0-ios 13.4 Exe true From f06642c315eb7b35298fd4f1f8e3ff9e9d075766 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 00:51:43 +0900 Subject: [PATCH 34/86] Upgrade to C# 12 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index b08283f071..2d289d0f22 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@  - 10.0 + 12.0 true enable From c8b4ff2b47d53f0a1397f05f481f3d47d70aca0e Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 00:51:55 +0900 Subject: [PATCH 35/86] Fix compile error (reserved name) --- osu.Game/IO/HardLinkHelper.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/IO/HardLinkHelper.cs b/osu.Game/IO/HardLinkHelper.cs index 619bfdad6e..ad57f87d10 100644 --- a/osu.Game/IO/HardLinkHelper.cs +++ b/osu.Game/IO/HardLinkHelper.cs @@ -153,12 +153,12 @@ namespace osu.Game.IO public static extern int link(string oldpath, string newpath); [DllImport("libc", SetLastError = true)] - private static extern int stat(string pathname, out struct_stat statbuf); + private static extern int stat(string pathname, out Stat statbuf); // ReSharper disable once InconsistentNaming // Struct layout is likely non-portable across unices. Tread with caution. [StructLayout(LayoutKind.Sequential)] - private struct struct_stat + private struct Stat { public readonly long st_dev; public readonly long st_ino; @@ -170,14 +170,14 @@ namespace osu.Game.IO public readonly long st_size; public readonly long st_blksize; public readonly long st_blocks; - public readonly timespec st_atim; - public readonly timespec st_mtim; - public readonly timespec st_ctim; + public readonly Timespec st_atim; + public readonly Timespec st_mtim; + public readonly Timespec st_ctim; } // ReSharper disable once InconsistentNaming [StructLayout(LayoutKind.Sequential)] - private struct timespec + private struct Timespec { public readonly long tv_sec; public readonly long tv_nsec; From 630278f6e727ce1b7d3cc727e60087db4fd61316 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 01:08:15 +0900 Subject: [PATCH 36/86] Replace UseMauiEssentials with PackageReference --- osu.Android/osu.Android.csproj | 4 +++- osu.iOS/osu.iOS.csproj | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Android/osu.Android.csproj b/osu.Android/osu.Android.csproj index 17e049a569..0e79e0ab3e 100644 --- a/osu.Android/osu.Android.csproj +++ b/osu.Android/osu.Android.csproj @@ -5,7 +5,6 @@ Exe osu.Android osu.Android - true false 0.0.0 @@ -19,4 +18,7 @@ + + + diff --git a/osu.iOS/osu.iOS.csproj b/osu.iOS/osu.iOS.csproj index 6e9449de95..19c0c610b5 100644 --- a/osu.iOS/osu.iOS.csproj +++ b/osu.iOS/osu.iOS.csproj @@ -3,7 +3,6 @@ net8.0-ios 13.4 Exe - true 0.1.0 $(Version) $(Version) @@ -16,4 +15,7 @@ + + + From a217a7f8cf74de72a416cda75deb18fdcb6d0712 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 01:11:58 +0900 Subject: [PATCH 37/86] Adjust CI workflows --- .github/workflows/ci.yml | 23 +++++++------------ .../workflows/update-web-mod-definitions.yml | 4 ++-- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 103e4dbc30..722e8910d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,17 +15,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - # FIXME: Tools won't run in .NET 6.0 unless you install 3.1.x LTS side by side. - # https://itnext.io/how-to-support-multiple-net-sdks-in-github-actions-workflows-b988daa884e - - name: Install .NET 3.1.x LTS + - name: Install .NET 8.0.x uses: actions/setup-dotnet@v3 with: - dotnet-version: "3.1.x" - - - name: Install .NET 6.0.x - uses: actions/setup-dotnet@v3 - with: - dotnet-version: "6.0.x" + dotnet-version: "8.0.x" - name: Restore Tools run: dotnet tool restore @@ -79,10 +72,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Install .NET 6.0.x + - name: Install .NET 8.0.x uses: actions/setup-dotnet@v3 with: - dotnet-version: "6.0.x" + dotnet-version: "8.0.x" - name: Compile run: dotnet build -c Debug -warnaserror osu.Desktop.slnf @@ -114,10 +107,10 @@ jobs: distribution: microsoft java-version: 11 - - name: Install .NET 6.0.x + - name: Install .NET 8.0.x uses: actions/setup-dotnet@v3 with: - dotnet-version: "6.0.x" + dotnet-version: "8.0.x" - name: Install .NET workloads run: dotnet workload install maui-android @@ -135,10 +128,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Install .NET 6.0.x + - name: Install .NET 8.0.x uses: actions/setup-dotnet@v3 with: - dotnet-version: "6.0.x" + dotnet-version: "8.0.x" - name: Install .NET Workloads run: dotnet workload install maui-ios diff --git a/.github/workflows/update-web-mod-definitions.yml b/.github/workflows/update-web-mod-definitions.yml index 32d3d37ffe..5827a6cdbf 100644 --- a/.github/workflows/update-web-mod-definitions.yml +++ b/.github/workflows/update-web-mod-definitions.yml @@ -12,10 +12,10 @@ jobs: name: Update osu-web mod definitions runs-on: ubuntu-latest steps: - - name: Install .NET 6.0.x + - name: Install .NET 8.0.x uses: actions/setup-dotnet@v3 with: - dotnet-version: "6.0.x" + dotnet-version: "8.0.x" - name: Checkout ppy/osu uses: actions/checkout@v3 From dda691b8c219f104a938d5a8c0bc29a88acfc19e Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 01:14:55 +0900 Subject: [PATCH 38/86] Fix NVAPI compile error --- osu.Desktop/NVAPI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop/NVAPI.cs b/osu.Desktop/NVAPI.cs index bb3a59cc7f..a34b762738 100644 --- a/osu.Desktop/NVAPI.cs +++ b/osu.Desktop/NVAPI.cs @@ -456,7 +456,7 @@ namespace osu.Desktop [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] public string ProfileName; - [MarshalAs(UnmanagedType.ByValArray)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public uint[] GPUSupport; public uint IsPredefined; From 38ed426f8fa90c2bfcd816317349767f1502082d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 02:03:37 +0900 Subject: [PATCH 39/86] Fix more compiler warnings/errors --- .../ruleset-empty/Directory.Build.props | 10 ++++ Templates/Rulesets/ruleset-empty/app.manifest | 46 +++++++++++++++++++ .../ruleset-example/Directory.Build.props | 10 ++++ .../Rulesets/ruleset-example/app.manifest | 46 +++++++++++++++++++ .../Directory.Build.props | 10 ++++ .../ruleset-scrolling-empty/app.manifest | 46 +++++++++++++++++++ .../Directory.Build.props | 10 ++++ .../ruleset-scrolling-example/app.manifest | 46 +++++++++++++++++++ 8 files changed, 224 insertions(+) create mode 100644 Templates/Rulesets/ruleset-empty/Directory.Build.props create mode 100644 Templates/Rulesets/ruleset-empty/app.manifest create mode 100644 Templates/Rulesets/ruleset-example/Directory.Build.props create mode 100644 Templates/Rulesets/ruleset-example/app.manifest create mode 100644 Templates/Rulesets/ruleset-scrolling-empty/Directory.Build.props create mode 100644 Templates/Rulesets/ruleset-scrolling-empty/app.manifest create mode 100644 Templates/Rulesets/ruleset-scrolling-example/Directory.Build.props create mode 100644 Templates/Rulesets/ruleset-scrolling-example/app.manifest diff --git a/Templates/Rulesets/ruleset-empty/Directory.Build.props b/Templates/Rulesets/ruleset-empty/Directory.Build.props new file mode 100644 index 0000000000..74d05ff690 --- /dev/null +++ b/Templates/Rulesets/ruleset-empty/Directory.Build.props @@ -0,0 +1,10 @@ + + + + $(MSBuildThisFileDirectory)app.manifest + + + true + $(NoWarn);CS1591 + + diff --git a/Templates/Rulesets/ruleset-empty/app.manifest b/Templates/Rulesets/ruleset-empty/app.manifest new file mode 100644 index 0000000000..1c1e5f540c --- /dev/null +++ b/Templates/Rulesets/ruleset-empty/app.manifest @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + diff --git a/Templates/Rulesets/ruleset-example/Directory.Build.props b/Templates/Rulesets/ruleset-example/Directory.Build.props new file mode 100644 index 0000000000..74d05ff690 --- /dev/null +++ b/Templates/Rulesets/ruleset-example/Directory.Build.props @@ -0,0 +1,10 @@ + + + + $(MSBuildThisFileDirectory)app.manifest + + + true + $(NoWarn);CS1591 + + diff --git a/Templates/Rulesets/ruleset-example/app.manifest b/Templates/Rulesets/ruleset-example/app.manifest new file mode 100644 index 0000000000..1c1e5f540c --- /dev/null +++ b/Templates/Rulesets/ruleset-example/app.manifest @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + diff --git a/Templates/Rulesets/ruleset-scrolling-empty/Directory.Build.props b/Templates/Rulesets/ruleset-scrolling-empty/Directory.Build.props new file mode 100644 index 0000000000..74d05ff690 --- /dev/null +++ b/Templates/Rulesets/ruleset-scrolling-empty/Directory.Build.props @@ -0,0 +1,10 @@ + + + + $(MSBuildThisFileDirectory)app.manifest + + + true + $(NoWarn);CS1591 + + diff --git a/Templates/Rulesets/ruleset-scrolling-empty/app.manifest b/Templates/Rulesets/ruleset-scrolling-empty/app.manifest new file mode 100644 index 0000000000..1c1e5f540c --- /dev/null +++ b/Templates/Rulesets/ruleset-scrolling-empty/app.manifest @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + diff --git a/Templates/Rulesets/ruleset-scrolling-example/Directory.Build.props b/Templates/Rulesets/ruleset-scrolling-example/Directory.Build.props new file mode 100644 index 0000000000..74d05ff690 --- /dev/null +++ b/Templates/Rulesets/ruleset-scrolling-example/Directory.Build.props @@ -0,0 +1,10 @@ + + + + $(MSBuildThisFileDirectory)app.manifest + + + true + $(NoWarn);CS1591 + + diff --git a/Templates/Rulesets/ruleset-scrolling-example/app.manifest b/Templates/Rulesets/ruleset-scrolling-example/app.manifest new file mode 100644 index 0000000000..1c1e5f540c --- /dev/null +++ b/Templates/Rulesets/ruleset-scrolling-example/app.manifest @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + From ec4f3577c0659709a26383af1c3818593aef1ebc Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 02:09:00 +0900 Subject: [PATCH 40/86] Use Xcode 15.2 --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 722e8910d5..de902df93f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -136,5 +136,8 @@ jobs: - name: Install .NET Workloads run: dotnet workload install maui-ios + - name: Select Xcode 15.2 + run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer + - name: Build run: dotnet build -c Debug osu.iOS From 19ea4842400f45cb78cf55b00cee69669c5b1369 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 02:18:22 +0900 Subject: [PATCH 41/86] Adjust pragma disable to fix Android compile --- osu.Android/OsuGameActivity.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Android/OsuGameActivity.cs b/osu.Android/OsuGameActivity.cs index 33ffed432e..bbee491d90 100644 --- a/osu.Android/OsuGameActivity.cs +++ b/osu.Android/OsuGameActivity.cs @@ -72,9 +72,9 @@ namespace osu.Android Debug.Assert(Resources?.DisplayMetrics != null); Point displaySize = new Point(); -#pragma warning disable 618 // GetSize is deprecated +#pragma warning disable CA1422 // GetSize is deprecated WindowManager.DefaultDisplay.GetSize(displaySize); -#pragma warning restore 618 +#pragma warning restore CA1422 float smallestWidthDp = Math.Min(displaySize.X, displaySize.Y) / Resources.DisplayMetrics.Density; bool isTablet = smallestWidthDp >= 600f; From 497213d529f57e1f057f69720d8fe7e3e22c806d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 02:25:52 +0900 Subject: [PATCH 42/86] Re-enable LLVM for now --- osu.Android/osu.Android.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Android/osu.Android.csproj b/osu.Android/osu.Android.csproj index 0e79e0ab3e..be2e669728 100644 --- a/osu.Android/osu.Android.csproj +++ b/osu.Android/osu.Android.csproj @@ -5,8 +5,6 @@ Exe osu.Android osu.Android - - false 0.0.0 1 $(Version) From 8e8ba9e77f94a33f06a05190b86c76da90b3c3a6 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 2 Feb 2024 21:36:41 +0900 Subject: [PATCH 43/86] Fix more CI inspections --- osu.Desktop/NVAPI.cs | 2 +- osu.Game.Tests/NonVisual/TaskChainTest.cs | 2 +- osu.Game/Online/Chat/WebSocketChatClient.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Desktop/NVAPI.cs b/osu.Desktop/NVAPI.cs index a34b762738..78a814c585 100644 --- a/osu.Desktop/NVAPI.cs +++ b/osu.Desktop/NVAPI.cs @@ -138,7 +138,7 @@ namespace osu.Desktop return false; // Make sure that this is a laptop. - var gpus = new IntPtr[64]; + IntPtr[] gpus = new IntPtr[64]; if (checkError(EnumPhysicalGPUs(gpus, out int gpuCount))) return false; diff --git a/osu.Game.Tests/NonVisual/TaskChainTest.cs b/osu.Game.Tests/NonVisual/TaskChainTest.cs index ad1a3fd63f..2ac89efb69 100644 --- a/osu.Game.Tests/NonVisual/TaskChainTest.cs +++ b/osu.Game.Tests/NonVisual/TaskChainTest.cs @@ -58,7 +58,7 @@ namespace osu.Game.Tests.NonVisual var task3 = addTask(); // Cancel task2, allow task3 to complete. - task2.cancellation.Cancel(); + await task2.cancellation.CancelAsync(); task2.mutex.Set(); task3.mutex.Set(); diff --git a/osu.Game/Online/Chat/WebSocketChatClient.cs b/osu.Game/Online/Chat/WebSocketChatClient.cs index b74f8bec4b..8e1b501b25 100644 --- a/osu.Game/Online/Chat/WebSocketChatClient.cs +++ b/osu.Game/Online/Chat/WebSocketChatClient.cs @@ -61,7 +61,7 @@ namespace osu.Game.Online.Chat { await client.SendAsync(new StartChatRequest()).ConfigureAwait(false); Logger.Log(@"Now listening to websocket chat messages.", LoggingTarget.Network); - chatStartCancellationSource.Cancel(); + await chatStartCancellationSource.CancelAsync().ConfigureAwait(false); } catch (Exception ex) { From dde7e068a4ae490ade2c49650996da50c60e939b Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Fri, 2 Feb 2024 22:28:47 +0300 Subject: [PATCH 44/86] Incorporate new unstable rate algo --- .../Rulesets/Scoring/HitEventExtensions.cs | 39 ++++++++++++------- osu.sln.DotSettings | 1 + 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs index 9fb61c6cd9..c3ad8980fe 100644 --- a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs +++ b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Scoring public static class HitEventExtensions { /// - /// Calculates the "unstable rate" for a sequence of s. + /// Calculates the "unstable rate" for a sequence of s using Welford's online algorithm. /// /// /// A non-null value if unstable rate could be calculated, @@ -21,9 +21,30 @@ namespace osu.Game.Rulesets.Scoring { Debug.Assert(hitEvents.All(ev => ev.GameplayRate != null)); - // Division by gameplay rate is to account for TimeOffset scaling with gameplay rate. - double[] timeOffsets = hitEvents.Where(affectsUnstableRate).Select(ev => ev.TimeOffset / ev.GameplayRate!.Value).ToArray(); - return 10 * standardDeviation(timeOffsets); + double currentValue; + int k = 0; + double m = 0; + double s = 0; + double mNext; + + foreach (var e in hitEvents) + { + if (!affectsUnstableRate(e)) + continue; + + // Division by gameplay rate is to account for TimeOffset scaling with gameplay rate. + currentValue = e.TimeOffset / e.GameplayRate!.Value; + + k++; + mNext = m + (currentValue - m) / k; + s += (currentValue - m) * (currentValue - mNext); + m = mNext; + } + + if (k == 0) + return null; + + return 10.0 * Math.Sqrt(s / k); } /// @@ -44,15 +65,5 @@ namespace osu.Game.Rulesets.Scoring } private static bool affectsUnstableRate(HitEvent e) => !(e.HitObject.HitWindows is HitWindows.EmptyHitWindows) && e.Result.IsHit(); - - private static double? standardDeviation(double[] timeOffsets) - { - if (timeOffsets.Length == 0) - return null; - - double mean = timeOffsets.Average(); - double squares = timeOffsets.Select(offset => Math.Pow(offset - mean, 2)).Sum(); - return Math.Sqrt(squares / timeOffsets.Length); - } } } diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 1bf8aa7b0b..ef557cbbfc 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -1041,4 +1041,5 @@ private void load() True True True + True True From 4d324a30573f9cd6c4dcff2e0c336e26e66a574a Mon Sep 17 00:00:00 2001 From: Loreos7 Date: Sat, 3 Feb 2024 00:08:36 +0300 Subject: [PATCH 45/86] localise remaining parts of the game settings --- .../TaikoSettingsSubsection.cs | 5 +++-- osu.Game/Localisation/AudioSettingsStrings.cs | 15 +++++++++++++++ osu.Game/Localisation/DebugSettingsStrings.cs | 5 +++++ osu.Game/Localisation/GraphicsSettingsStrings.cs | 5 +++++ osu.Game/Localisation/RulesetSettingsStrings.cs | 5 +++++ .../Sections/Audio/AudioOffsetAdjustControl.cs | 6 +++--- .../Sections/DebugSettings/GeneralSettings.cs | 2 +- .../Settings/Sections/Graphics/LayoutSettings.cs | 2 +- 8 files changed, 38 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/TaikoSettingsSubsection.cs b/osu.Game.Rulesets.Taiko/TaikoSettingsSubsection.cs index 9fe861c08c..84dea474c5 100644 --- a/osu.Game.Rulesets.Taiko/TaikoSettingsSubsection.cs +++ b/osu.Game.Rulesets.Taiko/TaikoSettingsSubsection.cs @@ -1,9 +1,10 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// 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.Localisation; +using osu.Game.Localisation; using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Taiko.Configuration; @@ -27,7 +28,7 @@ namespace osu.Game.Rulesets.Taiko { new SettingsEnumDropdown { - LabelText = "Touch control scheme", + LabelText = RulesetSettingsStrings.TouchControlScheme, Current = config.GetBindable(TaikoRulesetSetting.TouchControlScheme) } }; diff --git a/osu.Game/Localisation/AudioSettingsStrings.cs b/osu.Game/Localisation/AudioSettingsStrings.cs index 0f0f560df9..d93de59cd2 100644 --- a/osu.Game/Localisation/AudioSettingsStrings.cs +++ b/osu.Game/Localisation/AudioSettingsStrings.cs @@ -64,6 +64,21 @@ namespace osu.Game.Localisation /// public static LocalisableString AudioOffset => new TranslatableString(getKey(@"audio_offset"), @"Audio offset"); + /// + /// "Play a few beatmaps to receive a suggested offset!" + /// + public static LocalisableString SuggestedOffsetNote => new TranslatableString(getKey(@"suggested_offset_note"), @"Play a few beatmaps to receive a suggested offset!"); + + /// + /// "Based on the last {0} play(s), the suggested offset is {1} ms" + /// + public static LocalisableString SuggestedOffsetValueReceived(int plays, double? value) => new TranslatableString(getKey(@"suggested_offset_value_received"), @"Based on the last {0} play(s), the suggested offset is {1} ms", plays, value); + + /// + /// "Apply suggested offset" + /// + public static LocalisableString ApplySuggestedOffset => new TranslatableString(getKey(@"apply_suggested_offset"), @"Apply suggested offset"); + /// /// "Offset wizard" /// diff --git a/osu.Game/Localisation/DebugSettingsStrings.cs b/osu.Game/Localisation/DebugSettingsStrings.cs index 18fd3e83da..066c07858c 100644 --- a/osu.Game/Localisation/DebugSettingsStrings.cs +++ b/osu.Game/Localisation/DebugSettingsStrings.cs @@ -29,6 +29,11 @@ namespace osu.Game.Localisation /// public static LocalisableString ImportFiles => new TranslatableString(getKey(@"import_files"), @"Import files"); + /// + /// "Run latency certifier" + /// + public static LocalisableString RunLatencyCertifier => new TranslatableString(getKey(@"run_latency_certifier"), @"Run latency certifier"); + /// /// "Memory" /// diff --git a/osu.Game/Localisation/GraphicsSettingsStrings.cs b/osu.Game/Localisation/GraphicsSettingsStrings.cs index 1d14b0a596..d3952d0b4c 100644 --- a/osu.Game/Localisation/GraphicsSettingsStrings.cs +++ b/osu.Game/Localisation/GraphicsSettingsStrings.cs @@ -159,6 +159,11 @@ namespace osu.Game.Localisation /// public static LocalisableString MinimiseOnFocusLoss => new TranslatableString(getKey(@"minimise_on_focus_loss"), @"Minimise osu! when switching to another app"); + /// + /// "Shrink game to avoid cameras and notches" + /// + public static LocalisableString ShrinkGameOnMobile => new TranslatableString(getKey(@"shrink_game_on_mobile"), @"Shrink game to avoid cameras and notches"); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Localisation/RulesetSettingsStrings.cs b/osu.Game/Localisation/RulesetSettingsStrings.cs index 3fa7656cbb..e3d51f1124 100644 --- a/osu.Game/Localisation/RulesetSettingsStrings.cs +++ b/osu.Game/Localisation/RulesetSettingsStrings.cs @@ -84,6 +84,11 @@ namespace osu.Game.Localisation /// public static LocalisableString ScrollSpeedTooltip(int scrollTime, int scrollSpeed) => new TranslatableString(getKey(@"ruleset"), @"{0}ms (speed {1})", scrollTime, scrollSpeed); + /// + /// "Touch control scheme" + /// + public static LocalisableString TouchControlScheme => new TranslatableString(getKey(@"touch_control_scheme"), @"Touch control scheme"); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs index ef1691534f..71c357c065 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -91,7 +91,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio applySuggestion = new RoundedButton { RelativeSizeAxes = Axes.X, - Text = "Apply suggested offset", + Text = AudioSettingsStrings.ApplySuggestedOffset, Action = () => { if (SuggestedOffset.Value.HasValue) @@ -155,8 +155,8 @@ namespace osu.Game.Overlays.Settings.Sections.Audio private void updateHintText() { hintText.Text = SuggestedOffset.Value == null - ? @"Play a few beatmaps to receive a suggested offset!" - : $@"Based on the last {averageHitErrorHistory.Count} play(s), the suggested offset is {SuggestedOffset.Value:N0} ms."; + ? AudioSettingsStrings.SuggestedOffsetNote + : AudioSettingsStrings.SuggestedOffsetValueReceived(averageHitErrorHistory.Count, SuggestedOffset.Value); applySuggestion.Enabled.Value = SuggestedOffset.Value != null; } diff --git a/osu.Game/Overlays/Settings/Sections/DebugSettings/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/DebugSettings/GeneralSettings.cs index 049ccedf37..df46e38491 100644 --- a/osu.Game/Overlays/Settings/Sections/DebugSettings/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/DebugSettings/GeneralSettings.cs @@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings }, new SettingsButton { - Text = @"Run latency certifier", + Text = DebugSettingsStrings.RunLatencyCertifier, Action = () => performer?.PerformFromScreen(menu => menu.Push(new LatencyCertifierScreen())) } }; diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 71afec88d4..4eb3e54708 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -115,7 +115,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics }, safeAreaConsiderationsCheckbox = new SettingsCheckbox { - LabelText = "Shrink game to avoid cameras and notches", + LabelText = GraphicsSettingsStrings.ShrinkGameOnMobile, Current = osuConfig.GetBindable(OsuSetting.SafeAreaConsiderations), }, new SettingsSlider From 9706836778a8fb3e83c663dc9a957f2265001a64 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 3 Feb 2024 06:16:24 +0900 Subject: [PATCH 46/86] Update system requirements --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d7e710f392..dc5809d46b 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ If you are just looking to give the game a whirl, you can grab the latest releas ### Latest release: -| [Windows 8.1+ (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | macOS 10.15+ ([Intel](https://github.com/ppy/osu/releases/latest/download/osu.app.Intel.zip), [Apple Silicon](https://github.com/ppy/osu/releases/latest/download/osu.app.Apple.Silicon.zip)) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.AppImage) | [iOS 13.4+](https://osu.ppy.sh/home/testflight) | [Android 5+](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk) | -| ------------- | ------------- | ------------- | ------------- | ------------- | +| [Windows 10+ (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | macOS 12+ ([Intel](https://github.com/ppy/osu/releases/latest/download/osu.app.Intel.zip), [Apple Silicon](https://github.com/ppy/osu/releases/latest/download/osu.app.Apple.Silicon.zip)) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.AppImage) | [iOS 13.4+](https://osu.ppy.sh/home/testflight) | [Android 5+](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk) | +|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------------- | ------------- | ------------- | You can also generally download a version for your current device from the [osu! site](https://osu.ppy.sh/home/download). From 57bc5ee04fd68fc317dea18c51d6d473f1eb80dd Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 3 Feb 2024 00:19:04 +0300 Subject: [PATCH 47/86] Improve readability --- osu.Game/Rulesets/Scoring/HitEventExtensions.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs index c3ad8980fe..ab36a54d3d 100644 --- a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs +++ b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs @@ -21,30 +21,28 @@ namespace osu.Game.Rulesets.Scoring { Debug.Assert(hitEvents.All(ev => ev.GameplayRate != null)); - double currentValue; - int k = 0; + int count = 0; double m = 0; double s = 0; - double mNext; foreach (var e in hitEvents) { if (!affectsUnstableRate(e)) continue; - // Division by gameplay rate is to account for TimeOffset scaling with gameplay rate. - currentValue = e.TimeOffset / e.GameplayRate!.Value; + count++; - k++; - mNext = m + (currentValue - m) / k; + // Division by gameplay rate is to account for TimeOffset scaling with gameplay rate. + double currentValue = e.TimeOffset / e.GameplayRate!.Value; + double mNext = m + (currentValue - m) / count; s += (currentValue - m) * (currentValue - mNext); m = mNext; } - if (k == 0) + if (count == 0) return null; - return 10.0 * Math.Sqrt(s / k); + return 10.0 * Math.Sqrt(s / count); } /// From 24e5c7ed42a58f7a787a965a84488a02e00e8e3f Mon Sep 17 00:00:00 2001 From: Loreos7 Date: Sat, 3 Feb 2024 02:02:21 +0300 Subject: [PATCH 48/86] fix formatting --- osu.Game/Localisation/AudioSettingsStrings.cs | 2 +- .../Settings/Sections/Audio/AudioOffsetAdjustControl.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Localisation/AudioSettingsStrings.cs b/osu.Game/Localisation/AudioSettingsStrings.cs index d93de59cd2..f4537a4c1c 100644 --- a/osu.Game/Localisation/AudioSettingsStrings.cs +++ b/osu.Game/Localisation/AudioSettingsStrings.cs @@ -72,7 +72,7 @@ namespace osu.Game.Localisation /// /// "Based on the last {0} play(s), the suggested offset is {1} ms" /// - public static LocalisableString SuggestedOffsetValueReceived(int plays, double? value) => new TranslatableString(getKey(@"suggested_offset_value_received"), @"Based on the last {0} play(s), the suggested offset is {1} ms", plays, value); + public static LocalisableString SuggestedOffsetValueReceived(int plays, string value) => new TranslatableString(getKey(@"suggested_offset_value_received"), @"Based on the last {0} play(s), the suggested offset is {1} ms", plays, value); /// /// "Apply suggested offset" diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs index 71c357c065..ad33434848 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -156,7 +156,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { hintText.Text = SuggestedOffset.Value == null ? AudioSettingsStrings.SuggestedOffsetNote - : AudioSettingsStrings.SuggestedOffsetValueReceived(averageHitErrorHistory.Count, SuggestedOffset.Value); + : AudioSettingsStrings.SuggestedOffsetValueReceived(averageHitErrorHistory.Count, $"{SuggestedOffset.Value:N0}"); applySuggestion.Enabled.Value = SuggestedOffset.Value != null; } From 4aa27482a9b95ce8049d2a6cac1b1ded0945bc8f Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 3 Feb 2024 19:52:40 +0300 Subject: [PATCH 49/86] Use SlimReadOnlyDictionaryWrapper for AliveEntries --- .../Objects/Pooling/PooledDrawableWithLifetimeContainer.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs b/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs index aed608cf8f..efc10f26e1 100644 --- a/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs +++ b/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs @@ -2,12 +2,13 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Diagnostics; using System.Linq; +using osu.Framework.Extensions.ListExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Performance; +using osu.Framework.Lists; namespace osu.Game.Rulesets.Objects.Pooling { @@ -36,7 +37,7 @@ namespace osu.Game.Rulesets.Objects.Pooling /// /// The enumeration order is undefined. /// - public readonly ReadOnlyDictionary AliveEntries; + public readonly SlimReadOnlyDictionaryWrapper AliveEntries; /// /// Whether to remove an entry when clock goes backward and crossed its . @@ -65,7 +66,7 @@ namespace osu.Game.Rulesets.Objects.Pooling lifetimeManager.EntryBecameDead += entryBecameDead; lifetimeManager.EntryCrossedBoundary += entryCrossedBoundary; - AliveEntries = new ReadOnlyDictionary(aliveDrawableMap); + AliveEntries = aliveDrawableMap.AsSlimReadOnly(); } /// From e2e3c61c9c9e1a13434a6db6d919299ee459c78e Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 3 Feb 2024 19:54:04 +0300 Subject: [PATCH 50/86] Use AliveEntries where we don't need startTime order --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 4 +++- osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs | 4 +++- osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs | 4 +++- osu.Game/Screens/Play/FailAnimationContainer.cs | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index b70d607ca1..a9111eec1f 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -75,8 +75,10 @@ namespace osu.Game.Rulesets.Osu.Mods { double time = playfield.Time.Current; - foreach (var drawable in playfield.HitObjectContainer.AliveObjects) + foreach (var entry in playfield.HitObjectContainer.AliveEntries) { + var drawable = entry.Value; + switch (drawable) { case DrawableHitCircle circle: diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs b/osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs index befee4af5a..b49fb931d1 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs @@ -49,8 +49,10 @@ namespace osu.Game.Rulesets.Osu.Mods { var cursorPos = playfield.Cursor.AsNonNull().ActiveCursor.DrawPosition; - foreach (var drawable in playfield.HitObjectContainer.AliveObjects) + foreach (var entry in playfield.HitObjectContainer.AliveEntries) { + var drawable = entry.Value; + switch (drawable) { case DrawableHitCircle circle: diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs b/osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs index 91feb33931..ced98f0cd5 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs @@ -48,8 +48,10 @@ namespace osu.Game.Rulesets.Osu.Mods { var cursorPos = playfield.Cursor.AsNonNull().ActiveCursor.DrawPosition; - foreach (var drawable in playfield.HitObjectContainer.AliveObjects) + foreach (var entry in playfield.HitObjectContainer.AliveEntries) { + var drawable = entry.Value; + var destination = Vector2.Clamp(2 * drawable.Position - cursorPos, Vector2.Zero, OsuPlayfield.BASE_SIZE); if (drawable.HitObject is Slider thisSlider) diff --git a/osu.Game/Screens/Play/FailAnimationContainer.cs b/osu.Game/Screens/Play/FailAnimationContainer.cs index 821c67e3cb..ebb0d77726 100644 --- a/osu.Game/Screens/Play/FailAnimationContainer.cs +++ b/osu.Game/Screens/Play/FailAnimationContainer.cs @@ -198,8 +198,10 @@ namespace osu.Game.Screens.Play foreach (var nested in playfield.NestedPlayfields) applyToPlayfield(nested); - foreach (DrawableHitObject obj in playfield.HitObjectContainer.AliveObjects) + foreach (var entry in playfield.HitObjectContainer.AliveEntries) { + var obj = entry.Value; + if (appliedObjects.Contains(obj)) continue; From ba291621f0d9a0e074f8597f2f28aa203ee0c187 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 4 Feb 2024 17:27:07 +0900 Subject: [PATCH 51/86] Adjust Android SDK target version --- osu.Android/AndroidManifest.xml | 2 +- osu.Game.Rulesets.Catch.Tests.Android/AndroidManifest.xml | 2 +- osu.Game.Rulesets.Mania.Tests.Android/AndroidManifest.xml | 2 +- osu.Game.Rulesets.Osu.Tests.Android/AndroidManifest.xml | 2 +- osu.Game.Rulesets.Taiko.Tests.Android/AndroidManifest.xml | 2 +- osu.Game.Tests.Android/AndroidManifest.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Android/AndroidManifest.xml b/osu.Android/AndroidManifest.xml index a2b55257cb..a85e711cf2 100644 --- a/osu.Android/AndroidManifest.xml +++ b/osu.Android/AndroidManifest.xml @@ -1,6 +1,6 @@  - + - + \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania.Tests.Android/AndroidManifest.xml b/osu.Game.Rulesets.Mania.Tests.Android/AndroidManifest.xml index f5a49210ea..df4930419c 100644 --- a/osu.Game.Rulesets.Mania.Tests.Android/AndroidManifest.xml +++ b/osu.Game.Rulesets.Mania.Tests.Android/AndroidManifest.xml @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu.Tests.Android/AndroidManifest.xml b/osu.Game.Rulesets.Osu.Tests.Android/AndroidManifest.xml index ed4725dd94..d0c3484cfd 100644 --- a/osu.Game.Rulesets.Osu.Tests.Android/AndroidManifest.xml +++ b/osu.Game.Rulesets.Osu.Tests.Android/AndroidManifest.xml @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko.Tests.Android/AndroidManifest.xml b/osu.Game.Rulesets.Taiko.Tests.Android/AndroidManifest.xml index cc88d3080a..0ae9ee43ad 100644 --- a/osu.Game.Rulesets.Taiko.Tests.Android/AndroidManifest.xml +++ b/osu.Game.Rulesets.Taiko.Tests.Android/AndroidManifest.xml @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/osu.Game.Tests.Android/AndroidManifest.xml b/osu.Game.Tests.Android/AndroidManifest.xml index 6f91fb928c..71793af977 100644 --- a/osu.Game.Tests.Android/AndroidManifest.xml +++ b/osu.Game.Tests.Android/AndroidManifest.xml @@ -1,5 +1,5 @@  - + \ No newline at end of file From 9923c1b6e6e33fc982c3e61c457aa5210da3ae73 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 4 Feb 2024 17:08:39 +0300 Subject: [PATCH 52/86] Fix multiplayer/playlists lounge screen disposing rooms synchronously --- .../OnlinePlay/Lounge/Components/RoomsContainer.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs b/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs index ac6403bb34..8a3fbbf792 100644 --- a/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs +++ b/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs @@ -141,9 +141,18 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components private void removeRooms(IEnumerable rooms) { - foreach (var r in rooms) + foreach (var room in rooms) { - roomFlow.RemoveAll(d => d.Room == r, true); + var drawableRoom = roomFlow.SingleOrDefault(d => d.Room == room); + if (drawableRoom == null) + continue; + + // expire to trigger async disposal. the room still has to exist somewhere so we move it to internal content of RoomsContainer until next frame. + drawableRoom.Hide(); + drawableRoom.Expire(); + + roomFlow.Remove(drawableRoom, false); + AddInternal(drawableRoom); // selection may have a lease due to being in a sub screen. if (!SelectedRoom.Disabled) From 6f9ee3f526745d073c1cf4978a229a796766ad64 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Mon, 5 Feb 2024 00:30:48 +0300 Subject: [PATCH 53/86] Fix selected room bindable being set to null regardless of the removed room --- osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs b/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs index ac6403bb34..bd06890753 100644 --- a/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs +++ b/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs @@ -146,7 +146,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components roomFlow.RemoveAll(d => d.Room == r, true); // selection may have a lease due to being in a sub screen. - if (!SelectedRoom.Disabled) + if (SelectedRoom.Value == r && !SelectedRoom.Disabled) SelectedRoom.Value = null; } } From 44a594ba05325bf28197c3727ef5813b36e4ad61 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Mon, 5 Feb 2024 01:03:04 +0300 Subject: [PATCH 54/86] Simplify playback logic --- .../Expanded/Accuracy/AccuracyCircle.cs | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs index e5ba9500ee..d209c305fa 100644 --- a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs +++ b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs @@ -4,6 +4,7 @@ #nullable disable using System; +using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Audio; @@ -85,9 +86,6 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy /// public static readonly Easing ACCURACY_TRANSFORM_EASING = Easing.OutPow10; - [Resolved] - private SkinManager skins { get; set; } - private readonly ScoreInfo score; private CircularProgress accuracyCircle; @@ -101,7 +99,6 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy private PoolableSkinnableSample swooshUpSound; private PoolableSkinnableSample rankImpactSound; private PoolableSkinnableSample rankApplauseSound; - private PoolableSkinnableSample rankLegacyApplauseSound; private readonly Bindable tickPlaybackRate = new Bindable(); @@ -263,11 +260,15 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy if (isFailedSDueToMisses) AddInternal(failedSRankText = new RankText(ScoreRank.S)); + var applauseSamples = new List { applauseSampleName }; + if (score.Rank >= ScoreRank.B) + // when rank is B or higher, play legacy applause sample on legacy skins. + applauseSamples.Insert(0, @"applause"); + AddRangeInternal(new Drawable[] { rankImpactSound = new PoolableSkinnableSample(new SampleInfo(impactSampleName)), - rankApplauseSound = new PoolableSkinnableSample(new SampleInfo(applauseSampleName)), - rankLegacyApplauseSound = new PoolableSkinnableSample(new SampleInfo("applause")), + rankApplauseSound = new PoolableSkinnableSample(new SampleInfo(applauseSamples.ToArray())), scoreTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/score-tick")), badgeTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink")), badgeMaxSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink-max")), @@ -401,20 +402,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy { Schedule(() => { - if (skins.CurrentSkin.Value is LegacySkin) - { - // only play legacy "applause" sound if score rank is B or higher. - if (score.Rank >= ScoreRank.B) - { - rankLegacyApplauseSound.VolumeTo(applause_volume); - rankLegacyApplauseSound.Play(); - } - } - else - { - rankApplauseSound.VolumeTo(applause_volume); - rankApplauseSound.Play(); - } + rankApplauseSound.VolumeTo(applause_volume); + rankApplauseSound.Play(); }); } } From 5f39d4590ba1d69980a76537807a8f86b2476c52 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 5 Feb 2024 18:02:07 +0900 Subject: [PATCH 55/86] Update global.json version --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index da113e4cbd..789bff3bd0 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.0", + "version": "8.0.100", "rollForward": "latestFeature", "allowPrerelease": false } From 989e46c791de8261a970901fc8732b087d254a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 13:05:28 +0100 Subject: [PATCH 56/86] Use better test step name --- osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs index 2bda242de2..3f2b71b320 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs @@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.Ranking Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmapInfo); }); - AddToggleStep("toggle skin", v => + AddToggleStep("toggle legacy classic skin", v => { if (skins != null) skins.CurrentSkinInfo.Value = v ? skins.DefaultClassicSkin.SkinInfo : skins.CurrentSkinInfo.Default; From efe6bb25b14db26e7c0b79494aa3eaf038dd99b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 13:21:01 +0100 Subject: [PATCH 57/86] Refactor result application around again to remove requirement for fields Co-authored-by: Dean Herbert --- .../Objects/Drawables/DrawableHoldNote.cs | 2 +- .../Objects/Drawables/DrawableHoldNoteBody.cs | 12 +++----- .../Drawables/DrawableManiaHitObject.cs | 2 +- .../Objects/Drawables/DrawableNote.cs | 3 +- .../TestSceneHitCircle.cs | 2 +- .../TestSceneHitCircleLateFade.cs | 2 +- .../Objects/Drawables/DrawableHitCircle.cs | 29 ++++++++++--------- .../Objects/Drawables/DrawableOsuHitObject.cs | 4 +-- .../Objects/Drawables/DrawableDrumRoll.cs | 2 +- .../Objects/Drawables/DrawableDrumRollTick.cs | 6 ++-- .../Objects/Drawables/DrawableFlyingHit.cs | 2 +- .../Objects/Drawables/DrawableHit.cs | 10 +++---- .../Drawables/DrawableStrongNestedHit.cs | 2 +- .../Objects/Drawables/DrawableSwell.cs | 2 +- .../Gameplay/TestSceneDrawableHitObject.cs | 2 +- .../Gameplay/TestScenePoolingRuleset.cs | 8 ++--- .../Rulesets/Judgements/JudgementResult.cs | 2 +- .../Objects/Drawables/DrawableHitObject.cs | 17 +++++++++-- 18 files changed, 59 insertions(+), 50 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 6c70ab3526..2b55e81788 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -265,7 +265,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (Tail.AllJudged) { if (Tail.IsHit) - ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + ApplyMaxResult(); else MissForcefully(); } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs index 731b1b6298..6259033235 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteBody.cs @@ -11,8 +11,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables public override bool DisplayResult => false; - private bool hit; - public DrawableHoldNoteBody() : this(null) { @@ -27,12 +25,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { if (AllJudged) return; - this.hit = hit; - ApplyResult(static (r, hitObject) => - { - var holdNoteBody = (DrawableHoldNoteBody)hitObject; - r.Type = holdNoteBody.hit ? r.Judgement.MaxResult : r.Judgement.MinResult; - }); + if (hit) + ApplyMaxResult(); + else + ApplyMinResult(); } } } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs index 2d10fa27cd..e98622b8bf 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs @@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables /// /// Causes this to get missed, disregarding all conditions in implementations of . /// - public virtual void MissForcefully() => ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + public virtual void MissForcefully() => ApplyMinResult(); } public abstract partial class DrawableManiaHitObject : DrawableManiaHitObject diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index a70253798a..2246552abe 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -91,12 +91,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); return; } hitResult = HitObject.HitWindows.ResultFor(timeOffset); + if (hitResult == HitResult.None) return; diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs index 8d4145f2c1..abe950f9bb 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs @@ -136,7 +136,7 @@ namespace osu.Game.Rulesets.Osu.Tests if (auto && !userTriggered && timeOffset > hitOffset && CheckHittable?.Invoke(this, Time.Current, HitResult.Great) == ClickAction.Hit) { // force success - ApplyResult(static (r, _) => r.Type = HitResult.Great); + ApplyResult(HitResult.Great); } else base.CheckForResult(userTriggered, timeOffset); diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleLateFade.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleLateFade.cs index 2d1e9c1270..838b426cb4 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleLateFade.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleLateFade.cs @@ -208,7 +208,7 @@ namespace osu.Game.Rulesets.Osu.Tests if (shouldHit && !userTriggered && timeOffset >= 0) { // force success - ApplyResult(static (r, _) => r.Type = HitResult.Great); + ApplyResult(HitResult.Great); } else base.CheckForResult(userTriggered, timeOffset); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index ce5422b180..a014ba2e77 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -44,7 +44,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private Container scaleContainer; private InputManager inputManager; - private HitResult hitResult; public DrawableHitCircle() : this(null) @@ -156,12 +155,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); return; } - hitResult = ResultFor(timeOffset); + HitResult hitResult = ResultFor(timeOffset); var clickAction = CheckHittable?.Invoke(this, Time.Current, hitResult); if (clickAction == ClickAction.Shake) @@ -170,20 +169,22 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (hitResult == HitResult.None || clickAction != ClickAction.Hit) return; - ApplyResult(static (r, hitObject) => + Vector2? hitPosition = null; + + // Todo: This should also consider misses, but they're a little more interesting to handle, since we don't necessarily know the position at the time of a miss. + if (hitResult.IsHit()) + { + var localMousePosition = ToLocalSpace(inputManager.CurrentState.Mouse.Position); + hitPosition = HitObject.StackedPosition + (localMousePosition - DrawSize / 2); + } + + ApplyResult<(HitResult result, Vector2? position)>((r, state) => { - var hitCircle = (DrawableHitCircle)hitObject; var circleResult = (OsuHitCircleJudgementResult)r; - // Todo: This should also consider misses, but they're a little more interesting to handle, since we don't necessarily know the position at the time of a miss. - if (hitCircle.hitResult.IsHit()) - { - var localMousePosition = hitCircle.ToLocalSpace(hitCircle.inputManager.CurrentState.Mouse.Position); - circleResult.CursorPositionAtHit = hitCircle.HitObject.StackedPosition + (localMousePosition - hitCircle.DrawSize / 2); - } - - circleResult.Type = hitCircle.hitResult; - }); + circleResult.Type = state.result; + circleResult.CursorPositionAtHit = state.position; + }, (hitResult, hitPosition)); } /// diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 6de60a9d51..5271c03e08 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -100,12 +100,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// /// Causes this to get hit, disregarding all conditions in implementations of . /// - public void HitForcefully() => ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + public void HitForcefully() => ApplyMaxResult(); /// /// Causes this to get missed, disregarding all conditions in implementations of . /// - public void MissForcefully() => ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + public void MissForcefully() => ApplyMinResult(); private RectangleF parentScreenSpaceRectangle => ((DrawableOsuHitObject)ParentHitObject)?.parentScreenSpaceRectangle ?? Parent!.ScreenSpaceDrawQuad.AABBFloat; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index e15298f3ca..1af4719b02 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (timeOffset < 0) return; - ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + ApplyMaxResult(); } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs index aa678d7043..0333fd71a9 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -49,14 +49,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!userTriggered) { if (timeOffset > HitObject.HitWindow) - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); return; } if (Math.Abs(timeOffset) > HitObject.HitWindow) return; - ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + ApplyMaxResult(); } public override void OnKilled() @@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables base.OnKilled(); if (Time.Current > HitObject.GetEndTime() && !Judged) - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs index 4349dff9f9..aad9214c5e 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableFlyingHit.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables protected override void LoadComplete() { base.LoadComplete(); - ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + ApplyMaxResult(); } protected override void LoadSamples() diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index cf8e4050ee..ca49ddb7e1 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -101,7 +101,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); return; } @@ -110,7 +110,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables return; if (!validActionPressed) - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); else { ApplyResult(static (r, hitObject) => @@ -217,19 +217,19 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!ParentHitObject.Result.IsHit) { - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); return; } if (!userTriggered) { if (timeOffset - ParentHitObject.Result.TimeOffset > SECOND_HIT_WINDOW) - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); return; } if (Math.Abs(timeOffset - ParentHitObject.Result.TimeOffset) <= SECOND_HIT_WINDOW) - ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + ApplyMaxResult(); } public override bool OnPressed(KeyBindingPressEvent e) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs index 8f99538448..11759927a9 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs @@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables // it can happen that the hit window of the nested strong hit extends past the lifetime of the parent object. // this is a safety to prevent such cases from causing the nested hit to never be judged and as such prevent gameplay from completing. if (!Judged && Time.Current > ParentHitObject?.HitObject.GetEndTime()) - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 0781ea5e2a..6eb62cce22 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -208,7 +208,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, Easing.OutQuint); if (numHits == HitObject.RequiredHits) - ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + ApplyMaxResult(); } else { diff --git a/osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs b/osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs index bf1e52aab5..73177e36e1 100644 --- a/osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs +++ b/osu.Game.Tests/Gameplay/TestSceneDrawableHitObject.cs @@ -216,7 +216,7 @@ namespace osu.Game.Tests.Gameplay LifetimeStart = LIFETIME_ON_APPLY; } - public void MissForcefully() => ApplyResult(static (r, _) => r.Type = HitResult.Miss); + public void MissForcefully() => ApplyResult(HitResult.Miss); protected override void UpdateHitStateTransforms(ArmedState state) { diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePoolingRuleset.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePoolingRuleset.cs index 00bd58e303..b567e8de8d 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestScenePoolingRuleset.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestScenePoolingRuleset.cs @@ -431,7 +431,7 @@ namespace osu.Game.Tests.Visual.Gameplay protected override void CheckForResult(bool userTriggered, double timeOffset) { if (timeOffset > HitObject.Duration) - ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + ApplyMaxResult(); } protected override void UpdateHitStateTransforms(ArmedState state) @@ -468,7 +468,7 @@ namespace osu.Game.Tests.Visual.Gameplay public override void OnKilled() { base.OnKilled(); - ApplyResult(static (r, _) => r.Type = r.Judgement.MinResult); + ApplyMinResult(); } } @@ -547,7 +547,7 @@ namespace osu.Game.Tests.Visual.Gameplay { base.CheckForResult(userTriggered, timeOffset); if (timeOffset >= 0) - ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + ApplyMaxResult(); } } @@ -596,7 +596,7 @@ namespace osu.Game.Tests.Visual.Gameplay { base.CheckForResult(userTriggered, timeOffset); if (timeOffset >= 0) - ApplyResult(static (r, _) => r.Type = r.Judgement.MaxResult); + ApplyMaxResult(); } } diff --git a/osu.Game/Rulesets/Judgements/JudgementResult.cs b/osu.Game/Rulesets/Judgements/JudgementResult.cs index b781a13929..4b98df50d7 100644 --- a/osu.Game/Rulesets/Judgements/JudgementResult.cs +++ b/osu.Game/Rulesets/Judgements/JudgementResult.cs @@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Judgements /// /// The time at which this occurred. - /// Populated when this is applied via . + /// Populated when this is applied via . /// /// /// This is used instead of to check whether this should be reverted. diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index e30ce13f08..07fab72814 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -682,17 +682,28 @@ namespace osu.Game.Rulesets.Objects.Drawables UpdateResult(false); } + protected void ApplyMaxResult() => ApplyResult((r, _) => r.Type = r.Judgement.MaxResult); + protected void ApplyMinResult() => ApplyResult((r, _) => r.Type = r.Judgement.MinResult); + + protected void ApplyResult(HitResult type) => ApplyResult(static (result, state) => result.Type = state, type); + + [Obsolete("Use overload with state, preferrably with static delegates to avoid allocation overhead.")] // Can be removed 2024-07-26 + protected void ApplyResult(Action application) => ApplyResult((r, _) => application(r), this); + + protected void ApplyResult(Action application) => ApplyResult(application, this); + /// /// Applies the of this , notifying responders such as /// the of the . /// /// The callback that applies changes to the . Using a `static` delegate is recommended to avoid allocation overhead. - protected void ApplyResult(Action application) + /// The state. + protected void ApplyResult(Action application, T state) { if (Result.HasResult) throw new InvalidOperationException("Cannot apply result on a hitobject that already has a result."); - application?.Invoke(Result, this); + application?.Invoke(Result, state); if (!Result.HasResult) throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}."); @@ -737,7 +748,7 @@ namespace osu.Game.Rulesets.Objects.Drawables /// Checks if a scoring result has occurred for this . /// /// - /// If a scoring result has occurred, this method must invoke to update the result and notify responders. + /// If a scoring result has occurred, this method must invoke to update the result and notify responders. /// /// Whether the user triggered this check. /// The offset from the end time of the at which this check occurred. From 2976f225e0627ffa8cb4efe2ad6060e02a6fa5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 13:22:58 +0100 Subject: [PATCH 58/86] Improve xmldoc of `state` param --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 07fab72814..c5f1878d1f 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -697,7 +697,10 @@ namespace osu.Game.Rulesets.Objects.Drawables /// the of the . /// /// The callback that applies changes to the . Using a `static` delegate is recommended to avoid allocation overhead. - /// The state. + /// + /// Use this parameter to pass any data that requires + /// to apply a result, so that it can remain a `static` delegate and thus not allocate. + /// protected void ApplyResult(Action application, T state) { if (Result.HasResult) From fb80d76b4a814a8b79ce441833515f450ab8e12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 13:35:41 +0100 Subject: [PATCH 59/86] Apply further changes to remove remaining weirdness --- .../Drawables/DrawableEmptyFreeformHitObject.cs | 2 +- .../Drawables/DrawablePippidonHitObject.cs | 9 ++++----- .../Drawables/DrawableEmptyScrollingHitObject.cs | 3 +-- .../Drawables/DrawablePippidonHitObject.cs | 10 ++++------ .../Objects/Drawables/DrawableCatchHitObject.cs | 9 ++++----- .../Objects/Drawables/DrawableNote.cs | 15 ++++----------- .../Objects/Drawables/DrawableHitCircle.cs | 10 +++++----- .../Objects/Drawables/DrawableSpinnerTick.cs | 12 ++++-------- .../Objects/Drawables/DrawableHit.cs | 14 +++----------- .../Objects/Drawables/DrawableSwell.cs | 15 ++++++--------- .../Objects/Drawables/DrawableSwellTick.cs | 13 +++++-------- 11 files changed, 41 insertions(+), 71 deletions(-) diff --git a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs index 3ad8f06fb4..e53fe01157 100644 --- a/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs +++ b/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.EmptyFreeform.Objects.Drawables { if (timeOffset >= 0) // todo: implement judgement logic - ApplyResult(static (r, hitObject) => r.Type = HitResult.Perfect); + ApplyResult(HitResult.Perfect); } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs index 925f2d04bf..b1be25727f 100644 --- a/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs +++ b/Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs @@ -9,7 +9,6 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Audio; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Scoring; using osuTK; using osuTK.Graphics; @@ -50,10 +49,10 @@ namespace osu.Game.Rulesets.Pippidon.Objects.Drawables { if (timeOffset >= 0) { - ApplyResult(static (r, hitObject) => - { - r.Type = hitObject.IsHovered ? HitResult.Perfect : HitResult.Miss; - }); + if (IsHovered) + ApplyMaxResult(); + else + ApplyMinResult(); } } diff --git a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs index 408bbea717..adcbd36485 100644 --- a/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs +++ b/Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Objects/Drawables/DrawableEmptyScrollingHitObject.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Scoring; using osuTK; using osuTK.Graphics; @@ -24,7 +23,7 @@ namespace osu.Game.Rulesets.EmptyScrolling.Objects.Drawables { if (timeOffset >= 0) // todo: implement judgement logic - ApplyResult(static (r, hitObject) => r.Type = HitResult.Perfect); + ApplyMaxResult(); } protected override void UpdateHitStateTransforms(ArmedState state) diff --git a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs index 2c9eac7f65..3ad636a601 100644 --- a/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs +++ b/Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Objects/Drawables/DrawablePippidonHitObject.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Textures; using osu.Game.Audio; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Pippidon.UI; -using osu.Game.Rulesets.Scoring; using osuTK; using osuTK.Graphics; @@ -50,11 +49,10 @@ namespace osu.Game.Rulesets.Pippidon.Objects.Drawables { if (timeOffset >= 0) { - ApplyResult(static (r, hitObject) => - { - var pippidonHitObject = (DrawablePippidonHitObject)hitObject; - r.Type = pippidonHitObject.currentLane.Value == pippidonHitObject.HitObject.Lane ? HitResult.Perfect : HitResult.Miss; - }); + if (currentLane.Value == HitObject.Lane) + ApplyMaxResult(); + else + ApplyMinResult(); } } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs index 721c6aaa59..64705f9909 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableCatchHitObject.cs @@ -64,11 +64,10 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables if (timeOffset >= 0 && Result != null) { - ApplyResult(static (r, hitObject) => - { - var catchHitObject = (DrawableCatchHitObject)hitObject; - r.Type = catchHitObject.CheckPosition!.Invoke(catchHitObject.HitObject) ? r.Judgement.MaxResult : r.Judgement.MinResult; - }); + if (CheckPosition.Invoke(HitObject)) + ApplyMaxResult(); + else + ApplyMinResult(); } } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 2246552abe..f6b92ab405 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -38,8 +38,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables private Drawable headPiece; - private HitResult hitResult; - public DrawableNote() : this(null) { @@ -96,18 +94,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables return; } - hitResult = HitObject.HitWindows.ResultFor(timeOffset); + var result = HitObject.HitWindows.ResultFor(timeOffset); - if (hitResult == HitResult.None) + if (result == HitResult.None) return; - hitResult = GetCappedResult(hitResult); - - ApplyResult(static (r, hitObject) => - { - var note = (DrawableNote)hitObject; - r.Type = note.hitResult; - }); + result = GetCappedResult(result); + ApplyResult(result); } /// diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index a014ba2e77..b1c9bef6c4 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -160,19 +160,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables return; } - HitResult hitResult = ResultFor(timeOffset); - var clickAction = CheckHittable?.Invoke(this, Time.Current, hitResult); + var result = ResultFor(timeOffset); + var clickAction = CheckHittable?.Invoke(this, Time.Current, result); if (clickAction == ClickAction.Shake) Shake(); - if (hitResult == HitResult.None || clickAction != ClickAction.Hit) + if (result == HitResult.None || clickAction != ClickAction.Hit) return; Vector2? hitPosition = null; // Todo: This should also consider misses, but they're a little more interesting to handle, since we don't necessarily know the position at the time of a miss. - if (hitResult.IsHit()) + if (result.IsHit()) { var localMousePosition = ToLocalSpace(inputManager.CurrentState.Mouse.Position); hitPosition = HitObject.StackedPosition + (localMousePosition - DrawSize / 2); @@ -184,7 +184,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables circleResult.Type = state.result; circleResult.CursorPositionAtHit = state.position; - }, (hitResult, hitPosition)); + }, (result, hitPosition)); } /// diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs index 628f07a281..0a77faf924 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs @@ -11,8 +11,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { public override bool DisplayResult => false; - private bool hit; - public DrawableSpinnerTick() : this(null) { @@ -39,12 +37,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// Whether this tick was reached. internal void TriggerResult(bool hit) { - this.hit = hit; - ApplyResult(static (r, hitObject) => - { - var spinnerTick = (DrawableSpinnerTick)hitObject; - r.Type = spinnerTick.hit ? r.Judgement.MaxResult : r.Judgement.MinResult; - }); + if (hit) + ApplyMaxResult(); + else + ApplyMinResult(); } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index ca49ddb7e1..4fb69056da 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -37,8 +37,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private double? lastPressHandleTime; - private HitResult hitResult; - private readonly Bindable type = new Bindable(); public DrawableHit() @@ -105,20 +103,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables return; } - hitResult = HitObject.HitWindows.ResultFor(timeOffset); - if (hitResult == HitResult.None) + var result = HitObject.HitWindows.ResultFor(timeOffset); + if (result == HitResult.None) return; if (!validActionPressed) ApplyMinResult(); else - { - ApplyResult(static (r, hitObject) => - { - var drawableHit = (DrawableHit)hitObject; - r.Type = drawableHit.hitResult; - }); - } + ApplyResult(result); } public override bool OnPressed(KeyBindingPressEvent e) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 6eb62cce22..e1fc28fe16 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -41,8 +41,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private double? lastPressHandleTime; - private int numHits; - public override bool DisplayResult => false; public DrawableSwell() @@ -194,7 +192,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables nextTick?.TriggerResult(true); - numHits = ticks.Count(r => r.IsHit); + int numHits = ticks.Count(r => r.IsHit); float completion = (float)numHits / HitObject.RequiredHits; @@ -215,7 +213,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (timeOffset < 0) return; - numHits = 0; + int numHits = 0; foreach (var tick in ticks) { @@ -229,11 +227,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables tick.TriggerResult(false); } - ApplyResult(static (r, hitObject) => - { - var swell = (DrawableSwell)hitObject; - r.Type = swell.numHits == swell.HitObject.RequiredHits ? r.Judgement.MaxResult : r.Judgement.MinResult; - }); + if (numHits == HitObject.RequiredHits) + ApplyMaxResult(); + else + ApplyMinResult(); } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs index 557438e5e5..04dd01e066 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs @@ -15,8 +15,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public override bool DisplayResult => false; - private bool hit; - public DrawableSwellTick() : this(null) { @@ -31,13 +29,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables public void TriggerResult(bool hit) { - this.hit = hit; HitObject.StartTime = Time.Current; - ApplyResult(static (r, hitObject) => - { - var swellTick = (DrawableSwellTick)hitObject; - r.Type = swellTick.hit ? r.Judgement.MaxResult : r.Judgement.MinResult; - }); + + if (hit) + ApplyMaxResult(); + else + ApplyMinResult(); } protected override void CheckForResult(bool userTriggered, double timeOffset) From 8b9c9f4fedcb8177e5b33061eec320b3832e2d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 14:52:08 +0100 Subject: [PATCH 60/86] Add NRT annotations to `DrawableManiaRuleset` --- osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs index 070021ef74..decf670c5d 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.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 System.Linq; using osu.Framework.Allocation; @@ -61,9 +59,9 @@ namespace osu.Game.Rulesets.Mania.UI // Stores the current speed adjustment active in gameplay. private readonly Track speedAdjustmentTrack = new TrackVirtual(0); - private ISkinSource currentSkin; + private ISkinSource currentSkin = null!; - public DrawableManiaRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList mods = null) + public DrawableManiaRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList? mods = null) : base(ruleset, beatmap, mods) { BarLines = new BarLineGenerator(Beatmap).BarLines; @@ -114,7 +112,7 @@ namespace osu.Game.Rulesets.Mania.UI updateTimeRange(); } - private ScheduledDelegate pendingSkinChange; + private ScheduledDelegate? pendingSkinChange; private float hitPosition; private void onSkinChange() @@ -160,7 +158,7 @@ namespace osu.Game.Rulesets.Mania.UI protected override PassThroughInputManager CreateInputManager() => new ManiaInputManager(Ruleset.RulesetInfo, Variant); - public override DrawableHitObject CreateDrawableRepresentation(ManiaHitObject h) => null; + public override DrawableHitObject? CreateDrawableRepresentation(ManiaHitObject h) => null; protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new ManiaFramedReplayInputHandler(replay); From 9e1a24fdefe24dc3d6d8daa57439ffefe4ddacde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 16:20:50 +0100 Subject: [PATCH 61/86] Remove pointless enum --- .../Overlays/FirstRunSetup/ScreenImportFromStable.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs index 0b2b750136..a56af540e4 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs @@ -326,13 +326,4 @@ namespace osu.Game.Overlays.FirstRunSetup } } } - - public enum FileSystemAddition - { - [LocalisableDescription(typeof(FirstRunOverlayImportFromStableScreenStrings), nameof(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureNtfs))] - ToAvoidEnsureNtfs, - - [LocalisableDescription(typeof(FirstRunOverlayImportFromStableScreenStrings), nameof(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureHardLinksSupport))] - ToAvoidEnsureHardLinksSupport, - } } From fa894bda059e58626639e4a487181f191f207837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 16:25:44 +0100 Subject: [PATCH 62/86] Fix broken spacing --- osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs index a56af540e4..526dffa06f 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs @@ -137,6 +137,7 @@ namespace osu.Game.Overlays.FirstRunSetup copyInformation.Text = RuntimeInfo.OS == RuntimeInfo.Platform.Windows ? FirstRunOverlayImportFromStableScreenStrings.SecondCopyWillBeMade(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureNtfs) : FirstRunOverlayImportFromStableScreenStrings.SecondCopyWillBeMade(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureHardLinksSupport); + copyInformation.AddText(@" "); // just to ensure correct spacing copyInformation.AddLink(GeneralSettingsStrings.ChangeFolderLocation, () => { game?.PerformFromScreen(menu => menu.Push(new MigrationSelectScreen())); From 148e01327b41ebde80f9f1c0a83f844d14a93f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 16:27:56 +0100 Subject: [PATCH 63/86] Split copy info text into two rather than parameterise I have very low hopes translators would be able to correctly navigate this otherwise (especially in languages with different word order). --- .../FirstRunOverlayImportFromStableScreenStrings.cs | 13 ++++--------- .../FirstRunSetup/ScreenImportFromStable.cs | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs b/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs index bbd83d2395..04fecab3df 100644 --- a/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs +++ b/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs @@ -67,19 +67,14 @@ namespace osu.Game.Localisation public static LocalisableString LightweightLinkingNotSupported => new TranslatableString(getKey(@"lightweight_linking_not_supported"), @"Lightweight linking of files is not supported on your operating system yet, so a copy of all files will be made during import."); /// - /// "A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install {0}." + /// "A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install (and the file system is NTFS)." /// - public static LocalisableString SecondCopyWillBeMade(LocalisableString extra) => new TranslatableString(getKey(@"second_copy_will_be_made"), @"A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install {0}.", extra); + public static LocalisableString SecondCopyWillBeMadeWindows => new TranslatableString(getKey(@"second_copy_will_be_made_windows"), @"A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install (and the file system is NTFS)."); /// - /// "(and the file system is NTFS)" + /// "A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install (and the file system supports hard links)." /// - public static LocalisableString ToAvoidEnsureNtfs => new TranslatableString(getKey(@"to_avoid_ensure_ntfs"), @"(and the file system is NTFS)"); - - /// - /// "(and the file system supports hard links)" - /// - public static LocalisableString ToAvoidEnsureHardLinksSupport => new TranslatableString(getKey(@"to_avoid_ensure_hard_links_support"), @"(and the file system supports hard links)"); + public static LocalisableString SecondCopyWillBeMadeOtherPlatforms => new TranslatableString(getKey(@"second_copy_will_be_made_other_platforms"), @"A second copy of all files will be made during import. To avoid this, please make sure the lazer data folder is on the same drive as your previous osu! install (and the file system supports hard links)."); private static string getKey(string key) => $@"{prefix}:{key}"; } diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs index 526dffa06f..b19a9c6c99 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs @@ -135,8 +135,8 @@ namespace osu.Game.Overlays.FirstRunSetup else { copyInformation.Text = RuntimeInfo.OS == RuntimeInfo.Platform.Windows - ? FirstRunOverlayImportFromStableScreenStrings.SecondCopyWillBeMade(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureNtfs) - : FirstRunOverlayImportFromStableScreenStrings.SecondCopyWillBeMade(FirstRunOverlayImportFromStableScreenStrings.ToAvoidEnsureHardLinksSupport); + ? FirstRunOverlayImportFromStableScreenStrings.SecondCopyWillBeMadeWindows + : FirstRunOverlayImportFromStableScreenStrings.SecondCopyWillBeMadeOtherPlatforms; copyInformation.AddText(@" "); // just to ensure correct spacing copyInformation.AddLink(GeneralSettingsStrings.ChangeFolderLocation, () => { From 858f2fc7495867a600631e8683cefb193cc255fc Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Mon, 5 Feb 2024 18:39:04 +0300 Subject: [PATCH 64/86] Use `Clear` to trigger async disposal --- .../Lounge/Components/RoomsContainer.cs | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs b/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs index 8a3fbbf792..fd9aa6cb0e 100644 --- a/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs +++ b/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs @@ -126,7 +126,11 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components case NotifyCollectionChangedAction.Remove: Debug.Assert(args.OldItems != null); - removeRooms(args.OldItems.Cast()); + if (args.OldItems.Count == roomFlow.Count) + clearRooms(); + else + removeRooms(args.OldItems.Cast()); + break; } } @@ -141,18 +145,9 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components private void removeRooms(IEnumerable rooms) { - foreach (var room in rooms) + foreach (var r in rooms) { - var drawableRoom = roomFlow.SingleOrDefault(d => d.Room == room); - if (drawableRoom == null) - continue; - - // expire to trigger async disposal. the room still has to exist somewhere so we move it to internal content of RoomsContainer until next frame. - drawableRoom.Hide(); - drawableRoom.Expire(); - - roomFlow.Remove(drawableRoom, false); - AddInternal(drawableRoom); + roomFlow.RemoveAll(d => d.Room == r, true); // selection may have a lease due to being in a sub screen. if (!SelectedRoom.Disabled) @@ -160,6 +155,15 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components } } + private void clearRooms() + { + roomFlow.Clear(); + + // selection may have a lease due to being in a sub screen. + if (!SelectedRoom.Disabled) + SelectedRoom.Value = null; + } + private void updateSorting() { foreach (var room in roomFlow) From 4449ccd1d395c44b7a183f639bdd24d281b82eed Mon Sep 17 00:00:00 2001 From: Loreos7 Date: Mon, 5 Feb 2024 18:44:18 +0300 Subject: [PATCH 65/86] bring back missing dot --- osu.Game/Localisation/AudioSettingsStrings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Localisation/AudioSettingsStrings.cs b/osu.Game/Localisation/AudioSettingsStrings.cs index f4537a4c1c..405eec985c 100644 --- a/osu.Game/Localisation/AudioSettingsStrings.cs +++ b/osu.Game/Localisation/AudioSettingsStrings.cs @@ -72,7 +72,7 @@ namespace osu.Game.Localisation /// /// "Based on the last {0} play(s), the suggested offset is {1} ms" /// - public static LocalisableString SuggestedOffsetValueReceived(int plays, string value) => new TranslatableString(getKey(@"suggested_offset_value_received"), @"Based on the last {0} play(s), the suggested offset is {1} ms", plays, value); + public static LocalisableString SuggestedOffsetValueReceived(int plays, string value) => new TranslatableString(getKey(@"suggested_offset_value_received"), @"Based on the last {0} play(s), the suggested offset is {1} ms.", plays, value); /// /// "Apply suggested offset" From 8e82327509ad91decc132d56fb065d5fffc0597a Mon Sep 17 00:00:00 2001 From: Loreos7 Date: Mon, 5 Feb 2024 18:45:32 +0300 Subject: [PATCH 66/86] one more dot --- osu.Game/Localisation/AudioSettingsStrings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Localisation/AudioSettingsStrings.cs b/osu.Game/Localisation/AudioSettingsStrings.cs index 405eec985c..24508d6858 100644 --- a/osu.Game/Localisation/AudioSettingsStrings.cs +++ b/osu.Game/Localisation/AudioSettingsStrings.cs @@ -70,7 +70,7 @@ namespace osu.Game.Localisation public static LocalisableString SuggestedOffsetNote => new TranslatableString(getKey(@"suggested_offset_note"), @"Play a few beatmaps to receive a suggested offset!"); /// - /// "Based on the last {0} play(s), the suggested offset is {1} ms" + /// "Based on the last {0} play(s), the suggested offset is {1} ms." /// public static LocalisableString SuggestedOffsetValueReceived(int plays, string value) => new TranslatableString(getKey(@"suggested_offset_value_received"), @"Based on the last {0} play(s), the suggested offset is {1} ms.", plays, value); From 791423651640174323beef88c9607d5cde01690b Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Mon, 5 Feb 2024 18:49:59 +0300 Subject: [PATCH 67/86] Add explanatory note --- osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs b/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs index fd9aa6cb0e..bff1a8c64c 100644 --- a/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs +++ b/osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs @@ -126,6 +126,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components case NotifyCollectionChangedAction.Remove: Debug.Assert(args.OldItems != null); + // clear operations have a separate path that benefits from async disposal, + // since disposing is quite expensive when performed on a high number of drawables synchronously. if (args.OldItems.Count == roomFlow.Count) clearRooms(); else From 48d42ca7d39c66a79cb7d5194c86a4a0fef96afd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Feb 2024 23:58:10 +0800 Subject: [PATCH 68/86] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index d944e2ce8e..d7f29beeb3 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -10,7 +10,7 @@ true - + diff --git a/osu.iOS.props b/osu.iOS.props index bd6891f448..a4cd26a372 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -23,6 +23,6 @@ iossimulator-x64 - + From 2932184d24512eb945c49542bfe005479722688a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 18:05:21 +0100 Subject: [PATCH 69/86] Rename localisable string --- osu.Game/Localisation/GraphicsSettingsStrings.cs | 2 +- osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Localisation/GraphicsSettingsStrings.cs b/osu.Game/Localisation/GraphicsSettingsStrings.cs index d3952d0b4c..753444daf1 100644 --- a/osu.Game/Localisation/GraphicsSettingsStrings.cs +++ b/osu.Game/Localisation/GraphicsSettingsStrings.cs @@ -162,7 +162,7 @@ namespace osu.Game.Localisation /// /// "Shrink game to avoid cameras and notches" /// - public static LocalisableString ShrinkGameOnMobile => new TranslatableString(getKey(@"shrink_game_on_mobile"), @"Shrink game to avoid cameras and notches"); + public static LocalisableString ShrinkGameToSafeArea => new TranslatableString(getKey(@"shrink_game_to_safe_area"), @"Shrink game to avoid cameras and notches"); private static string getKey(string key) => $@"{prefix}:{key}"; } diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 4eb3e54708..ce087f1807 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -115,7 +115,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics }, safeAreaConsiderationsCheckbox = new SettingsCheckbox { - LabelText = GraphicsSettingsStrings.ShrinkGameOnMobile, + LabelText = GraphicsSettingsStrings.ShrinkGameToSafeArea, Current = osuConfig.GetBindable(OsuSetting.SafeAreaConsiderations), }, new SettingsSlider From 87381334ffdb12f6b39ad0933cb95da50c676308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 18:06:51 +0100 Subject: [PATCH 70/86] Use more proper method of formatting --- osu.Game/Localisation/AudioSettingsStrings.cs | 2 +- .../Settings/Sections/Audio/AudioOffsetAdjustControl.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Localisation/AudioSettingsStrings.cs b/osu.Game/Localisation/AudioSettingsStrings.cs index 24508d6858..89db60d8a6 100644 --- a/osu.Game/Localisation/AudioSettingsStrings.cs +++ b/osu.Game/Localisation/AudioSettingsStrings.cs @@ -72,7 +72,7 @@ namespace osu.Game.Localisation /// /// "Based on the last {0} play(s), the suggested offset is {1} ms." /// - public static LocalisableString SuggestedOffsetValueReceived(int plays, string value) => new TranslatableString(getKey(@"suggested_offset_value_received"), @"Based on the last {0} play(s), the suggested offset is {1} ms.", plays, value); + public static LocalisableString SuggestedOffsetValueReceived(int plays, LocalisableString value) => new TranslatableString(getKey(@"suggested_offset_value_received"), @"Based on the last {0} play(s), the suggested offset is {1} ms.", plays, value); /// /// "Apply suggested offset" diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs index ad33434848..b9f043a233 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -8,6 +8,7 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -156,7 +157,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { hintText.Text = SuggestedOffset.Value == null ? AudioSettingsStrings.SuggestedOffsetNote - : AudioSettingsStrings.SuggestedOffsetValueReceived(averageHitErrorHistory.Count, $"{SuggestedOffset.Value:N0}"); + : AudioSettingsStrings.SuggestedOffsetValueReceived(averageHitErrorHistory.Count, SuggestedOffset.Value.ToLocalisableString(@"N0")); applySuggestion.Enabled.Value = SuggestedOffset.Value != null; } From a5aeb2ff9e98f6d0a034548c2bc6664359f8ade2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 18:56:20 +0100 Subject: [PATCH 71/86] Use better variable names It's not the 1970s. We can spare a few extra letters. --- osu.Game/Rulesets/Scoring/HitEventExtensions.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs index ab36a54d3d..f9c6d62608 100644 --- a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs +++ b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs @@ -22,8 +22,8 @@ namespace osu.Game.Rulesets.Scoring Debug.Assert(hitEvents.All(ev => ev.GameplayRate != null)); int count = 0; - double m = 0; - double s = 0; + double mean = 0; + double sumOfSquares = 0; foreach (var e in hitEvents) { @@ -34,15 +34,15 @@ namespace osu.Game.Rulesets.Scoring // Division by gameplay rate is to account for TimeOffset scaling with gameplay rate. double currentValue = e.TimeOffset / e.GameplayRate!.Value; - double mNext = m + (currentValue - m) / count; - s += (currentValue - m) * (currentValue - mNext); - m = mNext; + double nextMean = mean + (currentValue - mean) / count; + sumOfSquares += (currentValue - mean) * (currentValue - nextMean); + mean = nextMean; } if (count == 0) return null; - return 10.0 * Math.Sqrt(s / count); + return 10.0 * Math.Sqrt(sumOfSquares / count); } /// From 7b03bebd5fd8b4288ea03da66ada81bf7f831781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 18:57:55 +0100 Subject: [PATCH 72/86] Move algorithm description to remarks section of xmldoc --- osu.Game/Rulesets/Scoring/HitEventExtensions.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs index f9c6d62608..6e2852676a 100644 --- a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs +++ b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs @@ -11,8 +11,11 @@ namespace osu.Game.Rulesets.Scoring public static class HitEventExtensions { /// - /// Calculates the "unstable rate" for a sequence of s using Welford's online algorithm. + /// Calculates the "unstable rate" for a sequence of s. /// + /// + /// Uses Welford's online algorithm. + /// /// /// A non-null value if unstable rate could be calculated, /// and if unstable rate cannot be calculated due to being empty. From e1a5aeac198903735125d9867389fef946754e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 19:10:14 +0100 Subject: [PATCH 73/86] Commit benchmark to source Co-authored-by: Andrei Zavatski --- osu.Game.Benchmarks/BenchmarkUnstableRate.cs | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 osu.Game.Benchmarks/BenchmarkUnstableRate.cs diff --git a/osu.Game.Benchmarks/BenchmarkUnstableRate.cs b/osu.Game.Benchmarks/BenchmarkUnstableRate.cs new file mode 100644 index 0000000000..aa229c7d06 --- /dev/null +++ b/osu.Game.Benchmarks/BenchmarkUnstableRate.cs @@ -0,0 +1,31 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using BenchmarkDotNet.Attributes; +using osu.Framework.Utils; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Benchmarks +{ + public class BenchmarkUnstableRate : BenchmarkTest + { + private List events = null!; + + public override void SetUp() + { + base.SetUp(); + events = new List(); + + for (int i = 0; i < 1000; i++) + events.Add(new HitEvent(RNG.NextDouble(-200.0, 200.0), RNG.NextDouble(1.0, 2.0), HitResult.Great, new HitObject(), null, null)); + } + + [Benchmark] + public void CalculateUnstableRate() + { + _ = events.CalculateUnstableRate(); + } + } +} From c1feccb4cfc6c7929e7adbfc8c1af04145525f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 19:53:19 +0100 Subject: [PATCH 74/86] Add test coverage for selection behaviour --- .../Visual/Multiplayer/TestSceneLoungeRoomsContainer.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneLoungeRoomsContainer.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneLoungeRoomsContainer.cs index b938e59d63..0883c626fe 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneLoungeRoomsContainer.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneLoungeRoomsContainer.cs @@ -64,6 +64,12 @@ namespace osu.Game.Tests.Visual.Multiplayer AddStep("select first room", () => container.Rooms.First().TriggerClick()); AddAssert("first spotlight selected", () => checkRoomSelected(RoomManager.Rooms.First(r => r.Category.Value == RoomCategory.Spotlight))); + + AddStep("remove last room", () => RoomManager.RemoveRoom(RoomManager.Rooms.MinBy(r => r.RoomID?.Value))); + AddAssert("first spotlight still selected", () => checkRoomSelected(RoomManager.Rooms.First(r => r.Category.Value == RoomCategory.Spotlight))); + + AddStep("remove spotlight room", () => RoomManager.RemoveRoom(RoomManager.Rooms.Single(r => r.Category.Value == RoomCategory.Spotlight))); + AddAssert("selection vacated", () => checkRoomSelected(null)); } [Test] From 08fac9772082088526845236c1b6dc471cee0e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 6 Feb 2024 12:27:45 +0100 Subject: [PATCH 75/86] Add resources covering failure case --- .../special-skin/taiko-bar-right@2x.png | Bin 0 -> 39297 bytes .../special-skin/taikohitcircle@2x.png | Bin 0 -> 8720 bytes .../special-skin/taikohitcircleoverlay@2x.png | Bin 0 -> 6478 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 osu.Game.Rulesets.Taiko.Tests/Resources/special-skin/taiko-bar-right@2x.png create mode 100644 osu.Game.Rulesets.Taiko.Tests/Resources/special-skin/taikohitcircle@2x.png create mode 100644 osu.Game.Rulesets.Taiko.Tests/Resources/special-skin/taikohitcircleoverlay@2x.png diff --git a/osu.Game.Rulesets.Taiko.Tests/Resources/special-skin/taiko-bar-right@2x.png b/osu.Game.Rulesets.Taiko.Tests/Resources/special-skin/taiko-bar-right@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..8ad7849e53161dc0e6320582aa54953389236a50 GIT binary patch literal 39297 zcmeFY1y@{6vj#dyAZUUF50W6k-95OwySp>EB?Jo^G`PFFOOO!UU4sM$g8N{1lf3VD z&bsHWb^pKz18nKtySlo&>ZzxSFhzL@G-Lu~5D0`OB`K;50zC%~VPc*m0DpM20t3M%zEuMl}dxlD^T3~^sMm8rdZAEZcI zw`X`dNs=uk61%bSt_g?ePOFTkiEDpvo#y#RLDErl`Ogf>8@^K6ViCB+N1JWl=tnDv z&o5Y}%A&ZkAPvd#l)bk0VyNx!g>bzvy1ow6nW)DqAD35p@8!0HpU^#a2$m|0=%79i z?R7H$%5lPTa$aEPxJngO6Kc+Ia<%EbMXA_z-pCw$W<0+g+nrR0)!WYTYy2Kr{P zF70qb3pV@}cdjiHP7HIu)YS);QMn8ldTn?-5F@vc@UiaGdl(PFT!%pzxJIF|63)h7 z-0~y=s3SCBI3gn0T(Lp@Gf#K-+vSG?tI;DwRxRhqjgKCkz`P(B%SecV;Ge!x3!S`x zD@cx#S}q_E!`r7H7>|5GH{c?otCXA=;w~%#3JUwU*9a82gzqY*=_=x2XJ=;b3KDTP zGjcUEC3UxQw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oD_R|OHfQOitJUUr+N0LKxpxCp zlFP)zojbU5Con*_q`ux;^(Nw9Va}O0XoxCwG90k(i{JZe-Tm@AduC2H&wrL8zHV#e z+GpDC{mW7}Lmgb;@5w!hf9=}Tl(c92BHwrS+s&H(>vygNG-&TBGE8`~vbFVh+FEmd z*;AXVzu$s}7{i`!;AQshY3c8~OU>BWKfiJ2PhGhFyc^W|2eDOl3MHQ{~ac{T>Wvu8_>TFu%T6<7IWqRsB|{AXUO z!oUeD5IB&(M4g%8@!BxHm_0k*zW(v^_r2-$76l5+vrQ*+z?3WnDv^(m@=DFkjkenz zx$?=GmBBw>?W?Waxc@#2v_QEaXe-H}p&EH>ul3>0o1?$Y1m-(STg#dGS6){x4l=BS zn8i>Ma^Lv8&ENl!mn9br%%hS2IiLZs{jAy02hv2I^j_l zvv!slRHvCQ&@2CzXH7bO{aO)li|6Fkt5>cErlwro=GU)Z#>e|_z38#?rceCpsbwpt z^m?hD^-|5gnkB~0zWKua`9Gs{r?azvzIDLiT*WDQh=~olPxQXp_NwTA|Ni{xzkewu zA8~pQ literal 0 HcmV?d00001 diff --git a/osu.Game.Rulesets.Taiko.Tests/Resources/special-skin/taikohitcircle@2x.png b/osu.Game.Rulesets.Taiko.Tests/Resources/special-skin/taikohitcircle@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..73f856b16b67b84add2959868e4abca51bb7dea3 GIT binary patch literal 8720 zcmYM41yoy2^xzXTIDz6)LUGqZae}+HrATqN&?2EY4G^?OOL2$dTAY&Nr8pET5`qQs=A4l`_x$GG7i*}mK}O6-3;+Pgv@}(Xu{q|y1R}t`O(>bB0RUi> ztBQ)DmWm1+?3K5ZtA`^1!1E#GgS=*!;e#jxlka&ngtAC!hi@1gIvStyr##RoL;m_L zo1^iExmqe8F&LgETIQP<^m zHc_4=owM1Hs?XK!;iX2}4ppLi14exv6tI8x(fFXEDrhUeCH_$0{)b|j!H@+h2-)r9 z^!4$f%;8CqCv1^Bsrq9%RW|jzbYEqRMkP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~Y z*sx}V2qp{5Jo#IIVL$^5CzBjnYYK)<$NX;HQJyHi%`TI)^Kin?#=;!iWLzNwUn{pa zQ2~P;+M5$5aWZHK8d7K)Cbr}9E$Bc7_*H)B#mH!n>(e6f-z$qL$9OvShUGH9tFBrkXNrFu>_HI?M zBSSTTS)x>jpY6v5jDA~SHd6$db_s#29~fgw=~S}GInr&B?#H_rhhq{!4KHSBz_AD) zD*5Qe1=S_N@0=eA)_JLAaa6Ja(N-S2jCX5fYL9V40RO*+wl=kMg;h2K3V*> zqnp$H;2SOv;OL-e#c@TD#Lgb>a}GfFT0Aab@}4u39VM1XkCcs;O7DpZu&9+OG_5mJ cyt@gr&c0MDy5W3}{VxEZrKYc13AKs*U&JQLk^lez literal 0 HcmV?d00001 diff --git a/osu.Game.Rulesets.Taiko.Tests/Resources/special-skin/taikohitcircleoverlay@2x.png b/osu.Game.Rulesets.Taiko.Tests/Resources/special-skin/taikohitcircleoverlay@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..83647266bceeb3a0e5311ecffa0ee7582ca6d6ec GIT binary patch literal 6478 zcmX9?2UJr{6Q%bSs?rmBFVedqp-UHp&^sy+q<2J+&;_JO7gRdZ6MDoDAaqbrIz)1jA=h=_>j4Gkccgnsk7QBe@yR!m$AL`1|% zzPh^RhPt}^@J9h&z7IW#h(xnvvNa9fo3kdFS#?yhQK}jUd>L;}!-YR6}9{NSr1naw#3%;hXu#lg2X^_wJk2Lh$LC6C4tFAS#u`iLPnE(yPJqc?gQ zQ0}{mr6)-Z!{R$qllEP>qKhvwbUWu;LQQj=dd#%<63GBGb)R%@D!H}qy}D;G7cn@j z{pFX?Be5@wL;}Ma;?w*+u}9iJHDUF#svAN{EIK=B_~>+^myQ({K_!Ro!@ea%@4VNI z0xl&&T()!1?2XfSiT^C2heC|4e#DRQxEzf>yYo3Op*;~y9IjmzfFmYF>P*!sBezve z`Qqsw8Axk;*^IH%Kyu&}G;zu$c)4=HciJ<8Zj2p=G<3x%7pK7`2R`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Gv$>*fl(72u&&MPVi#k<*_sfFCEe7*&_O!$nx>l_<_wmBYL#=;|W>2W`<3(Kn0;^7B2sMQ?fn5^*2e%kG A!2kdN literal 0 HcmV?d00001 From 27b97a3c4d720766e4c2468e2890fcaae69d40f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 6 Feb 2024 12:01:35 +0100 Subject: [PATCH 76/86] Convert selected legacy skin sprites to grayscale Matching stable. Closes https://github.com/ppy/osu/issues/9858. I would have liked to apply this in the taiko transformer itself, but the limited accessibility of texture uploads, and as such the raw image data, sort of prevents that... --- osu.Game/Skinning/LegacySkin.cs | 3 + osu.Game/Skinning/LegacyTextureLoaderStore.cs | 92 +++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 osu.Game/Skinning/LegacyTextureLoaderStore.cs diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index cfa5f972d2..816cfc0a2d 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -58,6 +58,9 @@ namespace osu.Game.Skinning { } + protected override IResourceStore CreateTextureLoaderStore(IStorageResourceProvider resources, IResourceStore storage) + => new LegacyTextureLoaderStore(base.CreateTextureLoaderStore(resources, storage)); + protected override void ParseConfigurationStream(Stream stream) { base.ParseConfigurationStream(stream); diff --git a/osu.Game/Skinning/LegacyTextureLoaderStore.cs b/osu.Game/Skinning/LegacyTextureLoaderStore.cs new file mode 100644 index 0000000000..8c466e6aac --- /dev/null +++ b/osu.Game/Skinning/LegacyTextureLoaderStore.cs @@ -0,0 +1,92 @@ +// 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 System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using osu.Framework.Graphics.Textures; +using osu.Framework.IO.Stores; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Processing; + +namespace osu.Game.Skinning +{ + public class LegacyTextureLoaderStore : IResourceStore + { + private readonly IResourceStore? wrappedStore; + + public LegacyTextureLoaderStore(IResourceStore? wrappedStore) + { + this.wrappedStore = wrappedStore; + } + + public TextureUpload Get(string name) + { + var textureUpload = wrappedStore?.Get(name); + + if (textureUpload == null) + return null!; + + return shouldConvertToGrayscale(name) + ? convertToGrayscale(textureUpload) + : textureUpload; + } + + public Task GetAsync(string name, CancellationToken cancellationToken = new CancellationToken()) + { + var textureUpload = wrappedStore?.Get(name); + + if (textureUpload == null) + return null!; + + return shouldConvertToGrayscale(name) + ? Task.Run(() => convertToGrayscale(textureUpload), cancellationToken) + : Task.FromResult(textureUpload); + } + + // https://github.com/peppy/osu-stable-reference/blob/013c3010a9d495e3471a9c59518de17006f9ad89/osu!/Graphics/Textures/TextureManager.cs#L91-L96 + private static readonly string[] grayscale_sprites = + { + @"taiko-bar-right", + @"taikobigcircle", + @"taikohitcircle", + @"taikohitcircleoverlay" + }; + + private bool shouldConvertToGrayscale(string name) + { + foreach (string grayscaleSprite in grayscale_sprites) + { + // unfortunately at this level of lookup we can encounter `@2x` scale suffixes in the name, + // so straight equality cannot be used. + if (name.StartsWith(grayscaleSprite, StringComparison.OrdinalIgnoreCase)) + return true; + } + + return false; + } + + private TextureUpload convertToGrayscale(TextureUpload textureUpload) + { + var image = Image.LoadPixelData(textureUpload.Data.ToArray(), textureUpload.Width, textureUpload.Height); + + // stable uses `0.299 * r + 0.587 * g + 0.114 * b` + // (https://github.com/peppy/osu-stable-reference/blob/013c3010a9d495e3471a9c59518de17006f9ad89/osu!/Graphics/Textures/pTexture.cs#L138-L153) + // which matches mode BT.601 (https://en.wikipedia.org/wiki/Grayscale#Luma_coding_in_video_systems) + image.Mutate(i => i.Grayscale(GrayscaleMode.Bt601)); + + return new TextureUpload(image); + } + + public Stream? GetStream(string name) => wrappedStore?.GetStream(name); + + public IEnumerable GetAvailableResources() => wrappedStore?.GetAvailableResources() ?? Array.Empty(); + + public void Dispose() + { + wrappedStore?.Dispose(); + } + } +} From a84f53b1693892973535250163d13dfe8981ee9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 6 Feb 2024 13:03:05 +0100 Subject: [PATCH 77/86] Allow pp for Blinds The mod does impact pp, but it requires no extra difficulty attributes (https://github.com/ppy/osu/pull/26935#issuecomment-1925734171). --- osu.Game.Rulesets.Osu/Mods/OsuModBlinds.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModBlinds.cs b/osu.Game.Rulesets.Osu/Mods/OsuModBlinds.cs index 8b0adbe50f..bb0e984418 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModBlinds.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModBlinds.cs @@ -31,6 +31,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1; public override Type[] IncompatibleMods => new[] { typeof(OsuModFlashlight) }; + public override bool Ranked => true; private DrawableOsuBlinds blinds = null!; From 8df593a8e6734f59e9c3dc81b903e8e6dc5f20e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 6 Feb 2024 13:03:38 +0100 Subject: [PATCH 78/86] Allow pp for No Scope Deemed as not affecting difficulty or pp in https://github.com/ppy/osu/pull/26935#issuecomment-1925644008, so can be treated pretty much as nomod. --- osu.Game/Rulesets/Mods/ModNoScope.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Rulesets/Mods/ModNoScope.cs b/osu.Game/Rulesets/Mods/ModNoScope.cs index 5b9dfc0430..dd1bd9a719 100644 --- a/osu.Game/Rulesets/Mods/ModNoScope.cs +++ b/osu.Game/Rulesets/Mods/ModNoScope.cs @@ -22,6 +22,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.Fun; public override IconUsage? Icon => FontAwesome.Solid.EyeSlash; public override double ScoreMultiplier => 1; + public override bool Ranked => true; /// /// Slightly higher than the cutoff for . From 9e7912e66310fdfaec7bd9e2b27b1f3369eae81a Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 6 Feb 2024 21:56:26 +0900 Subject: [PATCH 79/86] Add test showing filled heatmap --- .../TestSceneAccuracyHeatmap.cs | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneAccuracyHeatmap.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneAccuracyHeatmap.cs index f99518997b..5524af2061 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneAccuracyHeatmap.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneAccuracyHeatmap.cs @@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Osu.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(130) + Size = new Vector2(300) } }; }); @@ -85,6 +85,30 @@ namespace osu.Game.Rulesets.Osu.Tests AddStep("return user input", () => InputManager.UseParentInput = true); } + [Test] + public void TestAllPoints() + { + AddStep("add points", () => + { + float minX = object1.DrawPosition.X - object1.DrawSize.X / 2; + float maxX = object1.DrawPosition.X + object1.DrawSize.X / 2; + + float minY = object1.DrawPosition.Y - object1.DrawSize.Y / 2; + float maxY = object1.DrawPosition.Y + object1.DrawSize.Y / 2; + + for (int i = 0; i < 10; i++) + { + for (float x = minX; x <= maxX; x += 0.5f) + { + for (float y = minY; y <= maxY; y += 0.5f) + { + accuracyHeatmap.AddPoint(object2.Position, object1.Position, new Vector2(x, y), RNG.NextSingle(10, 500)); + } + } + } + }); + } + protected override bool OnMouseDown(MouseDownEvent e) { accuracyHeatmap.AddPoint(object2.Position, object1.Position, background.ToLocalSpace(e.ScreenSpaceMouseDownPosition), 50); From 891346f7958b517d82022cf4ecaf2f980032c5fe Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 6 Feb 2024 21:56:52 +0900 Subject: [PATCH 80/86] Fix hit accuracy heatmap points being offset --- osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs b/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs index 83bab7dc01..f9d4a3b325 100644 --- a/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs +++ b/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs @@ -191,7 +191,7 @@ namespace osu.Game.Rulesets.Osu.Statistics for (int c = 0; c < points_per_dimension; c++) { - HitPointType pointType = Vector2.Distance(new Vector2(c, r), centre) <= innerRadius + HitPointType pointType = Vector2.Distance(new Vector2(c + 0.5f, r + 0.5f), centre) <= innerRadius ? HitPointType.Hit : HitPointType.Miss; From c21af1bf3d44f3c5b70c95c573748c2f41cd35f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 6 Feb 2024 14:53:01 +0100 Subject: [PATCH 81/86] Use more explicit match `taiko-bar-right-glow` is a prefix of `taiko-bar-right`... --- osu.Game/Skinning/LegacyTextureLoaderStore.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacyTextureLoaderStore.cs b/osu.Game/Skinning/LegacyTextureLoaderStore.cs index 8c466e6aac..29206bbb85 100644 --- a/osu.Game/Skinning/LegacyTextureLoaderStore.cs +++ b/osu.Game/Skinning/LegacyTextureLoaderStore.cs @@ -61,8 +61,11 @@ namespace osu.Game.Skinning { // unfortunately at this level of lookup we can encounter `@2x` scale suffixes in the name, // so straight equality cannot be used. - if (name.StartsWith(grayscaleSprite, StringComparison.OrdinalIgnoreCase)) + if (name.Equals(grayscaleSprite, StringComparison.OrdinalIgnoreCase) + || name.Equals($@"{grayscaleSprite}@2x", StringComparison.OrdinalIgnoreCase)) + { return true; + } } return false; From ee05743921d8ab7a6b1041b4d47adadee9540b00 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 6 Feb 2024 22:58:11 +0900 Subject: [PATCH 82/86] Bump databased star rating versions --- osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs index 6bb6879052..4190e74e51 100644 --- a/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs @@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty private readonly bool isForCurrentRuleset; private readonly double originalOverallDifficulty; - public override int Version => 20220902; + public override int Version => 20230817; public ManiaDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap) : base(ruleset, beatmap) diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs index ab193caaa3..b84c2d25ee 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty { private const double difficulty_multiplier = 1.35; - public override int Version => 20220902; + public override int Version => 20221107; public TaikoDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap) : base(ruleset, beatmap) From 6ffe8e171373fa78c067f8c38747971ccf91f6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 6 Feb 2024 14:48:49 +0100 Subject: [PATCH 83/86] Use staggered exponential backoff when retrying in `PersistentEndpointClientConnector` There are suspicions that the straight 5s retry could have caused a situation a few days ago for `osu-server-spectator` wherein it was getting hammered by constant retry requests. This should make that a little less likely to happen. Numbers chosen are arbitrary, but mostly follow stable's bancho retry intervals because why not. Stable also skips the exponential backoff in case of errors it considers transient, but I decided not to bother for now. Starts off from 3 seconds, then ramps up to up to 2 minutes. Added stagger factor is 25% of duration, either direction. The stagger factor helps given that if spectator server is dead, each client has three separate connections to it which it will retry on (one to each hub). --- .../PersistentEndpointClientConnector.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/osu.Game/Online/PersistentEndpointClientConnector.cs b/osu.Game/Online/PersistentEndpointClientConnector.cs index 024a0fea73..9e7543ce2b 100644 --- a/osu.Game/Online/PersistentEndpointClientConnector.cs +++ b/osu.Game/Online/PersistentEndpointClientConnector.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using osu.Framework.Bindables; using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Logging; +using osu.Framework.Utils; using osu.Game.Online.API; namespace osu.Game.Online @@ -31,6 +32,12 @@ namespace osu.Game.Online private CancellationTokenSource connectCancelSource = new CancellationTokenSource(); private bool started; + /// + /// How much to delay before attempting to connect again, in milliseconds. + /// Subject to exponential back-off. + /// + private int retryDelay = 3000; + /// /// Constructs a new . /// @@ -78,6 +85,8 @@ namespace osu.Game.Online private async Task connect() { cancelExistingConnect(); + // reset retry delay to default. + retryDelay = 3000; if (!await connectionLock.WaitAsync(10000).ConfigureAwait(false)) throw new TimeoutException("Could not obtain a lock to connect. A previous attempt is likely stuck."); @@ -134,8 +143,15 @@ namespace osu.Game.Online /// private async Task handleErrorAndDelay(Exception exception, CancellationToken cancellationToken) { - Logger.Log($"{ClientName} connect attempt failed: {exception.Message}", LoggingTarget.Network); - await Task.Delay(5000, cancellationToken).ConfigureAwait(false); + // random stagger factor to avoid mass incidental synchronisation + // compare: https://github.com/peppy/osu-stable-reference/blob/013c3010a9d495e3471a9c59518de17006f9ad89/osu!/Online/BanchoClient.cs#L331 + int thisDelay = (int)(retryDelay * RNG.NextDouble(0.75, 1.25)); + // exponential backoff with upper limit + // compare: https://github.com/peppy/osu-stable-reference/blob/013c3010a9d495e3471a9c59518de17006f9ad89/osu!/Online/BanchoClient.cs#L539 + retryDelay = Math.Min(120000, (int)(retryDelay * 1.5)); + + Logger.Log($"{ClientName} connect attempt failed: {exception.Message}. Next attempt in {thisDelay / 1000:N0} seconds.", LoggingTarget.Network); + await Task.Delay(thisDelay, cancellationToken).ConfigureAwait(false); } /// From 9314de640fe6f34f41d5aab45be148d7c0af4a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 6 Feb 2024 18:30:48 +0100 Subject: [PATCH 84/86] Populate `TotalScoreInfo` when converting `SoloScoreInfo` to `ScoreInfo` For use in https://github.com/ppy/osu-tools/pull/195. --- osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs b/osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs index 732da3d5da..e4ae83ca74 100644 --- a/osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs +++ b/osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs @@ -203,6 +203,7 @@ namespace osu.Game.Online.API.Requests.Responses Ruleset = new RulesetInfo { OnlineID = RulesetID }, Passed = Passed, TotalScore = TotalScore, + LegacyTotalScore = LegacyTotalScore, Accuracy = Accuracy, MaxCombo = MaxCombo, Rank = Rank, From 8f59cb7659d2fddaaa588417c9c534bee6cc5ebd Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Tue, 6 Feb 2024 12:54:53 -0800 Subject: [PATCH 85/86] Hide ruleset selector when on kudosu ranking --- osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs index a23ec18afe..1c743ff152 100644 --- a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs +++ b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs @@ -39,5 +39,15 @@ namespace osu.Game.Overlays.Rankings Icon = OsuIcon.Ranking; } } + + protected override void LoadComplete() + { + base.LoadComplete(); + + Current.BindValueChanged(scope => + { + rulesetSelector.FadeTo(scope.NewValue <= RankingsScope.Country ? 1 : 0, 200, Easing.OutQuint); + }); + } } } From 21e5ae5ba975aa072e0246196971ebd347aa05a8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Feb 2024 16:43:53 +0800 Subject: [PATCH 86/86] Minor adjustments --- .../Rankings/RankingsOverlayHeader.cs | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs index 1c743ff152..cf132ed4da 100644 --- a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs +++ b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs @@ -1,13 +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 osu.Framework.Bindables; -using osu.Game.Localisation; -using osu.Game.Resources.Localisation.Web; using osu.Framework.Graphics; using osu.Game.Graphics; +using osu.Game.Localisation; +using osu.Game.Resources.Localisation.Web; using osu.Game.Rulesets; using osu.Game.Users; @@ -19,8 +17,8 @@ namespace osu.Game.Overlays.Rankings public Bindable Country => countryFilter.Current; - private OverlayRulesetSelector rulesetSelector; - private CountryFilter countryFilter; + private OverlayRulesetSelector rulesetSelector = null!; + private CountryFilter countryFilter = null!; protected override OverlayTitle CreateTitle() => new RankingsTitle(); @@ -46,8 +44,23 @@ namespace osu.Game.Overlays.Rankings Current.BindValueChanged(scope => { - rulesetSelector.FadeTo(scope.NewValue <= RankingsScope.Country ? 1 : 0, 200, Easing.OutQuint); - }); + rulesetSelector.FadeTo(showRulesetSelector(scope.NewValue) ? 1 : 0, 200, Easing.OutQuint); + }, true); + + bool showRulesetSelector(RankingsScope scope) + { + switch (scope) + { + case RankingsScope.Performance: + case RankingsScope.Spotlights: + case RankingsScope.Score: + case RankingsScope.Country: + return true; + + default: + return false; + } + } } } }