mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 16:43:52 +09:00
Merge branch 'master' into taiko-sample-based-plcaement
This commit is contained in:
@ -8,6 +8,7 @@ using osu.Framework.Testing;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
@ -45,6 +46,18 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddAssert("Time still stopped", () => lastTime == Player.GameplayClockContainer.CurrentTime);
|
AddAssert("Time still stopped", () => lastTime == Player.GameplayClockContainer.CurrentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestDoesNotFailOnExit()
|
||||||
|
{
|
||||||
|
loadPlayerWithBeatmap();
|
||||||
|
|
||||||
|
AddUntilStep("wait for first hit", () => Player.ScoreProcessor.TotalScore.Value > 0);
|
||||||
|
AddAssert("ensure rank is not fail", () => Player.ScoreProcessor.Rank.Value, () => Is.Not.EqualTo(ScoreRank.F));
|
||||||
|
AddStep("exit player", () => Player.Exit());
|
||||||
|
AddUntilStep("wait for exit", () => Player.Parent == null);
|
||||||
|
AddAssert("ensure rank is not fail", () => Player.ScoreProcessor.Rank.Value, () => Is.Not.EqualTo(ScoreRank.F));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestPauseViaSpaceWithSkip()
|
public void TestPauseViaSpaceWithSkip()
|
||||||
{
|
{
|
||||||
|
@ -114,6 +114,19 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase(OverlayActivation.All)]
|
||||||
|
[TestCase(OverlayActivation.Disabled)]
|
||||||
|
public void TestButtonKeyboardInputRespectsOverlayActivation(OverlayActivation mode)
|
||||||
|
{
|
||||||
|
AddStep($"set activation mode to {mode}", () => toolbar.OverlayActivationMode.Value = mode);
|
||||||
|
AddStep("hide toolbar", () => toolbar.Hide());
|
||||||
|
|
||||||
|
if (mode == OverlayActivation.Disabled)
|
||||||
|
AddAssert("check buttons not accepting input", () => InputManager.NonPositionalInputQueue.OfType<ToolbarButton>().Count(), () => Is.Zero);
|
||||||
|
else
|
||||||
|
AddAssert("check buttons accepting input", () => InputManager.NonPositionalInputQueue.OfType<ToolbarButton>().Count(), () => Is.Not.Zero);
|
||||||
|
}
|
||||||
|
|
||||||
[TestCase(OverlayActivation.All)]
|
[TestCase(OverlayActivation.All)]
|
||||||
[TestCase(OverlayActivation.Disabled)]
|
[TestCase(OverlayActivation.Disabled)]
|
||||||
public void TestRespectsOverlayActivation(OverlayActivation mode)
|
public void TestRespectsOverlayActivation(OverlayActivation mode)
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||||
|
|
||||||
// Toolbar and its components need keyboard input even when hidden.
|
// Toolbar and its components need keyboard input even when hidden.
|
||||||
public override bool PropagateNonPositionalInputSubTree => true;
|
public override bool PropagateNonPositionalInputSubTree => OverlayActivationMode.Value != OverlayActivation.Disabled;
|
||||||
|
|
||||||
public Toolbar()
|
public Toolbar()
|
||||||
{
|
{
|
||||||
|
@ -206,7 +206,13 @@ namespace osu.Game.Rulesets.UI
|
|||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When the debugger is attached, exceptions are expensive.
|
||||||
|
// Manually work around this by caching failed lookups and falling back straight to parent.
|
||||||
|
private readonly HashSet<(string, string)> failedLookups = new HashSet<(string, string)>();
|
||||||
|
|
||||||
public override IShader Load(string vertex, string fragment)
|
public override IShader Load(string vertex, string fragment)
|
||||||
|
{
|
||||||
|
if (!failedLookups.Contains((vertex, fragment)))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -215,9 +221,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
// Shader lookup is very non-standard. Rather than returning null on missing shaders, exceptions are thrown.
|
// Shader lookup is very non-standard. Rather than returning null on missing shaders, exceptions are thrown.
|
||||||
|
failedLookups.Add((vertex, fragment));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return parent.Load(vertex, fragment);
|
return parent.Load(vertex, fragment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1111,7 +1111,7 @@ namespace osu.Game.Screens.Play
|
|||||||
GameplayState.HasQuit = true;
|
GameplayState.HasQuit = true;
|
||||||
|
|
||||||
// if arriving here and the results screen preparation task hasn't run, it's safe to say the user has not completed the beatmap.
|
// if arriving here and the results screen preparation task hasn't run, it's safe to say the user has not completed the beatmap.
|
||||||
if (prepareScoreForDisplayTask == null)
|
if (prepareScoreForDisplayTask == null && DrawableRuleset.ReplayScore == null)
|
||||||
ScoreProcessor.FailScore(Score.ScoreInfo);
|
ScoreProcessor.FailScore(Score.ScoreInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user