mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 16:27:43 +08:00
Refactoring for correctness
This commit is contained in:
parent
19b586e6f7
commit
6e659e156e
@ -12,7 +12,7 @@ namespace osu.Game.Input
|
||||
{
|
||||
protected override bool AllowRightClickFromLongTouch => PlayingState.Value == LocalUserPlayingState.NotPlaying;
|
||||
|
||||
public readonly Bindable<LocalUserPlayingState> PlayingState = new Bindable<LocalUserPlayingState>();
|
||||
public readonly IBindable<LocalUserPlayingState> PlayingState = new Bindable<LocalUserPlayingState>();
|
||||
|
||||
internal OsuUserInputManager()
|
||||
{
|
||||
|
@ -1548,11 +1548,15 @@ namespace osu.Game
|
||||
scope.SetTag(@"screen", newScreen?.GetType().ReadableName() ?? @"none");
|
||||
});
|
||||
|
||||
// reset on screen change for sanity.
|
||||
playingState.Value = LocalUserPlayingState.NotPlaying;
|
||||
switch (current)
|
||||
{
|
||||
case Player player:
|
||||
player.PlayingState.UnbindFrom(playingState);
|
||||
|
||||
if (current is Player oldPlayer)
|
||||
oldPlayer.PlayingState.UnbindFrom(playingState);
|
||||
// reset for sanity.
|
||||
playingState.Value = LocalUserPlayingState.NotPlaying;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (newScreen)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user