-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into stamina-available-fingers
- Loading branch information
Showing
334 changed files
with
6,905 additions
and
1,734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
osu.Game.Rulesets.Catch.Tests/Mods/TestSceneCatchModFlashlight.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using NUnit.Framework; | ||
using osu.Game.Rulesets.Catch.Mods; | ||
using osu.Game.Tests.Visual; | ||
|
||
namespace osu.Game.Rulesets.Catch.Tests.Mods | ||
{ | ||
public class TestSceneCatchModFlashlight : ModTestScene | ||
{ | ||
protected override Ruleset CreatePlayerRuleset() => new CatchRuleset(); | ||
|
||
[TestCase(1f)] | ||
[TestCase(0.5f)] | ||
[TestCase(1.25f)] | ||
[TestCase(1.5f)] | ||
public void TestSizeMultiplier(float sizeMultiplier) => CreateModTest(new ModTestData { Mod = new CatchModFlashlight { SizeMultiplier = { Value = sizeMultiplier } }, PassCondition = () => true }); | ||
|
||
[Test] | ||
public void TestComboBasedSize([Values] bool comboBasedSize) => CreateModTest(new ModTestData { Mod = new CatchModFlashlight { ComboBasedSize = { Value = comboBasedSize } }, PassCondition = () => true }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using NUnit.Framework; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Testing; | ||
using osu.Game.Rulesets.Catch.Beatmaps; | ||
using osu.Game.Rulesets.Catch.Mods; | ||
using osu.Game.Rulesets.Catch.UI; | ||
using osu.Game.Rulesets.Mods; | ||
using osu.Game.Tests.Visual; | ||
|
||
namespace osu.Game.Rulesets.Catch.Tests | ||
{ | ||
[TestFixture] | ||
public class TestSceneCatchTouchInput : OsuTestScene | ||
{ | ||
private CatchTouchInputMapper catchTouchInputMapper = null!; | ||
|
||
[SetUpSteps] | ||
public void SetUpSteps() | ||
[Test] | ||
public void TestBasic() | ||
{ | ||
CatchTouchInputMapper catchTouchInputMapper = null!; | ||
|
||
AddStep("create input overlay", () => | ||
{ | ||
Child = new CatchInputManager(new CatchRuleset().RulesetInfo) | ||
|
@@ -32,12 +37,30 @@ public void SetUpSteps() | |
} | ||
}; | ||
}); | ||
|
||
AddStep("show overlay", () => catchTouchInputMapper.Show()); | ||
} | ||
|
||
[Test] | ||
public void TestBasic() | ||
public void TestWithoutRelax() | ||
{ | ||
AddStep("show overlay", () => catchTouchInputMapper.Show()); | ||
AddStep("create drawable ruleset without relax mod", () => | ||
{ | ||
Child = new DrawableCatchRuleset(new CatchRuleset(), new CatchBeatmap(), new List<Mod>()); | ||
}); | ||
AddUntilStep("wait for load", () => Child.IsLoaded); | ||
AddAssert("check touch input is shown", () => this.ChildrenOfType<CatchTouchInputMapper>().Any()); | ||
} | ||
|
||
[Test] | ||
public void TestWithRelax() | ||
{ | ||
AddStep("create drawable ruleset with relax mod", () => | ||
{ | ||
Child = new DrawableCatchRuleset(new CatchRuleset(), new CatchBeatmap(), new List<Mod> { new CatchModRelax() }); | ||
}); | ||
AddUntilStep("wait for load", () => Child.IsLoaded); | ||
AddAssert("check touch input is not shown", () => !this.ChildrenOfType<CatchTouchInputMapper>().Any()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,48 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System.Linq; | ||
using NUnit.Framework; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Bindables; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Utils; | ||
using osu.Game.Rulesets.Catch.Objects; | ||
using osu.Game.Rulesets.Catch.Objects.Drawables; | ||
using osu.Game.Rulesets.Catch.UI; | ||
using osu.Game.Rulesets.Judgements; | ||
using osu.Game.Rulesets.Scoring; | ||
using osu.Game.Screens.Play; | ||
using osu.Game.Tests.Visual; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
|
||
namespace osu.Game.Rulesets.Catch.Tests | ||
{ | ||
public class TestSceneComboCounter : CatchSkinnableTestScene | ||
{ | ||
private ScoreProcessor scoreProcessor; | ||
private ScoreProcessor scoreProcessor = null!; | ||
|
||
private Color4 judgedObjectColour = Color4.White; | ||
|
||
private readonly Bindable<bool> showHud = new Bindable<bool>(true); | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
{ | ||
Dependencies.CacheAs<Player>(new TestPlayer | ||
{ | ||
ShowingOverlayComponents = { BindTarget = showHud }, | ||
}); | ||
} | ||
|
||
[SetUp] | ||
public void SetUp() => Schedule(() => | ||
{ | ||
scoreProcessor = new ScoreProcessor(new CatchRuleset()); | ||
|
||
showHud.Value = true; | ||
|
||
SetContents(_ => new CatchComboDisplay | ||
{ | ||
Anchor = Anchor.Centre, | ||
|
@@ -51,9 +66,15 @@ public void TestCatchComboCounter() | |
1f | ||
); | ||
}); | ||
|
||
AddStep("set hud to never show", () => showHud.Value = false); | ||
AddRepeatStep("perform hit", () => performJudgement(HitResult.Great), 5); | ||
|
||
AddStep("set hud to show", () => showHud.Value = true); | ||
AddRepeatStep("perform hit", () => performJudgement(HitResult.Great), 5); | ||
} | ||
|
||
private void performJudgement(HitResult type, Judgement judgement = null) | ||
private void performJudgement(HitResult type, Judgement? judgement = null) | ||
{ | ||
var judgedObject = new DrawableFruit(new Fruit()) { AccentColour = { Value = judgedObjectColour } }; | ||
|
||
|
4 changes: 2 additions & 2 deletions
4
osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
osu.Game.Rulesets.Catch/Edit/CatchEditorPlayfieldAdjustmentContainer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Game.Rulesets.Catch.UI; | ||
using osu.Game.Rulesets.UI; | ||
using osuTK; | ||
|
||
namespace osu.Game.Rulesets.Catch.Edit | ||
{ | ||
public class CatchEditorPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer | ||
{ | ||
protected override Container<Drawable> Content => content; | ||
private readonly Container content; | ||
|
||
public CatchEditorPlayfieldAdjustmentContainer() | ||
{ | ||
Anchor = Anchor.TopCentre; | ||
Origin = Anchor.TopCentre; | ||
Size = new Vector2(0.8f, 0.9f); | ||
|
||
InternalChild = new ScalingContainer | ||
{ | ||
Anchor = Anchor.TopCentre, | ||
Origin = Anchor.TopCentre, | ||
Child = content = new Container { RelativeSizeAxes = Axes.Both }, | ||
}; | ||
} | ||
|
||
private class ScalingContainer : Container | ||
{ | ||
public ScalingContainer() | ||
{ | ||
RelativeSizeAxes = Axes.Y; | ||
Width = CatchPlayfield.WIDTH; | ||
} | ||
|
||
protected override void Update() | ||
{ | ||
base.Update(); | ||
|
||
Scale = new Vector2(Math.Min(Parent.ChildSize.X / CatchPlayfield.WIDTH, Parent.ChildSize.Y / CatchPlayfield.HEIGHT)); | ||
Height = 1 / Scale.Y; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.