Better pause logic

This commit is contained in:
Dean Herbert
2018-07-11 17:01:27 +09:00
parent ffd3040fe2
commit c2cdf12986
3 changed files with 19 additions and 14 deletions

View File

@ -89,6 +89,14 @@ namespace osu.Game.Rulesets.UI
Ruleset = ruleset;
playfield = new Lazy<Playfield>(CreatePlayfield);
IsPaused.ValueChanged += paused =>
{
if (HasReplayLoaded)
return;
KeyBindingInputManager.UseParentInput = !paused;
};
Cursor = CreateCursor();
}
@ -120,6 +128,11 @@ namespace osu.Game.Rulesets.UI
public Replay Replay { get; private set; }
/// <summary>
/// Whether the game is paused. Used to block user input.
/// </summary>
public readonly BindableBool IsPaused = new BindableBool();
/// <summary>
/// Sets a replay to be used, overriding local input.
/// </summary>