mirror of
https://github.com/ppy/osu
synced 2024-12-16 11:56:31 +00:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into useroverlay-overall-improvements
This commit is contained in:
commit
f5f041acc8
@ -25,6 +25,7 @@ namespace osu.Game.Tests.Visual.Components
|
|||||||
{
|
{
|
||||||
box1 = new IdleTrackingBox(1000)
|
box1 = new IdleTrackingBox(1000)
|
||||||
{
|
{
|
||||||
|
Name = "TopLeft",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Red,
|
Colour = Color4.Red,
|
||||||
Anchor = Anchor.TopLeft,
|
Anchor = Anchor.TopLeft,
|
||||||
@ -32,6 +33,7 @@ namespace osu.Game.Tests.Visual.Components
|
|||||||
},
|
},
|
||||||
box2 = new IdleTrackingBox(2000)
|
box2 = new IdleTrackingBox(2000)
|
||||||
{
|
{
|
||||||
|
Name = "TopRight",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Green,
|
Colour = Color4.Green,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
@ -39,6 +41,7 @@ namespace osu.Game.Tests.Visual.Components
|
|||||||
},
|
},
|
||||||
box3 = new IdleTrackingBox(3000)
|
box3 = new IdleTrackingBox(3000)
|
||||||
{
|
{
|
||||||
|
Name = "BottomLeft",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Blue,
|
Colour = Color4.Blue,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
@ -46,6 +49,7 @@ namespace osu.Game.Tests.Visual.Components
|
|||||||
},
|
},
|
||||||
box4 = new IdleTrackingBox(4000)
|
box4 = new IdleTrackingBox(4000)
|
||||||
{
|
{
|
||||||
|
Name = "BottomRight",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Orange,
|
Colour = Color4.Orange,
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
@ -57,51 +61,80 @@ namespace osu.Game.Tests.Visual.Components
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestNudge()
|
public void TestNudge()
|
||||||
{
|
{
|
||||||
AddStep("move mouse to top left", () => InputManager.MoveMouseTo(box1.ScreenSpaceDrawQuad.Centre));
|
AddStep("move to top left", () => InputManager.MoveMouseTo(box1));
|
||||||
|
|
||||||
AddUntilStep("Wait for all idle", () => box1.IsIdle && box2.IsIdle && box3.IsIdle && box4.IsIdle);
|
waitForAllIdle();
|
||||||
|
|
||||||
AddStep("nudge mouse", () => InputManager.MoveMouseTo(box1.ScreenSpaceDrawQuad.Centre + new Vector2(1)));
|
AddStep("nudge mouse", () => InputManager.MoveMouseTo(box1.ScreenSpaceDrawQuad.Centre + new Vector2(1)));
|
||||||
|
|
||||||
AddAssert("check not idle", () => !box1.IsIdle);
|
checkIdleStatus(box1, false);
|
||||||
AddAssert("check idle", () => box2.IsIdle);
|
checkIdleStatus(box2, true);
|
||||||
AddAssert("check idle", () => box3.IsIdle);
|
checkIdleStatus(box3, true);
|
||||||
AddAssert("check idle", () => box4.IsIdle);
|
checkIdleStatus(box4, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMovement()
|
public void TestMovement()
|
||||||
{
|
{
|
||||||
AddStep("move mouse", () => InputManager.MoveMouseTo(box2.ScreenSpaceDrawQuad.Centre));
|
AddStep("move to top right", () => InputManager.MoveMouseTo(box2));
|
||||||
|
|
||||||
AddAssert("check not idle", () => box1.IsIdle);
|
checkIdleStatus(box1, true);
|
||||||
AddAssert("check not idle", () => !box2.IsIdle);
|
checkIdleStatus(box2, false);
|
||||||
AddAssert("check idle", () => box3.IsIdle);
|
checkIdleStatus(box3, true);
|
||||||
AddAssert("check idle", () => box4.IsIdle);
|
checkIdleStatus(box4, true);
|
||||||
|
|
||||||
AddStep("move mouse", () => InputManager.MoveMouseTo(box3.ScreenSpaceDrawQuad.Centre));
|
AddStep("move to bottom left", () => InputManager.MoveMouseTo(box3));
|
||||||
AddStep("move mouse", () => InputManager.MoveMouseTo(box4.ScreenSpaceDrawQuad.Centre));
|
AddStep("move to bottom right", () => InputManager.MoveMouseTo(box4));
|
||||||
|
|
||||||
AddAssert("check not idle", () => box1.IsIdle);
|
checkIdleStatus(box1, true);
|
||||||
AddAssert("check not idle", () => !box2.IsIdle);
|
checkIdleStatus(box2, false);
|
||||||
AddAssert("check idle", () => !box3.IsIdle);
|
checkIdleStatus(box3, false);
|
||||||
AddAssert("check idle", () => !box4.IsIdle);
|
checkIdleStatus(box4, false);
|
||||||
|
|
||||||
AddUntilStep("Wait for all idle", () => box1.IsIdle && box2.IsIdle && box3.IsIdle && box4.IsIdle);
|
waitForAllIdle();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestTimings()
|
public void TestTimings()
|
||||||
{
|
{
|
||||||
AddStep("move mouse", () => InputManager.MoveMouseTo(ScreenSpaceDrawQuad.Centre));
|
AddStep("move to centre", () => InputManager.MoveMouseTo(Content));
|
||||||
|
|
||||||
|
checkIdleStatus(box1, false);
|
||||||
|
checkIdleStatus(box2, false);
|
||||||
|
checkIdleStatus(box3, false);
|
||||||
|
checkIdleStatus(box4, false);
|
||||||
|
|
||||||
AddAssert("check not idle", () => !box1.IsIdle && !box2.IsIdle && !box3.IsIdle && !box4.IsIdle);
|
|
||||||
AddUntilStep("Wait for idle", () => box1.IsIdle);
|
AddUntilStep("Wait for idle", () => box1.IsIdle);
|
||||||
AddAssert("check not idle", () => !box2.IsIdle && !box3.IsIdle && !box4.IsIdle);
|
|
||||||
|
checkIdleStatus(box1, true);
|
||||||
|
checkIdleStatus(box2, false);
|
||||||
|
checkIdleStatus(box3, false);
|
||||||
|
checkIdleStatus(box4, false);
|
||||||
|
|
||||||
AddUntilStep("Wait for idle", () => box2.IsIdle);
|
AddUntilStep("Wait for idle", () => box2.IsIdle);
|
||||||
AddAssert("check not idle", () => !box3.IsIdle && !box4.IsIdle);
|
|
||||||
|
checkIdleStatus(box1, true);
|
||||||
|
checkIdleStatus(box2, true);
|
||||||
|
checkIdleStatus(box3, false);
|
||||||
|
checkIdleStatus(box4, false);
|
||||||
|
|
||||||
AddUntilStep("Wait for idle", () => box3.IsIdle);
|
AddUntilStep("Wait for idle", () => box3.IsIdle);
|
||||||
|
|
||||||
|
checkIdleStatus(box1, true);
|
||||||
|
checkIdleStatus(box2, true);
|
||||||
|
checkIdleStatus(box3, true);
|
||||||
|
checkIdleStatus(box4, false);
|
||||||
|
|
||||||
|
waitForAllIdle();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkIdleStatus(IdleTrackingBox box, bool expectedIdle)
|
||||||
|
{
|
||||||
|
AddAssert($"{box.Name} is {(expectedIdle ? "idle" : "active")}", () => box.IsIdle == expectedIdle);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void waitForAllIdle()
|
||||||
|
{
|
||||||
AddUntilStep("Wait for all idle", () => box1.IsIdle && box2.IsIdle && box3.IsIdle && box4.IsIdle);
|
AddUntilStep("Wait for all idle", () => box1.IsIdle && box2.IsIdle && box3.IsIdle && box4.IsIdle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
name = round.Name.GetBoundCopy();
|
name = round.Name.GetBoundCopy();
|
||||||
name.BindValueChanged(n => textName.Text = ((losers ? "Losers " : "") + round.Name).ToUpper(), true);
|
name.BindValueChanged(n => textName.Text = ((losers ? "Losers " : "") + round.Name).ToUpper(), true);
|
||||||
|
|
||||||
description = round.Name.GetBoundCopy();
|
description = round.Description.GetBoundCopy();
|
||||||
description.BindValueChanged(n => textDescription.Text = round.Description.Value.ToUpper(), true);
|
description.BindValueChanged(n => textDescription.Text = round.Description.Value?.ToUpper(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,6 +222,7 @@ namespace osu.Game.Tournament
|
|||||||
sw.Write(JsonConvert.SerializeObject(ladder,
|
sw.Write(JsonConvert.SerializeObject(ladder,
|
||||||
new JsonSerializerSettings
|
new JsonSerializerSettings
|
||||||
{
|
{
|
||||||
|
Formatting = Formatting.Indented,
|
||||||
NullValueHandling = NullValueHandling.Ignore,
|
NullValueHandling = NullValueHandling.Ignore,
|
||||||
DefaultValueHandling = DefaultValueHandling.Ignore,
|
DefaultValueHandling = DefaultValueHandling.Ignore,
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user