1
0
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:
Dan Balasescu 2024-10-07 17:50:23 +09:00
parent 19b586e6f7
commit 6e659e156e
No known key found for this signature in database
2 changed files with 9 additions and 5 deletions

View File

@ -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()
{

View File

@ -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)
{