From e5eab72aeb493dd870c243c1d7fec184bc2f97e7 Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Thu, 19 Jan 2023 00:37:36 +0900 Subject: [PATCH 01/28] add check for preview time setting --- osu.Game/Rulesets/Edit/BeatmapVerifier.cs | 3 + .../Rulesets/Edit/Checks/CheckPreviewTime.cs | 64 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs diff --git a/osu.Game/Rulesets/Edit/BeatmapVerifier.cs b/osu.Game/Rulesets/Edit/BeatmapVerifier.cs index a89a0e76a9..5f5aba26bb 100644 --- a/osu.Game/Rulesets/Edit/BeatmapVerifier.cs +++ b/osu.Game/Rulesets/Edit/BeatmapVerifier.cs @@ -36,6 +36,9 @@ namespace osu.Game.Rulesets.Edit new CheckUnsnappedObjects(), new CheckConcurrentObjects(), new CheckZeroLengthObjects(), + + // Timing + new CheckPreviewTime(), }; public IEnumerable Run(BeatmapVerifierContext context) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs new file mode 100644 index 0000000000..4fad8c0af6 --- /dev/null +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -0,0 +1,64 @@ +// 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 osu.Game.Beatmaps; +using osu.Game.Rulesets.Edit.Checks.Components; + +namespace osu.Game.Rulesets.Edit.Checks +{ + public class CheckPreviewTime : ICheck + { + public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Timing, "Check Preview Time Consistency"); + + public IEnumerable PossibleTemplates => new IssueTemplate[] + { + new IssueTemplatePreviewTimeConflict(this), + new IssueTemplateHasNoPreviewTime(this), + }; + + public IEnumerable Run(BeatmapVerifierContext context) + { + var diffList = context.Beatmap.BeatmapInfo.BeatmapSet?.Beatmaps ?? new List(); + int previewTime = context.Beatmap.BeatmapInfo.Metadata.PreviewTime; + + if (previewTime == -1) + { + yield return new IssueTemplateHasNoPreviewTime(this).Create(); + } + + foreach (var diff in diffList) + { + if (diff.Equals(context.Beatmap.BeatmapInfo)) + { + continue; + } + + if (diff.Metadata.PreviewTime != previewTime) + { + yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName); + } + } + } + + public class IssueTemplatePreviewTimeConflict : IssueTemplate + { + public IssueTemplatePreviewTimeConflict(ICheck check) + : base(check, IssueType.Warning, "Audio preview time conflicts with {0} diff") + { + } + + public Issue Create(string diffName) => new Issue(this, diffName); + } + + public class IssueTemplateHasNoPreviewTime : IssueTemplate + { + public IssueTemplateHasNoPreviewTime(ICheck check) + : base(check, IssueType.Warning, "A preview point for this map is not set. Consider settings one from the Timing menu") + { + } + + public Issue Create() => new Issue(this); + } + } +} From 997a1a8b02d0b99ba77a4dbe629ea5f2d8f46a9f Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Thu, 19 Jan 2023 01:00:02 +0900 Subject: [PATCH 02/28] add test for CheckPreviewTime --- .../Editing/Checks/CheckPreviewTimeTest.cs | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs diff --git a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs new file mode 100644 index 0000000000..59ff8d4923 --- /dev/null +++ b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs @@ -0,0 +1,108 @@ +// 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 System.Linq; +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Edit; +using osu.Game.Rulesets.Edit.Checks; +using osu.Game.Rulesets.Objects; +using osu.Game.Tests.Beatmaps; + +namespace osu.Game.Tests.Editing.Checks +{ + public class CheckPreviewTimeTest + { + private CheckPreviewTime check = null!; + + private IBeatmap beatmap = null!; + + [SetUp] + public void Setup() + { + check = new CheckPreviewTime(); + beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + Metadata = new BeatmapMetadata { PreviewTime = -1 }, + BeatmapSet = new BeatmapSetInfo(new List + { + new BeatmapInfo + { + DifficultyName = "Test1", + Metadata = new BeatmapMetadata { PreviewTime = 5 }, + }, + new BeatmapInfo + { + DifficultyName = "Test2", + Metadata = new BeatmapMetadata { PreviewTime = 10 }, + }, + }) + } + }; + } + + [Test] + public void TestPreviewTimeNotSet() + { + setNoPreviewTimeBeatmap(); + var content = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap)); + + var issues = check.Run(content).ToList(); + + Assert.That(issues, Has.Count.EqualTo(1)); + Assert.That(issues.Single().Template is CheckPreviewTime.IssueTemplateHasNoPreviewTime); + } + + [Test] + public void TestPreviewTimeconflict() + { + setPreviewTimeConflictBeatmap(); + + var content = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap)); + + var issues = check.Run(content).ToList(); + + Assert.That(issues, Has.Count.EqualTo(1)); + Assert.That(issues.Single().Template is CheckPreviewTime.IssueTemplatePreviewTimeConflict); + Assert.That(issues.Single().Arguments.Single().ToString() == "Test1"); + } + + private void setNoPreviewTimeBeatmap() + { + beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + Metadata = new BeatmapMetadata { PreviewTime = -1 }, + } + }; + } + + private void setPreviewTimeConflictBeatmap() + { + beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + Metadata = new BeatmapMetadata { PreviewTime = 10 }, + BeatmapSet = new BeatmapSetInfo(new List + { + new BeatmapInfo + { + DifficultyName = "Test1", + Metadata = new BeatmapMetadata { PreviewTime = 5 }, + }, + new BeatmapInfo + { + DifficultyName = "Test2", + Metadata = new BeatmapMetadata { PreviewTime = 10 }, + }, + }) + } + }; + } + } +} From 5afb733fb2e8dbf4350880699350be590bd726f6 Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Mon, 23 Jan 2023 15:26:28 +0900 Subject: [PATCH 03/28] change IssueTemplatePreviewTimeConflict's text --- osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs | 2 +- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs index 59ff8d4923..2b7d37dc81 100644 --- a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs +++ b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs @@ -67,7 +67,7 @@ namespace osu.Game.Tests.Editing.Checks Assert.That(issues, Has.Count.EqualTo(1)); Assert.That(issues.Single().Template is CheckPreviewTime.IssueTemplatePreviewTimeConflict); - Assert.That(issues.Single().Arguments.Single().ToString() == "Test1"); + Assert.That(issues.Single().Arguments.FirstOrDefault()?.ToString() == "Test1"); } private void setNoPreviewTimeBeatmap() diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index 4fad8c0af6..05e49eba84 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Edit.Checks if (diff.Metadata.PreviewTime != previewTime) { - yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName); + yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName, previewTime, diff.Metadata.PreviewTime); } } } @@ -44,11 +44,15 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplatePreviewTimeConflict : IssueTemplate { public IssueTemplatePreviewTimeConflict(ICheck check) - : base(check, IssueType.Warning, "Audio preview time conflicts with {0} diff") + : base(check, IssueType.Warning, "Audio preview time {1} doesn't match \"{0}\"'s preview time {2}") { } - public Issue Create(string diffName) => new Issue(this, diffName); + public Issue Create(string diffName, int originalTime, int conflictTime) => + // preview time should show (not set) when it is not set. + new Issue(this, diffName, + originalTime != -1 ? $"({originalTime:N0})" : "(not set)", + conflictTime != -1 ? $"({conflictTime:N0})" : "(not set)"); } public class IssueTemplateHasNoPreviewTime : IssueTemplate From 338a14ff69c9dcda990b2c714c2831028f8ed1cf Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Mon, 23 Jan 2023 01:01:45 -0600 Subject: [PATCH 04/28] new mania hold tail --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 76 +++++++++++-------- .../Skinning/Argon/ArgonNotePiece.cs | 4 +- 2 files changed, 45 insertions(+), 35 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index a2166a6708..6f6270c1f5 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -3,13 +3,13 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; -using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; +using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Mania.Skinning.Argon @@ -19,45 +19,57 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon private readonly IBindable direction = new Bindable(); private readonly IBindable accentColour = new Bindable(); - private readonly Box colouredBox; - private readonly Box shadow; + private readonly Container spriteContainer; + private readonly Container shadeContainer; + private readonly Circle hitLine; public ArgonHoldNoteTailPiece() { RelativeSizeAxes = Axes.X; - Height = ArgonNotePiece.NOTE_HEIGHT; + + // multiply by two so that the hold body extends up to the height of the note head accent + Height = ArgonNotePiece.NOTE_HEIGHT * ArgonNotePiece.NOTE_ACCENT_RATIO * 2; CornerRadius = ArgonNotePiece.CORNER_RADIUS; Masking = true; InternalChildren = new Drawable[] { - shadow = new Box - { + shadeContainer = new Container { RelativeSizeAxes = Axes.Both, - }, - new Container - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - RelativeSizeAxes = Axes.Both, - Height = 0.82f, - Masking = true, + Height = 0.5f, CornerRadius = ArgonNotePiece.CORNER_RADIUS, - Children = new Drawable[] - { - colouredBox = new Box + Masking = true, + Children = new Drawable[] { + new Box { RelativeSizeAxes = Axes.Both, - } - } + Colour = Color4.Black, + Alpha = 0.2f, + }, + }, }, - new Circle - { + spriteContainer = new Container { + RelativeSizeAxes = Axes.X, + Height = ArgonNotePiece.NOTE_HEIGHT, + Children = new Drawable[] + { + new SpriteIcon + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Y = 4, + Icon = FontAwesome.Solid.AngleDown, + Size = new Vector2(20), + Scale = new Vector2(1, 0.7f), + Colour = Color4.White, + Alpha = 0.2f, + }, + }, + }, + hitLine = new Circle { RelativeSizeAxes = Axes.X, Height = ArgonNotePiece.CORNER_RADIUS * 2, - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, }, }; } @@ -77,19 +89,17 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon private void onDirectionChanged(ValueChangedEvent direction) { - colouredBox.Anchor = colouredBox.Origin = direction.NewValue == ScrollingDirection.Up - ? Anchor.TopCentre - : Anchor.BottomCentre; + hitLine.Anchor = hitLine.Origin = + spriteContainer.Anchor = spriteContainer.Origin = + shadeContainer.Anchor = shadeContainer.Origin = + direction.NewValue == ScrollingDirection.Up + ? Anchor.TopCentre + : Anchor.BottomCentre; } private void onAccentChanged(ValueChangedEvent accent) { - colouredBox.Colour = ColourInfo.GradientVertical( - accent.NewValue, - accent.NewValue.Darken(0.1f) - ); - - shadow.Colour = accent.NewValue.Darken(0.5f); + hitLine.Colour = accent.NewValue; } } } diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonNotePiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonNotePiece.cs index 25b1965c18..f680483634 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonNotePiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonNotePiece.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon internal partial class ArgonNotePiece : CompositeDrawable { public const float NOTE_HEIGHT = 42; - + public const float NOTE_ACCENT_RATIO = 0.82f; public const float CORNER_RADIUS = 3.4f; private readonly IBindable direction = new Bindable(); @@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.Both, - Height = 0.82f, + Height = NOTE_ACCENT_RATIO, Masking = true, CornerRadius = CORNER_RADIUS, Children = new Drawable[] From 9a053f114ebc0040d850f94e5b62f41f0f15c587 Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Mon, 23 Jan 2023 01:50:50 -0600 Subject: [PATCH 05/28] remove sprite --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index 6f6270c1f5..02325904c4 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -6,10 +6,8 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Sprites; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; -using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Mania.Skinning.Argon @@ -19,7 +17,6 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon private readonly IBindable direction = new Bindable(); private readonly IBindable accentColour = new Bindable(); - private readonly Container spriteContainer; private readonly Container shadeContainer; private readonly Circle hitLine; @@ -28,7 +25,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon RelativeSizeAxes = Axes.X; // multiply by two so that the hold body extends up to the height of the note head accent - Height = ArgonNotePiece.NOTE_HEIGHT * ArgonNotePiece.NOTE_ACCENT_RATIO * 2; + Height = ArgonNotePiece.NOTE_HEIGHT * 2; CornerRadius = ArgonNotePiece.CORNER_RADIUS; Masking = true; @@ -45,25 +42,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, - Alpha = 0.2f, - }, - }, - }, - spriteContainer = new Container { - RelativeSizeAxes = Axes.X, - Height = ArgonNotePiece.NOTE_HEIGHT, - Children = new Drawable[] - { - new SpriteIcon - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Y = 4, - Icon = FontAwesome.Solid.AngleDown, - Size = new Vector2(20), - Scale = new Vector2(1, 0.7f), - Colour = Color4.White, - Alpha = 0.2f, + Alpha = 0.4f, }, }, }, @@ -90,7 +69,6 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon private void onDirectionChanged(ValueChangedEvent direction) { hitLine.Anchor = hitLine.Origin = - spriteContainer.Anchor = spriteContainer.Origin = shadeContainer.Anchor = shadeContainer.Origin = direction.NewValue == ScrollingDirection.Up ? Anchor.TopCentre From 5f037ac1e95493f87847a34ff4f08d260abb95da Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Tue, 24 Jan 2023 22:24:21 -0600 Subject: [PATCH 06/28] comment not useful --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index 02325904c4..a14abf7011 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -23,8 +23,6 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon public ArgonHoldNoteTailPiece() { RelativeSizeAxes = Axes.X; - - // multiply by two so that the hold body extends up to the height of the note head accent Height = ArgonNotePiece.NOTE_HEIGHT * 2; CornerRadius = ArgonNotePiece.CORNER_RADIUS; From 132417b4e4e9880e3336783743c120afe7e18a0c Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Tue, 24 Jan 2023 22:36:13 -0600 Subject: [PATCH 07/28] fix braces --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index a14abf7011..b2cccfac26 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -30,12 +30,14 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon InternalChildren = new Drawable[] { - shadeContainer = new Container { + shadeContainer = new Container + { RelativeSizeAxes = Axes.Both, Height = 0.5f, CornerRadius = ArgonNotePiece.CORNER_RADIUS, Masking = true, - Children = new Drawable[] { + Children = new Drawable[] + { new Box { RelativeSizeAxes = Axes.Both, @@ -44,7 +46,8 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon }, }, }, - hitLine = new Circle { + hitLine = new Circle + { RelativeSizeAxes = Axes.X, Height = ArgonNotePiece.CORNER_RADIUS * 2, }, From a4a94cb96e418cbd6adaffd0e7be75c08636616c Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Wed, 25 Jan 2023 14:34:00 -0300 Subject: [PATCH 08/28] Add movement to misses in osu ruleset --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 5 ++--- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 2430e511c4..7fece3e896 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -104,9 +104,8 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - //todo: this only applies to osu! ruleset apparently. - this.MoveTo(new Vector2(0, -2)); - this.MoveToOffset(new Vector2(0, 20), fade_out_delay + fade_out_length, Easing.In); + this.MoveTo(new Vector2(0, -5)); + this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); float rotation = RNG.NextSingle(-8.6f, 8.6f); diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 796080f4f5..291b28991d 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -10,6 +10,8 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Utils; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; +using osuTK; + namespace osu.Game.Skinning { @@ -55,6 +57,9 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); + this.MoveTo(new Vector2(0, -5)); + this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); + float rotation = RNG.NextSingle(-8.6f, 8.6f); this.RotateTo(0); From fc968d1d89887474093ef017c2346777252b4d6c Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Wed, 25 Jan 2023 14:38:02 -0300 Subject: [PATCH 09/28] del extra newline --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 291b28991d..749edf80db 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -12,7 +12,6 @@ using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; - namespace osu.Game.Skinning { public partial class LegacyJudgementPieceOld : CompositeDrawable, IAnimatableJudgement From a6fc3ce477e400ef30298ef00cd21330d0849b6c Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Wed, 25 Jan 2023 20:38:55 -0300 Subject: [PATCH 10/28] bring comment back --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 7fece3e896..6be310c419 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -104,6 +104,7 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); + //todo: this only applies to osu! ruleset apparently. this.MoveTo(new Vector2(0, -5)); this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); From bcecc49092d08b0f1a775e8fe0a092f382edc491 Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Wed, 25 Jan 2023 23:05:11 -0300 Subject: [PATCH 11/28] Only do misses animations on modern skins --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 21 ++++---------------- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 11 +++++++--- osu.Game/Skinning/LegacySkin.cs | 4 ++-- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 6be310c419..5e2bba9ccd 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -17,6 +17,7 @@ namespace osu.Game.Skinning public partial class LegacyJudgementPieceNew : CompositeDrawable, IAnimatableJudgement { private readonly HitResult result; + private readonly decimal? version; private readonly LegacyJudgementPieceOld? temporaryOldStyle; @@ -24,9 +25,10 @@ namespace osu.Game.Skinning private readonly ParticleExplosion? particles; - public LegacyJudgementPieceNew(HitResult result, Func createMainDrawable, Texture? particleTexture) + public LegacyJudgementPieceNew(HitResult result, decimal? version, Func createMainDrawable, Texture? particleTexture) { this.result = result; + this.version = version; AutoSizeAxes = Axes.Both; Origin = Anchor.Centre; @@ -54,7 +56,7 @@ namespace osu.Game.Skinning if (result != HitResult.Miss) { //new judgement shows old as a temporary effect - AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true) + AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, this.version, createMainDrawable, 1.05f, true) { Blending = BlendingParameters.Additive, Anchor = Anchor.Centre, @@ -100,21 +102,6 @@ namespace osu.Game.Skinning switch (result) { - case HitResult.Miss: - this.ScaleTo(1.6f); - this.ScaleTo(1, 100, Easing.In); - - //todo: this only applies to osu! ruleset apparently. - this.MoveTo(new Vector2(0, -5)); - this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); - - float rotation = RNG.NextSingle(-8.6f, 8.6f); - - this.RotateTo(0); - this.RotateTo(rotation, fade_in_length) - .Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In); - break; - default: mainPiece.ScaleTo(0.9f); mainPiece.ScaleTo(1.05f, fade_out_delay + fade_out_length); diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 749edf80db..e427e19a6b 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -17,13 +17,15 @@ namespace osu.Game.Skinning public partial class LegacyJudgementPieceOld : CompositeDrawable, IAnimatableJudgement { private readonly HitResult result; + private readonly decimal? version; private readonly float finalScale; private readonly bool forceTransforms; - public LegacyJudgementPieceOld(HitResult result, Func createMainDrawable, float finalScale = 1f, bool forceTransforms = false) + public LegacyJudgementPieceOld(HitResult result, decimal? version, Func createMainDrawable, float finalScale = 1f, bool forceTransforms = false) { this.result = result; + this.version = version; this.finalScale = finalScale; this.forceTransforms = forceTransforms; @@ -56,8 +58,11 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - this.MoveTo(new Vector2(0, -5)); - this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); + if (this.version > 1) + { + this.MoveTo(new Vector2(0, -5)); + this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); + } float rotation = RNG.NextSingle(-8.6f, 8.6f); diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 5f12d2ce23..0942966b1c 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -390,9 +390,9 @@ namespace osu.Game.Skinning var particle = getParticleTexture(resultComponent.Component); if (particle != null) - return new LegacyJudgementPieceNew(resultComponent.Component, createDrawable, particle); + return new LegacyJudgementPieceNew(resultComponent.Component, this.Configuration.LegacyVersion, createDrawable, particle); - return new LegacyJudgementPieceOld(resultComponent.Component, createDrawable); + return new LegacyJudgementPieceOld(resultComponent.Component, this.Configuration.LegacyVersion, createDrawable); } return null; From f3c92749bf280c10f5a9ed971bb92f55b7848b48 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 26 Jan 2023 15:43:03 +0900 Subject: [PATCH 12/28] Fix code quality issues --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 5 +---- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 2 +- osu.Game/Skinning/LegacySkin.cs | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 5e2bba9ccd..2f3a308b57 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Animations; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Textures; -using osu.Framework.Utils; using osu.Game.Graphics; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; @@ -17,7 +16,6 @@ namespace osu.Game.Skinning public partial class LegacyJudgementPieceNew : CompositeDrawable, IAnimatableJudgement { private readonly HitResult result; - private readonly decimal? version; private readonly LegacyJudgementPieceOld? temporaryOldStyle; @@ -28,7 +26,6 @@ namespace osu.Game.Skinning public LegacyJudgementPieceNew(HitResult result, decimal? version, Func createMainDrawable, Texture? particleTexture) { this.result = result; - this.version = version; AutoSizeAxes = Axes.Both; Origin = Anchor.Centre; @@ -56,7 +53,7 @@ namespace osu.Game.Skinning if (result != HitResult.Miss) { //new judgement shows old as a temporary effect - AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, this.version, createMainDrawable, 1.05f, true) + AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, version, createMainDrawable, 1.05f, true) { Blending = BlendingParameters.Additive, Anchor = Anchor.Centre, diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index e427e19a6b..ed3a88219e 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -58,7 +58,7 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - if (this.version > 1) + if (version > 1) { this.MoveTo(new Vector2(0, -5)); this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 0942966b1c..04bb551668 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -390,9 +390,9 @@ namespace osu.Game.Skinning var particle = getParticleTexture(resultComponent.Component); if (particle != null) - return new LegacyJudgementPieceNew(resultComponent.Component, this.Configuration.LegacyVersion, createDrawable, particle); + return new LegacyJudgementPieceNew(resultComponent.Component, Configuration.LegacyVersion, createDrawable, particle); - return new LegacyJudgementPieceOld(resultComponent.Component, this.Configuration.LegacyVersion, createDrawable); + return new LegacyJudgementPieceOld(resultComponent.Component, Configuration.LegacyVersion, createDrawable); } return null; From 7cd21e12f3278d8da8e8fc1378d20e0393a6cef5 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 26 Jan 2023 09:46:41 +0300 Subject: [PATCH 13/28] Implement masking property for TrianglesV2 background --- .../TestSceneTrianglesV2Background.cs | 58 +++++++++++++++++-- osu.Game/Graphics/Backgrounds/TrianglesV2.cs | 50 ++++++++++++---- 2 files changed, 90 insertions(+), 18 deletions(-) diff --git a/osu.Game.Tests/Visual/Background/TestSceneTrianglesV2Background.cs b/osu.Game.Tests/Visual/Background/TestSceneTrianglesV2Background.cs index ae1f3de6bf..01a2464b8e 100644 --- a/osu.Game.Tests/Visual/Background/TestSceneTrianglesV2Background.cs +++ b/osu.Game.Tests/Visual/Background/TestSceneTrianglesV2Background.cs @@ -8,12 +8,14 @@ using osuTK; using osuTK.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Framework.Graphics.Colour; +using osu.Game.Graphics.Sprites; namespace osu.Game.Tests.Visual.Background { public partial class TestSceneTrianglesV2Background : OsuTestScene { private readonly TrianglesV2 triangles; + private readonly TrianglesV2 maskedTriangles; private readonly Box box; public TestSceneTrianglesV2Background() @@ -31,12 +33,20 @@ namespace osu.Game.Tests.Visual.Background Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 5), + Spacing = new Vector2(0, 10), Children = new Drawable[] { + new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = "Masked" + }, new Container { Size = new Vector2(500, 100), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, Masking = true, CornerRadius = 40, Children = new Drawable[] @@ -54,9 +64,43 @@ namespace osu.Game.Tests.Visual.Background } } }, + new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = "Non-masked" + }, new Container { Size = new Vector2(500, 100), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Red + }, + maskedTriangles = new TrianglesV2 + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both + } + } + }, + new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = "Gradient comparison box" + }, + new Container + { + Size = new Vector2(500, 100), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, Masking = true, CornerRadius = 40, Child = box = new Box @@ -75,14 +119,16 @@ namespace osu.Game.Tests.Visual.Background AddSliderStep("Spawn ratio", 0f, 10f, 1f, s => { - triangles.SpawnRatio = s; + triangles.SpawnRatio = maskedTriangles.SpawnRatio = s; triangles.Reset(1234); + maskedTriangles.Reset(1234); }); - AddSliderStep("Thickness", 0f, 1f, 0.02f, t => triangles.Thickness = t); + AddSliderStep("Thickness", 0f, 1f, 0.02f, t => triangles.Thickness = maskedTriangles.Thickness = t); - AddStep("White colour", () => box.Colour = triangles.Colour = Color4.White); - AddStep("Vertical gradient", () => box.Colour = triangles.Colour = ColourInfo.GradientVertical(Color4.White, Color4.Red)); - AddStep("Horizontal gradient", () => box.Colour = triangles.Colour = ColourInfo.GradientHorizontal(Color4.White, Color4.Red)); + AddStep("White colour", () => box.Colour = triangles.Colour = maskedTriangles.Colour = Color4.White); + AddStep("Vertical gradient", () => box.Colour = triangles.Colour = maskedTriangles.Colour = ColourInfo.GradientVertical(Color4.White, Color4.Red)); + AddStep("Horizontal gradient", () => box.Colour = triangles.Colour = maskedTriangles.Colour = ColourInfo.GradientHorizontal(Color4.White, Color4.Red)); + AddToggleStep("Masking", m => maskedTriangles.Masking = m); } } } diff --git a/osu.Game/Graphics/Backgrounds/TrianglesV2.cs b/osu.Game/Graphics/Backgrounds/TrianglesV2.cs index d543f082b4..3bc8bb6df1 100644 --- a/osu.Game/Graphics/Backgrounds/TrianglesV2.cs +++ b/osu.Game/Graphics/Backgrounds/TrianglesV2.cs @@ -34,6 +34,12 @@ namespace osu.Game.Graphics.Backgrounds /// protected virtual bool CreateNewTriangles => true; + /// + /// If enabled, only the portion of triangles that falls within this 's + /// shape is drawn to the screen. + /// + public bool Masking { get; set; } + private readonly BindableFloat spawnRatio = new BindableFloat(1f); /// @@ -189,6 +195,7 @@ namespace osu.Game.Graphics.Backgrounds private Vector2 size; private float thickness; private float texelSize; + private bool masking; private IVertexBatch? vertexBatch; @@ -205,6 +212,7 @@ namespace osu.Game.Graphics.Backgrounds texture = Source.texture; size = Source.DrawSize; thickness = Source.Thickness; + masking = Source.Masking; Quad triangleQuad = new Quad( Vector2Extensions.Transform(Vector2.Zero, DrawInfo.Matrix), @@ -236,26 +244,31 @@ namespace osu.Game.Graphics.Backgrounds shader.GetUniform("thickness").UpdateValue(ref thickness); shader.GetUniform("texelSize").UpdateValue(ref texelSize); - float relativeHeight = triangleSize.Y / size.Y; - float relativeWidth = triangleSize.X / size.X; + Vector2 relativeSize = Vector2.Divide(triangleSize, size); foreach (TriangleParticle particle in parts) { - Vector2 topLeft = particle.Position - new Vector2(relativeWidth * 0.5f, 0f); - Vector2 topRight = topLeft + new Vector2(relativeWidth, 0f); - Vector2 bottomLeft = topLeft + new Vector2(0f, relativeHeight); - Vector2 bottomRight = bottomLeft + new Vector2(relativeWidth, 0f); + Vector2 topLeft = particle.Position - new Vector2(relativeSize.X * 0.5f, 0f); + + Quad triangleQuad = masking ? clampToDrawable(topLeft, relativeSize) : new Quad(topLeft.X, topLeft.Y, relativeSize.X, relativeSize.Y); var drawQuad = new Quad( - Vector2Extensions.Transform(topLeft * size, DrawInfo.Matrix), - Vector2Extensions.Transform(topRight * size, DrawInfo.Matrix), - Vector2Extensions.Transform(bottomLeft * size, DrawInfo.Matrix), - Vector2Extensions.Transform(bottomRight * size, DrawInfo.Matrix) + Vector2Extensions.Transform(triangleQuad.TopLeft * size, DrawInfo.Matrix), + Vector2Extensions.Transform(triangleQuad.TopRight * size, DrawInfo.Matrix), + Vector2Extensions.Transform(triangleQuad.BottomLeft * size, DrawInfo.Matrix), + Vector2Extensions.Transform(triangleQuad.BottomRight * size, DrawInfo.Matrix) ); - ColourInfo colourInfo = triangleColourInfo(DrawColourInfo.Colour, new Quad(topLeft, topRight, bottomLeft, bottomRight)); + ColourInfo colourInfo = triangleColourInfo(DrawColourInfo.Colour, triangleQuad); - renderer.DrawQuad(texture, drawQuad, colourInfo, vertexAction: vertexBatch.AddAction); + RectangleF textureCoords = new RectangleF( + triangleQuad.TopLeft.X - topLeft.X, + triangleQuad.TopLeft.Y - topLeft.Y, + triangleQuad.Width, + triangleQuad.Height + ) / relativeSize; + + renderer.DrawQuad(texture, drawQuad, colourInfo, new RectangleF(0, 0, 1, 1), vertexBatch.AddAction, textureCoords: textureCoords); } shader.Unbind(); @@ -272,6 +285,19 @@ namespace osu.Game.Graphics.Backgrounds }; } + private static Quad clampToDrawable(Vector2 topLeft, Vector2 size) + { + float leftClamped = Math.Clamp(topLeft.X, 0f, 1f); + float topClamped = Math.Clamp(topLeft.Y, 0f, 1f); + + return new Quad( + leftClamped, + topClamped, + Math.Clamp(topLeft.X + size.X, 0f, 1f) - leftClamped, + Math.Clamp(topLeft.Y + size.Y, 0f, 1f) - topClamped + ); + } + protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); From 758b4c8cfcc7b1ecbb91e64ea8230d211bd6de8f Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Thu, 26 Jan 2023 10:01:33 -0300 Subject: [PATCH 14/28] Do the thing aka fix the if --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 4 ++-- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 12 ++++++++---- osu.Game/Skinning/LegacySkin.cs | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 2f3a308b57..9b1ff9b22f 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -23,7 +23,7 @@ namespace osu.Game.Skinning private readonly ParticleExplosion? particles; - public LegacyJudgementPieceNew(HitResult result, decimal? version, Func createMainDrawable, Texture? particleTexture) + public LegacyJudgementPieceNew(HitResult result, Func createMainDrawable, Texture? particleTexture) { this.result = result; @@ -53,7 +53,7 @@ namespace osu.Game.Skinning if (result != HitResult.Miss) { //new judgement shows old as a temporary effect - AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, version, createMainDrawable, 1.05f, true) + AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true) { Blending = BlendingParameters.Additive, Anchor = Anchor.Centre, diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index ed3a88219e..69d38b06c5 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -4,6 +4,7 @@ #nullable disable using System; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Animations; using osu.Framework.Graphics.Containers; @@ -17,15 +18,16 @@ namespace osu.Game.Skinning public partial class LegacyJudgementPieceOld : CompositeDrawable, IAnimatableJudgement { private readonly HitResult result; - private readonly decimal? version; private readonly float finalScale; private readonly bool forceTransforms; - public LegacyJudgementPieceOld(HitResult result, decimal? version, Func createMainDrawable, float finalScale = 1f, bool forceTransforms = false) + [Resolved] + private ISkinSource skin { get; set; } = null!; + + public LegacyJudgementPieceOld(HitResult result, Func createMainDrawable, float finalScale = 1f, bool forceTransforms = false) { this.result = result; - this.version = version; this.finalScale = finalScale; this.forceTransforms = forceTransforms; @@ -58,7 +60,9 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - if (version > 1) + decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; + + if (legacyVersion > 1) { this.MoveTo(new Vector2(0, -5)); this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 04bb551668..5f12d2ce23 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -390,9 +390,9 @@ namespace osu.Game.Skinning var particle = getParticleTexture(resultComponent.Component); if (particle != null) - return new LegacyJudgementPieceNew(resultComponent.Component, Configuration.LegacyVersion, createDrawable, particle); + return new LegacyJudgementPieceNew(resultComponent.Component, createDrawable, particle); - return new LegacyJudgementPieceOld(resultComponent.Component, Configuration.LegacyVersion, createDrawable); + return new LegacyJudgementPieceOld(resultComponent.Component, createDrawable); } return null; From 9e7f9c86cabfae4d82499df1d384e3d119f8d7f3 Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Mon, 30 Jan 2023 11:14:29 -0600 Subject: [PATCH 15/28] flat hold tail --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 71 +------------------ 1 file changed, 2 insertions(+), 69 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index b2cccfac26..74b4a7b661 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -1,84 +1,17 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Allocation; -using osu.Framework.Bindables; -using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.UI.Scrolling; -using osuTK.Graphics; namespace osu.Game.Rulesets.Mania.Skinning.Argon { internal partial class ArgonHoldNoteTailPiece : CompositeDrawable { - private readonly IBindable direction = new Bindable(); - private readonly IBindable accentColour = new Bindable(); - - private readonly Container shadeContainer; - private readonly Circle hitLine; - public ArgonHoldNoteTailPiece() { - RelativeSizeAxes = Axes.X; + // holds end at the middle of the tail, + // so we do * 2 pull up the hold body to be the height of a note Height = ArgonNotePiece.NOTE_HEIGHT * 2; - - CornerRadius = ArgonNotePiece.CORNER_RADIUS; - Masking = true; - - InternalChildren = new Drawable[] - { - shadeContainer = new Container - { - RelativeSizeAxes = Axes.Both, - Height = 0.5f, - CornerRadius = ArgonNotePiece.CORNER_RADIUS, - Masking = true, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.4f, - }, - }, - }, - hitLine = new Circle - { - RelativeSizeAxes = Axes.X, - Height = ArgonNotePiece.CORNER_RADIUS * 2, - }, - }; - } - - [BackgroundDependencyLoader(true)] - private void load(IScrollingInfo scrollingInfo, DrawableHitObject? drawableObject) - { - direction.BindTo(scrollingInfo.Direction); - direction.BindValueChanged(onDirectionChanged, true); - - if (drawableObject != null) - { - accentColour.BindTo(drawableObject.AccentColour); - accentColour.BindValueChanged(onAccentChanged, true); - } - } - - private void onDirectionChanged(ValueChangedEvent direction) - { - hitLine.Anchor = hitLine.Origin = - shadeContainer.Anchor = shadeContainer.Origin = - direction.NewValue == ScrollingDirection.Up - ? Anchor.TopCentre - : Anchor.BottomCentre; - } - - private void onAccentChanged(ValueChangedEvent accent) - { - hitLine.Colour = accent.NewValue; } } } From e77b0b9fccd1b5ca7ae8b9af47d9c44c6aaff86a Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Tue, 31 Jan 2023 02:22:40 -0600 Subject: [PATCH 16/28] use dark tail with shadow matching the hold head --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index 74b4a7b661..73cb9a9c00 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -1,17 +1,71 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Mania.Skinning.Argon { internal partial class ArgonHoldNoteTailPiece : CompositeDrawable { + private readonly IBindable direction = new Bindable(); + + private readonly Container container; + public ArgonHoldNoteTailPiece() { // holds end at the middle of the tail, // so we do * 2 pull up the hold body to be the height of a note Height = ArgonNotePiece.NOTE_HEIGHT * 2; + RelativeSizeAxes = Axes.X; + + CornerRadius = ArgonNotePiece.CORNER_RADIUS; + Masking = true; + + InternalChildren = new Drawable[] { + container = new Container { + RelativeSizeAxes = Axes.Both, + Height = 0.5f, + + CornerRadius = ArgonNotePiece.CORNER_RADIUS, + Masking = true, + + Children = new Drawable[] { + new Box { + RelativeSizeAxes = Axes.Both, + Colour = Colour4.Black, + Alpha = 0.4f, + }, + new Box { + RelativeSizeAxes = Axes.Both, + Height = 1 - ArgonNotePiece.NOTE_ACCENT_RATIO, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = Colour4.Black, + Alpha = 0.3f, + }, + }, + } + }; + } + + [BackgroundDependencyLoader(true)] + private void load(IScrollingInfo scrollingInfo) + { + direction.BindTo(scrollingInfo.Direction); + direction.BindValueChanged(onDirectionChanged, true); + } + + private void onDirectionChanged(ValueChangedEvent direction) + { + container.Anchor = container.Origin = + direction.NewValue == ScrollingDirection.Down + ? Anchor.BottomCentre + : Anchor.TopCentre; } } } From c81bac5f3121b1c6b6cb4b9435ce530898f37853 Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Tue, 31 Jan 2023 02:23:25 -0600 Subject: [PATCH 17/28] braces --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index 73cb9a9c00..ffb3e3d0a4 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -26,21 +26,26 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon CornerRadius = ArgonNotePiece.CORNER_RADIUS; Masking = true; - InternalChildren = new Drawable[] { - container = new Container { + InternalChildren = new Drawable[] + { + container = new Container + { RelativeSizeAxes = Axes.Both, Height = 0.5f, CornerRadius = ArgonNotePiece.CORNER_RADIUS, Masking = true, - Children = new Drawable[] { - new Box { + Children = new Drawable[] + { + new Box + { RelativeSizeAxes = Axes.Both, Colour = Colour4.Black, Alpha = 0.4f, }, - new Box { + new Box + { RelativeSizeAxes = Axes.Both, Height = 1 - ArgonNotePiece.NOTE_ACCENT_RATIO, Anchor = Anchor.TopCentre, From ff26effa29fada1a91065e089a50cbdce9b8c103 Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Tue, 31 Jan 2023 19:36:49 -0600 Subject: [PATCH 18/28] rounded tail line --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index ffb3e3d0a4..326f25f3bd 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon Colour = Colour4.Black, Alpha = 0.4f, }, - new Box + new Circle { RelativeSizeAxes = Axes.Both, Height = 1 - ArgonNotePiece.NOTE_ACCENT_RATIO, From fe175e72a9eb5d8e98f03a1a18ff4385c340fe90 Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Tue, 31 Jan 2023 19:52:58 -0600 Subject: [PATCH 19/28] make upscroll make sense --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 23 +++++++++++++------ .../Skinning/Argon/ArgonNotePiece.cs | 2 ++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index 326f25f3bd..c07322262f 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -30,6 +30,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon { container = new Container { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + RelativeSizeAxes = Axes.Both, Height = 0.5f, @@ -44,14 +47,23 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon Colour = Colour4.Black, Alpha = 0.4f, }, - new Circle + new Container { + CornerRadius = ArgonNotePiece.CORNER_RADIUS, + Masking = true, RelativeSizeAxes = Axes.Both, Height = 1 - ArgonNotePiece.NOTE_ACCENT_RATIO, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Colour = Colour4.Black, - Alpha = 0.3f, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Colour4.Black, + Alpha = 0.3f, + } + } }, }, } @@ -67,10 +79,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon private void onDirectionChanged(ValueChangedEvent direction) { - container.Anchor = container.Origin = - direction.NewValue == ScrollingDirection.Down - ? Anchor.BottomCentre - : Anchor.TopCentre; + Scale = new osuTK.Vector2(1, direction.NewValue == ScrollingDirection.Up ? -1 : 1); } } } diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonNotePiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonNotePiece.cs index f680483634..2a5bce255c 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonNotePiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonNotePiece.cs @@ -95,6 +95,8 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon colouredBox.Anchor = colouredBox.Origin = direction.NewValue == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre; + + Scale = new Vector2(1, direction.NewValue == ScrollingDirection.Up ? -1 : 1); } private void onAccentChanged(ValueChangedEvent accent) From 76296eb35ad87810ad56c9da0dcaff19209a4119 Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Wed, 1 Feb 2023 11:52:14 +0800 Subject: [PATCH 20/28] Consistent with BeatmapsetVerifier --- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index 05e49eba84..918be7ff90 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Edit.Checks { public class CheckPreviewTime : ICheck { - public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Timing, "Check Preview Time Consistency"); + public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Timing, "Inconsistent or unset preview time"); public IEnumerable PossibleTemplates => new IssueTemplate[] { @@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplatePreviewTimeConflict : IssueTemplate { public IssueTemplatePreviewTimeConflict(ICheck check) - : base(check, IssueType.Warning, "Audio preview time {1} doesn't match \"{0}\"'s preview time {2}") + : base(check, IssueType.Problem, "Audio preview time {1} doesn't match \"{0}\"'s preview time. {2}") { } @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplateHasNoPreviewTime : IssueTemplate { public IssueTemplateHasNoPreviewTime(ICheck check) - : base(check, IssueType.Warning, "A preview point for this map is not set. Consider settings one from the Timing menu") + : base(check, IssueType.Problem, "A preview point for this map is not set. Consider settings one from the Timing menu.") { } From 209bc3c1ed87e96485edc9fe179157d6a1b60a92 Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Wed, 1 Feb 2023 11:53:26 +0800 Subject: [PATCH 21/28] remove useless setup --- .../Editing/Checks/CheckPreviewTimeTest.cs | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs index 2b7d37dc81..37b01da6ee 100644 --- a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs +++ b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs @@ -22,26 +22,6 @@ namespace osu.Game.Tests.Editing.Checks public void Setup() { check = new CheckPreviewTime(); - beatmap = new Beatmap - { - BeatmapInfo = new BeatmapInfo - { - Metadata = new BeatmapMetadata { PreviewTime = -1 }, - BeatmapSet = new BeatmapSetInfo(new List - { - new BeatmapInfo - { - DifficultyName = "Test1", - Metadata = new BeatmapMetadata { PreviewTime = 5 }, - }, - new BeatmapInfo - { - DifficultyName = "Test2", - Metadata = new BeatmapMetadata { PreviewTime = 10 }, - }, - }) - } - }; } [Test] From a8ce0a32783fbcaa062a71a5fad33a1b59e8a7c3 Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Wed, 1 Feb 2023 18:50:38 -0600 Subject: [PATCH 22/28] now without the weird hacks --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 64 +++++++++---------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index c07322262f..b7f4e30dcc 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -2,84 +2,80 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osuTK.Graphics; using osu.Framework.Bindables; -using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; +using osu.Framework.Graphics; +using osu.Framework.Extensions.Color4Extensions; namespace osu.Game.Rulesets.Mania.Skinning.Argon { internal partial class ArgonHoldNoteTailPiece : CompositeDrawable { private readonly IBindable direction = new Bindable(); + private readonly IBindable accentColour = new Bindable(); - private readonly Container container; + private readonly Box shadeBackground; + private readonly Box shadeForeground; public ArgonHoldNoteTailPiece() { - // holds end at the middle of the tail, - // so we do * 2 pull up the hold body to be the height of a note - Height = ArgonNotePiece.NOTE_HEIGHT * 2; RelativeSizeAxes = Axes.X; + Height = ArgonNotePiece.NOTE_HEIGHT; CornerRadius = ArgonNotePiece.CORNER_RADIUS; Masking = true; InternalChildren = new Drawable[] { - container = new Container + shadeBackground = new Box { + RelativeSizeAxes = Axes.Both, + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Height = ArgonNotePiece.NOTE_ACCENT_RATIO, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, - - RelativeSizeAxes = Axes.Both, - Height = 0.5f, - CornerRadius = ArgonNotePiece.CORNER_RADIUS, Masking = true, - Children = new Drawable[] { - new Box + shadeForeground = new Box { RelativeSizeAxes = Axes.Both, - Colour = Colour4.Black, - Alpha = 0.4f, - }, - new Container - { - CornerRadius = ArgonNotePiece.CORNER_RADIUS, - Masking = true, - RelativeSizeAxes = Axes.Both, - Height = 1 - ArgonNotePiece.NOTE_ACCENT_RATIO, - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Colour4.Black, - Alpha = 0.3f, - } - } }, }, - } + }, }; } [BackgroundDependencyLoader(true)] - private void load(IScrollingInfo scrollingInfo) + private void load(IScrollingInfo scrollingInfo, DrawableHitObject? drawableObject) { direction.BindTo(scrollingInfo.Direction); direction.BindValueChanged(onDirectionChanged, true); + + if (drawableObject != null) + { + accentColour.BindTo(drawableObject.AccentColour); + accentColour.BindValueChanged(onAccentChanged, true); + } } private void onDirectionChanged(ValueChangedEvent direction) { Scale = new osuTK.Vector2(1, direction.NewValue == ScrollingDirection.Up ? -1 : 1); } + + private void onAccentChanged(ValueChangedEvent accent) + { + shadeBackground.Colour = accent.NewValue.Darken(1.7f); + shadeForeground.Colour = accent.NewValue.Darken(1.1f); + } } } From ccd68a6263b13cf985051f93482cdc2ec44538ec Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Wed, 1 Feb 2023 19:22:28 -0600 Subject: [PATCH 23/28] optimize imports --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index b7f4e30dcc..428439d52c 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -2,14 +2,15 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; -using osuTK.Graphics; using osu.Framework.Bindables; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; -using osu.Framework.Graphics; -using osu.Framework.Extensions.Color4Extensions; +using osuTK; +using osuTK.Graphics; namespace osu.Game.Rulesets.Mania.Skinning.Argon { @@ -69,7 +70,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon private void onDirectionChanged(ValueChangedEvent direction) { - Scale = new osuTK.Vector2(1, direction.NewValue == ScrollingDirection.Up ? -1 : 1); + Scale = new Vector2(1, direction.NewValue == ScrollingDirection.Up ? -1 : 1); } private void onAccentChanged(ValueChangedEvent accent) From 183d1c5bd60612c4b385a08b9e1c3c2f7ad086f5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:08:45 +0900 Subject: [PATCH 24/28] Change version comparison to match other existing code as proposed in review --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 69d38b06c5..ae9ab86d3e 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -62,7 +62,7 @@ namespace osu.Game.Skinning decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; - if (legacyVersion > 1) + if (legacyVersion >= 2.0m) { this.MoveTo(new Vector2(0, -5)); this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); From 229fb518dc54b76c2c49dd62954ebd76381c075b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:09:05 +0900 Subject: [PATCH 25/28] Apply NRT to `LegacyJudgementPieceOld` --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index ae9ab86d3e..082d0e4a67 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using osu.Framework.Allocation; using osu.Framework.Graphics; From 3a861fd94370f473b17caf7aa9e0899dd346788d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:28:21 +0900 Subject: [PATCH 26/28] Remove multiple cases of excess braces --- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index 918be7ff90..adf8c1a73c 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -23,21 +23,15 @@ namespace osu.Game.Rulesets.Edit.Checks int previewTime = context.Beatmap.BeatmapInfo.Metadata.PreviewTime; if (previewTime == -1) - { yield return new IssueTemplateHasNoPreviewTime(this).Create(); - } foreach (var diff in diffList) { if (diff.Equals(context.Beatmap.BeatmapInfo)) - { continue; - } if (diff.Metadata.PreviewTime != previewTime) - { yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName, previewTime, diff.Metadata.PreviewTime); - } } } From c2cde8361a5a05a43e3da6261cffc0973869b9a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:33:41 +0900 Subject: [PATCH 27/28] Fix message not reading well --- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index adf8c1a73c..fe5853a840 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -38,15 +38,15 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplatePreviewTimeConflict : IssueTemplate { public IssueTemplatePreviewTimeConflict(ICheck check) - : base(check, IssueType.Problem, "Audio preview time {1} doesn't match \"{0}\"'s preview time. {2}") + : base(check, IssueType.Problem, "Audio preview time ({1}) doesn't match the time specified in \"{0}\" ({2})") { } public Issue Create(string diffName, int originalTime, int conflictTime) => // preview time should show (not set) when it is not set. new Issue(this, diffName, - originalTime != -1 ? $"({originalTime:N0})" : "(not set)", - conflictTime != -1 ? $"({conflictTime:N0})" : "(not set)"); + originalTime != -1 ? $"{originalTime:N0} ms" : "not set", + conflictTime != -1 ? $"{conflictTime:N0} ms" : "not set"); } public class IssueTemplateHasNoPreviewTime : IssueTemplate From 5b3d7a8f266a9efc80b7f33c54f57084a002cdc7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:34:59 +0900 Subject: [PATCH 28/28] Fix typo in missing-preview-point message --- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index fe5853a840..d4f9c1feaf 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplateHasNoPreviewTime : IssueTemplate { public IssueTemplateHasNoPreviewTime(ICheck check) - : base(check, IssueType.Problem, "A preview point for this map is not set. Consider settings one from the Timing menu.") + : base(check, IssueType.Problem, "A preview point for this map is not set. Consider setting one from the Timing menu.") { }