1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-09 06:13:43 +08:00

Refactoring for correctness

This commit is contained in:
Dan Balasescu
2024-10-07 17:50:23 +09:00
Unverified
parent 19b586e6f7
commit 6e659e156e
2 changed files with 9 additions and 5 deletions
+1 -1
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()
{
+8 -4
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)
{