diff --git a/osu.Android/GameplayScreenRotationLocker.cs b/osu.Android/GameplayScreenRotationLocker.cs index e5fc354db7..ffd4218ea9 100644 --- a/osu.Android/GameplayScreenRotationLocker.cs +++ b/osu.Android/GameplayScreenRotationLocker.cs @@ -6,28 +6,29 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game; +using osu.Game.Screens.Play; namespace osu.Android { public partial class GameplayScreenRotationLocker : Component { - private Bindable localUserPlaying = null!; + private IBindable localUserPlaying = null!; [Resolved] private OsuGameActivity gameActivity { get; set; } = null!; [BackgroundDependencyLoader] - private void load(OsuGame game) + private void load(ILocalUserPlayInfo localUserPlayInfo) { - localUserPlaying = game.LocalUserPlaying.GetBoundCopy(); + localUserPlaying = localUserPlayInfo.PlayingState.GetBoundCopy(); localUserPlaying.BindValueChanged(updateLock, true); } - private void updateLock(ValueChangedEvent userPlaying) + private void updateLock(ValueChangedEvent userPlaying) { gameActivity.RunOnUiThread(() => { - gameActivity.RequestedOrientation = userPlaying.NewValue ? ScreenOrientation.Locked : gameActivity.DefaultOrientation; + gameActivity.RequestedOrientation = userPlaying.NewValue != LocalUserPlayingStates.NotPlaying ? ScreenOrientation.Locked : gameActivity.DefaultOrientation; }); } }