From bc35a30a257e3509fd360c43c55684dfc622b5f2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 17 Jun 2019 12:27:53 +0900 Subject: [PATCH 1/7] Fix audio being dimmed during multiplayer --- osu.Game/Screens/Multi/Multiplayer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 9e5c11e098..9939915e16 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -255,7 +255,6 @@ namespace osu.Game.Screens.Multi if (!track.IsRunning) { - game.Audio.AddItem(track); track.Seek(Beatmap.Value.Metadata.PreviewTime); track.Start(); } From c1d2fff651b090da3337f763324f77d516c9d47e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 17 Jun 2019 12:44:19 +0900 Subject: [PATCH 2/7] Use RestartPoint --- osu.Game/Screens/Multi/Multiplayer.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 9939915e16..c76f132395 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -251,13 +251,11 @@ namespace osu.Game.Screens.Multi if (track != null) { + track.RestartPoint = Beatmap.Value.Metadata.PreviewTime; track.Looping = true; if (!track.IsRunning) - { - track.Seek(Beatmap.Value.Metadata.PreviewTime); - track.Start(); - } + track.Restart(); } createButton.Hide(); From 5bb8649f3b3502707db16c9a5963d74b7f98039a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 14:22:59 +0900 Subject: [PATCH 3/7] Remove unused property from chat message --- osu.Game/Online/Chat/Message.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 62f20daddf..2e41038a59 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -13,10 +13,6 @@ namespace osu.Game.Online.Chat [JsonProperty(@"message_id")] public readonly long? Id; - //todo: this should be inside sender. - [JsonProperty(@"sender_id")] - public long UserId; - [JsonProperty(@"channel_id")] public long ChannelId; From 6823ba1ab08ce335f08b7b5a82c8c715cce2e315 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 14:24:44 +0900 Subject: [PATCH 4/7] Unbind from previous bindable when rebinding a SettingsItem --- osu.Game/Overlays/Settings/SettingsItem.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 4776cd6442..ae840c8c00 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -63,6 +63,9 @@ namespace osu.Game.Overlays.Settings set { + if (bindable != null) + controlWithCurrent?.Current.UnbindFrom(bindable); + bindable = value; controlWithCurrent?.Current.BindTo(bindable); From a5adc8983920d97b5488c5a59be6410b954bb99c Mon Sep 17 00:00:00 2001 From: KingLuigi4932 Date: Tue, 18 Jun 2019 20:37:56 +0300 Subject: [PATCH 5/7] Update framework --- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 957d365724..9dd8c8572e 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -15,7 +15,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index 9b146fa490..1482b6ed03 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -105,8 +105,8 @@ - - + + From 6426983de0d20fc89f31504f8ed20fbd4ece662b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 19 Jun 2019 13:15:58 +0900 Subject: [PATCH 6/7] Move logic out of update (and simplify, hopefully) --- osu.Game/Screens/Multi/Multiplayer.cs | 98 ++++++++++++++++----------- 1 file changed, 59 insertions(+), 39 deletions(-) diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index c76f132395..5252b41dfd 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Logging; using osu.Framework.Screens; +using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Containers; @@ -185,6 +186,28 @@ namespace osu.Game.Screens.Multi { this.FadeIn(); waves.Show(); + + beginHandlingTrack(); + } + + public override void OnResuming(IScreen last) + { + this.FadeIn(250); + this.ScaleTo(1, 250, Easing.OutSine); + + base.OnResuming(last); + + beginHandlingTrack(); + } + + public override void OnSuspending(IScreen next) + { + this.ScaleTo(1.1f, 250, Easing.InSine); + this.FadeOut(250); + + endHandlingTrack(); + + roomManager.TimeBetweenPolls = 0; } public override bool OnExiting(IScreen next) @@ -193,12 +216,10 @@ namespace osu.Game.Screens.Multi this.Delay(WaveContainer.DISAPPEAR_DURATION).FadeOut(); - cancelLooping(); - if (screenStack.CurrentScreen != null) loungeSubScreen.MakeCurrent(); - updatePollingRate(isIdle.Value); + endHandlingTrack(); base.OnExiting(next); return false; @@ -212,42 +233,44 @@ namespace osu.Game.Screens.Multi logo.Delay(WaveContainer.DISAPPEAR_DURATION / 2).FadeOut(); } - public override void OnResuming(IScreen last) + private void beginHandlingTrack() { - this.FadeIn(250); - this.ScaleTo(1, 250, Easing.OutSine); - - base.OnResuming(last); - - updatePollingRate(isIdle.Value); + Beatmap.BindValueChanged(updateTrack, true); } - public override void OnSuspending(IScreen next) + private void endHandlingTrack() { - this.ScaleTo(1.1f, 250, Easing.InSine); - this.FadeOut(250); - cancelLooping(); - roomManager.TimeBetweenPolls = 0; + Beatmap.ValueChanged -= updateTrack; } - private void cancelLooping() - { - var track = Beatmap?.Value?.Track; + private void screenPushed(IScreen lastScreen, IScreen newScreen) => subScreenChanged(newScreen); - if (track != null) - track.Looping = false; + private void screenExited(IScreen lastScreen, IScreen newScreen) + { + subScreenChanged(newScreen); + + if (screenStack.CurrentScreen == null && this.IsCurrentScreen()) + this.Exit(); } - protected override void Update() + private void subScreenChanged(IScreen newScreen) { - base.Update(); + updatePollingRate(isIdle.Value); + createButton.FadeTo(newScreen is MatchSubScreen ? 0 : 1, 200); - if (!this.IsCurrentScreen()) return; + updateTrack(); + } - if (screenStack.CurrentScreen is MatchSubScreen) + private void updateTrack(ValueChangedEvent _ = null) + { + bool isMatch = screenStack.CurrentScreen is MatchSubScreen; + + Beatmap.Disabled = isMatch; + + if (isMatch) { - var track = Beatmap.Value.Track; + var track = Beatmap.Value?.Track; if (track != null) { @@ -257,25 +280,22 @@ namespace osu.Game.Screens.Multi if (!track.IsRunning) track.Restart(); } - - createButton.Hide(); } - else if (screenStack.CurrentScreen is LoungeSubScreen) - createButton.Show(); + else + { + cancelLooping(); + } } - private void screenPushed(IScreen lastScreen, IScreen newScreen) - => updatePollingRate(isIdle.Value); - - private void screenExited(IScreen lastScreen, IScreen newScreen) + private void cancelLooping() { - if (lastScreen is MatchSubScreen) - cancelLooping(); + var track = Beatmap?.Value?.Track; - updatePollingRate(isIdle.Value); - - if (screenStack.CurrentScreen == null && this.IsCurrentScreen()) - this.Exit(); + if (track != null) + { + track.Looping = false; + track.RestartPoint = 0; + } } protected override void Dispose(bool isDisposing) From f26fe53feb5c1d92c97a207a03a655974eec45e8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 19 Jun 2019 13:16:19 +0900 Subject: [PATCH 7/7] Fix startup crash if main menu does not load fast enough --- osu.Game/Screens/Menu/MainMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 3afe9b9371..c81f6ae8ea 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -28,7 +28,7 @@ namespace osu.Game.Screens.Menu { private ButtonSystem buttons; - public override bool HideOverlaysOnEnter => buttons.State == ButtonSystemState.Initial; + public override bool HideOverlaysOnEnter => buttons == null || buttons.State == ButtonSystemState.Initial; protected override bool AllowBackButton => buttons.State != ButtonSystemState.Initial && host.CanExit;