mirror of
https://github.com/osukey/osukey.git
synced 2025-05-23 06:27:24 +09:00
Add ability to open overlays during gameplay breaks.
This commit is contained in:
parent
9a09f97478
commit
052bb06c91
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
@ -47,6 +48,16 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddAssert("activation mode is user triggered", () => testPlayer.OverlayActivationMode == OverlayActivation.UserTriggered);
|
AddAssert("activation mode is user triggered", () => testPlayer.OverlayActivationMode == OverlayActivation.UserTriggered);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestGameplayOverlayActivationBreaks()
|
||||||
|
{
|
||||||
|
AddAssert("activation mode is disabled", () => testPlayer.OverlayActivationMode == OverlayActivation.Disabled);
|
||||||
|
AddStep("seek to break", () => testPlayer.GameplayClockContainer.Seek(Beatmap.Value.Beatmap.Breaks.First().StartTime));
|
||||||
|
AddUntilStep("activation mode is user triggered", () => testPlayer.OverlayActivationMode == OverlayActivation.UserTriggered);
|
||||||
|
AddStep("seek to break end", () => testPlayer.GameplayClockContainer.Seek(Beatmap.Value.Beatmap.Breaks.First().EndTime));
|
||||||
|
AddUntilStep("activation mode is disabled", () => testPlayer.OverlayActivationMode == OverlayActivation.Disabled);
|
||||||
|
}
|
||||||
|
|
||||||
protected override TestPlayer CreatePlayer(Ruleset ruleset) => testPlayer = new OverlayTestPlayer();
|
protected override TestPlayer CreatePlayer(Ruleset ruleset) => testPlayer = new OverlayTestPlayer();
|
||||||
|
|
||||||
private class OverlayTestPlayer : TestPlayer
|
private class OverlayTestPlayer : TestPlayer
|
||||||
|
@ -215,6 +215,7 @@ namespace osu.Game.Screens.Play
|
|||||||
gameplayOverlaysDisabled.BindValueChanged(_ => updateOverlayActivationMode());
|
gameplayOverlaysDisabled.BindValueChanged(_ => updateOverlayActivationMode());
|
||||||
DrawableRuleset.IsPaused.BindValueChanged(_ => updateOverlayActivationMode());
|
DrawableRuleset.IsPaused.BindValueChanged(_ => updateOverlayActivationMode());
|
||||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updateOverlayActivationMode());
|
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updateOverlayActivationMode());
|
||||||
|
breakTracker.IsBreakTime.BindValueChanged(_ => updateOverlayActivationMode());
|
||||||
|
|
||||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
|
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
|
||||||
|
|
||||||
@ -362,7 +363,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void updateOverlayActivationMode()
|
private void updateOverlayActivationMode()
|
||||||
{
|
{
|
||||||
bool canTriggerOverlays = DrawableRuleset.IsPaused.Value || !gameplayOverlaysDisabled.Value;
|
bool canTriggerOverlays = DrawableRuleset.IsPaused.Value || breakTracker.IsBreakTime.Value || !gameplayOverlaysDisabled.Value;
|
||||||
|
|
||||||
if (DrawableRuleset.HasReplayLoaded.Value || canTriggerOverlays)
|
if (DrawableRuleset.HasReplayLoaded.Value || canTriggerOverlays)
|
||||||
OverlayActivationMode.Value = OverlayActivation.UserTriggered;
|
OverlayActivationMode.Value = OverlayActivation.UserTriggered;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user