-
-
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 ruleset-specific-combo-counter
- Loading branch information
Showing
276 changed files
with
8,465 additions
and
1,864 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
66 changes: 66 additions & 0 deletions
66
osu.Game.Rulesets.Catch.Tests/Editor/TestSceneCatchEditorSaving.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,66 @@ | ||
// 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.Linq; | ||
using NUnit.Framework; | ||
using osu.Framework.Testing; | ||
using osu.Game.Beatmaps.ControlPoints; | ||
using osu.Game.Rulesets.Catch.Objects; | ||
using osu.Game.Rulesets.Catch.UI; | ||
using osu.Game.Tests.Visual; | ||
using osuTK; | ||
using osuTK.Input; | ||
|
||
namespace osu.Game.Rulesets.Catch.Tests.Editor | ||
{ | ||
public partial class TestSceneCatchEditorSaving : EditorSavingTestScene | ||
{ | ||
protected override Ruleset CreateRuleset() => new CatchRuleset(); | ||
|
||
[Test] | ||
public void TestCatchJuiceStreamTickCorrect() | ||
{ | ||
AddStep("enter timing mode", () => InputManager.Key(Key.F3)); | ||
AddStep("add timing point", () => EditorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint())); | ||
AddStep("enter compose mode", () => InputManager.Key(Key.F1)); | ||
|
||
Vector2 startPoint = Vector2.Zero; | ||
float increment = 0; | ||
|
||
AddUntilStep("wait for playfield", () => this.ChildrenOfType<CatchPlayfield>().FirstOrDefault()?.IsLoaded == true); | ||
AddStep("move to centre", () => | ||
{ | ||
var playfield = this.ChildrenOfType<CatchPlayfield>().Single(); | ||
startPoint = playfield.ScreenSpaceDrawQuad.Centre + new Vector2(0, playfield.ScreenSpaceDrawQuad.Height / 3); | ||
increment = playfield.ScreenSpaceDrawQuad.Height / 10; | ||
InputManager.MoveMouseTo(startPoint); | ||
}); | ||
AddStep("choose juice stream placing tool", () => InputManager.Key(Key.Number3)); | ||
AddStep("start placement", () => InputManager.Click(MouseButton.Left)); | ||
|
||
AddStep("move to next", () => InputManager.MoveMouseTo(startPoint + new Vector2(2 * increment, -increment))); | ||
AddStep("add node", () => InputManager.Click(MouseButton.Left)); | ||
|
||
AddStep("move to next", () => InputManager.MoveMouseTo(startPoint + new Vector2(-2 * increment, -2 * increment))); | ||
AddStep("add node", () => InputManager.Click(MouseButton.Left)); | ||
|
||
AddStep("move to next", () => InputManager.MoveMouseTo(startPoint + new Vector2(0, -3 * increment))); | ||
AddStep("end placement", () => InputManager.Click(MouseButton.Right)); | ||
|
||
AddUntilStep("juice stream placed", () => EditorBeatmap.HitObjects, () => Has.Count.EqualTo(1)); | ||
|
||
int largeDropletCount = 0, tinyDropletCount = 0; | ||
AddStep("store droplet count", () => | ||
{ | ||
largeDropletCount = EditorBeatmap.HitObjects[0].NestedHitObjects.Count(t => t.GetType() == typeof(Droplet)); | ||
tinyDropletCount = EditorBeatmap.HitObjects[0].NestedHitObjects.Count(t => t.GetType() == typeof(TinyDroplet)); | ||
}); | ||
|
||
SaveEditor(); | ||
ReloadEditorToSameBeatmap(); | ||
|
||
AddAssert("large droplet count is the same", () => EditorBeatmap.HitObjects[0].NestedHitObjects.Count(t => t.GetType() == typeof(Droplet)), () => Is.EqualTo(largeDropletCount)); | ||
AddAssert("tiny droplet count is the same", () => EditorBeatmap.HitObjects[0].NestedHitObjects.Count(t => t.GetType() == typeof(TinyDroplet)), () => Is.EqualTo(tinyDropletCount)); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// 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 System.Collections.Generic; | ||
using System.Linq; | ||
using osu.Framework.Allocation; | ||
|
@@ -17,6 +18,7 @@ | |
using osu.Game.Rulesets.UI; | ||
using osu.Game.Rulesets.UI.Scrolling; | ||
using osu.Game.Screens.Edit; | ||
using osu.Game.Screens.Edit.Compose.Components; | ||
using osu.Game.Tests.Visual; | ||
using osuTK; | ||
|
||
|
@@ -84,6 +86,7 @@ protected override bool OnMouseMove(MouseMoveEvent e) | |
public partial class TestHitObjectComposer : HitObjectComposer | ||
{ | ||
public override Playfield Playfield { get; } | ||
public override ComposeBlueprintContainer BlueprintContainer => throw new NotImplementedException(); | ||
public override IEnumerable<DrawableHitObject> HitObjects => Enumerable.Empty<DrawableHitObject>(); | ||
public override bool CursorInPlacementArea => false; | ||
|
||
|
@@ -100,7 +103,7 @@ public Drawable Child | |
|
||
public override SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition, SnapType snapType = SnapType.All) | ||
{ | ||
throw new System.NotImplementedException(); | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
osu.Game.Rulesets.Mania.Tests/Editor/TestSceneManiaEditorSaving.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,45 @@ | ||
// 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.Linq; | ||
using NUnit.Framework; | ||
using osu.Framework.Testing; | ||
using osu.Game.Graphics.UserInterfaceV2; | ||
using osu.Game.Overlays; | ||
using osu.Game.Screens.Edit; | ||
using osu.Game.Screens.Edit.Setup; | ||
using osu.Game.Tests.Visual; | ||
using osuTK.Input; | ||
|
||
namespace osu.Game.Rulesets.Mania.Tests.Editor | ||
{ | ||
public partial class TestSceneManiaEditorSaving : EditorSavingTestScene | ||
{ | ||
protected override Ruleset CreateRuleset() => new ManiaRuleset(); | ||
|
||
[Test] | ||
public void TestKeyCountChange() | ||
{ | ||
LabelledSliderBar<float> keyCount = null!; | ||
|
||
AddStep("go to setup screen", () => InputManager.Key(Key.F4)); | ||
AddUntilStep("retrieve key count slider", () => keyCount = Editor.ChildrenOfType<SetupScreen>().Single().ChildrenOfType<LabelledSliderBar<float>>().First(), () => Is.Not.Null); | ||
AddAssert("key count is 5", () => keyCount.Current.Value, () => Is.EqualTo(5)); | ||
AddStep("change key count to 8", () => | ||
{ | ||
keyCount.Current.Value = 8; | ||
}); | ||
AddUntilStep("dialog visible", () => Game.ChildrenOfType<IDialogOverlay>().SingleOrDefault()?.CurrentDialog, Is.InstanceOf<ReloadEditorDialog>); | ||
AddStep("refuse", () => InputManager.Key(Key.Number2)); | ||
AddAssert("key count is 5", () => keyCount.Current.Value, () => Is.EqualTo(5)); | ||
|
||
AddStep("change key count to 8 again", () => | ||
{ | ||
keyCount.Current.Value = 8; | ||
}); | ||
AddUntilStep("dialog visible", () => Game.ChildrenOfType<IDialogOverlay>().Single().CurrentDialog, Is.InstanceOf<ReloadEditorDialog>); | ||
AddStep("acquiesce", () => InputManager.Key(Key.Number1)); | ||
AddUntilStep("beatmap became 8K", () => Game.Beatmap.Value.BeatmapInfo.Difficulty.CircleSize, () => Is.EqualTo(8)); | ||
} | ||
} | ||
} |
Oops, something went wrong.