From 806fae16f5b041ce026d4b547ed9ac992be1237d Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Mon, 5 Dec 2022 11:15:52 +0100 Subject: [PATCH] Cleanup code style inconsistencies --- .editorconfig | 16 +- Directory.Build.props | 4 +- .../Objects/Slides/TestSceneAllSlides.cs | 5 +- .../Objects/Slides/TestSceneFanSlide.cs | 6 +- .../Objects/Slides/TestSceneSlide.cs | 7 +- .../Objects/TestSceneBreakNote.cs | 2 +- .../Objects/TestSceneHoldNote.cs | 2 +- .../Objects/TestSceneSlideFan.cs | 11 +- .../Objects/TestSceneSlideNote.cs | 42 +- .../Objects/TestSceneTapNote.cs | 2 +- .../Objects/TestSceneTouchHold.cs | 5 +- .../Objects/TestSceneTouchNote.cs | 4 +- .../Statistics/TestSceneJudgementChart.cs | 75 +- .../UI/TestSceneHitExplosion.cs | 2 +- .../UI/TestSceneLineRenderer.cs | 2 +- .../UI/TestSceneLiveCounter.cs | 8 +- .../UI/TestSceneSentakkiRing.cs | 7 +- .../osu.Game.Rulesets.Sentakki.Tests.csproj | 10 +- osu.Game.Rulesets.Sentakki.sln.DotSettings | 996 ++++++++++-------- .../Beatmaps/SentakkiBeatmapConverter.cs | 50 +- .../Beatmaps/SentakkiPatternGenerator.cs | 18 +- .../Configuration/LaneInputMode.cs | 1 - .../SentakkiDifficultyCalculator.cs | 9 +- .../Mods/SentakkiModAutoTouchStrings.cs | 3 +- .../Mods/SentakkiModChallengeStrings.cs | 1 + .../Mods/SentakkiModExperimentalStrings.cs | 9 +- .../Mods/SentakkiModMirrorStrings.cs | 2 + .../Mods/SentakkiModSpinStrings.cs | 1 + .../Localisation/SentakkiActionStrings.cs | 2 + .../SentakkiSettingsSubsectionStrings.cs | 2 + .../Mods/SentakkiModAutoTouch.cs | 8 +- .../Mods/SentakkiModAutoplay.cs | 2 +- .../Mods/SentakkiModChallenge.cs | 34 +- .../Mods/SentakkiModHidden.cs | 7 +- .../Mods/SentakkiModMirror.cs | 3 + .../Mods/SentakkiModPerfect.cs | 12 +- .../Mods/SentakkiModSuddenDeath.cs | 2 +- .../Objects/Drawables/DrawableHold.cs | 34 +- .../Objects/Drawables/DrawableHoldHead.cs | 5 +- .../Drawables/DrawableScoreBonusObject.cs | 9 +- .../Drawables/DrawableScorePaddingObject.cs | 9 +- .../Drawables/DrawableSentakkiHitObject.cs | 12 +- .../Drawables/DrawableSentakkiJudgement.cs | 12 +- .../DrawableSentakkiLanedHitObject.cs | 13 +- .../Objects/Drawables/DrawableSlide.cs | 12 +- .../Objects/Drawables/DrawableSlideBody.cs | 25 +- .../Drawables/DrawableSlideCheckpoint.cs | 17 +- .../Drawables/DrawableSlideCheckpointNode.cs | 6 +- .../Objects/Drawables/DrawableSlideTap.cs | 17 +- .../Objects/Drawables/DrawableTap.cs | 22 +- .../Objects/Drawables/DrawableTouch.cs | 25 +- .../Objects/Drawables/DrawableTouchHold.cs | 20 +- .../Objects/Drawables/Pieces/DotPiece.cs | 11 +- .../Objects/Drawables/Pieces/NoteRingPiece.cs | 3 +- .../Objects/Drawables/Pieces/RingPiece.cs | 7 +- .../Pieces/Slides/SlideFanChevrons.cs | 31 +- .../Drawables/Pieces/Slides/SlideTapPiece.cs | 6 +- .../Drawables/Pieces/Slides/SlideVisual.cs | 22 +- .../Drawables/Pieces/Slides/StarPiece.cs | 2 +- .../Pieces/TouchHolds/TouchHoldBody.cs | 5 +- .../Pieces/TouchHolds/TouchHoldCentrePiece.cs | 24 +- .../TouchHolds/TouchHoldProgressPiece.cs | 31 +- .../Drawables/Pieces/Touches/TouchBlobs.cs | 122 --- .../Drawables/Pieces/Touches/TouchBody.cs | 32 +- .../Drawables/Pieces/Touches/TouchPiece.cs | 3 +- .../Drawables/Pieces/TrianglesPiece.cs | 21 - .../Objects/SentakkiHitObject.cs | 8 +- .../Objects/SentakkiLanedHitObject.cs | 5 +- .../Objects/SentakkiSlidePath.cs | 18 +- .../Objects/SlideBody.cs | 9 +- .../Objects/SlideBodyInfo.cs | 2 + .../Objects/SlidePathPart.cs | 2 +- .../Objects/SlidePaths.cs | 172 +-- osu.Game.Rulesets.Sentakki/Objects/Tap.cs | 4 +- .../Scoring/SentakkiHitWindows.cs | 4 +- .../Scoring/SentakkiScoreProcessor.cs | 5 +- .../Scoring/SentakkiSlideHitWindows.cs | 3 +- .../Scoring/SentakkiTouchHitWindows.cs | 3 +- .../SentakkiExtensions.cs | 7 + .../SentakkiInputManager.cs | 3 + osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs | 18 +- .../Statistics/JudgementChart.cs | 70 +- .../UI/Components/HitExplosion.cs | 10 +- .../Components/HitObjectLine/DrawableLine.cs | 3 +- .../HitObjectLine/LineLifetimeEntry.cs | 13 +- .../Components/HitObjectLine/LineRenderer.cs | 1 + .../UI/Components/LiveCounter.cs | 5 +- .../UI/Components/PlayfieldVisualization.cs | 1 + .../UI/Components/SentakkiRing.cs | 8 +- .../UI/DrawableSentakkiRuleset.cs | 3 +- osu.Game.Rulesets.Sentakki/UI/Lane.cs | 21 +- .../UI/LanedPlayfield.cs | 5 +- .../UI/SentakkiHitObjectLifetimeEntry.cs | 17 +- .../UI/SentakkiPlayfield.cs | 10 +- .../UI/SentakkiResumeOverlay.cs | 11 +- .../UI/SentakkiSettingsSubsection.cs | 5 +- .../UI/TouchPlayfield.cs | 4 +- 97 files changed, 1376 insertions(+), 1004 deletions(-) delete mode 100644 osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBlobs.cs delete mode 100644 osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TrianglesPiece.cs diff --git a/.editorconfig b/.editorconfig index d128964cc..e9f5d05a2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,8 +12,8 @@ trim_trailing_whitespace = true #PascalCase for public and protected members dotnet_naming_style.pascalcase.capitalization = pascal_case -dotnet_naming_symbols.public_members.applicable_accessibilities = public,internal,protected,protected_internal,private_protected -dotnet_naming_symbols.public_members.applicable_kinds = property,method,field,event +dotnet_naming_symbols.public_members.applicable_accessibilities = public, internal, protected, protected_internal, private_protected +dotnet_naming_symbols.public_members.applicable_kinds = property, method, field, event dotnet_naming_rule.public_members_pascalcase.severity = error dotnet_naming_rule.public_members_pascalcase.symbols = public_members dotnet_naming_rule.public_members_pascalcase.style = pascalcase @@ -22,7 +22,7 @@ dotnet_naming_rule.public_members_pascalcase.style = pascalcase dotnet_naming_style.camelcase.capitalization = camel_case dotnet_naming_symbols.private_members.applicable_accessibilities = private -dotnet_naming_symbols.private_members.applicable_kinds = property,method,field,event +dotnet_naming_symbols.private_members.applicable_kinds = property, method, field, event dotnet_naming_rule.private_members_camelcase.severity = warning dotnet_naming_rule.private_members_camelcase.symbols = private_members dotnet_naming_rule.private_members_camelcase.style = camelcase @@ -44,7 +44,7 @@ dotnet_naming_rule.private_const_all_lower.symbols = private_constants dotnet_naming_rule.private_const_all_lower.style = all_lower dotnet_naming_symbols.private_static_readonly.applicable_accessibilities = private -dotnet_naming_symbols.private_static_readonly.required_modifiers = static,readonly +dotnet_naming_symbols.private_static_readonly.required_modifiers = static, readonly dotnet_naming_symbols.private_static_readonly.applicable_kinds = field dotnet_naming_rule.private_static_readonly_all_lower.severity = warning dotnet_naming_rule.private_static_readonly_all_lower.symbols = private_static_readonly @@ -60,15 +60,15 @@ dotnet_naming_rule.local_const_all_lower.style = all_lower dotnet_naming_style.all_upper.capitalization = all_upper dotnet_naming_style.all_upper.word_separator = _ -dotnet_naming_symbols.public_constants.applicable_accessibilities = public,internal,protected,protected_internal,private_protected +dotnet_naming_symbols.public_constants.applicable_accessibilities = public, internal, protected, protected_internal, private_protected dotnet_naming_symbols.public_constants.required_modifiers = const dotnet_naming_symbols.public_constants.applicable_kinds = field dotnet_naming_rule.public_const_all_upper.severity = warning dotnet_naming_rule.public_const_all_upper.symbols = public_constants dotnet_naming_rule.public_const_all_upper.style = all_upper -dotnet_naming_symbols.public_static_readonly.applicable_accessibilities = public,internal,protected,protected_internal,private_protected -dotnet_naming_symbols.public_static_readonly.required_modifiers = static,readonly +dotnet_naming_symbols.public_static_readonly.applicable_accessibilities = public, internal, protected, protected_internal, private_protected +dotnet_naming_symbols.public_static_readonly.required_modifiers = static, readonly dotnet_naming_symbols.public_static_readonly.applicable_kinds = field dotnet_naming_rule.public_static_readonly_all_upper.severity = warning dotnet_naming_rule.public_static_readonly_all_upper.symbols = public_static_readonly @@ -126,7 +126,7 @@ csharp_style_var_elsewhere = true:silent #Style - modifiers dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning -csharp_preferred_modifier_order = public,private,protected,internal,new,abstract,virtual,sealed,override,static,readonly,extern,unsafe,volatile,async:warning +csharp_preferred_modifier_order = public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:warning #Style - parentheses # Skipped because roslyn cannot separate +-*/ with << >> diff --git a/Directory.Build.props b/Directory.Build.props index bb8d44598..7e55cac0a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,7 +16,7 @@ - - + + diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneAllSlides.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneAllSlides.cs index 9929fa153..dd5260473 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneAllSlides.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneAllSlides.cs @@ -36,7 +36,7 @@ public TestSceneAllSlides() Add(chevronPool = new DrawablePool(62)); Add(fanChevrons = new SlideFanChevrons()); - Add(new SentakkiRing() + Add(new SentakkiRing { RelativeSizeAxes = Axes.None, Size = new Vector2(SentakkiPlayfield.RINGSIZE) @@ -49,7 +49,7 @@ public TestSceneAllSlides() RefreshSlide(); }); - Add(nodes = new Container() + Add(nodes = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -68,6 +68,7 @@ protected void RefreshSlide() { slide.Path = CreatePattern(); nodes.Clear(); + foreach (var node in slide.Path.SlideSegments.SelectMany(s => s.ControlPoints)) { nodes.Add(new CircularContainer diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneFanSlide.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneFanSlide.cs index 7e8fbea03..48c583451 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneFanSlide.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneFanSlide.cs @@ -18,18 +18,16 @@ public partial class TestSceneFanSlide : OsuTestScene protected int StartPath; protected int EndPath; - private SentakkiRing ring; - [Cached] private readonly SlideFanChevrons fanChevrons; - private SlideVisual slide; + private readonly SlideVisual slide; public TestSceneFanSlide() { Add(fanChevrons = new SlideFanChevrons()); - Add(ring = new SentakkiRing() + Add(new SentakkiRing { RelativeSizeAxes = Axes.None, Size = new Vector2(SentakkiPlayfield.RINGSIZE) diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs index df691c615..cf2226104 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs @@ -36,12 +36,12 @@ public abstract partial class TestSceneSlide : OsuTestScene [Cached] private readonly SlideFanChevrons fanChevrons; - public TestSceneSlide() + protected TestSceneSlide() { Add(chevronPool = new DrawablePool(62)); Add(fanChevrons = new SlideFanChevrons()); - Add(new SentakkiRing() + Add(new SentakkiRing { RelativeSizeAxes = Axes.None, Size = new Vector2(SentakkiPlayfield.RINGSIZE) @@ -76,7 +76,7 @@ public TestSceneSlide() AddStep("Perform exit animation", () => slide.PerformExitAnimation(1000)); AddWaitStep("Wait for transforms", 5); - Add(nodes = new Container() + Add(nodes = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -95,6 +95,7 @@ protected void RefreshSlide() { slide.Path = CreatePattern(); nodes.Clear(); + foreach (var node in slide.Path.SlideSegments.SelectMany(s => s.ControlPoints)) { nodes.Add(new CircularContainer diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneBreakNote.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneBreakNote.cs index 038ab58ac..b0d998270 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneBreakNote.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneBreakNote.cs @@ -39,7 +39,7 @@ private void testSingle(bool auto = false) NoteColour = Color4.OrangeRed, }; - circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); + circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); Add(new DrawableTap(circle) { diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneHoldNote.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneHoldNote.cs index 1af842aec..e9398b520 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneHoldNote.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneHoldNote.cs @@ -45,7 +45,7 @@ private void testSingle(double duration, bool auto = false) EndTime = Time.Current + 1000 + duration, }; - circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); + circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); Add(new DrawableHold(circle) { diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs index d3e771c84..a52f5b546 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs @@ -32,7 +32,7 @@ public partial class TestSceneSlideFan : OsuTestScene public TestSceneSlideFan() { base.Content.Add(content = new SentakkiInputManager(new SentakkiRuleset().RulesetInfo)); - Add(new SentakkiRing() + Add(new SentakkiRing { RelativeSizeAxes = Axes.None, Size = new Vector2(SentakkiPlayfield.RINGSIZE), @@ -53,15 +53,16 @@ private void testSingle(double duration, bool auto = false) //Break = true, SlideInfoList = new List { - new SlideBodyInfo { - SlidePathParts = new[] {new SlideBodyPart(SlidePaths.PathShapes.Fan, 4, false)}, + new SlideBodyInfo + { + SlidePathParts = new[] { new SlideBodyPart(SlidePaths.PathShapes.Fan, 4, false) }, Duration = 1000, }, }, StartTime = Time.Current + 1000, }; - slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); + slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); DrawableSlide dSlide; @@ -74,8 +75,10 @@ private void testSingle(double duration, bool auto = false) }); foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects) + { foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects) nested2.Auto = auto; + } } } } diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs index 60fb7d489..5633f6e46 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs @@ -36,7 +36,7 @@ public partial class TestSceneSlideNote : OsuTestScene public TestSceneSlideNote() { base.Content.Add(content = new SentakkiInputManager(new SentakkiRuleset().RulesetInfo)); - Add(new SentakkiRing() + Add(new SentakkiRing { RelativeSizeAxes = Axes.None, Size = new Vector2(SentakkiPlayfield.RINGSIZE), @@ -66,23 +66,26 @@ private void testSingle(double duration, bool auto = false) //Break = true, SlideInfoList = new List { - new SlideBodyInfo { - SlidePathParts = new []{new SlideBodyPart(SlidePaths.PathShapes.Circle, 0, false)}, + new SlideBodyInfo + { + SlidePathParts = new[] { new SlideBodyPart(SlidePaths.PathShapes.Circle, 0, false) }, Duration = 1000, }, - new SlideBodyInfo { - SlidePathParts = new []{new SlideBodyPart(SlidePaths.PathShapes.Straight, 4, false)}, + new SlideBodyInfo + { + SlidePathParts = new[] { new SlideBodyPart(SlidePaths.PathShapes.Straight, 4, false) }, Duration = 1500, }, - new SlideBodyInfo { - SlidePathParts = new []{new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false)}, + new SlideBodyInfo + { + SlidePathParts = new[] { new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false) }, Duration = 2000, } }, StartTime = Time.Current + 1000, }; - slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); + slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); DrawableSlide dSlide; @@ -95,8 +98,10 @@ private void testSingle(double duration, bool auto = false) }); foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects) + { foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects) nested2.Auto = auto; + } } private void testChain(double duration, bool auto = false) @@ -106,8 +111,10 @@ private void testChain(double duration, bool auto = false) //Break = true, SlideInfoList = new List { - new SlideBodyInfo { - SlidePathParts = new []{ + new SlideBodyInfo + { + SlidePathParts = new[] + { new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false), new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false), new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false), @@ -119,7 +126,7 @@ private void testChain(double duration, bool auto = false) StartTime = Time.Current + 1000, }; - slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); + slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); DrawableSlide dSlide; @@ -132,9 +139,12 @@ private void testChain(double duration, bool auto = false) }); foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects) + { foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects) nested2.Auto = auto; + } } + private void testChainWithFan(double duration, bool auto = false) { var slide = new Slide @@ -142,8 +152,10 @@ private void testChainWithFan(double duration, bool auto = false) //Break = true, SlideInfoList = new List { - new SlideBodyInfo { - SlidePathParts = new []{ + new SlideBodyInfo + { + SlidePathParts = new[] + { new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false), new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false), new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false), @@ -156,7 +168,7 @@ private void testChainWithFan(double duration, bool auto = false) StartTime = Time.Current + 1000, }; - slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); + slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); DrawableSlide dSlide; @@ -169,8 +181,10 @@ private void testChainWithFan(double duration, bool auto = false) }); foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects) + { foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects) nested2.Auto = auto; + } } } } diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTapNote.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTapNote.cs index ba3851603..98dd9f484 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTapNote.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTapNote.cs @@ -34,7 +34,7 @@ private void testSingle(bool auto = false) StartTime = Time.Current + 1000, }; - circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); + circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); Add(new DrawableTap(circle) { diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTouchHold.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTouchHold.cs index c427a3f47..b5737e54f 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTouchHold.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTouchHold.cs @@ -35,12 +35,13 @@ private void testSingle(bool auto = false) { StartTime = Time.Current + 1000, Duration = 5000, - Samples = new List{ + Samples = new List + { new HitSampleInfo(HitSampleInfo.HIT_NORMAL) }, }; - circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); + circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); Add(new DrawableTouchHold(circle) { diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTouchNote.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTouchNote.cs index b15021ffa..c860e59f9 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTouchNote.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneTouchNote.cs @@ -25,7 +25,7 @@ public partial class TestSceneTouchNote : OsuTestScene public TestSceneTouchNote() { base.Content.Add(content = new SentakkiInputManager(new SentakkiRuleset().RulesetInfo)); - base.Content.Add(new SentakkiRing() + base.Content.Add(new SentakkiRing { RelativeSizeAxes = Axes.None, Size = new Vector2(SentakkiPlayfield.RINGSIZE) @@ -46,7 +46,7 @@ private void testAllPositions(bool auto = false) Position = position, }; - circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); + circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); Add(new DrawableTouch(circle) { diff --git a/osu.Game.Rulesets.Sentakki.Tests/Statistics/TestSceneJudgementChart.cs b/osu.Game.Rulesets.Sentakki.Tests/Statistics/TestSceneJudgementChart.cs index aaaf536fd..3f1494be0 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Statistics/TestSceneJudgementChart.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Statistics/TestSceneJudgementChart.cs @@ -10,49 +10,50 @@ namespace osu.Game.Rulesets.Sentakki.Tests.Statistics [TestFixture] public partial class TestSceneJudgementChart : OsuTestScene { - private List testevents = new List + private readonly List testevents = new List { // Tap - new HitEvent(0,HitResult.Great,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Great,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Great,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Great,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Great,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Great,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Ok,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Ok,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Ok,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Miss,new Tap(),new Tap(), null), - new HitEvent(0,HitResult.Miss,new Tap(),new Tap(), null), + new HitEvent(0, HitResult.Great, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Great, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Great, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Great, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Great, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Great, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Ok, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Ok, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Ok, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Miss, new Tap(), new Tap(), null), + new HitEvent(0, HitResult.Miss, new Tap(), new Tap(), null), // Holds - new HitEvent(0,HitResult.Great,new Hold(),new Tap(), null), - new HitEvent(0,HitResult.Great,new Hold(),new Tap(), null), + new HitEvent(0, HitResult.Great, new Hold(), new Tap(), null), + new HitEvent(0, HitResult.Great, new Hold(), new Tap(), null), // Touch - new HitEvent(0,HitResult.Good,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Good,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Good,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Good,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Ok,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Ok,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Ok,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Miss,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Miss,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Great,new Touch(),new Tap(), null), - new HitEvent(0,HitResult.Great,new Touch(),new Tap(), null), + new HitEvent(0, HitResult.Good, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Good, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Good, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Good, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Ok, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Ok, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Ok, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Miss, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Miss, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Great, new Touch(), new Tap(), null), + new HitEvent(0, HitResult.Great, new Touch(), new Tap(), null), // Breaks - new HitEvent(0,HitResult.Great,new Tap(){Break = true},new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(){Break = true},new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(){Break = true},new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(){Break = true},new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(){Break = true},new Tap(), null), - new HitEvent(0,HitResult.Good,new Tap(){Break = true},new Tap(), null), - new HitEvent(0,HitResult.Ok,new Tap(){Break = true},new Tap(), null), + new HitEvent(0, HitResult.Great, new Tap { Break = true }, new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap { Break = true }, new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap { Break = true }, new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap { Break = true }, new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap { Break = true }, new Tap(), null), + new HitEvent(0, HitResult.Good, new Tap { Break = true }, new Tap(), null), + new HitEvent(0, HitResult.Ok, new Tap { Break = true }, new Tap(), null), }; + public TestSceneJudgementChart() { Add(new JudgementChart(testevents)); diff --git a/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneHitExplosion.cs b/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneHitExplosion.cs index e724340b7..4b1e0b3ed 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneHitExplosion.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneHitExplosion.cs @@ -7,9 +7,9 @@ namespace osu.Game.Rulesets.Sentakki.Tests.UI [TestFixture] public partial class TestSceneHitExplosion : OsuTestScene { - private readonly HitExplosion explosion; public TestSceneHitExplosion() { + HitExplosion explosion; Add(explosion = new HitExplosion()); AddStep("Explode", () => { diff --git a/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneLineRenderer.cs b/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneLineRenderer.cs index 059fcb1f6..c4c8138aa 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneLineRenderer.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneLineRenderer.cs @@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Sentakki.Tests.UI [TestFixture] public partial class TestSceneLineRenderer : OsuTestScene { - private LineRenderer lineRenderer; + private readonly LineRenderer lineRenderer; protected override Ruleset CreateRuleset() => new SentakkiRuleset(); diff --git a/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneLiveCounter.cs b/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneLiveCounter.cs index 57465cf92..8cd9367f0 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneLiveCounter.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneLiveCounter.cs @@ -9,7 +9,8 @@ namespace osu.Game.Rulesets.Sentakki.Tests.UI public partial class TestSceneLiveCounter : OsuTestScene { private LiveCounter counter = null!; - private BindableInt lives = new BindableInt + + private readonly BindableInt lives = new BindableInt { MaxValue = 500, Value = 500 @@ -17,10 +18,7 @@ public partial class TestSceneLiveCounter : OsuTestScene public TestSceneLiveCounter() { - AddStep("Clear test", () => - { - Clear(); - }); + AddStep("Clear test", Clear); AddStep("Create counter", () => Add(counter = new LiveCounter(lives))); AddUntilStep("Counter loaded", () => counter.IsLoaded); diff --git a/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneSentakkiRing.cs b/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneSentakkiRing.cs index c55b003a2..678b02337 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneSentakkiRing.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/UI/TestSceneSentakkiRing.cs @@ -24,7 +24,7 @@ public TestSceneSentakkiRing() }); }); - AddStep("Create Ring", () => Add(ring = new SentakkiRing() + AddStep("Create Ring", () => Add(ring = new SentakkiRing { RelativeSizeAxes = Axes.None, Size = new Vector2(SentakkiPlayfield.RINGSIZE) @@ -33,7 +33,10 @@ public TestSceneSentakkiRing() AddUntilStep("Ring loaded", () => ring.IsLoaded && ring.Alpha == 1); AddToggleStep("Toggle notestart Indicators", b => ring.NoteStartIndicators.Value = b); AddRepeatStep("Trigger Kiai Beat", () => ring.KiaiBeat(), 5); - AddSliderStep("Test opacity", 0, 1, 1, f => { if (ring != null) ring.RingOpacity.Value = f; }); + AddSliderStep("Test opacity", 0, 1, 1, f => + { + if (ring != null) ring.RingOpacity.Value = f; + }); } } } diff --git a/osu.Game.Rulesets.Sentakki.Tests/osu.Game.Rulesets.Sentakki.Tests.csproj b/osu.Game.Rulesets.Sentakki.Tests/osu.Game.Rulesets.Sentakki.Tests.csproj index 4ccb5fe24..4ca5c341c 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/osu.Game.Rulesets.Sentakki.Tests.csproj +++ b/osu.Game.Rulesets.Sentakki.Tests/osu.Game.Rulesets.Sentakki.Tests.csproj @@ -3,20 +3,20 @@ osu.Game.Rulesets.Sentakki.Tests.VisualTestRunner - + false osu.Game.Rulesets.Sentakki.Tests - - - + + + - + WinExe diff --git a/osu.Game.Rulesets.Sentakki.sln.DotSettings b/osu.Game.Rulesets.Sentakki.sln.DotSettings index b4aa6b2a8..ba8472937 100644 --- a/osu.Game.Rulesets.Sentakki.sln.DotSettings +++ b/osu.Game.Rulesets.Sentakki.sln.DotSettings @@ -7,17 +7,23 @@ ExplicitlyExcluded SOLUTION WARNING + WARNING + WARNING WARNING WARNING HINT HINT WARNING - + WARNING + WARNING + WARNING True WARNING WARNING HINT - HINT + DO_NOT_SHOW + WARNING + WARNING HINT HINT WARNING @@ -29,7 +35,7 @@ WARNING WARNING WARNING - WARNING + WARNING WARNING WARNING WARNING @@ -57,24 +63,42 @@ HINT HINT WARNING + DO_NOT_SHOW WARNING WARNING + WARNING WARNING + DO_NOT_SHOW WARNING WARNING WARNING - HINT + DO_NOT_SHOW + WARNING + WARNING + WARNING WARNING WARNING HINT WARNING + HINT + DO_NOT_SHOW WARNING - DO_NOT_SHOW + DO_NOT_SHOW + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING HINT WARNING DO_NOT_SHOW WARNING HINT + DO_NOT_SHOW + HINT HINT HINT ERROR @@ -91,27 +115,38 @@ HINT HINT WARNING + DO_NOT_SHOW + DO_NOT_SHOW WARNING + WARNING + WARNING WARNING WARNING WARNING WARNING WARNING WARNING + HINT WARNING WARNING WARNING WARNING HINT + HINT WARNING + HINT + HINT HINT HINT HINT + DO_NOT_SHOW HINT HINT WARNING + HINT + HINT WARNING - HINT + WARNING WARNING WARNING WARNING @@ -120,11 +155,13 @@ DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW - WARNING - + WARNING + WARNING WARNING WARNING WARNING + WARNING + WARNING WARNING WARNING ERROR @@ -171,7 +208,7 @@ WARNING WARNING WARNING - HINT + WARNING WARNING WARNING WARNING @@ -181,9 +218,14 @@ WARNING WARNING WARNING + WARNING HINT - DO_NOT_SHOW + WARNING + WARNING + SUGGESTION DO_NOT_SHOW + + True DO_NOT_SHOW WARNING WARNING @@ -199,12 +241,17 @@ HINT HINT HINT - HINT + HINT + HINT + DO_NOT_SHOW WARNING + WARNING WARNING WARNING + WARNING WARNING + WARNING True WARNING @@ -216,11 +263,22 @@ HINT WARNING WARNING - <?xml version="1.0" encoding="utf-16"?><Profile name="Code Cleanup (peppy)"><CSArrangeThisQualifier>True</CSArrangeThisQualifier><CSUseVar><BehavourStyle>CAN_CHANGE_TO_EXPLICIT</BehavourStyle><LocalVariableStyle>ALWAYS_EXPLICIT</LocalVariableStyle><ForeachVariableStyle>ALWAYS_EXPLICIT</ForeachVariableStyle></CSUseVar><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSUpdateFileHeader>True</CSUpdateFileHeader><CSCodeStyleAttributes ArrangeTypeAccessModifier="False" ArrangeTypeMemberAccessModifier="False" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="False" ArrangeBraces="False" ArrangeAttributes="False" ArrangeArgumentsStyle="False" /><XAMLCollapseSentakkiScrollingTags>False</XAMLCollapseSentakkiScrollingTags><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CSArrangeQualifiers>True</CSArrangeQualifiers></Profile> + <?xml version="1.0" encoding="utf-16"?><Profile name="Code Cleanup (peppy)"><CSArrangeThisQualifier>True</CSArrangeThisQualifier><CSUseVar><BehavourStyle>CAN_CHANGE_TO_EXPLICIT</BehavourStyle><LocalVariableStyle>ALWAYS_EXPLICIT</LocalVariableStyle><ForeachVariableStyle>ALWAYS_EXPLICIT</ForeachVariableStyle></CSUseVar><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSUpdateFileHeader>True</CSUpdateFileHeader><CSCodeStyleAttributes ArrangeTypeAccessModifier="False" ArrangeTypeMemberAccessModifier="False" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="False" ArrangeBraces="False" ArrangeAttributes="False" ArrangeArgumentsStyle="False" /><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CSArrangeQualifiers>True</CSArrangeQualifiers></Profile> Code Cleanup (peppy) + RequiredForMultiline + RequiredForMultiline + RequiredForMultiline + RequiredForMultiline + RequiredForMultiline + RequiredForMultiline + RequiredForMultiline + RequiredForMultiline + Explicit ExpressionBody - ExpressionBody + BlockBody + ExplicitlyTyped True + NEXT_LINE True True True @@ -232,14 +290,24 @@ NEXT_LINE 1 1 + NEXT_LINE + MULTILINE + True + True + True + True NEXT_LINE 1 1 True + NEXT_LINE NEVER NEVER + True False + True NEVER + False False True False @@ -247,22 +315,32 @@ True True False + False CHOP_IF_LONG True 200 CHOP_IF_LONG + UseExplicitType + UseVarWhenEvident + UseVarWhenEvident False False AABB API BPM + EF + FPS GC GL GLSL HID + HSPA + HSV + HTML HUD ID IL + IOS IP IPC JIT @@ -273,400 +351,401 @@ PM RGB RNG + SDL SHA SRGB TK - SS - PP - GMT - QAT - BNG + SS + PP + GMT + QAT + BNG UI False HINT <?xml version="1.0" encoding="utf-16"?> <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> - <TypePattern DisplayName="COM interfaces or structs"> - <TypePattern.Match> - <Or> - <And> - <Kind Is="Interface" /> - <Or> - <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" /> - <HasAttribute Name="System.Runtime.InteropServices.ComImport" /> - </Or> - </And> - <Kind Is="Struct" /> - </Or> - </TypePattern.Match> - </TypePattern> - <TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All"> - <TypePattern.Match> - <And> - <Kind Is="Class" /> - <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="True" /> - </And> - </TypePattern.Match> - <Entry DisplayName="Setup/Teardown Methods"> - <Entry.Match> - <And> - <Kind Is="Method" /> - <Or> - <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="True" /> - <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="True" /> - <HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="True" /> - <HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="True" /> - </Or> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="All other members" /> - <Entry Priority="100" DisplayName="Test Methods"> - <Entry.Match> - <And> - <Kind Is="Method" /> - <HasAttribute Name="NUnit.Framework.TestAttribute" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Name /> - </Entry.SortBy> - </Entry> - </TypePattern> - <TypePattern DisplayName="Default Pattern"> - <Group DisplayName="Fields/Properties"> - <Group DisplayName="Public Fields"> - <Entry DisplayName="Constant Fields"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Or> - <Kind Is="Constant" /> - <Readonly /> - <And> - <Static /> - <Readonly /> - </And> - </Or> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Static Fields"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Static /> - <Not> - <Readonly /> - </Not> - <Kind Is="Field" /> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Normal Fields"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Not> - <Or> - <Static /> - <Readonly /> - </Or> - </Not> - <Kind Is="Field" /> - </And> - </Entry.Match> - </Entry> - </Group> - <Entry DisplayName="Public Properties"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Kind Is="Property" /> - </And> - </Entry.Match> - </Entry> - <Group DisplayName="Internal Fields"> - <Entry DisplayName="Constant Fields"> - <Entry.Match> - <And> - <Access Is="Internal" /> - <Or> - <Kind Is="Constant" /> - <Readonly /> - <And> - <Static /> - <Readonly /> - </And> - </Or> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Static Fields"> - <Entry.Match> - <And> - <Access Is="Internal" /> - <Static /> - <Not> - <Readonly /> - </Not> - <Kind Is="Field" /> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Normal Fields"> - <Entry.Match> - <And> - <Access Is="Internal" /> - <Not> - <Or> - <Static /> - <Readonly /> - </Or> - </Not> - <Kind Is="Field" /> - </And> - </Entry.Match> - </Entry> - </Group> - <Entry DisplayName="Internal Properties"> - <Entry.Match> - <And> - <Access Is="Internal" /> - <Kind Is="Property" /> - </And> - </Entry.Match> - </Entry> - <Group DisplayName="Protected Fields"> - <Entry DisplayName="Constant Fields"> - <Entry.Match> - <And> - <Access Is="Protected" /> - <Or> - <Kind Is="Constant" /> - <Readonly /> - <And> - <Static /> - <Readonly /> - </And> - </Or> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Static Fields"> - <Entry.Match> - <And> - <Access Is="Protected" /> - <Static /> - <Not> - <Readonly /> - </Not> - <Kind Is="Field" /> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Normal Fields"> - <Entry.Match> - <And> - <Access Is="Protected" /> - <Not> - <Or> - <Static /> - <Readonly /> - </Or> - </Not> - <Kind Is="Field" /> - </And> - </Entry.Match> - </Entry> - </Group> - <Entry DisplayName="Protected Properties"> - <Entry.Match> - <And> - <Access Is="Protected" /> - <Kind Is="Property" /> - </And> - </Entry.Match> - </Entry> - <Group DisplayName="Private Fields"> - <Entry DisplayName="Constant Fields"> - <Entry.Match> - <And> - <Access Is="Private" /> - <Or> - <Kind Is="Constant" /> - <Readonly /> - <And> - <Static /> - <Readonly /> - </And> - </Or> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Static Fields"> - <Entry.Match> - <And> - <Access Is="Private" /> - <Static /> - <Not> - <Readonly /> - </Not> - <Kind Is="Field" /> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Normal Fields"> - <Entry.Match> - <And> - <Access Is="Private" /> - <Not> - <Or> - <Static /> - <Readonly /> - </Or> - </Not> - <Kind Is="Field" /> - </And> - </Entry.Match> - </Entry> - </Group> - <Entry DisplayName="Private Properties"> - <Entry.Match> - <And> - <Access Is="Private" /> - <Kind Is="Property" /> - </And> - </Entry.Match> - </Entry> - </Group> - <Group DisplayName="Constructor/Destructor"> - <Entry DisplayName="Ctor"> - <Entry.Match> - <Kind Is="Constructor" /> - </Entry.Match> - </Entry> - <Region Name="Disposal"> - <Entry DisplayName="Dtor"> - <Entry.Match> - <Kind Is="Destructor" /> - </Entry.Match> - </Entry> - <Entry DisplayName="Dispose()"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Kind Is="Method" /> - <Name Is="Dispose" /> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Dispose(true)"> - <Entry.Match> - <And> - <Access Is="Protected" /> - <Or> - <Virtual /> - <Override /> - </Or> - <Kind Is="Method" /> - <Name Is="Dispose" /> - </And> - </Entry.Match> - </Entry> - </Region> - </Group> - <Group DisplayName="Methods"> - <Group DisplayName="Public"> - <Entry DisplayName="Static Methods"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Static /> - <Kind Is="Method" /> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Methods"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Not> - <Static /> - </Not> - <Kind Is="Method" /> - </And> - </Entry.Match> - </Entry> - </Group> - <Group DisplayName="Internal"> - <Entry DisplayName="Static Methods"> - <Entry.Match> - <And> - <Access Is="Internal" /> - <Static /> - <Kind Is="Method" /> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Methods"> - <Entry.Match> - <And> - <Access Is="Internal" /> - <Not> - <Static /> - </Not> - <Kind Is="Method" /> - </And> - </Entry.Match> - </Entry> - </Group> - <Group DisplayName="Protected"> - <Entry DisplayName="Static Methods"> - <Entry.Match> - <And> - <Access Is="Protected" /> - <Static /> - <Kind Is="Method" /> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Methods"> - <Entry.Match> - <And> - <Access Is="Protected" /> - <Not> - <Static /> - </Not> - <Kind Is="Method" /> - </And> - </Entry.Match> - </Entry> - </Group> - <Group DisplayName="Private"> - <Entry DisplayName="Static Methods"> - <Entry.Match> - <And> - <Access Is="Private" /> - <Static /> - <Kind Is="Method" /> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="Methods"> - <Entry.Match> - <And> - <Access Is="Private" /> - <Not> - <Static /> - </Not> - <Kind Is="Method" /> - </And> - </Entry.Match> - </Entry> - </Group> - </Group> - </TypePattern> + <TypePattern DisplayName="COM interfaces or structs"> + <TypePattern.Match> + <Or> + <And> + <Kind Is="Interface" /> + <Or> + <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" /> + <HasAttribute Name="System.Runtime.InteropServices.ComImport" /> + </Or> + </And> + <Kind Is="Struct" /> + </Or> + </TypePattern.Match> + </TypePattern> + <TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All"> + <TypePattern.Match> + <And> + <Kind Is="Class" /> + <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="True" /> + </And> + </TypePattern.Match> + <Entry DisplayName="Setup/Teardown Methods"> + <Entry.Match> + <And> + <Kind Is="Method" /> + <Or> + <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="True" /> + </Or> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="All other members" /> + <Entry Priority="100" DisplayName="Test Methods"> + <Entry.Match> + <And> + <Kind Is="Method" /> + <HasAttribute Name="NUnit.Framework.TestAttribute" /> + </And> + </Entry.Match> + <Entry.SortBy> + <Name /> + </Entry.SortBy> + </Entry> + </TypePattern> + <TypePattern DisplayName="Default Pattern"> + <Group DisplayName="Fields/Properties"> + <Group DisplayName="Public Fields"> + <Entry DisplayName="Constant Fields"> + <Entry.Match> + <And> + <Access Is="Public" /> + <Or> + <Kind Is="Constant" /> + <Readonly /> + <And> + <Static /> + <Readonly /> + </And> + </Or> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Static Fields"> + <Entry.Match> + <And> + <Access Is="Public" /> + <Static /> + <Not> + <Readonly /> + </Not> + <Kind Is="Field" /> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Normal Fields"> + <Entry.Match> + <And> + <Access Is="Public" /> + <Not> + <Or> + <Static /> + <Readonly /> + </Or> + </Not> + <Kind Is="Field" /> + </And> + </Entry.Match> + </Entry> + </Group> + <Entry DisplayName="Public Properties"> + <Entry.Match> + <And> + <Access Is="Public" /> + <Kind Is="Property" /> + </And> + </Entry.Match> + </Entry> + <Group DisplayName="Internal Fields"> + <Entry DisplayName="Constant Fields"> + <Entry.Match> + <And> + <Access Is="Internal" /> + <Or> + <Kind Is="Constant" /> + <Readonly /> + <And> + <Static /> + <Readonly /> + </And> + </Or> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Static Fields"> + <Entry.Match> + <And> + <Access Is="Internal" /> + <Static /> + <Not> + <Readonly /> + </Not> + <Kind Is="Field" /> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Normal Fields"> + <Entry.Match> + <And> + <Access Is="Internal" /> + <Not> + <Or> + <Static /> + <Readonly /> + </Or> + </Not> + <Kind Is="Field" /> + </And> + </Entry.Match> + </Entry> + </Group> + <Entry DisplayName="Internal Properties"> + <Entry.Match> + <And> + <Access Is="Internal" /> + <Kind Is="Property" /> + </And> + </Entry.Match> + </Entry> + <Group DisplayName="Protected Fields"> + <Entry DisplayName="Constant Fields"> + <Entry.Match> + <And> + <Access Is="Protected" /> + <Or> + <Kind Is="Constant" /> + <Readonly /> + <And> + <Static /> + <Readonly /> + </And> + </Or> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Static Fields"> + <Entry.Match> + <And> + <Access Is="Protected" /> + <Static /> + <Not> + <Readonly /> + </Not> + <Kind Is="Field" /> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Normal Fields"> + <Entry.Match> + <And> + <Access Is="Protected" /> + <Not> + <Or> + <Static /> + <Readonly /> + </Or> + </Not> + <Kind Is="Field" /> + </And> + </Entry.Match> + </Entry> + </Group> + <Entry DisplayName="Protected Properties"> + <Entry.Match> + <And> + <Access Is="Protected" /> + <Kind Is="Property" /> + </And> + </Entry.Match> + </Entry> + <Group DisplayName="Private Fields"> + <Entry DisplayName="Constant Fields"> + <Entry.Match> + <And> + <Access Is="Private" /> + <Or> + <Kind Is="Constant" /> + <Readonly /> + <And> + <Static /> + <Readonly /> + </And> + </Or> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Static Fields"> + <Entry.Match> + <And> + <Access Is="Private" /> + <Static /> + <Not> + <Readonly /> + </Not> + <Kind Is="Field" /> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Normal Fields"> + <Entry.Match> + <And> + <Access Is="Private" /> + <Not> + <Or> + <Static /> + <Readonly /> + </Or> + </Not> + <Kind Is="Field" /> + </And> + </Entry.Match> + </Entry> + </Group> + <Entry DisplayName="Private Properties"> + <Entry.Match> + <And> + <Access Is="Private" /> + <Kind Is="Property" /> + </And> + </Entry.Match> + </Entry> + </Group> + <Group DisplayName="Constructor/Destructor"> + <Entry DisplayName="Ctor"> + <Entry.Match> + <Kind Is="Constructor" /> + </Entry.Match> + </Entry> + <Region Name="Disposal"> + <Entry DisplayName="Dtor"> + <Entry.Match> + <Kind Is="Destructor" /> + </Entry.Match> + </Entry> + <Entry DisplayName="Dispose()"> + <Entry.Match> + <And> + <Access Is="Public" /> + <Kind Is="Method" /> + <Name Is="Dispose" /> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Dispose(true)"> + <Entry.Match> + <And> + <Access Is="Protected" /> + <Or> + <Virtual /> + <Override /> + </Or> + <Kind Is="Method" /> + <Name Is="Dispose" /> + </And> + </Entry.Match> + </Entry> + </Region> + </Group> + <Group DisplayName="Methods"> + <Group DisplayName="Public"> + <Entry DisplayName="Static Methods"> + <Entry.Match> + <And> + <Access Is="Public" /> + <Static /> + <Kind Is="Method" /> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Methods"> + <Entry.Match> + <And> + <Access Is="Public" /> + <Not> + <Static /> + </Not> + <Kind Is="Method" /> + </And> + </Entry.Match> + </Entry> + </Group> + <Group DisplayName="Internal"> + <Entry DisplayName="Static Methods"> + <Entry.Match> + <And> + <Access Is="Internal" /> + <Static /> + <Kind Is="Method" /> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Methods"> + <Entry.Match> + <And> + <Access Is="Internal" /> + <Not> + <Static /> + </Not> + <Kind Is="Method" /> + </And> + </Entry.Match> + </Entry> + </Group> + <Group DisplayName="Protected"> + <Entry DisplayName="Static Methods"> + <Entry.Match> + <And> + <Access Is="Protected" /> + <Static /> + <Kind Is="Method" /> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Methods"> + <Entry.Match> + <And> + <Access Is="Protected" /> + <Not> + <Static /> + </Not> + <Kind Is="Method" /> + </And> + </Entry.Match> + </Entry> + </Group> + <Group DisplayName="Private"> + <Entry DisplayName="Static Methods"> + <Entry.Match> + <And> + <Access Is="Private" /> + <Static /> + <Kind Is="Method" /> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="Methods"> + <Entry.Match> + <And> + <Access Is="Private" /> + <Not> + <Static /> + </Not> + <Kind Is="Method" /> + </And> + </Entry.Match> + </Entry> + </Group> + </Group> + </TypePattern> </Patterns> <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> <Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /> @@ -723,6 +802,17 @@ <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + + True + True + True + True + True + True + True + True + True + True True True True @@ -733,6 +823,7 @@ True True True + TestFolder True True o!f – Object Initializer: Anchor&Origin @@ -758,7 +849,7 @@ Origin = Anchor.$anchor$, True InternalChildren = new Drawable[] { - $END$ + $END$ }; True True @@ -771,12 +862,12 @@ Origin = Anchor.$anchor$, True new GridContainer { - RelativeSizeAxes = Axes.Both, - Content = new[] - { - new Drawable[] { $END$ }, - new Drawable[] { } - } + RelativeSizeAxes = Axes.Both, + Content = new[] + { + new Drawable[] { $END$ }, + new Drawable[] { } + } }; True True @@ -789,12 +880,12 @@ Origin = Anchor.$anchor$, True new FillFlowContainer { - RelativeSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Children = new Drawable[] - { - $END$ - } + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + $END$ + } }, True True @@ -807,11 +898,11 @@ Origin = Anchor.$anchor$, True new Container { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - $END$ - } + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + $END$ + } }, True True @@ -825,7 +916,7 @@ Origin = Anchor.$anchor$, [BackgroundDependencyLoader] private void load() { - $END$ + $END$ } True True @@ -838,8 +929,8 @@ private void load() True new Box { - Colour = Color4.Black, - RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + RelativeSizeAxes = Axes.Both, }, True True @@ -852,23 +943,84 @@ private void load() True Children = new Drawable[] { - $END$ + $END$ }; + True True True + True True True + True True + True + True + True + True + True + True + True + True True + True + True + True True + True + True + True + True True + True + True + True + True + True True True + True + True True True + True + True + True + True + True + True + True + True True + True + True + True + True + True + True + True + True + True True + True + True + True True True + True + True + True + True + True + True + True + True True - True + True + True + True + True + True + True + True + True + True \ No newline at end of file diff --git a/osu.Game.Rulesets.Sentakki/Beatmaps/SentakkiBeatmapConverter.cs b/osu.Game.Rulesets.Sentakki/Beatmaps/SentakkiBeatmapConverter.cs index 6aaa454c8..aee6bbdc9 100644 --- a/osu.Game.Rulesets.Sentakki/Beatmaps/SentakkiBeatmapConverter.cs +++ b/osu.Game.Rulesets.Sentakki/Beatmaps/SentakkiBeatmapConverter.cs @@ -30,16 +30,20 @@ public class SentakkiBeatmapConverter : BeatmapConverter public bool ClassicMode; public static readonly List VALID_TOUCH_POSITIONS; + static SentakkiBeatmapConverter() { - var tmp = new List(){ + var tmp = new List + { Vector2.Zero }; + foreach (float angle in SentakkiPlayfield.LANEANGLES) { tmp.Add(SentakkiExtensions.GetCircularPosition(190, angle - 22.5f)); tmp.Add(SentakkiExtensions.GetCircularPosition(130, angle)); } + VALID_TOUCH_POSITIONS = tmp; } @@ -79,16 +83,19 @@ protected override IEnumerable ConvertHitObject(HitObject ori switch (original) { - case IHasPathWithRepeats _: + case IHasPathWithRepeats: return convertSlider(original); - case IHasDuration _: + + case IHasDuration: return convertSpinner(original); + default: return convertHitCircle(original); } } #region std -> sentakki conversion rules + private IEnumerable convertHitCircle(HitObject original) { bool breakNote = original.Samples.Any(s => s.Name == HitSampleInfo.HIT_FINISH); @@ -109,13 +116,16 @@ private IEnumerable convertHitCircle(HitObject original) private IEnumerable convertSpinner(HitObject original) { IHasDuration spinner = (IHasDuration)original; + if (spinner.Duration >= 100) { if (!ClassicMode) yield return createTouchHold(original); else + { foreach (var ho in convertSlider(original)) yield return ho; + } } else { @@ -137,11 +147,13 @@ private IEnumerable convertSlider(HitObject original) if (original is IHasPathWithRepeats sl) nodeSamples = sl.NodeSamples; else + { nodeSamples = new List> { original.Samples, original.Samples }; + } // Check properties for tap foreach (var sample in nodeSamples[0]) @@ -169,6 +181,7 @@ private IEnumerable convertSlider(HitObject original) if (special && slider.Duration >= 350) { var result = tryConvertSliderToSlide(original, nodeSamples, twin, breakHead, breakTail).ToList(); + if (result.Any()) { foreach (var ho in result) @@ -180,19 +193,25 @@ private IEnumerable convertSlider(HitObject original) // Fallback to hold notes if (EnabledExperiments.HasFlag(ConversionExperiments.twinNotes)) + { if (twin) yield return createHoldNote(original, nodeSamples, true, breakHead); else + { foreach (var note in createTapsFromNodes(original, nodeSamples)) yield return note; + } + } yield return createHoldNote(original, nodeSamples, false, breakHead); } - private IEnumerable tryConvertSliderToSlide(HitObject original, IList> nodeSamples, bool twin = false, bool hasBreakHead = false, bool hasBreakTail = false) + private IEnumerable tryConvertSliderToSlide(HitObject original, IList> nodeSamples, bool twin = false, bool hasBreakHead = false, + bool hasBreakTail = false) { List slides = new List(); List taps = new List(); + if (EnabledExperiments.HasFlag(ConversionExperiments.twinSlides)) { if (twin) @@ -207,11 +226,14 @@ private IEnumerable tryConvertSliderToSlide(HitObject origina // If there is a SlideFan, we always prioritize that, and ignore the rest foreach (var slide in slides) + { if (slide.SlideInfoList[0].SlidePathParts[0].Shape == SlidePaths.PathShapes.Fan) { yield return slide; + yield break; } + } // If both slides have the same start lane, we attempt to merge them if (slides.Count == 2 && slides[0].Lane == slides[1].Lane) @@ -269,15 +291,14 @@ private SentakkiHitObject createTouchNote(HitObject original) { if (endTimes.TryGetValue(v, out double endTime)) return original.StartTime >= endTime; + return true; }); // Choosing a position - Vector2 position; - if (availableTouchPositions.Any()) - position = availableTouchPositions.ElementAt(patternGenerator.RNG.Next(0, availableTouchPositions.Count())); - else - position = endTimes.OrderBy(x => x.Value).First().Key; + var position = availableTouchPositions.Any() + ? availableTouchPositions.ElementAt(patternGenerator.RNG.Next(0, availableTouchPositions.Count())) + : endTimes.OrderBy(x => x.Value).First().Key; endTimes[position] = original.StartTime + 500; @@ -296,7 +317,7 @@ private SentakkiHitObject createSlideNote(HitObject original, IList ((IHasDuration)original).Duration >= p.MinDuration && ((IHasDuration)original).Duration <= p.MinDuration * 10) - .Select(t => t.parameters); + .Select(t => t.parameters); if (!EnabledExperiments.HasFlag(ConversionExperiments.fanSlides)) pathEnumerable = pathEnumerable.Where(s => s.Shape != SlidePaths.PathShapes.Fan); @@ -305,14 +326,16 @@ private SentakkiHitObject createSlideNote(HitObject original, IList{ + SlideInfoList = new List + { new SlideBodyInfo { - SlidePathParts = new SlideBodyPart[]{selectedPath}, + SlidePathParts = new[] { selectedPath }, Duration = ((IHasDuration)original).Duration, Break = hasBreakTail, ShootDelay = 0.5f, @@ -363,7 +386,8 @@ private IEnumerable createTapsFromNodes(HitObject original, IList> patternlist => new List>{ + private List> patternlist => new List> + { //Stream pattern, lane difference determined by offset2 - (twin)=> { - if(twin) return offset + 4; - else offset+=offset2; + twin => + { + if (twin) return offset + 4; + else offset += offset2; + return offset; }, // Back and forth, works better with longer combos // Lane difference determined by offset2, but will make sure offset2 is never 0. - (twin)=>{ + twin => + { offset2 = offset2 == 0 ? 1 : offset2; - offset+=offset2 * (twin ? 2: 1); - offset2= -offset2; + offset += offset2 * (twin ? 2 : 1); + offset2 = -offset2; return offset; } diff --git a/osu.Game.Rulesets.Sentakki/Configuration/LaneInputMode.cs b/osu.Game.Rulesets.Sentakki/Configuration/LaneInputMode.cs index 95a478ab1..3928c1593 100644 --- a/osu.Game.Rulesets.Sentakki/Configuration/LaneInputMode.cs +++ b/osu.Game.Rulesets.Sentakki/Configuration/LaneInputMode.cs @@ -1,4 +1,3 @@ - using osu.Framework.Localisation; using osu.Game.Rulesets.Sentakki.Localisation; diff --git a/osu.Game.Rulesets.Sentakki/Difficulty/SentakkiDifficultyCalculator.cs b/osu.Game.Rulesets.Sentakki/Difficulty/SentakkiDifficultyCalculator.cs index f1e828dbe..3a79ee75a 100644 --- a/osu.Game.Rulesets.Sentakki/Difficulty/SentakkiDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Sentakki/Difficulty/SentakkiDifficultyCalculator.cs @@ -11,11 +11,15 @@ namespace osu.Game.Rulesets.Sentakki.Difficulty { public class SentakkiDifficultyCalculator : DifficultyCalculator { - public SentakkiDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap) : base(ruleset, beatmap) { } + public SentakkiDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap) + : base(ruleset, beatmap) + { + } protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate) { int maxCombo = 0; + foreach (SentakkiHitObject h in beatmap.HitObjects) { switch (h) @@ -23,12 +27,15 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat case Slide slide: maxCombo += 1 + slide.SlideInfoList.Count + (slide.Break ? 4 : 0); break; + case Hold hold: maxCombo += 2 + (hold.Break ? 8 : 0); break; + case Tap tap: maxCombo += 1 + (tap.Break ? 4 : 0); break; + default: ++maxCombo; break; diff --git a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModAutoTouchStrings.cs b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModAutoTouchStrings.cs index c52862609..8688c1440 100644 --- a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModAutoTouchStrings.cs +++ b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModAutoTouchStrings.cs @@ -6,7 +6,8 @@ public static class SentakkiModAutoTouchStrings { private const string prefix = @"osu.Game.Rulesets.Sentakki.Resources.Localisation.Mods.SentakkiModAutoTouchStrings"; - public static LocalisableString ModDescription => new TranslatableString(getKey(@"mod_description"), @"Focus on the laned notes. Touch notes and Slide bodies will be automatically completed."); + public static LocalisableString ModDescription => + new TranslatableString(getKey(@"mod_description"), @"Focus on the laned notes. Touch notes and Slide bodies will be automatically completed."); private static string getKey(string key) => $"{prefix}:{key}"; } diff --git a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModChallengeStrings.cs b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModChallengeStrings.cs index 74c3ef6b1..de5067459 100644 --- a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModChallengeStrings.cs +++ b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModChallengeStrings.cs @@ -12,6 +12,7 @@ public static class SentakkiModChallengeStrings /// "Number of Lives" /// public static LocalisableString NumberOfLives => new TranslatableString(getKey(@"number_of_lives"), @"Number of lives"); + public static LocalisableString NumberOfLivesDescription => new TranslatableString(getKey(@"number_of_lives_description"), @"The number of lives you start with."); private static string getKey(string key) => $"{prefix}:{key}"; diff --git a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModExperimentalStrings.cs b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModExperimentalStrings.cs index 16d58bd47..4bff54895 100644 --- a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModExperimentalStrings.cs +++ b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModExperimentalStrings.cs @@ -6,24 +6,29 @@ public static class SentakkiModExperimentalStrings { private const string prefix = @"osu.Game.Rulesets.Sentakki.Resources.Localisation.Mods.SentakkiModExperimentalStrings"; - public static LocalisableString ModDescription => new TranslatableString(getKey(@"mod_description"), @"Some experimental features to be added to future sentakki builds. Autoplay/No-Fail recommended. Replays unsupported."); + public static LocalisableString ModDescription => new TranslatableString(getKey(@"mod_description"), + @"Some experimental features to be added to future sentakki builds. Autoplay/No-Fail recommended. Replays unsupported."); /// /// "Twin Notes" /// public static LocalisableString TwinNotes => new TranslatableString(getKey(@"twin_notes"), @"Twin notes"); + public static LocalisableString TwinNotesDescription => new TranslatableString(getKey(@"twin_notes_description"), @"Allow more than one note to share the same times (Requires multitouch)"); /// /// "Twin Slides" /// public static LocalisableString TwinSlides => new TranslatableString(getKey(@"twin_slides"), @"Twin slides"); - public static LocalisableString TwinSlidesDescription => new TranslatableString(getKey(@"twin_slides_description"), @"Allow more than one Slide-body to share the same time and origin (Requires multitouch)"); + + public static LocalisableString TwinSlidesDescription => + new TranslatableString(getKey(@"twin_slides_description"), @"Allow more than one Slide-body to share the same time and origin (Requires multitouch)"); /// /// "Fan Slides" /// public static LocalisableString FanSlides => new TranslatableString(getKey(@"fan_slides"), @"Fan slides"); + public static LocalisableString FanSlidesDescription => new TranslatableString(getKey(@"fan_slides_description"), @"Allow fan slides to occasionally appear (Requires multitouch)"); private static string getKey(string key) => $"{prefix}:{key}"; diff --git a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModMirrorStrings.cs b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModMirrorStrings.cs index 8ec4ddea7..4a57db54c 100644 --- a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModMirrorStrings.cs +++ b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModMirrorStrings.cs @@ -12,12 +12,14 @@ public static class SentakkiModMirrorStrings /// "⇅ Mirror vertically" /// public static LocalisableString MirrorVertically => new TranslatableString(getKey(@"mirror_vertically"), @"⇅ Mirror vertically"); + public static LocalisableString MirrorVerticallyDescription => new TranslatableString(getKey(@"mirror_vertically_description"), @"Mirror entire playfield across the x-axis"); /// /// "⇆ Mirror horizontally" /// public static LocalisableString MirrorHorizontally => new TranslatableString(getKey(@"mirror_horizontally"), @"⇆ Mirror horizontally"); + public static LocalisableString MirrorHorizontallyDescription => new TranslatableString(getKey(@"mirror_horizontally_description"), @"Mirror entire playfield across the y-axis"); private static string getKey(string key) => $"{prefix}:{key}"; diff --git a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModSpinStrings.cs b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModSpinStrings.cs index 5fd06e900..63bda7b61 100644 --- a/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModSpinStrings.cs +++ b/osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModSpinStrings.cs @@ -12,6 +12,7 @@ public static class SentakkiModSpinStrings /// "Revolution duration" /// public static LocalisableString RevolutionDuration => new TranslatableString(getKey(@"revolution_duration"), @"Revolution duration"); + public static LocalisableString RevolutionDurationDescription => new TranslatableString(getKey(@"revolution_duration_description"), @"The duration in seconds to complete a revolution."); private static string getKey(string key) => $"{prefix}:{key}"; diff --git a/osu.Game.Rulesets.Sentakki/Localisation/SentakkiActionStrings.cs b/osu.Game.Rulesets.Sentakki/Localisation/SentakkiActionStrings.cs index 30b70b015..11b491781 100644 --- a/osu.Game.Rulesets.Sentakki/Localisation/SentakkiActionStrings.cs +++ b/osu.Game.Rulesets.Sentakki/Localisation/SentakkiActionStrings.cs @@ -10,6 +10,7 @@ public static class SentakkiActionStrings /// "Button #" /// private static LocalisableString button(int number) => new TranslatableString(getKey(@"button_#"), @"Button {0}", number); + public static LocalisableString Button1 => button(1); public static LocalisableString Button2 => button(2); @@ -17,6 +18,7 @@ public static class SentakkiActionStrings /// "Key #" /// private static LocalisableString key(int number) => new TranslatableString(getKey(@"key_#"), @"Key {0}", number); + public static LocalisableString Key1 => key(1); public static LocalisableString Key2 => key(2); public static LocalisableString Key3 => key(3); diff --git a/osu.Game.Rulesets.Sentakki/Localisation/SentakkiSettingsSubsectionStrings.cs b/osu.Game.Rulesets.Sentakki/Localisation/SentakkiSettingsSubsectionStrings.cs index 3d33ac37d..28c752669 100644 --- a/osu.Game.Rulesets.Sentakki/Localisation/SentakkiSettingsSubsectionStrings.cs +++ b/osu.Game.Rulesets.Sentakki/Localisation/SentakkiSettingsSubsectionStrings.cs @@ -30,6 +30,7 @@ public static class SentakkiSettingsSubsectionStrings /// "Ring colour" /// public static LocalisableString RingColor => new TranslatableString(getKey(@"ring_color"), @"Ring colour"); + public static LocalisableString RingColorDefault => new TranslatableString(getKey(@"ring_color_default"), @"Default"); public static LocalisableString RingColorDifficulty => new TranslatableString(getKey(@"ring_color_difficulty"), @"Difficulty-based colour"); public static LocalisableString RingColorSkin => new TranslatableString(getKey(@"ring_color_skin"), @"Skin"); @@ -53,6 +54,7 @@ public static class SentakkiSettingsSubsectionStrings /// "Lane input mode (Doesn't apply to touch)" /// public static LocalisableString LaneInputMode => new TranslatableString(getKey(@"lane_input_mode"), @"Lane input mode (Doesn't apply to touch)"); + public static LocalisableString LaneInputModeButton => new TranslatableString(getKey(@"lane_input_mode_button"), @"Button"); public static LocalisableString LaneInputModeSensor => new TranslatableString(getKey(@"lane_input_mode_sensor"), @"Sensor"); diff --git a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModAutoTouch.cs b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModAutoTouch.cs index 268c4e485..0541685b2 100644 --- a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModAutoTouch.cs +++ b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModAutoTouch.cs @@ -26,11 +26,11 @@ public void ApplyToDrawableHitObject(DrawableHitObject drawableHitObject) switch (drawableSentakkiHitObject) { - case DrawableSlide _: - case DrawableTouch _: - case DrawableTouchHold _: + case DrawableSlide: + case DrawableTouch: + case DrawableTouchHold: // Slide nodes needs to be handled as well because the pool creates the object outside the DHO context - case DrawableSlideCheckpointNode _: + case DrawableSlideCheckpointNode: drawableSentakkiHitObject.Auto = true; break; } diff --git a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModAutoplay.cs b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModAutoplay.cs index b351dee70..a1fea9a42 100644 --- a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModAutoplay.cs +++ b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModAutoplay.cs @@ -16,7 +16,7 @@ public class SentakkiModAutoplay : ModAutoplay, IApplicableToDrawableHitObject public override ModReplayData CreateReplayData(IBeatmap beatmap, IReadOnlyList mods) => new ModReplayData(new SentakkiAutoGenerator(beatmap).Generate(), new ModCreatedUser { Username = getRandomCharacter() }); - public override Type[] IncompatibleMods => new Type[6] + public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), diff --git a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModChallenge.cs b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModChallenge.cs index 847ce5394..e022a98c6 100644 --- a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModChallenge.cs +++ b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModChallenge.cs @@ -30,7 +30,7 @@ public class SentakkiModChallenge : Mod, IApplicableToDrawableRuleset 1.00; - public override Type[] IncompatibleMods => new Type[5] + public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), @@ -41,13 +41,26 @@ public class SentakkiModChallenge : Mod, IApplicableToDrawableRuleset drawableRuleset) { int maxLives = (int)LiveSetting.Value; - LivesLeft = new BindableInt() + LivesLeft = new BindableInt { Value = maxLives, MaxValue = maxLives, @@ -89,13 +102,16 @@ protected bool FailCondition(HealthProcessor healthProcessor, JudgementResult re case HitResult.Good: newValue -= 1; break; + case HitResult.Ok: newValue -= 2; break; + case HitResult.Miss: newValue -= 5; break; } + if (newValue < 0) newValue = 0; LivesLeft.Value = newValue; diff --git a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs index 0d40737d4..5cc0c8fc5 100644 --- a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs +++ b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs @@ -49,6 +49,7 @@ protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, { double preemptTime; double fadeOutTime; + switch (hitObject) { case DrawableTouch t: @@ -145,12 +146,12 @@ private partial class FixedSizeBufferedContainer : BufferedContainer protected override Quad ComputeScreenSpaceDrawQuad() { - var SSDQDrawinfo = DrawInfo; + var ssdqDrawinfo = DrawInfo; // We apply a counter rotation so that the SSDQ retains the non-rotated Quad - SSDQDrawinfo.ApplyTransform(AnchorPosition, Vector2.One, -sentakkiPlayfield.Rotation, Vector2.Zero, OriginPosition); + ssdqDrawinfo.ApplyTransform(AnchorPosition, Vector2.One, -sentakkiPlayfield.Rotation, Vector2.Zero, OriginPosition); - return Quad.FromRectangle(DrawRectangle) * SSDQDrawinfo.Matrix; + return Quad.FromRectangle(DrawRectangle) * ssdqDrawinfo.Matrix; } } diff --git a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModMirror.cs b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModMirror.cs index f1f4578ea..6032d331a 100644 --- a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModMirror.cs +++ b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModMirror.cs @@ -53,6 +53,7 @@ public void ApplyToBeatmap(IBeatmap beatmap) } if (mirrored && laned is Slide slide) + { foreach (var slideInfo in slide.SlideInfoList) { foreach (var part in slideInfo.SlidePathParts) @@ -60,8 +61,10 @@ public void ApplyToBeatmap(IBeatmap beatmap) part.EndOffset = (part.EndOffset * -1).NormalizePath(); part.Mirrored ^= mirrored; } + slideInfo.UpdatePaths(); } + } }); beatmap.HitObjects.OfType().ForEach(touch => diff --git a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModPerfect.cs b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModPerfect.cs index 2301e2c52..088ee888b 100644 --- a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModPerfect.cs +++ b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModPerfect.cs @@ -10,13 +10,13 @@ public class SentakkiModPerfect : ModPerfect protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result) => result.Judgement is not IgnoreJudgement && result.Type < result.Judgement.MaxResult; - public override Type[] IncompatibleMods => new Type[5] + public override Type[] IncompatibleMods => new[] { - typeof(ModNoFail), - typeof(ModRelax), - typeof(ModAutoplay), - typeof(SentakkiModChallenge), - typeof(ModSuddenDeath) + typeof(ModNoFail), + typeof(ModRelax), + typeof(ModAutoplay), + typeof(SentakkiModChallenge), + typeof(ModSuddenDeath) }; } } diff --git a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModSuddenDeath.cs b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModSuddenDeath.cs index e9c35dfc5..69164a117 100644 --- a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModSuddenDeath.cs +++ b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModSuddenDeath.cs @@ -5,7 +5,7 @@ namespace osu.Game.Rulesets.Sentakki.Mods { public class SentakkiModSuddenDeath : ModSuddenDeath { - public override Type[] IncompatibleMods => new Type[5] + public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs index 040e10904..b7e83ef94 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs @@ -33,6 +33,7 @@ public override double LifetimeStart NoteBody.LifetimeStart = value; } } + public override double LifetimeEnd { get => base.LifetimeEnd; @@ -43,17 +44,23 @@ public override double LifetimeEnd } } - public DrawableHold() : this(null) { } + public DrawableHold() + : this(null) + { + } public DrawableHold(Hold? hitObject = null) - : base(hitObject) { } + : base(hitObject) + { + } [BackgroundDependencyLoader] private void load() { Anchor = Anchor.Centre; Origin = Anchor.Centre; - AddRangeInternal(new Drawable[]{ + AddRangeInternal(new Drawable[] + { NoteBody = new HoldBody(), headContainer = new Container { RelativeSizeAxes = Axes.Both }, }); @@ -74,14 +81,12 @@ protected override void UpdateInitialTransforms() NoteBody.FadeColour(AccentColour.Value); - using (BeginDelayedSequence(animTime, true)) + using (BeginDelayedSequence(animTime)) { // This is the movable length (not including start position) - float totalMovableDistance = SentakkiPlayfield.INTERSECTDISTANCE - SentakkiPlayfield.NOTESTARTDISTANCE; - float originalStretchAmount = (float)(totalMovableDistance / animTime * (HitObject as IHasDuration).Duration); - float stretchAmount = Math.Clamp((float)(totalMovableDistance / animTime * (HitObject as IHasDuration).Duration), 0, totalMovableDistance); - float stretchTime = (float)(stretchAmount / totalMovableDistance * animTime); - float excessDistance = (float)((-SentakkiPlayfield.INTERSECTDISTANCE + SentakkiPlayfield.NOTESTARTDISTANCE) / animTime); + const float total_movable_distance = SentakkiPlayfield.INTERSECTDISTANCE - SentakkiPlayfield.NOTESTARTDISTANCE; + float stretchAmount = Math.Clamp((float)(total_movable_distance / animTime * (HitObject as IHasDuration).Duration), 0, total_movable_distance); + float stretchTime = (float)(stretchAmount / total_movable_distance * animTime); NoteBody.ResizeHeightTo(stretchAmount, stretchTime) .Delay((HitObject as IHasDuration).Duration) @@ -134,11 +139,11 @@ protected override void UpdateHitStateTransforms(ArmedState state) case ArmedState.Miss: NoteBody.ScaleTo(0.5f, time_fade_miss, Easing.InCubic) - .FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint) - .MoveToOffset(new Vector2(0, -100), time_fade_miss, Easing.OutCubic) - .FadeOut(time_fade_miss); + .FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint) + .MoveToOffset(new Vector2(0, -100), time_fade_miss, Easing.OutCubic) + .FadeOut(time_fade_miss); - using (BeginDelayedSequence(time_fade_miss, true)) + using (BeginDelayedSequence(time_fade_miss)) this.FadeOut(); break; } @@ -156,12 +161,14 @@ protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject) AutoBindable = { BindTarget = AutoBindable } }; } + return base.CreateNestedHitObject(hitObject); } protected override void AddNestedHitObject(DrawableHitObject hitObject) { base.AddNestedHitObject(hitObject); + switch (hitObject) { case DrawableHoldHead head: @@ -180,6 +187,7 @@ protected override void ClearNestedHitObjects() /// Time at which the user started holding this hold note. Null if the user is not holding this hold note. /// public double? HoldStartTime { get; private set; } + public double TotalHoldTime; private bool beginHoldAt(double timeOffset) diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHoldHead.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHoldHead.cs index 6b4084a84..4d6ad10b3 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHoldHead.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHoldHead.cs @@ -5,7 +5,10 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables { public partial class DrawableHoldHead : DrawableSentakkiLanedHitObject { - public DrawableHoldHead() : this(null) { } + public DrawableHoldHead() + : this(null) + { + } public DrawableHoldHead(Hold.HoldHead? hitObject) : base(hitObject) diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableScoreBonusObject.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableScoreBonusObject.cs index bbb6c404d..99935092e 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableScoreBonusObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableScoreBonusObject.cs @@ -6,10 +6,15 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables { public partial class DrawableScoreBonusObject : DrawableHitObject { - public DrawableScoreBonusObject() : this(null) { } + public DrawableScoreBonusObject() + : this(null) + { + } public DrawableScoreBonusObject(ScoreBonusObject? hitObject) - : base(hitObject!) { } + : base(hitObject!) + { + } public void TriggerResult() => ApplyResult(static r => r.Type = (Math.Abs(r.TimeOffset) < 16) ? r.Judgement.MaxResult : r.Judgement.MinResult); diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableScorePaddingObject.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableScorePaddingObject.cs index e8779f6d0..93c37cae6 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableScorePaddingObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableScorePaddingObject.cs @@ -6,10 +6,15 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables { public partial class DrawableScorePaddingObject : DrawableHitObject { - public DrawableScorePaddingObject() : this(null) { } + public DrawableScorePaddingObject() + : this(null) + { + } public DrawableScorePaddingObject(ScorePaddingObject? hitObject) - : base(hitObject!) { } + : base(hitObject!) + { + } public new void ApplyResult(Action application) { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiHitObject.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiHitObject.cs index 9a986718d..46e5cb53c 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiHitObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiHitObject.cs @@ -12,7 +12,8 @@ public partial class DrawableSentakkiHitObject : DrawableHitObject AdjustedAnimationDuration; - public readonly BindableBool AutoBindable = new BindableBool(false); + public readonly BindableBool AutoBindable = new BindableBool(); + public bool Auto { get => AutoBindable.Value; @@ -24,10 +25,15 @@ public bool Auto protected override float SamplePlaybackPosition => Position.X / (SentakkiPlayfield.INTERSECTDISTANCE * 2); - public DrawableSentakkiHitObject() : this(null) { } + public DrawableSentakkiHitObject() + : this(null) + { + } public DrawableSentakkiHitObject(SentakkiHitObject? hitObject = null) - : base(hitObject!) { } + : base(hitObject!) + { + } [Resolved] private DrawableSentakkiRuleset? drawableSentakkiRuleset { get; set; } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiJudgement.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiJudgement.cs index a4b53e6ac..a15bb7547 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiJudgement.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiJudgement.cs @@ -41,8 +41,10 @@ private void load(SentakkiRulesetConfigManager? sentakkiConfigs) Anchor = Anchor.Centre, Origin = Anchor.Centre, Scale = new Vector2(0.9f), - Children = new Drawable[]{ - timingPiece = new OsuSpriteText{ + Children = new Drawable[] + { + timingPiece = new OsuSpriteText + { Y = -15, Origin = Anchor.Centre, Font = OsuFont.Torus.With(size: 20, weight: FontWeight.Bold), @@ -68,6 +70,7 @@ public DrawableSentakkiJudgement Apply(JudgementResult result, DrawableHitObject else { timingPiece.Alpha = 1; + if (result.TimeOffset >= 16) { timingPiece.Text = "LATE"; @@ -84,6 +87,7 @@ public DrawableSentakkiJudgement Apply(JudgementResult result, DrawableHitObject timingPiece.Colour = Color4.Orange; } } + LifetimeStart = result.TimeAbsolute; switch (hitObject) @@ -92,6 +96,7 @@ public DrawableSentakkiJudgement Apply(JudgementResult result, DrawableHitObject Position = SentakkiExtensions.GetPositionAlongLane(240, laned.HitObject.Lane); Rotation = laned.HitObject.Lane.GetRotationForLane(); break; + default: Position = hitObject.Position; Rotation = 0; @@ -122,7 +127,8 @@ private void applyHitAnimations() private partial class SentakkiJudgementPiece : DefaultJudgementPiece { - public SentakkiJudgementPiece(HitResult result) : base(result) + public SentakkiJudgementPiece(HitResult result) + : base(result) { } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiLanedHitObject.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiLanedHitObject.cs index e48180a81..3f7f01a3f 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiLanedHitObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSentakkiLanedHitObject.cs @@ -15,7 +15,8 @@ public partial class DrawableSentakkiLanedHitObject : DrawableSentakkiHitObject { public new SentakkiLanedHitObject HitObject => (SentakkiLanedHitObject)base.HitObject; - protected override float SamplePlaybackPosition => (SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, HitObject.Lane).X / (SentakkiPlayfield.INTERSECTDISTANCE * 2)) + .5f; + protected override float SamplePlaybackPosition => + (SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, HitObject.Lane).X / (SentakkiPlayfield.INTERSECTDISTANCE * 2)) + .5f; private PausableSkinnableSound breakSample = null!; @@ -24,12 +25,15 @@ public partial class DrawableSentakkiLanedHitObject : DrawableSentakkiHitObject private Container scoreBonusObjects = null!; public DrawableSentakkiLanedHitObject(SentakkiLanedHitObject? hitObject) - : base(hitObject) { } + : base(hitObject) + { + } [BackgroundDependencyLoader] private void load(SentakkiRulesetConfigManager? sentakkiConfig) { - AddRangeInternal(new Drawable[]{ + AddRangeInternal(new Drawable[] + { scorePaddingObjects = new Container(), scoreBonusObjects = new Container(), breakSample = new PausableSkinnableSound(), @@ -60,6 +64,7 @@ protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject) { case ScorePaddingObject p: return new DrawableScorePaddingObject(p); + case ScoreBonusObject b: return new DrawableScoreBonusObject(b); } @@ -74,9 +79,11 @@ protected override void AddNestedHitObject(DrawableHitObject hitObject) case DrawableScorePaddingObject p: scorePaddingObjects.Add(p); break; + case DrawableScoreBonusObject b: scoreBonusObjects.Add(b); break; + default: base.AddNestedHitObject(hitObject); break; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlide.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlide.cs index edd67628e..32dffa16d 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlide.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlide.cs @@ -14,10 +14,15 @@ public partial class DrawableSlide : DrawableSentakkiHitObject public Container SlideBodies = null!; public Container SlideTaps = null!; - public DrawableSlide() : this(null) { } + public DrawableSlide() + : this(null) + { + } public DrawableSlide(SentakkiHitObject? hitObject = null) - : base(hitObject) { } + : base(hitObject) + { + } [BackgroundDependencyLoader] private void load() @@ -62,6 +67,7 @@ protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject) { AutoBindable = { BindTarget = AutoBindable }, }; + case SlideBody slideBody: return new DrawableSlideBody(slideBody) { @@ -81,10 +87,12 @@ protected override void AddNestedHitObject(DrawableHitObject hitObject) case DrawableSlideBody body: SlideBodies.Add(body); break; + case DrawableSlideTap tap: SlideTaps.Child = tap; break; } + base.AddNestedHitObject(hitObject); } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs index 1e934d203..f235bbc9b 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs @@ -21,8 +21,6 @@ public partial class DrawableSlideBody : DrawableSentakkiLanedHitObject public override bool RemoveWhenNotAlive => false; - protected override double InitialLifetimeOffset => base.InitialLifetimeOffset; - public Container SlideCheckpoints { get; private set; } = null!; public SlideVisual Slidepath { get; private set; } = null!; @@ -30,6 +28,7 @@ public partial class DrawableSlideBody : DrawableSentakkiLanedHitObject public Container SlideStars { get; private set; } = null!; private float starProgress; + public virtual float StarProgress { get => starProgress; @@ -50,9 +49,15 @@ public virtual float StarProgress } } - public DrawableSlideBody() : this(null) { } + public DrawableSlideBody() + : this(null) + { + } + public DrawableSlideBody(SlideBody? hitObject) - : base(hitObject) { } + : base(hitObject) + { + } [BackgroundDependencyLoader] private void load() @@ -65,7 +70,8 @@ private void load() AddRangeInternal(new Drawable[] { Slidepath = new SlideVisual(), - SlideStars = new Container{ + SlideStars = new Container + { Anchor = Anchor.Centre, Origin = Anchor.Centre, }, @@ -77,6 +83,7 @@ private void load() }); for (int i = 0; i < 3; ++i) + { SlideStars.Add(new StarPiece { Alpha = 0, @@ -86,6 +93,7 @@ private void load() Position = SentakkiExtensions.GetCircularPosition(296.5f, 22.5f), RelativeSizeAxes = Axes.None, }); + } AccentColour.BindValueChanged(c => Colour = c.NewValue); OnNewResult += updateSlideCompletion; @@ -132,6 +140,7 @@ protected override void UpdateInitialTransforms() { base.UpdateInitialTransforms(); Slidepath.PerformEntryAnimation(AdjustedAnimationDuration); + using (BeginAbsoluteSequence(HitObject.StartTime - 50)) { SlideStars[2].FadeInFromZero(HitObject.ShootDelay).ScaleTo(1.25f, HitObject.ShootDelay); @@ -147,11 +156,13 @@ protected override void UpdateInitialTransforms() using (BeginDelayedSequence(50 + HitObject.ShootDelay)) { if (!Slidepath.Path.StartsWithSlideFan && Slidepath.Path.EndsWithSlideFan) + { using (BeginDelayedSequence((HitObject.Duration - HitObject.ShootDelay) * Slidepath.Path.FanStartProgress)) { SlideStars[0].FadeIn(); SlideStars[1].FadeIn(); } + } this.TransformTo(nameof(StarProgress), 1f, (HitObject as IHasDuration).Duration - HitObject.ShootDelay); } @@ -164,6 +175,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset) // Player completed all nodes, we consider this user triggered userTriggered = true; + for (int i = 0; i < SlideCheckpoints.Count; ++i) { if (!SlideCheckpoints[i].Result.HasResult) @@ -201,6 +213,7 @@ protected override void UpdateHitStateTransforms(ArmedState state) { base.UpdateHitStateTransforms(state); const double time_fade_miss = 400 /* time_fade_miss = 400 */; + switch (state) { case ArmedState.Hit: @@ -215,6 +228,7 @@ protected override void UpdateHitStateTransforms(ArmedState state) } break; + case ArmedState.Miss: Slidepath.PerformExitAnimation(time_fade_miss); this.FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint).FadeOut(time_fade_miss).Expire(); @@ -241,6 +255,7 @@ protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject) protected override void AddNestedHitObject(DrawableHitObject hitObject) { base.AddNestedHitObject(hitObject); + switch (hitObject) { case DrawableSlideCheckpoint node: diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideCheckpoint.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideCheckpoint.cs index e1804bfd9..f60ec6c94 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideCheckpoint.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideCheckpoint.cs @@ -32,9 +32,15 @@ public partial class DrawableSlideCheckpoint : DrawableSentakkiHitObject private Container nodes = null!; - public DrawableSlideCheckpoint() : this(null) { } + public DrawableSlideCheckpoint() + : this(null) + { + } + public DrawableSlideCheckpoint(SlideCheckpoint? checkpoint) - : base(checkpoint) { } + : base(checkpoint) + { + } [BackgroundDependencyLoader] private void load() @@ -42,7 +48,7 @@ private void load() Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; - AddInternal(nodes = new Container() + AddInternal(nodes = new Container { RelativeSizeAxes = Axes.Both }); @@ -61,9 +67,12 @@ protected override void CheckForResult(bool userTriggered, double timeOffset) { // Counting hit notes manually to avoid LINQ alloc overhead int hitNotes = 0; + foreach (var node in nodes) + { if (node.IsHit) ++hitNotes; + } if (hitNotes >= HitObject.NodesToPass) ApplyResult(Result.Judgement.MaxResult); @@ -103,6 +112,7 @@ protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject) protected override void AddNestedHitObject(DrawableHitObject hitObject) { base.AddNestedHitObject(hitObject); + switch (hitObject) { case DrawableSlideCheckpointNode node: @@ -110,6 +120,7 @@ protected override void AddNestedHitObject(DrawableHitObject hitObject) break; } } + protected override void ClearNestedHitObjects() { base.ClearNestedHitObjects(); diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideCheckpointNode.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideCheckpointNode.cs index b7d59744f..b5aea6596 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideCheckpointNode.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideCheckpointNode.cs @@ -23,7 +23,11 @@ public partial class DrawableSlideCheckpointNode : DrawableSentakkiHitObject private SentakkiInputManager sentakkiActionInputManager = null!; internal SentakkiInputManager SentakkiActionInputManager => sentakkiActionInputManager ??= ((SentakkiInputManager)GetContainingInputManager()); - public DrawableSlideCheckpointNode() : this(null) { } + public DrawableSlideCheckpointNode() + : this(null) + { + } + public DrawableSlideCheckpointNode(SlideCheckpoint.CheckpointNode? node) : base(node) { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs index 27c948281..96b1d908c 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs @@ -8,9 +8,15 @@ public partial class DrawableSlideTap : DrawableTap { protected override Drawable CreateTapRepresentation() => new SlideTapPiece(); - public DrawableSlideTap() : this(null) { } + public DrawableSlideTap() + : this(null) + { + } + public DrawableSlideTap(SlideTap? hitObject) - : base(hitObject) { } + : base(hitObject) + { + } protected override void UpdateInitialTransforms() { @@ -23,13 +29,10 @@ protected override void UpdateInitialTransforms() if (ParentHitObject is DrawableSlide slide) { spinDuration = ((Slide)slide.HitObject).SlideInfoList.FirstOrDefault().Duration; - if (slide.SlideBodies.Count > 1) - note.SecondStar.Alpha = 1; - else - note.SecondStar.Alpha = 0; + note.SecondStar.Alpha = slide.SlideBodies.Count > 1 ? 1 : 0; } - note.Stars.Spin(spinDuration, RotationDirection.Counterclockwise, 0).Loop(); + note.Stars.Spin(spinDuration, RotationDirection.Counterclockwise).Loop(); } } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs index 245042d09..f03fa20be 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs @@ -25,6 +25,7 @@ public override double LifetimeStart TapVisual.LifetimeStart = value; } } + public override double LifetimeEnd { get => base.LifetimeEnd; @@ -37,17 +38,23 @@ public override double LifetimeEnd public Drawable TapVisual = null!; - public DrawableTap() : this(null) { } + public DrawableTap() + : this(null) + { + } public DrawableTap(Tap? hitObject = null) - : base(hitObject) { } + : base(hitObject) + { + } [BackgroundDependencyLoader] private void load() { Origin = Anchor.Centre; Anchor = Anchor.Centre; - AddRangeInternal(new Drawable[] { + AddRangeInternal(new[] + { TapVisual = CreateTapRepresentation(), }); } @@ -57,7 +64,8 @@ protected override void UpdateInitialTransforms() base.UpdateInitialTransforms(); double animTime = AdjustedAnimationDuration / 2; TapVisual.FadeInFromZero(animTime).ScaleTo(1, animTime); - using (BeginDelayedSequence(animTime, true)) + + using (BeginDelayedSequence(animTime)) { double excessDistance = (-SentakkiPlayfield.INTERSECTDISTANCE + SentakkiPlayfield.NOTESTARTDISTANCE) / animTime * HitObject.HitWindows.WindowFor(HitResult.Miss); TapVisual.MoveToY((float)(-SentakkiPlayfield.INTERSECTDISTANCE + excessDistance), animTime + HitObject.HitWindows.WindowFor(HitResult.Miss)); @@ -98,9 +106,9 @@ protected override void UpdateHitStateTransforms(ArmedState state) case ArmedState.Miss: TapVisual.ScaleTo(0.5f, time_fade_miss, Easing.InCubic) - .FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint) - .MoveToOffset(new Vector2(0, -100), time_fade_miss, Easing.OutCubic) - .FadeOut(time_fade_miss); + .FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint) + .MoveToOffset(new Vector2(0, -100), time_fade_miss, Easing.OutCubic) + .FadeOut(time_fade_miss); this.ScaleTo(1f, time_fade_miss).Expire(); diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs index 0d1ea8cc5..1fa25a0c3 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs @@ -29,9 +29,15 @@ public partial class DrawableTouch : DrawableSentakkiHitObject private SentakkiInputManager sentakkiActionInputManager = null!; internal SentakkiInputManager SentakkiActionInputManager => sentakkiActionInputManager ??= (SentakkiInputManager)GetContainingInputManager(); - public DrawableTouch() : this(null) { } + public DrawableTouch() + : this(null) + { + } + public DrawableTouch(Touch? hitObject) - : base(hitObject) { } + : base(hitObject) + { + } [BackgroundDependencyLoader] private void load(SentakkiRulesetConfigManager? sentakkiConfigs) @@ -41,7 +47,8 @@ private void load(SentakkiRulesetConfigManager? sentakkiConfigs) Size = new Vector2(105); Origin = Anchor.Centre; Anchor = Anchor.Centre; - AddRangeInternal(new Drawable[]{ + AddRangeInternal(new Drawable[] + { TouchBody = new TouchBody(), }); @@ -67,17 +74,17 @@ protected override void OnFree() PointInteractionState[i] = false; } - private BindableInt trackedKeys = new BindableInt(0); + private readonly BindableInt trackedKeys = new BindableInt(); protected override void UpdateInitialTransforms() { base.UpdateInitialTransforms(); - double FadeIn = AdjustedAnimationDuration / 2; + double fadeIn = AdjustedAnimationDuration / 2; double moveTo = HitObject.HitWindows.WindowFor(HitResult.Ok); - TouchBody.FadeIn(FadeIn); + TouchBody.FadeIn(fadeIn); - using (BeginDelayedSequence(AdjustedAnimationDuration, true)) + using (BeginDelayedSequence(AdjustedAnimationDuration)) { TouchBody.ResizeTo(90, moveTo, Easing.InCirc); TouchBody.BorderContainer.Delay(moveTo).FadeIn(); @@ -125,8 +132,8 @@ protected override void UpdateHitStateTransforms(ArmedState state) case ArmedState.Miss: this.ScaleTo(0.5f, time_fade_miss, Easing.InCubic) - .FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint) - .FadeOut(time_fade_miss); + .FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint) + .FadeOut(time_fade_miss); break; } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs index a8e849204..ff64f6e06 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs @@ -34,10 +34,15 @@ public partial class DrawableTouchHold : DrawableSentakkiHitObject private PausableSkinnableSound holdSample = null!; - public DrawableTouchHold() : this(null) { } + public DrawableTouchHold() + : this(null) + { + } public DrawableTouchHold(TouchHold? hitObject) - : base(hitObject) { } + : base(hitObject) + { + } [BackgroundDependencyLoader] private void load(SentakkiRulesetConfigManager? sentakkiConfigs) @@ -48,7 +53,8 @@ private void load(SentakkiRulesetConfigManager? sentakkiConfigs) Origin = Anchor.Centre; Scale = new Vector2(0f); Alpha = 0; - AddRangeInternal(new Drawable[] { + AddRangeInternal(new Drawable[] + { TouchHoldBody = new TouchHoldBody(), holdSample = new PausableSkinnableSound { @@ -103,7 +109,8 @@ protected override void UpdateInitialTransforms() base.UpdateInitialTransforms(); double fadeIn = AdjustedAnimationDuration; this.FadeInFromZero(fadeIn).ScaleTo(1, fadeIn); - using (BeginDelayedSequence(fadeIn, true)) + + using (BeginDelayedSequence(fadeIn)) { TouchHoldBody.ProgressPiece.TransformBindableTo(TouchHoldBody.ProgressPiece.ProgressBindable, 1, ((IHasDuration)HitObject).Duration); } @@ -115,6 +122,7 @@ protected override void UpdateInitialTransforms() /// Time at which the user started holding this hold note. Null if the user is not holding this hold note. /// private double? holdStartTime; + private double totalHoldTime; private void beginHold() @@ -141,8 +149,8 @@ protected override void Update() base.Update(); isHitting.Value = Time.Current >= HitObject.StartTime - && Time.Current <= HitObject.GetEndTime() - && (Auto || checkForTouchInput() || ((SentakkiActionInputManager?.PressedActions.Any() ?? false) && IsHovered)); + && Time.Current <= HitObject.GetEndTime() + && (Auto || checkForTouchInput() || ((SentakkiActionInputManager?.PressedActions.Any() ?? false) && IsHovered)); if (isHitting.Value) holdSample.Frequency.Value = 0.5 + ((Time.Current - holdStartTime!.Value + totalHoldTime) / ((IHasDuration)HitObject).Duration); diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/DotPiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/DotPiece.cs index 72753a2d1..e4c780a33 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/DotPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/DotPiece.cs @@ -10,7 +10,10 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces { public partial class DotPiece : CompositeDrawable { - public DotPiece(float outlineThickness = 2, bool squared = false) : this(new Vector2(SentakkiPlayfield.DOTSIZE), outlineThickness, squared) { } + public DotPiece(float outlineThickness = 2, bool squared = false) + : this(new Vector2(SentakkiPlayfield.DOTSIZE), outlineThickness, squared) + { + } public DotPiece(Vector2 size, float outlineThickness = 2, bool squared = false) { @@ -21,8 +24,10 @@ public DotPiece(Vector2 size, float outlineThickness = 2, bool squared = false) Masking = true; CornerExponent = squared ? 2.5f : 2f; CornerRadius = Math.Min(size.X, size.Y) / (squared ? 4 : 2); - InternalChildren = new Drawable[]{ - new Box{ + InternalChildren = new Drawable[] + { + new Box + { Colour = Color4.Gray, RelativeSizeAxes = Axes.Both, }, diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/NoteRingPiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/NoteRingPiece.cs index 880791a0f..9cbe80fb1 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/NoteRingPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/NoteRingPiece.cs @@ -16,7 +16,8 @@ public NoteRingPiece() RelativeSizeAxes = Axes.Both; Anchor = Anchor.Centre; Origin = Anchor.Centre; - InternalChildren = new Drawable[]{ + InternalChildren = new Drawable[] + { new ShadowPiece(), new RingPiece(), }; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/RingPiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/RingPiece.cs index 60087aaaf..784ddf18f 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/RingPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/RingPiece.cs @@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces public partial class RingPiece : CircularContainer { private const float outline_thickness = 2; + public RingPiece(float thickness = 18) { RelativeSizeAxes = Axes.Both; @@ -16,8 +17,10 @@ public RingPiece(float thickness = 18) Masking = true; BorderThickness = thickness; BorderColour = Color4.Gray; - InternalChildren = new Drawable[]{ - new Box{ + InternalChildren = new Drawable[] + { + new Box + { Alpha = 0, RelativeSizeAxes = Axes.Both, AlwaysPresent = true, diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanChevrons.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanChevrons.cs index 56ab82e9f..73b8266f9 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanChevrons.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanChevrons.cs @@ -63,13 +63,14 @@ protected override bool OnInvalidate(Invalidation invalidation, InvalidationSour return base.OnInvalidate(invalidation, source); } - public ChevronBackingTexture(float lengthScale, float HeightScale) : base(cachedFrameBuffer: true) + public ChevronBackingTexture(float lengthScale, float heightScale) + : base(cachedFrameBuffer: true) { Anchor = Anchor.Centre; Origin = Anchor.Centre; AutoSizeAxes = Axes.Both; - float chevHeight = 16 + (10 * HeightScale); + float chevHeight = 16 + (10 * heightScale); float chevWidth = 6 + (210 * lengthScale); AddInternal(new Container @@ -77,20 +78,22 @@ public ChevronBackingTexture(float lengthScale, float HeightScale) : base(cached Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, AutoSizeAxes = Axes.Both, - Children = new Drawable[]{ + Children = new Drawable[] + { // Outlines new Container { X = 2.5f, Masking = true, - CornerRadius = chevHeight/4, + CornerRadius = chevHeight / 4, CornerExponent = 2.5f, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomRight, Rotation = 22.5f, Width = chevWidth, Height = chevHeight, - Child = new Box{ + Child = new Box + { RelativeSizeAxes = Axes.Both, Colour = Color4.Gray }, @@ -99,14 +102,15 @@ public ChevronBackingTexture(float lengthScale, float HeightScale) : base(cached { X = -2.5f, Masking = true, - CornerRadius = chevHeight/4, + CornerRadius = chevHeight / 4, CornerExponent = 2.5f, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomLeft, Rotation = -22.5f, Width = chevWidth, Height = chevHeight, - Child = new Box{ + Child = new Box + { RelativeSizeAxes = Axes.Both, Colour = Color4.Gray }, @@ -120,14 +124,16 @@ public ChevronBackingTexture(float lengthScale, float HeightScale) : base(cached Size = new Vector2(chevWidth, chevHeight), Rotation = 22.5f, Padding = new MarginPadding(2), - Child = new Container{ + Child = new Container + { RelativeSizeAxes = Axes.Both, Masking = true, - CornerRadius = (chevHeight-4)/4, + CornerRadius = (chevHeight - 4) / 4, CornerExponent = 2.5f, Colour = Color4.White, - Child = new Box{ + Child = new Box + { RelativeSizeAxes = Axes.Both, Colour = Color4.White } @@ -145,9 +151,10 @@ public ChevronBackingTexture(float lengthScale, float HeightScale) : base(cached { RelativeSizeAxes = Axes.Both, Masking = true, - CornerRadius = (chevHeight-4)/4, + CornerRadius = (chevHeight - 4) / 4, CornerExponent = 2.5f, - Child = new Box{ + Child = new Box + { RelativeSizeAxes = Axes.Both, Colour = Color4.White } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideTapPiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideTapPiece.cs index e83d6765c..bf139b990 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideTapPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideTapPiece.cs @@ -28,11 +28,13 @@ public SlideTapPiece() InternalChildren = new Drawable[] { - Stars = new Container(){ + Stars = new Container + { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, - Children = new Drawable[]{ + Children = new Drawable[] + { new StarPiece(), SecondStar = new StarPiece { Rotation = 36 } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisual.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisual.cs index 311ec0a3b..ae10abcd9 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisual.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisual.cs @@ -44,26 +44,29 @@ public SlideVisual() } [Resolved] - private DrawablePool? chevronPool { get; set; } = null!; + private DrawablePool? chevronPool { get; set; } private Container chevrons = null!; private readonly BindableBool snakingIn = new BindableBool(true); - private List fanChevrons = new List(); + private readonly List fanChevrons = new List(); [BackgroundDependencyLoader] private void load(SentakkiRulesetConfigManager? sentakkiConfig, SlideFanChevrons? fanChevrons) { sentakkiConfig?.BindWith(SentakkiRulesetSettings.SnakingSlideBody, snakingIn); - AddRangeInternal(new Drawable[]{ + AddRangeInternal(new Drawable[] + { chevrons = new Container() }); if (fanChevrons != null) + { for (int i = 0; i < 11; ++i) this.fanChevrons.Add(new SlideFanChevron(fanChevrons.Get(i))); + } } private void updateVisuals() @@ -93,6 +96,7 @@ private void tryCreateRegularChevrons() return; double runningDistance = 0; + foreach (var path in path.SlideSegments) { int chevronCount = chevronsInContinuousPath(path); @@ -100,6 +104,7 @@ private void tryCreateRegularChevrons() double safeDistance = totalDistance - (endpoint_distance * 2); var previousPosition = path.PositionAt(0); + for (int i = 0; i < chevronCount; i++) { double progress = (double)i / (chevronCount - 1); // from 0 to 1, both inclusive @@ -118,6 +123,7 @@ private void tryCreateRegularChevrons() previousPosition = position; } + runningDistance += totalDistance; } } @@ -127,7 +133,7 @@ private void tryCreateFanChevrons() if (!path.EndsWithSlideFan) return; - var delta = path.PositionAt(1) - path.fanOrigin; + var delta = path.PositionAt(1) - path.FanOrigin; for (int i = 0; i < 11; ++i) { @@ -135,12 +141,12 @@ private void tryCreateFanChevrons() float scale = progress; SlideFanChevron fanChev = fanChevrons[i]; - float safeSpaceRatio = 570 / 600f; + const float safe_space_ratio = 570 / 600f; - float Y = safeSpaceRatio * scale; + float y = safe_space_ratio * scale; - fanChev.Position = path.fanOrigin + (delta * Y); - fanChev.Rotation = fanChev.Position.GetDegreesFromPosition(path.fanOrigin); + fanChev.Position = path.FanOrigin + (delta * y); + fanChev.Rotation = fanChev.Position.GetDegreesFromPosition(path.FanOrigin); fanChev.DisappearThreshold = path.FanStartProgress + ((i + 1) / 11f * (1 - path.FanStartProgress)); fanChev.Depth = chevrons.Count; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/StarPiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/StarPiece.cs index 081ed5ef6..cf63d5173 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/StarPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/StarPiece.cs @@ -17,7 +17,7 @@ public StarPiece() [BackgroundDependencyLoader] private void load(TextureStore textures) { - AddInternal(new Sprite() + AddInternal(new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldBody.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldBody.cs index 12e4b758b..7e977e992 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldBody.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldBody.cs @@ -20,7 +20,8 @@ public TouchHoldBody() Size = new Vector2(110); Anchor = Anchor.Centre; Origin = Anchor.Centre; - InternalChildren = new Drawable[]{ + InternalChildren = new Drawable[] + { ProgressPiece = new TouchHoldProgressPiece(), centrePiece = new TouchHoldCentrePiece(), }; @@ -36,7 +37,7 @@ private void load(DrawableHitObject drawableObject) private void updateState(DrawableHitObject drawableObject, ArmedState state) { - using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime, true)) + using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime)) { switch (state) { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldCentrePiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldCentrePiece.cs index 2a1deaf31..a6b374921 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldCentrePiece.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldCentrePiece.cs @@ -10,7 +10,8 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.TouchHolds { public partial class TouchHoldCentrePiece : CompositeDrawable { - private OsuColour colours = new OsuColour(); + private readonly OsuColour colours = new OsuColour(); + public TouchHoldCentrePiece() { Origin = Anchor.Centre; @@ -25,15 +26,19 @@ public TouchHoldCentrePiece() Colour = Color4.Black, Radius = 10f, }; - InternalChildren = new Drawable[]{ - new Container { + InternalChildren = new Drawable[] + { + new Container + { Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Both, Size = new Vector2(2), Rotation = -45f, - Children = new Drawable[]{ - new CircularProgress{ + Children = new Drawable[] + { + new CircularProgress + { Anchor = Anchor.Centre, Origin = Anchor.Centre, InnerRadius = 1, @@ -42,7 +47,8 @@ public TouchHoldCentrePiece() Current = { Value = 1 }, Colour = colours.Blue }, - new CircularProgress{ + new CircularProgress + { Anchor = Anchor.Centre, Origin = Anchor.Centre, InnerRadius = 1, @@ -51,7 +57,8 @@ public TouchHoldCentrePiece() Current = { Value = .75 }, Colour = colours.Green }, - new CircularProgress{ + new CircularProgress + { Anchor = Anchor.Centre, Origin = Anchor.Centre, InnerRadius = 1, @@ -60,7 +67,8 @@ public TouchHoldCentrePiece() Current = { Value = .5 }, Colour = colours.Yellow, }, - new CircularProgress{ + new CircularProgress + { Anchor = Anchor.Centre, Origin = Anchor.Centre, InnerRadius = 1, diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldProgressPiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldProgressPiece.cs index 293ab1818..db2bd15b5 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldProgressPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldProgressPiece.cs @@ -11,15 +11,15 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.TouchHolds { public partial class TouchHoldProgressPiece : CompositeDrawable { - private readonly CircularProgress redProgress; - private readonly CircularProgress yellowProgress; - private readonly CircularProgress greenProgress; - private readonly CircularProgress blueProgress; - public BindableDouble ProgressBindable = new BindableDouble(); public TouchHoldProgressPiece() { + CircularProgress blueProgress; + CircularProgress greenProgress; + CircularProgress yellowProgress; + CircularProgress redProgress; + OsuColour colours = new OsuColour(); Origin = Anchor.Centre; Anchor = Anchor.Centre; @@ -30,15 +30,19 @@ public TouchHoldProgressPiece() Size = new Vector2(110); CornerRadius = 27.5f; Rotation = 45; - InternalChildren = new Drawable[]{ - new Container { + InternalChildren = new Drawable[] + { + new Container + { Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Both, Size = new Vector2(2), Rotation = -45f, - Children = new Drawable[]{ - blueProgress = new CircularProgress{ + Children = new Drawable[] + { + blueProgress = new CircularProgress + { Anchor = Anchor.Centre, Origin = Anchor.Centre, InnerRadius = 1, @@ -47,7 +51,8 @@ public TouchHoldProgressPiece() Current = { Value = 0 }, Colour = colours.Blue }, - greenProgress = new CircularProgress{ + greenProgress = new CircularProgress + { Anchor = Anchor.Centre, Origin = Anchor.Centre, InnerRadius = 1, @@ -56,7 +61,8 @@ public TouchHoldProgressPiece() Current = { Value = 0 }, Colour = colours.Green }, - yellowProgress = new CircularProgress{ + yellowProgress = new CircularProgress + { Anchor = Anchor.Centre, Origin = Anchor.Centre, InnerRadius = 1, @@ -65,7 +71,8 @@ public TouchHoldProgressPiece() Current = { Value = 0 }, Colour = colours.Yellow, }, - redProgress = new CircularProgress{ + redProgress = new CircularProgress + { Anchor = Anchor.Centre, Origin = Anchor.Centre, InnerRadius = 1, diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBlobs.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBlobs.cs deleted file mode 100644 index 5a45c715f..000000000 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBlobs.cs +++ /dev/null @@ -1,122 +0,0 @@ -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Effects; -using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets.Objects.Drawables; -using osuTK; -using osuTK.Graphics; - -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Touches -{ - public partial class TouchBlob : CircularContainer - { - public TouchBlob() - { - Size = new Vector2(80); - Scale = new Vector2(.5f); - Anchor = Anchor.Centre; - Origin = Anchor.Centre; - Children = new Drawable[] - { - new Container - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Padding = new MarginPadding(1), - Child = new Container - { - Alpha = .5f, - Masking = true, - RelativeSizeAxes = Axes.Both, - CornerRadius = 20, - CornerExponent = 2.5f, - EdgeEffect = new EdgeEffectParameters - { - Hollow = true, - Type = EdgeEffectType.Shadow, - Radius = 15, - Colour = Color4.Black, - } - } - }, - new Container - { - CornerRadius = 20, - CornerExponent = 2.5f, - RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = 16.35f, - BorderColour = Color4.Gray, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha= 0, - AlwaysPresent = true - } - }, - new Container - { - Masking = true, - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding(1), - Child = new Container - { - CornerRadius = 20, - CornerExponent = 2.5f, - RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = 15, - BorderColour = Color4.White, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true, - } - } - }, - new Container - { - CornerRadius = 20, - CornerExponent = 2.5f, - RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = 2, - BorderColour = Color4.Gray, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true - } - }, - }; - } - - [BackgroundDependencyLoader] - private void load(DrawableHitObject drawableObject) - { - drawableObject.ApplyCustomUpdateState += updateState; - } - - private void updateState(DrawableHitObject drawableObject, ArmedState state) - { - using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime, true)) - { - switch (state) - { - case ArmedState.Hit: - const double flash_in = 40; - - this.Delay(flash_in).FadeOut(); - - break; - } - } - } - } -} diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBody.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBody.cs index b5dfc45fc..ef9a55dd2 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBody.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBody.cs @@ -13,6 +13,7 @@ public partial class TouchBody : Container { public Container BorderContainer; public Container PieceContainer; + public TouchBody() { Size = new Vector2(130); @@ -20,43 +21,52 @@ public TouchBody() Origin = Anchor.Centre; Alpha = 0; - InternalChildren = new Drawable[]{ - BorderContainer = new Container{ + InternalChildren = new Drawable[] + { + BorderContainer = new Container + { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size= new Vector2(105), + Size = new Vector2(105), CornerRadius = 25f, CornerExponent = 2.5f, Masking = true, BorderThickness = 15, BorderColour = Color4.White, Alpha = 0, - Child = new Box{ + Child = new Box + { Alpha = 0, AlwaysPresent = true, RelativeSizeAxes = Axes.Both } }, - PieceContainer = new Container{ + PieceContainer = new Container + { Anchor = Anchor.Centre, Origin = Anchor.Centre, - RelativeSizeAxes= Axes.Both, - Children = new Drawable[]{ - new TouchPiece{ + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new TouchPiece + { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }, - new TouchPiece{ + new TouchPiece + { Anchor = Anchor.BottomCentre, Origin = Anchor.TopCentre, Rotation = 180 }, - new TouchPiece{ + new TouchPiece + { Anchor = Anchor.CentreLeft, Origin = Anchor.TopCentre, Rotation = 270 }, - new TouchPiece{ + new TouchPiece + { Anchor = Anchor.CentreRight, Origin = Anchor.TopCentre, Rotation = 90 diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchPiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchPiece.cs index 96a86d383..fda178e83 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchPiece.cs @@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Touches public partial class TouchPiece : CompositeDrawable { private Texture touchTexture = null!; + public TouchPiece() { Size = new Vector2(75); @@ -22,7 +23,7 @@ public TouchPiece() private void load(TextureStore textures) { touchTexture = textures.Get("Touch"); - AddInternal(new Sprite() + AddInternal(new Sprite { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TrianglesPiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TrianglesPiece.cs deleted file mode 100644 index 2a3fbf99e..000000000 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TrianglesPiece.cs +++ /dev/null @@ -1,21 +0,0 @@ -using osu.Game.Graphics.Backgrounds; - -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces -{ - public partial class TrianglesPiece : Triangles - { - protected override float SpawnRatio => 1f; - - public TrianglesPiece() - { - TriangleScale = 1.2f; - HideAlphaDiscrepancies = false; - } - - protected override void Update() - { - if (IsPresent) - base.Update(); - } - } -} diff --git a/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs b/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs index 92db6c2e9..fb0108608 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Sentakki.Objects { public abstract class SentakkiHitObject : HitObject { - public SentakkiHitObject() + protected SentakkiHitObject() { // We initialize the note colour to the default value first for test scenes // The colours during gameplay will be set during beatmap post-process @@ -43,7 +43,11 @@ public Color4 NoteColour // This special hitsample is used for Sentakki specific samples, with doesn't have bank specific variants public class SentakkiHitSampleInfo : HitSampleInfo, IEquatable { - public SentakkiHitSampleInfo(string name, int volume = 0) : base(name, volume: volume) { } + public SentakkiHitSampleInfo(string name, int volume = 0) + : base(name, volume: volume) + { + } + public override IEnumerable LookupNames { get diff --git a/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs b/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs index 887455a4a..33992cb8c 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs @@ -20,6 +20,7 @@ public bool Break } public readonly BindableInt LaneBindable = new BindableInt(); + public int Lane { get => LaneBindable.Value; @@ -33,10 +34,10 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok if (Break) { for (int i = 0; i < 4; ++i) - AddNested(new ScorePaddingObject() { StartTime = this.GetEndTime() }); + AddNested(new ScorePaddingObject { StartTime = this.GetEndTime() }); // Add bonus for players hitting within the critical window - AddNested(new ScoreBonusObject() { StartTime = this.GetEndTime() }); + AddNested(new ScoreBonusObject { StartTime = this.GetEndTime() }); } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/SentakkiSlidePath.cs b/osu.Game.Rulesets.Sentakki/Objects/SentakkiSlidePath.cs index 48a83cfa6..470409a7f 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SentakkiSlidePath.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SentakkiSlidePath.cs @@ -27,15 +27,17 @@ public class SentakkiSlidePath public bool EndsWithSlideFan { get; private set; } public bool StartsWithSlideFan { get; private set; } - public readonly Vector2 pathOrigin; - public readonly Vector2 fanOrigin; + public readonly Vector2 PathOrigin; + public readonly Vector2 FanOrigin; public SentakkiSlidePath(SliderPath segment, int endLane, bool lastSegmentIsFan = false) - : this(new[] { segment }, endLane, lastSegmentIsFan) { } + : this(new[] { segment }, endLane, lastSegmentIsFan) + { + } public SentakkiSlidePath(SliderPath[] segments, int endLane, bool lastSegmentIsFan = false) { - fanOrigin = pathOrigin = segments[0].PositionAt(0); + FanOrigin = PathOrigin = segments[0].PositionAt(0); TotalDistance = segments.Sum(p => p.Distance); EndLane = endLane; EndsWithSlideFan = lastSegmentIsFan; @@ -46,7 +48,7 @@ public SentakkiSlidePath(SliderPath[] segments, int endLane, bool lastSegmentIsF SlideSegments = new SliderPath[segments.Length - 1]; Array.Copy(segments, SlideSegments, segments.Length - 1); FanStartProgress = (float)(SlideSegments.Sum(p => p.Distance) / TotalDistance); - fanOrigin = segments[^1].PositionAt(0); + FanOrigin = segments[^1].PositionAt(0); } else SlideSegments = segments; @@ -54,7 +56,7 @@ public SentakkiSlidePath(SliderPath[] segments, int endLane, bool lastSegmentIsF public Vector2 PositionAt(double progress, int laneOffset = 0) { - if (progress <= 0) return pathOrigin; + if (progress <= 0) return PathOrigin; if (progress >= 1 && !EndsWithSlideFan) return SlideSegments[^1].PositionAt(1); // Handle the regular shapes @@ -72,12 +74,12 @@ public Vector2 PositionAt(double progress, int laneOffset = 0) } // Here starts the fan slide fallback - float originAngle = Vector2.Zero.GetDegreesFromPosition(fanOrigin); + float originAngle = Vector2.Zero.GetDegreesFromPosition(FanOrigin); float destAngle = originAngle + 180 + (laneOffset * 45); var destPosition = SentakkiExtensions.GetCircularPosition(SentakkiPlayfield.INTERSECTDISTANCE, destAngle); - return Vector2.Lerp(fanOrigin, destPosition, Math.Clamp((float)((progress - FanStartProgress) / (1 - FanStartProgress)), 0, 1)); + return Vector2.Lerp(FanOrigin, destPosition, Math.Clamp((float)((progress - FanStartProgress) / (1 - FanStartProgress)), 0, 1)); } } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs b/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs index ff4145388..e5b8fc9a3 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs @@ -52,6 +52,7 @@ protected void CreateSlideCheckpoints() { double totalDistance = SlideBodyInfo.SlidePath.TotalDistance; double runningDistance = 0; + foreach (var segment in SlideBodyInfo.SlidePath.SlideSegments) { double distance = segment.Distance; @@ -64,7 +65,7 @@ protected void CreateSlideCheckpoints() runningDistance += nodeDelta; double progress = runningDistance / totalDistance; - SlideCheckpoint checkpoint = new SlideCheckpoint() + SlideCheckpoint checkpoint = new SlideCheckpoint { Progress = (float)progress, StartTime = StartTime + ShootDelay + ((Duration - ShootDelay) * progress), @@ -84,11 +85,12 @@ protected void CreateSlideFanCheckpoints() return; // Add body nodes (should be two major sets) - Vector2 originpoint = SlideBodyInfo.SlidePath.fanOrigin; + Vector2 originpoint = SlideBodyInfo.SlidePath.FanOrigin; + for (int i = 1; i < 5; ++i) { float progress = SlideBodyInfo.SlidePath.FanStartProgress + (0.25f * i * (1 - SlideBodyInfo.SlidePath.FanStartProgress)); - SlideCheckpoint checkpoint = new SlideCheckpoint() + SlideCheckpoint checkpoint = new SlideCheckpoint { Progress = progress, StartTime = StartTime + ShootDelay + ((Duration - ShootDelay) * progress), @@ -100,6 +102,7 @@ protected void CreateSlideFanCheckpoints() Vector2 dest = SlideBodyInfo.SlidePath.PositionAt(1, j); checkpoint.NodePositions.Add(Vector2.Lerp(originpoint, dest, 0.25f * i)); } + AddNested(checkpoint); } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/SlideBodyInfo.cs b/osu.Game.Rulesets.Sentakki/Objects/SlideBodyInfo.cs index cad343bfa..a86c22647 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SlideBodyInfo.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SlideBodyInfo.cs @@ -56,8 +56,10 @@ public bool ShapeEquals(SlideBodyInfo other) return false; for (int i = 0; i < slidePathParts.Length; ++i) + { if (!slidePathParts[i].Equals(other.slidePathParts[i])) return false; + } return true; } diff --git a/osu.Game.Rulesets.Sentakki/Objects/SlidePathPart.cs b/osu.Game.Rulesets.Sentakki/Objects/SlidePathPart.cs index 96d336d82..cb65a8204 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SlidePathPart.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SlidePathPart.cs @@ -17,7 +17,7 @@ public SlideBodyPart(SlidePaths.PathShapes shape, int endOffset, bool mirrored) public override bool Equals(object obj) => obj is SlideBodyPart otherPart && Equals(otherPart); - public bool Equals(SlideBodyPart other) => ReferenceEquals(this, other) || (Shape == other.Shape && EndOffset == EndOffset); + public bool Equals(SlideBodyPart other) => ReferenceEquals(this, other) || (Shape == other.Shape && EndOffset == other.EndOffset); public override int GetHashCode() => HashCode.Combine(Shape, EndOffset, Mirrored); } diff --git a/osu.Game.Rulesets.Sentakki/Objects/SlidePaths.cs b/osu.Game.Rulesets.Sentakki/Objects/SlidePaths.cs index a7edd09e7..abae8e909 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SlidePaths.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SlidePaths.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; - using osu.Game.Rulesets.Sentakki.UI; using osuTK; @@ -24,17 +23,23 @@ public enum PathShapes } public static readonly List<(SlideBodyPart parameters, double MinDuration)> VALIDPATHS; + static SlidePaths() { VALIDPATHS = new List<(SlideBodyPart, double)>(); + for (PathShapes i = PathShapes.Straight; i <= PathShapes.Fan; ++i) + { for (int j = 0; j < 8; ++j) + { for (int k = 0; k < 2; ++k) { var tmp = new SlideBodyPart(i, j, k == 1); if (CheckSlideValidity(tmp, true)) VALIDPATHS.Add((tmp, CreateSlidePath(tmp).MinDuration)); } + } + } } // Checks if a slide is valid given parameters @@ -75,6 +80,7 @@ public static bool CheckSlideValidity(SlideBodyPart param, bool discardRedundant } public static SentakkiSlidePath CreateSlidePath(params SlideBodyPart[] pathParameters) => CreateSlidePath(0, pathParameters); + public static SentakkiSlidePath CreateSlidePath(int startOffset, params SlideBodyPart[] pathParameters) { List slideSegments = new List(); @@ -110,6 +116,7 @@ public static SentakkiSlidePath CreateSlidePath(int startOffset, params SlideBod case PathShapes.Cup: slideSegments.Add(generateCupPattern(startOffset, path.EndOffset, path.Mirrored)); break; + case PathShapes.Thunder: slideSegments.AddRange(generateThunderPattern(startOffset, path.Mirrored)); break; @@ -128,20 +135,21 @@ public static SentakkiSlidePath CreateSlidePath(int startOffset, params SlideBod // Covers DX Straight 3-7 private static SliderPath generateStraightPattern(int offset, int end) { - return new SliderPath(new PathControlPoint[] { + return new SliderPath(new[] + { new PathControlPoint(SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset), PathType.Linear), new PathControlPoint(SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset), PathType.Linear), }); } - private static Vector2 getIntesectPoint(Vector2 A1, Vector2 A2, Vector2 B1, Vector2 B2) + private static Vector2 getIntesectPoint(Vector2 a1, Vector2 a2, Vector2 b1, Vector2 b2) { - float tmp = ((B2.X - B1.X) * (A2.Y - A1.Y)) - ((B2.Y - B1.Y) * (A2.X - A1.X)); - float mu = (((A1.X - B1.X) * (A2.Y - A1.Y)) - ((A1.Y - B1.Y) * (A2.X - A1.X))) / tmp; + float tmp = ((b2.X - b1.X) * (a2.Y - a1.Y)) - ((b2.Y - b1.Y) * (a2.X - a1.X)); + float mu = (((a1.X - b1.X) * (a2.Y - a1.Y)) - ((a1.Y - b1.Y) * (a2.X - a1.X))) / tmp; return new Vector2( - B1.X + ((B2.X - B1.X) * mu), - B1.Y + ((B2.Y - B1.Y) * mu) + b1.X + ((b2.X - b1.X) * mu), + b1.Y + ((b2.Y - b1.Y) * mu) ); } @@ -154,24 +162,28 @@ private static IEnumerable generateThunderPattern(int offset, bool m int lane4 = (mirrored ? 7 : 1) + offset; static Vector2 lanestart(int x) => SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, x); - Vector2 Node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); - Vector2 Node1Pos = getIntesectPoint(lanestart(offset), lanestart(lane1), lanestart(lane2), lanestart(lane3)); + Vector2 node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); + Vector2 node1Pos = getIntesectPoint(lanestart(offset), lanestart(lane1), lanestart(lane2), lanestart(lane3)); - Vector2 Node2Pos = getIntesectPoint(lanestart(lane2), lanestart(lane3), lanestart(lane4), lanestart(4 + offset)); - Vector2 Node3Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, 4 + offset); + Vector2 node2Pos = getIntesectPoint(lanestart(lane2), lanestart(lane3), lanestart(lane4), lanestart(4 + offset)); + Vector2 node3Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, 4 + offset); - return new SliderPath[]{ - new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node0Pos, PathType.Linear), - new PathControlPoint(Node1Pos, PathType.Linear), + return new[] + { + new SliderPath(new[] + { + new PathControlPoint(node0Pos, PathType.Linear), + new PathControlPoint(node1Pos, PathType.Linear), }), - new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node1Pos, PathType.Linear), - new PathControlPoint(Node2Pos, PathType.Linear), + new SliderPath(new[] + { + new PathControlPoint(node1Pos, PathType.Linear), + new PathControlPoint(node2Pos, PathType.Linear), }), - new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node2Pos, PathType.Linear), - new PathControlPoint(Node3Pos, PathType.Linear), + new SliderPath(new[] + { + new PathControlPoint(node2Pos, PathType.Linear), + new PathControlPoint(node3Pos, PathType.Linear), }) }; } @@ -179,28 +191,31 @@ private static IEnumerable generateThunderPattern(int offset, bool m // Covers DX V pattern 1-8 private static IEnumerable generateVPattern(int offset, int end) { - Vector2 Node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); - Vector2 Node1Pos = Vector2.Zero; - Vector2 Node2Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset); + Vector2 node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); + Vector2 node1Pos = Vector2.Zero; + Vector2 node2Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset); if (end >= 3 && end <= 5) { - yield return new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node0Pos, PathType.Linear), - new PathControlPoint(Node1Pos, PathType.Linear), - new PathControlPoint(Node2Pos, PathType.Linear) + yield return new SliderPath(new[] + { + new PathControlPoint(node0Pos, PathType.Linear), + new PathControlPoint(node1Pos, PathType.Linear), + new PathControlPoint(node2Pos, PathType.Linear) }); } else { - yield return new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node0Pos, PathType.Linear), - new PathControlPoint(Node1Pos, PathType.Linear), + yield return new SliderPath(new[] + { + new PathControlPoint(node0Pos, PathType.Linear), + new PathControlPoint(node1Pos, PathType.Linear), }); - yield return new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node1Pos, PathType.Linear), - new PathControlPoint(Node2Pos, PathType.Linear), + yield return new SliderPath(new[] + { + new PathControlPoint(node1Pos, PathType.Linear), + new PathControlPoint(node2Pos, PathType.Linear), }); } } @@ -208,18 +223,20 @@ private static IEnumerable generateVPattern(int offset, int end) // Covers DX L pattern 2-5 private static IEnumerable generateLPattern(int offset, int end, bool mirrored = false) { - Vector2 Node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); - Vector2 Node1Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, (mirrored ? 2 : 6) + offset); - Vector2 Node2Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset); + Vector2 node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); + Vector2 node1Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, (mirrored ? 2 : 6) + offset); + Vector2 node2Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset); - yield return new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node0Pos, PathType.Linear), - new PathControlPoint(Node1Pos, PathType.Linear), + yield return new SliderPath(new[] + { + new PathControlPoint(node0Pos, PathType.Linear), + new PathControlPoint(node1Pos, PathType.Linear), }); - yield return new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node1Pos, PathType.Linear), - new PathControlPoint(Node2Pos, PathType.Linear), + yield return new SliderPath(new[] + { + new PathControlPoint(node1Pos, PathType.Linear), + new PathControlPoint(node2Pos, PathType.Linear), }); } @@ -229,36 +246,40 @@ private static SliderPath generateCirclePattern(int offset, int end, RotationDir float centre = ((offset.GetRotationForLane() + (end + offset).GetRotationForLane()) / 2) + (direction == RotationDirection.Counterclockwise ? 180 : 0); Vector2 centreNode = SentakkiExtensions.GetCircularPosition(SentakkiPlayfield.INTERSECTDISTANCE, centre == offset.GetRotationForLane() ? centre + 180 : centre); - return new SliderPath(new PathControlPoint[]{ - new PathControlPoint(SentakkiExtensions.GetCircularPosition(SentakkiPlayfield.INTERSECTDISTANCE, offset.GetRotationForLane() + (direction == RotationDirection.Counterclockwise ? -.5f : .5f)), PathType.PerfectCurve), + return new SliderPath(new[] + { + new PathControlPoint( + SentakkiExtensions.GetCircularPosition(SentakkiPlayfield.INTERSECTDISTANCE, offset.GetRotationForLane() + (direction == RotationDirection.Counterclockwise ? -.5f : .5f)), + PathType.PerfectCurve), new PathControlPoint(centreNode), - new PathControlPoint(SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end+offset), PathType.PerfectCurve) + new PathControlPoint(SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset), PathType.PerfectCurve) }); } private static SliderPath generateUPattern(int offset, int end, bool reversed = false) { - Vector2 Node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); - Vector2 Node1Pos = getPositionInBetween(Node0Pos, SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, (reversed ? 3 : 5) + offset), .51f); + Vector2 node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); + Vector2 node1Pos = getPositionInBetween(node0Pos, SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, (reversed ? 3 : 5) + offset), .51f); float angleDiff = (((end + offset).GetRotationForLane() + offset.GetRotationForLane()) / 2) + (Math.Abs(end) > (reversed ? 3 : 4) ? 0 : 180); - Vector2 Node2Pos = SentakkiExtensions.GetCircularPosition(115, angleDiff); + Vector2 node2Pos = SentakkiExtensions.GetCircularPosition(115, angleDiff); - Vector2 Node4Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset); - Vector2 Node3Pos = getPositionInBetween(Node4Pos, SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + (reversed ? -3 : 3) + offset), .51f); + Vector2 node4Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset); + Vector2 node3Pos = getPositionInBetween(node4Pos, SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + (reversed ? -3 : 3) + offset), .51f); - return new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node0Pos,PathType.Linear), - new PathControlPoint(Node1Pos, PathType.PerfectCurve), - new PathControlPoint(Node2Pos), - new PathControlPoint(Node3Pos, PathType.PerfectCurve), - new PathControlPoint(Node4Pos,PathType.Linear) + return new SliderPath(new[] + { + new PathControlPoint(node0Pos, PathType.Linear), + new PathControlPoint(node1Pos, PathType.PerfectCurve), + new PathControlPoint(node2Pos), + new PathControlPoint(node3Pos, PathType.PerfectCurve), + new PathControlPoint(node4Pos, PathType.Linear) }); } private static SliderPath generateCupPattern(int offset, int end, bool mirrored = false) { - float r = 270 / 2f; + const float r = 270 / 2f; int x = mirrored ? (-end).NormalizePath() : end; @@ -279,6 +300,7 @@ private static SliderPath generateCupPattern(int offset, int end, bool mirrored else if (x == 7) loopEndAngle = 390; float offsetAdjustment = offset.GetRotationForLane() - 22.5f; + if (mirrored) { originAngle = -originAngle + 45; @@ -290,24 +312,26 @@ private static SliderPath generateCupPattern(int offset, int end, bool mirrored Vector2 loopOrigin = SentakkiExtensions.GetCircularPosition(r, originAngle + offsetAdjustment); - Vector2 Node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); - Vector2 Node1Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, angle1 + offsetAdjustment); - Vector2 Node2Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, angle2 + offsetAdjustment); - Vector2 Node3Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, angle3 + offsetAdjustment); - Vector2 Node4Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, ((angle3 + loopEndAngle) / 2) + (x >= 3 ? 180 : 0) + offsetAdjustment); - Vector2 Node5Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, loopEndAngle + offsetAdjustment); - Vector2 Node6Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset); - - return new SliderPath(new PathControlPoint[]{ - new PathControlPoint(Node0Pos, PathType.Linear), - new PathControlPoint(Node1Pos, PathType.PerfectCurve), - new PathControlPoint(Node2Pos), - new PathControlPoint(Node3Pos, PathType.PerfectCurve), - new PathControlPoint(Node4Pos), - new PathControlPoint(Node5Pos,PathType.PerfectCurve), - new PathControlPoint(Node6Pos, PathType.Linear) + Vector2 node0Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, offset); + Vector2 node1Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, angle1 + offsetAdjustment); + Vector2 node2Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, angle2 + offsetAdjustment); + Vector2 node3Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, angle3 + offsetAdjustment); + Vector2 node4Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, ((angle3 + loopEndAngle) / 2) + (x >= 3 ? 180 : 0) + offsetAdjustment); + Vector2 node5Pos = loopOrigin + SentakkiExtensions.GetCircularPosition(r, loopEndAngle + offsetAdjustment); + Vector2 node6Pos = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, end + offset); + + return new SliderPath(new[] + { + new PathControlPoint(node0Pos, PathType.Linear), + new PathControlPoint(node1Pos, PathType.PerfectCurve), + new PathControlPoint(node2Pos), + new PathControlPoint(node3Pos, PathType.PerfectCurve), + new PathControlPoint(node4Pos), + new PathControlPoint(node5Pos, PathType.PerfectCurve), + new PathControlPoint(node6Pos, PathType.Linear) }); } + #endregion } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Tap.cs b/osu.Game.Rulesets.Sentakki/Objects/Tap.cs index 6d969f24e..ddcf99448 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Tap.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Tap.cs @@ -1,4 +1,6 @@ namespace osu.Game.Rulesets.Sentakki.Objects { - public class Tap : SentakkiLanedHitObject { } + public class Tap : SentakkiLanedHitObject + { + } } diff --git a/osu.Game.Rulesets.Sentakki/Scoring/SentakkiHitWindows.cs b/osu.Game.Rulesets.Sentakki/Scoring/SentakkiHitWindows.cs index 9f7a77e18..476a55b9c 100644 --- a/osu.Game.Rulesets.Sentakki/Scoring/SentakkiHitWindows.cs +++ b/osu.Game.Rulesets.Sentakki/Scoring/SentakkiHitWindows.cs @@ -13,12 +13,14 @@ public override bool IsHitResultAllowed(HitResult result) case HitResult.Ok: case HitResult.Miss: return true; + default: return false; } } - protected override DifficultyRange[] GetRanges() => new DifficultyRange[]{ + protected override DifficultyRange[] GetRanges() => new[] + { new DifficultyRange(HitResult.Miss, 144, 144, 72), new DifficultyRange(HitResult.Ok, 144, 144, 72), new DifficultyRange(HitResult.Good, 96, 96, 48), diff --git a/osu.Game.Rulesets.Sentakki/Scoring/SentakkiScoreProcessor.cs b/osu.Game.Rulesets.Sentakki/Scoring/SentakkiScoreProcessor.cs index 9596bcb72..d81f23abc 100644 --- a/osu.Game.Rulesets.Sentakki/Scoring/SentakkiScoreProcessor.cs +++ b/osu.Game.Rulesets.Sentakki/Scoring/SentakkiScoreProcessor.cs @@ -4,7 +4,10 @@ namespace osu.Game.Rulesets.Sentakki.Scoring { public partial class SentakkiScoreProcessor : ScoreProcessor { - public SentakkiScoreProcessor(SentakkiRuleset ruleset) : base(ruleset) { } + public SentakkiScoreProcessor(SentakkiRuleset ruleset) + : base(ruleset) + { + } protected override double DefaultAccuracyPortion => 0.9; protected override double DefaultComboPortion => 0.1; diff --git a/osu.Game.Rulesets.Sentakki/Scoring/SentakkiSlideHitWindows.cs b/osu.Game.Rulesets.Sentakki/Scoring/SentakkiSlideHitWindows.cs index ee5004fb8..3b22d2f3c 100644 --- a/osu.Game.Rulesets.Sentakki/Scoring/SentakkiSlideHitWindows.cs +++ b/osu.Game.Rulesets.Sentakki/Scoring/SentakkiSlideHitWindows.cs @@ -4,7 +4,8 @@ namespace osu.Game.Rulesets.Sentakki.Scoring { public class SentakkiSlideHitWindows : SentakkiHitWindows { - protected override DifficultyRange[] GetRanges() => new DifficultyRange[]{ + protected override DifficultyRange[] GetRanges() => new[] + { new DifficultyRange(HitResult.Miss, 576, 576, 288), new DifficultyRange(HitResult.Ok, 576, 576, 288), new DifficultyRange(HitResult.Good, 416, 416, 208), diff --git a/osu.Game.Rulesets.Sentakki/Scoring/SentakkiTouchHitWindows.cs b/osu.Game.Rulesets.Sentakki/Scoring/SentakkiTouchHitWindows.cs index 298f48624..0f59c8902 100644 --- a/osu.Game.Rulesets.Sentakki/Scoring/SentakkiTouchHitWindows.cs +++ b/osu.Game.Rulesets.Sentakki/Scoring/SentakkiTouchHitWindows.cs @@ -4,7 +4,8 @@ namespace osu.Game.Rulesets.Sentakki.Scoring { public class SentakkiTouchHitWindows : SentakkiHitWindows { - protected override DifficultyRange[] GetRanges() => new DifficultyRange[]{ + protected override DifficultyRange[] GetRanges() => new[] + { new DifficultyRange(HitResult.Miss, 288, 288, 144), new DifficultyRange(HitResult.Ok, 288, 288, 144), new DifficultyRange(HitResult.Good, 240, 240, 120), diff --git a/osu.Game.Rulesets.Sentakki/SentakkiExtensions.cs b/osu.Game.Rulesets.Sentakki/SentakkiExtensions.cs index f4debc81e..e351b16c3 100644 --- a/osu.Game.Rulesets.Sentakki/SentakkiExtensions.cs +++ b/osu.Game.Rulesets.Sentakki/SentakkiExtensions.cs @@ -57,10 +57,13 @@ public static Color4 GetColorForSentakkiResult(this HitResult result) { case HitResult.Great: return Color4.Orange; + case HitResult.Good: return Color4.DeepPink; + case HitResult.Ok: return Color4.Green; + default: return Color4.LightGray; } @@ -72,12 +75,16 @@ public static string GetDisplayNameForSentakkiResult(this HitResult result) { case HitResult.LargeBonus: return "Critical Break Bonus"; + case HitResult.Great: return "Perfect"; + case HitResult.Good: return "Great"; + case HitResult.Ok: return "Good"; + default: return result.GetDescription(); } diff --git a/osu.Game.Rulesets.Sentakki/SentakkiInputManager.cs b/osu.Game.Rulesets.Sentakki/SentakkiInputManager.cs index 5dfe264c5..b27b47364 100644 --- a/osu.Game.Rulesets.Sentakki/SentakkiInputManager.cs +++ b/osu.Game.Rulesets.Sentakki/SentakkiInputManager.cs @@ -14,6 +14,7 @@ namespace osu.Game.Rulesets.Sentakki public partial class SentakkiInputManager : RulesetInputManager { protected override bool MapMouseToLatestTouch => false; + public bool AllowUserPresses { set => ((SentakkiKeyBindingContainer)KeyBindingContainer).AllowUserPresses = value; @@ -48,8 +49,10 @@ protected override void PropagateReleased(IEnumerable drawables, Input var pressed = (List)PressedActions; for (int i = 0; i < pressed.Count; ++i) + { if (pressed[i] == released && ++actionCount > 1) break; + } if (actionCount > 1) pressed.Remove(released); diff --git a/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs b/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs index e08287c5c..4f139f133 100644 --- a/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs +++ b/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs @@ -44,6 +44,7 @@ public class SentakkiRuleset : Ruleset private static readonly Lazy is_development_build = new Lazy(() => typeof(SentakkiRuleset).Assembly.GetCustomAttributes(false).OfType().Any(da => da.IsJITTrackingEnabled)); + public static bool IsDevelopmentBuild => is_development_build.Value; public override string Description => IsDevelopmentBuild ? "sentakki (Dev build)" : "sentakki"; @@ -97,7 +98,8 @@ public override IEnumerable GetModsFor(ModType type) }; case ModType.Conversion: - return new Mod[]{ + return new Mod[] + { new SentakkiModExperimental(), new SentakkiModClassic(), new SentakkiModMirror(), @@ -154,11 +156,11 @@ public override StatisticRow[] CreateStatisticsForScore(ScoreInfo score, IBeatma { Columns = new[] { - new StatisticItem(SentakkiStatisticsStrings.JudgementChart, () => new JudgementChart(score.HitEvents.Where(e=>e.HitObject is SentakkiHitObject).ToList()) + new StatisticItem(SentakkiStatisticsStrings.JudgementChart, () => new JudgementChart(score.HitEvents.Where(e => e.HitObject is SentakkiHitObject).ToList()) { RelativeSizeAxes = Axes.X, Size = new Vector2(1, 250) - },true), + }, true), } }, new StatisticRow @@ -224,12 +226,14 @@ private void load(GameHost host) Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Size = new Vector2(60, 35), - Children = new Drawable[]{ + Children = new Drawable[] + { // Used to offset the fonts being misaligned - new Container{ + new Container + { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, - Size = new Vector2(60,32), + Size = new Vector2(60, 32), CornerRadius = 8f, CornerExponent = 2.5f, Masking = true, @@ -242,7 +246,7 @@ private void load(GameHost host) { Text = "DEV", Colour = Color4.Gray, - Font = OsuFont.Torus.With(size: 32,weight: FontWeight.Bold), + Font = OsuFont.Torus.With(size: 32, weight: FontWeight.Bold), Anchor = Anchor.Centre, Origin = Anchor.Centre, } diff --git a/osu.Game.Rulesets.Sentakki/Statistics/JudgementChart.cs b/osu.Game.Rulesets.Sentakki/Statistics/JudgementChart.cs index bb37418b9..65cebb209 100644 --- a/osu.Game.Rulesets.Sentakki/Statistics/JudgementChart.cs +++ b/osu.Game.Rulesets.Sentakki/Statistics/JudgementChart.cs @@ -20,16 +20,18 @@ public partial class JudgementChart : CompositeDrawable { private const double entry_animation_duration = 150; private const double bar_fill_duration = 3000; + public JudgementChart(List hitEvents) { Origin = Anchor.Centre; Anchor = Anchor.Centre; Size = new Vector2(500, 250); - AddRangeInternal(new Drawable[]{ + AddRangeInternal(new Drawable[] + { new NoteEntry { ObjectName = "Tap", - HitEvents = hitEvents.Where(e=> e.HitObject is Tap x && !x.Break).ToList(), + HitEvents = hitEvents.Where(e => e.HitObject is Tap x && !x.Break).ToList(), Position = new Vector2(0, 0), InitialLifetimeOffset = entry_animation_duration * 0 }, @@ -70,6 +72,7 @@ public JudgementChart(List hitEvents) }, }); } + public partial class NoteEntry : Container { public double InitialLifetimeOffset; @@ -82,30 +85,33 @@ public partial class NoteEntry : Container [BackgroundDependencyLoader] private void load(OsuColour colours) { - float GoodCount = 0; - float GreatCount = 0; - float PerfectCount = 0; + float goodCount = 0; + float greatCount = 0; + float perfectCount = 0; foreach (var e in HitEvents) { switch (e.Result) { case HitResult.Great: - ++PerfectCount; + ++perfectCount; goto case HitResult.Good; + case HitResult.Good: - ++GreatCount; + ++greatCount; goto case HitResult.Ok; + case HitResult.Ok: - ++GoodCount; + ++goodCount; break; } } - Color4 textColour = !HitEvents.Any() ? Color4Extensions.FromHex("bcbcbc") : (PerfectCount == HitEvents.Count) ? Color4.White : Color4Extensions.FromHex("#3c5394"); - Color4 boxColour = !HitEvents.Any() ? Color4Extensions.FromHex("808080") : (PerfectCount == HitEvents.Count) ? Color4Extensions.FromHex("fda908") : Color4Extensions.FromHex("#DCE9F9"); - Color4 borderColour = !HitEvents.Any() ? Color4Extensions.FromHex("536277") : (PerfectCount == HitEvents.Count) ? Color4Extensions.FromHex("fda908") : Color4Extensions.FromHex("#98b8df"); - Color4 numberColour = (PerfectCount == HitEvents.Count && HitEvents.Any()) ? Color4.White : Color4Extensions.FromHex("#3c5394"); + Color4 textColour = !HitEvents.Any() ? Color4Extensions.FromHex("bcbcbc") : (perfectCount == HitEvents.Count) ? Color4.White : Color4Extensions.FromHex("#3c5394"); + Color4 boxColour = !HitEvents.Any() ? Color4Extensions.FromHex("808080") : (perfectCount == HitEvents.Count) ? Color4Extensions.FromHex("fda908") : Color4Extensions.FromHex("#DCE9F9"); + Color4 borderColour = !HitEvents.Any() ? Color4Extensions.FromHex("536277") : + (perfectCount == HitEvents.Count) ? Color4Extensions.FromHex("fda908") : Color4Extensions.FromHex("#98b8df"); + Color4 numberColour = (perfectCount == HitEvents.Count && HitEvents.Any()) ? Color4.White : Color4Extensions.FromHex("#3c5394"); Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; @@ -121,12 +127,16 @@ private void load(OsuColour colours) CornerExponent = 2.5f; AlwaysPresent = true; - InternalChildren = new Drawable[]{ - new Box { + InternalChildren = new Drawable[] + { + new Box + { RelativeSizeAxes = Axes.Both, Colour = boxColour, }, - new Container { // Left + new Container + { + // Left RelativeSizeAxes = Axes.Both, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, @@ -140,7 +150,9 @@ private void load(OsuColour colours) Font = OsuFont.Torus.With(size: 20, weight: FontWeight.Bold) } }, - progressBox = new Container { // Centre + progressBox = new Container + { + // Centre RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, @@ -150,14 +162,18 @@ private void load(OsuColour colours) Masking = true, BorderThickness = 2, BorderColour = Color4.Black, - Children = new Drawable[]{ - new Box{ + Children = new Drawable[] + { + new Box + { RelativeSizeAxes = Axes.Both, - Colour = !HitEvents.Any() ? Color4Extensions.FromHex("343434"):Color4.DarkGray, + Colour = !HitEvents.Any() ? Color4Extensions.FromHex("343434") : Color4.DarkGray, } } }, - new Container { // Right + new Container + { + // Right RelativeSizeAxes = Axes.Both, Origin = Anchor.CentreRight, Anchor = Anchor.CentreRight, @@ -172,14 +188,18 @@ private void load(OsuColour colours) }, }; - progressBox.AddRange(new Drawable[]{ - new ChartBar(HitResult.Ok, GoodCount/HitEvents.Count){ + progressBox.AddRange(new Drawable[] + { + new ChartBar(HitResult.Ok, goodCount / HitEvents.Count) + { InitialLifetimeOffset = InitialLifetimeOffset }, - new ChartBar(HitResult.Good, GreatCount/HitEvents.Count){ + new ChartBar(HitResult.Good, greatCount / HitEvents.Count) + { InitialLifetimeOffset = InitialLifetimeOffset }, - new ChartBar(HitResult.Great, PerfectCount/HitEvents.Count){ + new ChartBar(HitResult.Great, perfectCount / HitEvents.Count) + { InitialLifetimeOffset = InitialLifetimeOffset }, }); @@ -190,7 +210,7 @@ protected override void LoadComplete() base.LoadComplete(); ScheduleAfterChildren(() => { - using (BeginDelayedSequence(InitialLifetimeOffset, true)) + using (BeginDelayedSequence(InitialLifetimeOffset)) { this.ScaleTo(1, entry_animation_duration, Easing.OutBack).FadeIn(); noteCounter.Current.Value = HitEvents.Count; diff --git a/osu.Game.Rulesets.Sentakki/UI/Components/HitExplosion.cs b/osu.Game.Rulesets.Sentakki/UI/Components/HitExplosion.cs index 62c0c97de..9f2a51bfc 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Components/HitExplosion.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Components/HitExplosion.cs @@ -27,15 +27,18 @@ public HitExplosion() Size = new Vector2(default_explosion_size); Colour = Color4.Cyan; Alpha = 0; - InternalChildren = new Drawable[]{ - circle = new CircularContainer{ + InternalChildren = new Drawable[] + { + circle = new CircularContainer + { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Masking = true, BorderThickness = 45, BorderColour = Color4.White, - Child = new Box{ + Child = new Box + { Alpha = 0, RelativeSizeAxes = Axes.Both, AlwaysPresent = true, @@ -56,6 +59,7 @@ private void setBorderThiccness(ValueChangedEvent v) public HitExplosion Apply(DrawableSentakkiHitObject drawableSentakkiHitObject) { Colour = drawableSentakkiHitObject.AccentColour.Value; + switch (drawableSentakkiHitObject.HitObject) { case SentakkiLanedHitObject lanedObject: diff --git a/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/DrawableLine.cs b/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/DrawableLine.cs index cdf490a24..28eb9d02c 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/DrawableLine.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/DrawableLine.cs @@ -32,7 +32,7 @@ private void load(SentakkiRulesetConfigManager? sentakkiConfigs) sentakkiConfigs?.BindWith(SentakkiRulesetSettings.AnimationDuration, animationDuration); animationDuration.BindValueChanged(_ => resetAnimation()); - AddInternal(line = new CircularProgress() + AddInternal(line = new CircularProgress { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, @@ -57,6 +57,7 @@ protected override void PrepareForUse() private void resetAnimation() { if (!IsInUse) return; + ApplyTransformsAt(double.MinValue); ClearTransforms(); using (BeginAbsoluteSequence(Entry.StartTime - Entry.AdjustedAnimationDuration)) diff --git a/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/LineLifetimeEntry.cs b/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/LineLifetimeEntry.cs index 5d05759be..6c2b6e26d 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/LineLifetimeEntry.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/LineLifetimeEntry.cs @@ -12,8 +12,8 @@ namespace osu.Game.Rulesets.Sentakki.UI.Components.HitObjectLine { public class LineLifetimeEntry : LifetimeEntry { - private readonly BindableDouble AnimationDuration = new BindableDouble(1000); - public double AdjustedAnimationDuration => AnimationDuration.Value * GameplaySpeed; + private readonly BindableDouble animationDuration = new BindableDouble(1000); + public double AdjustedAnimationDuration => animationDuration.Value * GameplaySpeed; public double GameplaySpeed => drawableRuleset?.GameplaySpeed ?? 1; @@ -21,12 +21,12 @@ public class LineLifetimeEntry : LifetimeEntry public double StartTime { get; private set; } - public LineLifetimeEntry(BindableDouble AnimationDuration, DrawableSentakkiRuleset? drawableSentakkiRuleset, double startTime) + public LineLifetimeEntry(BindableDouble animationDuration, DrawableSentakkiRuleset? drawableSentakkiRuleset, double startTime) { StartTime = startTime; drawableRuleset = drawableSentakkiRuleset; - this.AnimationDuration.BindTo(AnimationDuration); - this.AnimationDuration.BindValueChanged(refreshLifetime, true); + this.animationDuration.BindTo(animationDuration); + this.animationDuration.BindValueChanged(refreshLifetime, true); } public List HitObjects = new List(); @@ -75,14 +75,13 @@ public void UpdateLine() var anchor = HitObjects.First(h => getDelta(HitObjects[0], h) == minDelta); int delta = maxDelta - minDelta; - bool allBreaks = HitObjects.All(h => h.Break); Colour = Color4.Gold; int angleRange = delta == 4 ? 360 : (90 + (45 * delta)); AngleRange = angleRange / 360f; - Rotation = anchor.Lane.GetRotationForLane() + (delta * 22.5f) - (angleRange / 2); + Rotation = anchor.Lane.GetRotationForLane() + (delta * 22.5f) - (angleRange / 2f); } // Notify the renderer that the line may be updated diff --git a/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/LineRenderer.cs b/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/LineRenderer.cs index cb8bff06a..c89d1d80c 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/LineRenderer.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Components/HitObjectLine/LineRenderer.cs @@ -127,6 +127,7 @@ private void addHitObjectToEntry(double entryTime, SentakkiLanedHitObject hitObj // We want to listen in on line changes in case we need to swap out colours/drawables newEntry.OnLineUpdated += onEntryUpdated; } + lineEntries[entryTime].Add(hitObject); } } diff --git a/osu.Game.Rulesets.Sentakki/UI/Components/LiveCounter.cs b/osu.Game.Rulesets.Sentakki/UI/Components/LiveCounter.cs index 1e524ba3c..c846afbb7 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Components/LiveCounter.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Components/LiveCounter.cs @@ -15,7 +15,7 @@ public partial class LiveCounter : BeatSyncedContainer { public BindableInt LivesLeft = new BindableInt(); - private LiveRollingCounter livesText; + private readonly LiveRollingCounter livesText; public LiveCounter(BindableInt livesBindable) { @@ -31,6 +31,7 @@ public LiveCounter(BindableInt livesBindable) Shake(); }, true); } + protected override void LoadComplete() { base.LoadComplete(); @@ -75,10 +76,12 @@ protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, float beatMagnitude = 0.1f + (0.05f * panicLevel); if (beatIndex % (int)(timingPoint.TimeSignature.Numerator * Math.Max(panicDurationMultiplier, 0.5f)) == 0) + { this.ScaleTo(1 + beatMagnitude, 200 * panicDurationMultiplier) .Then().ScaleTo(1, 120 * panicDurationMultiplier) .Then().ScaleTo(1 + beatMagnitude, 160 * panicDurationMultiplier) .Then().ScaleTo(1, 320 * panicDurationMultiplier); + } } private partial class LiveRollingCounter : RollingCounter diff --git a/osu.Game.Rulesets.Sentakki/UI/Components/PlayfieldVisualization.cs b/osu.Game.Rulesets.Sentakki/UI/Components/PlayfieldVisualization.cs index d78cb05d7..a7f5cb553 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Components/PlayfieldVisualization.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Components/PlayfieldVisualization.cs @@ -135,6 +135,7 @@ protected override void Update() base.Update(); timeDelta += Math.Abs(Time.Elapsed); + if (timeDelta >= time_between_updates) { timeDelta %= time_between_updates; diff --git a/osu.Game.Rulesets.Sentakki/UI/Components/SentakkiRing.cs b/osu.Game.Rulesets.Sentakki/UI/Components/SentakkiRing.cs index 007a2d8ea..07381c06c 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Components/SentakkiRing.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Components/SentakkiRing.cs @@ -38,19 +38,21 @@ public SentakkiRing() { AddInternal(new DotPiece { - Position = new Vector2(-(SentakkiPlayfield.INTERSECTDISTANCE * (float)Math.Cos((pathAngle + 90f) * (float)(Math.PI / 180))), -(SentakkiPlayfield.INTERSECTDISTANCE * (float)Math.Sin((pathAngle + 90f) * (float)(Math.PI / 180)))), + Position = new Vector2(-(SentakkiPlayfield.INTERSECTDISTANCE * (float)Math.Cos((pathAngle + 90f) * (float)(Math.PI / 180))), + -(SentakkiPlayfield.INTERSECTDISTANCE * (float)Math.Sin((pathAngle + 90f) * (float)(Math.PI / 180)))), }); spawnIndicator.Add(new DotPiece(size: new Vector2(16, 8)) { Rotation = pathAngle, - Position = new Vector2(-(SentakkiPlayfield.NOTESTARTDISTANCE * (float)Math.Cos((pathAngle + 90f) * (float)(Math.PI / 180))), -(SentakkiPlayfield.NOTESTARTDISTANCE * (float)Math.Sin((pathAngle + 90f) * (float)(Math.PI / 180)))), + Position = new Vector2(-(SentakkiPlayfield.NOTESTARTDISTANCE * (float)Math.Cos((pathAngle + 90f) * (float)(Math.PI / 180))), + -(SentakkiPlayfield.NOTESTARTDISTANCE * (float)Math.Sin((pathAngle + 90f) * (float)(Math.PI / 180)))), }); } } public readonly Bindable RingOpacity = new Bindable(1); - public readonly Bindable NoteStartIndicators = new Bindable(false); + public readonly Bindable NoteStartIndicators = new Bindable(); private readonly Bindable kiaiEffect = new Bindable(true); [BackgroundDependencyLoader] diff --git a/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs b/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs index fdd32e7c8..89f846d6c 100644 --- a/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs +++ b/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs @@ -3,6 +3,7 @@ using osu.Framework.Allocation; using osu.Framework.Audio.Track; using osu.Framework.Bindables; +using osu.Framework.Input; using osu.Game.Beatmaps; using osu.Game.Input.Handlers; using osu.Game.Replays; @@ -77,6 +78,6 @@ private void load() protected override ResumeOverlay CreateResumeOverlay() => new SentakkiResumeOverlay(); - protected override Framework.Input.PassThroughInputManager CreateInputManager() => new SentakkiInputManager(Ruleset.RulesetInfo); + protected override PassThroughInputManager CreateInputManager() => new SentakkiInputManager(Ruleset.RulesetInfo); } } diff --git a/osu.Game.Rulesets.Sentakki/UI/Lane.cs b/osu.Game.Rulesets.Sentakki/UI/Lane.cs index 80e637ded..e57b506bc 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Lane.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Lane.cs @@ -67,6 +67,7 @@ private void load() protected override HitObjectLifetimeEntry CreateLifetimeEntry(HitObject hitObject) => new SentakkiHitObjectLifetimeEntry(hitObject, sentakkiRulesetConfig, drawableSentakkiRuleset); #region Input Handling + private const float receptor_angle_range = 45 * 1.4f; private SentakkiInputManager sentakkiActionInputManager = null!; @@ -87,7 +88,7 @@ public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) return true; } - private readonly BindableInt currentKeys = new BindableInt(0); + private readonly BindableInt currentKeys = new BindableInt(); private bool usingSensor => drawableSentakkiRuleset.UseSensorMode; @@ -98,17 +99,28 @@ private void updateInputState() int count = 0; foreach (var buttonState in buttonTriggerState) - if (buttonState.Value) ++count; + { + if (buttonState.Value) + ++count; + } var touchInput = SentakkiActionInputManager.CurrentState.Touch; for (TouchSource t = TouchSource.Touch1; t <= TouchSource.Touch10; ++t) - if (touchInput.GetTouchPosition(t) is Vector2 touchPosition && ReceivePositionalInputAt(touchPosition)) ++count; + { + if (touchInput.GetTouchPosition(t) is Vector2 touchPosition && ReceivePositionalInputAt(touchPosition)) + ++count; + } // We don't attempt to check mouse input if touch input is used if (count == 0 && IsHovered && usingSensor) + { foreach (var a in SentakkiActionInputManager.PressedActions) - if (a < SentakkiAction.Key1) ++count; + { + if (a < SentakkiAction.Key1) + ++count; + } + } currentKeys.Value = count; } @@ -140,6 +152,7 @@ public void OnReleased(KeyBindingReleaseEvent e) buttonTriggerState[e.Action] = false; } + #endregion } } diff --git a/osu.Game.Rulesets.Sentakki/UI/LanedPlayfield.cs b/osu.Game.Rulesets.Sentakki/UI/LanedPlayfield.cs index b922cb56b..3d5c1c4bb 100644 --- a/osu.Game.Rulesets.Sentakki/UI/LanedPlayfield.cs +++ b/osu.Game.Rulesets.Sentakki/UI/LanedPlayfield.cs @@ -44,7 +44,8 @@ public LanedPlayfield() AddNested(lane); } - AddRangeInternal(new Drawable[]{ + AddRangeInternal(new Drawable[] + { chevronPool = new DrawablePool(100), HitObjectLineRenderer = new LineRenderer(), slideBodyProxyContainer = new SortedDrawableProxyContainer(), @@ -88,9 +89,11 @@ private void onHitObjectLoaded(Drawable hitObject) case DrawableSlideBody s: slideBodyProxyContainer.Add(s.CreateProxy(), s); break; + case DrawableTap t: lanedNoteProxyContainer.Add(t.TapVisual.CreateProxy(), t); break; + case DrawableHold h: lanedNoteProxyContainer.Add(h.NoteBody.CreateProxy(), h); break; diff --git a/osu.Game.Rulesets.Sentakki/UI/SentakkiHitObjectLifetimeEntry.cs b/osu.Game.Rulesets.Sentakki/UI/SentakkiHitObjectLifetimeEntry.cs index d5d7f356b..64faa4b4f 100644 --- a/osu.Game.Rulesets.Sentakki/UI/SentakkiHitObjectLifetimeEntry.cs +++ b/osu.Game.Rulesets.Sentakki/UI/SentakkiHitObjectLifetimeEntry.cs @@ -10,7 +10,7 @@ public class SentakkiHitObjectLifetimeEntry : HitObjectLifetimeEntry { protected override double InitialLifetimeOffset => initialLifetimeOffsetFor(HitObject); - private DrawableSentakkiRuleset drawableRuleset; + private readonly DrawableSentakkiRuleset drawableRuleset; public double GameplaySpeed => drawableRuleset?.GameplaySpeed ?? 1; @@ -18,9 +18,10 @@ public class SentakkiHitObjectLifetimeEntry : HitObjectLifetimeEntry protected double AdjustedAnimationDuration => AnimationDurationBindable.Value * GameplaySpeed; - private SentakkiRulesetConfigManager? sentakkiConfigs; + private readonly SentakkiRulesetConfigManager? sentakkiConfigs; - public SentakkiHitObjectLifetimeEntry(HitObject hitObject, SentakkiRulesetConfigManager? configManager, DrawableSentakkiRuleset senRuleset) : base(hitObject) + public SentakkiHitObjectLifetimeEntry(HitObject hitObject, SentakkiRulesetConfigManager? configManager, DrawableSentakkiRuleset senRuleset) + : base(hitObject) { sentakkiConfigs = configManager; drawableRuleset = senRuleset; @@ -32,11 +33,12 @@ private void bindAnimationDuration() { switch (HitObject) { - case SentakkiLanedHitObject _: + case SentakkiLanedHitObject: sentakkiConfigs?.BindWith(SentakkiRulesetSettings.AnimationDuration, AnimationDurationBindable); break; - case Touch _: - case TouchHold _: + + case Touch: + case TouchHold: sentakkiConfigs?.BindWith(SentakkiRulesetSettings.TouchAnimationDuration, AnimationDurationBindable); break; } @@ -46,8 +48,9 @@ private double initialLifetimeOffsetFor(HitObject hitObject) { switch (hitObject) { - case Touch _: + case Touch: return AdjustedAnimationDuration + HitObject.HitWindows.WindowFor(HitResult.Ok); + default: return AdjustedAnimationDuration; } diff --git a/osu.Game.Rulesets.Sentakki/UI/SentakkiPlayfield.cs b/osu.Game.Rulesets.Sentakki/UI/SentakkiPlayfield.cs index 53933de41..56c768cf7 100644 --- a/osu.Game.Rulesets.Sentakki/UI/SentakkiPlayfield.cs +++ b/osu.Game.Rulesets.Sentakki/UI/SentakkiPlayfield.cs @@ -78,7 +78,7 @@ public SentakkiPlayfield() LanedPlayfield = new LanedPlayfield(), HitObjectContainer, // This only contains TouchHolds, which needs to be above others types touchPlayfield = new TouchPlayfield(), // This only contains Touch, which needs a custom playfield to handle their input - explosionLayer = new Container() { RelativeSizeAxes = Axes.Both }, + explosionLayer = new Container { RelativeSizeAxes = Axes.Both }, judgementLayer = new Container { RelativeSizeAxes = Axes.Both, @@ -128,12 +128,14 @@ public override void Add(HitObject h) { switch (h) { - case SentakkiLanedHitObject _: + case SentakkiLanedHitObject: LanedPlayfield.Add(h); break; - case Touch _: + + case Touch: touchPlayfield.Add(h); break; + default: base.Add(h); break; @@ -168,9 +170,11 @@ private void changePlayfieldAccent() case ColorOption.Difficulty: AccentContainer.FadeColour(colours.ForDifficultyRating(beatmapDifficulty?.Value?.DifficultyRating ?? DifficultyRating.Normal, true), 200); break; + case ColorOption.Skin: AccentContainer.FadeColour(skin.Value.GetConfig(GlobalSkinColours.MenuGlow)?.Value ?? Color4.White, 200); break; + default: AccentContainer.FadeColour(Color4.White, 200); break; diff --git a/osu.Game.Rulesets.Sentakki/UI/SentakkiResumeOverlay.cs b/osu.Game.Rulesets.Sentakki/UI/SentakkiResumeOverlay.cs index 979c9057d..5c88484f6 100644 --- a/osu.Game.Rulesets.Sentakki/UI/SentakkiResumeOverlay.cs +++ b/osu.Game.Rulesets.Sentakki/UI/SentakkiResumeOverlay.cs @@ -26,7 +26,8 @@ public partial class SentakkiResumeOverlay : ResumeOverlay [Resolved] private DrawableSentakkiRuleset? drawableSentakkiRuleset { get; set; } - private readonly string[] supporter_list = new string[]{ + private readonly string[] supporterList = new[] + { "Ayato_K", "Bosch", "Dubita", @@ -50,14 +51,14 @@ public partial class SentakkiResumeOverlay : ResumeOverlay private double remainingTime = 3500; - private Bindable beatsLeft = new Bindable(4); + private readonly Bindable beatsLeft = new Bindable(4); private int barLength; private OsuSpriteText supporterText = null!; private SkinnableSound countSound = null!; - private SentakkiCursorContainer? localCursorContainer = null; + private SentakkiCursorContainer? localCursorContainer; public override CursorContainer? LocalCursor => State.Value == Visibility.Visible ? localCursorContainer : null; @@ -138,8 +139,8 @@ protected override void PopOut() private string getRandomSupporter() { - string tmp = supporter_list[currentSupporterIndex++]; - if (currentSupporterIndex >= supporter_list.Length) currentSupporterIndex = 0; + string tmp = supporterList[currentSupporterIndex++]; + if (currentSupporterIndex >= supporterList.Length) currentSupporterIndex = 0; return tmp; } diff --git a/osu.Game.Rulesets.Sentakki/UI/SentakkiSettingsSubsection.cs b/osu.Game.Rulesets.Sentakki/UI/SentakkiSettingsSubsection.cs index 32c3f0328..1d9ceb9ac 100644 --- a/osu.Game.Rulesets.Sentakki/UI/SentakkiSettingsSubsection.cs +++ b/osu.Game.Rulesets.Sentakki/UI/SentakkiSettingsSubsection.cs @@ -42,7 +42,8 @@ private void load() LabelText = SentakkiSettingsSubsectionStrings.SnakingInSlides, Current = config.GetBindable(SentakkiRulesetSettings.SnakingSlideBody) }, - new SettingsCheckbox{ + new SettingsCheckbox + { LabelText = SentakkiSettingsSubsectionStrings.ShowDetailedJudgements, Current = config.GetBindable(SentakkiRulesetSettings.DetailedJudgements) }, @@ -94,6 +95,7 @@ private string speedRating() return speed.ToString(); } + public override LocalisableString TooltipText => Current.Value.ToString("N0") + "ms (" + speedRating() + ")"; } @@ -108,6 +110,7 @@ private string speedRating() return speed.ToString(); } + public override LocalisableString TooltipText => Current.Value.ToString("N0") + "ms (" + speedRating() + ")"; } } diff --git a/osu.Game.Rulesets.Sentakki/UI/TouchPlayfield.cs b/osu.Game.Rulesets.Sentakki/UI/TouchPlayfield.cs index 7fb037cd7..beae08066 100644 --- a/osu.Game.Rulesets.Sentakki/UI/TouchPlayfield.cs +++ b/osu.Game.Rulesets.Sentakki/UI/TouchPlayfield.cs @@ -7,6 +7,7 @@ using osu.Game.Rulesets.Sentakki.Objects.Drawables; using osu.Game.Rulesets.UI; using osuTK; +using Touch = osu.Game.Rulesets.Sentakki.Objects.Touch; namespace osu.Game.Rulesets.Sentakki.UI { @@ -33,7 +34,7 @@ public TouchPlayfield() [BackgroundDependencyLoader] private void load() { - RegisterPool(8); + RegisterPool(8); } protected override HitObjectLifetimeEntry CreateLifetimeEntry(HitObject hitObject) => new SentakkiHitObjectLifetimeEntry(hitObject, sentakkiRulesetConfig, drawableSentakkiRuleset); @@ -53,6 +54,7 @@ protected override void Update() // Handle mouse input var mousePosition = SentakkiActionInputManager.CurrentState.Mouse.Position; bool actionPressed = false; + foreach (var action in SentakkiActionInputManager.PressedActions) { if (action < SentakkiAction.Key1)