Skip to content

Commit

Permalink
Merge branch 'master' into skinning-separation
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed Oct 1, 2022
2 parents 08a2b7f + 63e174a commit 7abcb87
Show file tree
Hide file tree
Showing 83 changed files with 1,096 additions and 942 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<Nullable>enable</Nullable>

<Authors>Derrick Timmermans</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
7 changes: 7 additions & 0 deletions TRANSLATORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Sentakki - Translators

Special thanks to these people for providing translations to the sentakki project via [Crowdin](https://crowdin.com/project/sentakki).

| Name | Languages | Translated strings |
| ----------------------------------------------------------------- | ------------------------------ | ------------------ |
| Derrick Timmermans ([@LumpBloom7](https://github.com/LumpBloom7)) | Simplified/Traditional Chinese | 110 |
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@ public class TestSceneAllSlides : OsuTestScene
protected override Ruleset CreateRuleset() => new SentakkiRuleset();

private int id;
private bool mirrored;

private readonly SlideVisual slide;
private readonly Container nodes;

[Cached]
private readonly DrawablePool<SlideVisual.SlideChevron> chevronPool;
private readonly DrawablePool<SlideChevron> chevronPool;

[Cached]
private readonly SlideFanChevrons fanChevrons;

public TestSceneAllSlides()
{
Add(chevronPool = new DrawablePool<SlideVisual.SlideChevron>(62));
Add(chevronPool = new DrawablePool<SlideChevron>(62));
Add(fanChevrons = new SlideFanChevrons());

Add(new SentakkiRing()
{
RelativeSizeAxes = Axes.None,
Expand All @@ -44,20 +49,14 @@ public TestSceneAllSlides()
RefreshSlide();
});

AddToggleStep("Mirrored", b =>
{
mirrored = b;
RefreshSlide();
});

Add(nodes = new Container()
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
});
}

protected SentakkiSlidePath CreatePattern() => SlidePaths.GetSlidePath(id, mirrored);
protected SentakkiSlidePath CreatePattern() => SlidePaths.CreateSlidePath(SlidePaths.VALIDPATHS[id].parameters);

protected override void LoadComplete()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
using osu.Framework.Graphics;
using osu.Game.Rulesets.Sentakki.Objects;

namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides
{
public class TestSceneCircleSlide : TestSceneSlide
{
private bool clockwise;
public TestSceneCircleSlide()
{
AddToggleStep("Clockwise", b =>
{
clockwise = b;
RefreshSlide();
});
}
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateCirclePattern(EndPath, clockwise ? RotationDirection.Clockwise : RotationDirection.Counterclockwise);
protected override SlidePaths.PathShapes PathShape => SlidePaths.PathShapes.Circle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides
{
public class TestSceneCupSlide : TestSceneSlide
{
private bool mirrored;

public TestSceneCupSlide()
{
AddToggleStep("Mirrored", b =>
{
mirrored = b;
RefreshSlide();
});
}

protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateCupPattern(EndPath, mirrored);
protected override SlidePaths.PathShapes PathShape => SlidePaths.PathShapes.Cup;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Sentakki.Objects;
using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides;
using osu.Game.Rulesets.Sentakki.UI;
using osu.Game.Rulesets.Sentakki.UI.Components;
Expand All @@ -19,11 +20,11 @@ public class TestSceneFanSlide : OsuTestScene

private SentakkiRing ring;

private readonly SlideFanVisual slide;

[Cached]
private readonly SlideFanChevrons fanChevrons;

private SlideVisual slide;

public TestSceneFanSlide()
{
Add(fanChevrons = new SlideFanChevrons());
Expand All @@ -34,10 +35,7 @@ public TestSceneFanSlide()
Size = new Vector2(SentakkiPlayfield.RINGSIZE)
});

Add(slide = new SlideFanVisual()
{
Rotation = 22.5f
});
Add(slide = new SlideVisual());

AddSliderStep("Progress", 0.0f, 1.0f, 0.0f, p =>
{
Expand All @@ -47,7 +45,6 @@ public TestSceneFanSlide()
AddSliderStep("Rotation", 0.0f, 360f, 22.5f, p =>
{
slide.Rotation = p;
ring.Rotation = p - 22.5f;
});

AddStep("Perform entry animation", () => slide.PerformEntryAnimation(1000));
Expand All @@ -56,5 +53,11 @@ public TestSceneFanSlide()
AddStep("Perform exit animation", () => slide.PerformExitAnimation(1000));
AddWaitStep("Wait for transforms", 5);
}

protected override void LoadComplete()
{
base.LoadComplete();
slide.Path = SlidePaths.CreateSlidePath(new SlideBodyPart(SlidePaths.PathShapes.Fan, 4, false));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides
{
public class TestSceneLSlide : TestSceneSlide
{
private bool mirrored;

public TestSceneLSlide()
{
AddToggleStep("Mirrored", b =>
{
mirrored = b;
RefreshSlide();
});
}

protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateLPattern(EndPath, mirrored);
protected override SlidePaths.PathShapes PathShape => SlidePaths.PathShapes.L;
}
}
34 changes: 25 additions & 9 deletions osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,56 @@ public abstract class TestSceneSlide : OsuTestScene
{
protected override Ruleset CreateRuleset() => new SentakkiRuleset();

protected int StartPath;
protected int EndPath;
private int startPath;
private int endPath;

private bool mirrored;

protected abstract SlidePaths.PathShapes PathShape { get; }

private readonly SlideVisual slide;
private readonly Container nodes;

[Cached]
private readonly DrawablePool<SlideVisual.SlideChevron> chevronPool;
private readonly DrawablePool<SlideChevron> chevronPool;

[Cached]
private readonly SlideFanChevrons fanChevrons;

public TestSceneSlide()
{
Add(chevronPool = new DrawablePool<SlideVisual.SlideChevron>(62));
Add(chevronPool = new DrawablePool<SlideChevron>(62));
Add(fanChevrons = new SlideFanChevrons());

Add(new SentakkiRing()
{
RelativeSizeAxes = Axes.None,
Size = new Vector2(SentakkiPlayfield.RINGSIZE)
});

Add(slide = new SlideVisual());

AddSliderStep("Path offset", 0, 7, 0, p =>
AddSliderStep("Start lane", 0, 7, 0, p =>
{
slide.Rotation = 45 * p;
startPath = p;
RefreshSlide();
});
AddSliderStep("End Path", 0, 7, 4, p =>
AddSliderStep("End lane", 0, 7, 4, p =>
{
EndPath = p;
endPath = p;
RefreshSlide();
});
AddSliderStep("Progress", 0.0f, 1.0f, 0.0f, p =>
{
slide.Progress = p;
});

AddToggleStep("Mirrored", b =>
{
mirrored = b;
RefreshSlide();
});

AddStep("Perform entry animation", () => slide.PerformEntryAnimation(1000));
AddWaitStep("Wait for transforms", 5);

Expand All @@ -67,7 +83,7 @@ public TestSceneSlide()
});
}

protected abstract SentakkiSlidePath CreatePattern();
protected SentakkiSlidePath CreatePattern() => SlidePaths.CreateSlidePath(startPath, new SlideBodyPart(PathShape, endPath, mirrored));

protected override void LoadComplete()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides
{
public class TestSceneStraightSlide : TestSceneSlide
{
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateStraightPattern(EndPath);
protected override SlidePaths.PathShapes PathShape => SlidePaths.PathShapes.Straight;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides
{
public class TestSceneThunderSlide : TestSceneSlide
{
private bool mirrored;

public TestSceneThunderSlide()
{
AddToggleStep("Mirrored", b =>
{
mirrored = b;
RefreshSlide();
});
}
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateThunderPattern(mirrored);
protected override SlidePaths.PathShapes PathShape => SlidePaths.PathShapes.Thunder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides
{
public class TestSceneUSlide : TestSceneSlide
{
private bool reversed;

public TestSceneUSlide()
{
AddToggleStep("Mirrored", b =>
{
reversed = b;
RefreshSlide();
});
}

protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateUPattern(EndPath, reversed);
protected override SlidePaths.PathShapes PathShape => SlidePaths.PathShapes.U;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides
{
public class TestSceneVSlide : TestSceneSlide
{
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateVPattern(EndPath);
protected override SlidePaths.PathShapes PathShape => SlidePaths.PathShapes.V;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public TestSceneBreakNote()

AddStep("Miss Single", () => testSingle());
AddStep("Hit Single", () => testSingle(true));
AddUntilStep("Wait for object despawn", () => !Children.Any(h => (h is DrawableSentakkiHitObject) && (h as DrawableSentakkiHitObject).AllJudged == false));
AddUntilStep("Wait for object despawn", () => !Children.Any(h => h is DrawableSentakkiHitObject sentakkiHitObject && sentakkiHitObject.AllJudged == false));
}

private void testSingle(bool auto = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public TestSceneHoldNote()
AddStep("Hit Long", () => testSingle(1000, true));
AddStep("Miss Very Long", () => testSingle(3000));
AddStep("Hit Very Long", () => testSingle(3000, true));
AddUntilStep("Wait for object despawn", () => !Children.Any(h => (h is DrawableSentakkiHitObject) && (h as DrawableSentakkiHitObject).AllJudged == false));
AddUntilStep("Wait for object despawn", () => !Children.Any(h => h is DrawableSentakkiHitObject sentakkiHitObject && sentakkiHitObject.AllJudged == false));
}

private void testSingle(double duration, bool auto = false)
Expand Down
17 changes: 13 additions & 4 deletions osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
using osu.Game.Rulesets.Sentakki.Objects;
using osu.Game.Rulesets.Sentakki.Objects.Drawables;
using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides;
using osu.Game.Rulesets.Sentakki.UI;
using osu.Game.Rulesets.Sentakki.UI.Components;
using osu.Game.Tests.Visual;
using osuTK;

namespace osu.Game.Rulesets.Sentakki.Tests.Objects
{
Expand All @@ -29,23 +32,29 @@ public class TestSceneSlideFan : OsuTestScene
public TestSceneSlideFan()
{
base.Content.Add(content = new SentakkiInputManager(new SentakkiRuleset().RulesetInfo));
Add(new SentakkiRing()
{
RelativeSizeAxes = Axes.None,
Size = new Vector2(SentakkiPlayfield.RINGSIZE),
Rotation = -22.5f
});

Add(fanChevrons = new SlideFanChevrons());

AddStep("Miss Single", () => testSingle(2000));
AddStep("Hit Single", () => testSingle(2000, true));
AddUntilStep("Wait for object despawn", () => !Children.Any(h => (h is DrawableSentakkiHitObject) && (h as DrawableSentakkiHitObject).AllJudged == false));
AddUntilStep("Wait for object despawn", () => !Children.Any(h => (h is DrawableSentakkiHitObject hitObject) && hitObject.AllJudged == false));
}

private void testSingle(double duration, bool auto = false)
{
var slide = new Slide
{
//Break = true,
SlideInfoList = new List<SentakkiSlideInfo>
SlideInfoList = new List<SlideBodyInfo>
{
new SentakkiSlideInfo {
ID = SlidePaths.FANID,
new SlideBodyInfo {
SlidePathParts = new[] {new SlideBodyPart(SlidePaths.PathShapes.Fan, 4, false)},
Duration = 1000,
},
},
Expand Down
Loading

0 comments on commit 7abcb87

Please sign in to comment.