From 015a39abc76eaebe0b69ff3b1bf6eef6b4c0a761 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 26 Feb 2020 18:45:06 +0900 Subject: [PATCH 01/26] Fix hyperdash fruit not visible on default skin --- .../Objects/Drawables/FruitPiece.cs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/FruitPiece.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/FruitPiece.cs index 0f5044eda7..5797588ded 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawables/FruitPiece.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawables/FruitPiece.cs @@ -7,9 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets.Catch.Objects.Drawables.Pieces; using osu.Game.Rulesets.Objects.Drawables; -using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Catch.Objects.Drawables @@ -64,15 +62,24 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables if (hitObject.HyperDash) { - AddInternal(new Pulp + AddInternal(new Circle { - RelativePositionAxes = Axes.Both, + RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, - AccentColour = { Value = Color4.Red }, - Blending = BlendingParameters.Additive, - Alpha = 0.5f, - Scale = new Vector2(1.333f) + BorderColour = Color4.Red, + BorderThickness = 12f * RADIUS_ADJUST, + Children = new Drawable[] + { + new Box + { + AlwaysPresent = true, + Alpha = 0.3f, + Blending = BlendingParameters.Additive, + RelativeSizeAxes = Axes.Both, + Colour = Color4.Red, + } + } }); } } From 83495eb64804e1089cb8712a992f20e64996d1de Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 26 Feb 2020 19:22:09 +0900 Subject: [PATCH 02/26] Add testing support for hyperdash fruits --- .../TestSceneFruitObjects.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneFruitObjects.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneFruitObjects.cs index 7bade41e6c..82d5aa936f 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneFruitObjects.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneFruitObjects.cs @@ -42,6 +42,9 @@ namespace osu.Game.Rulesets.Catch.Tests AddStep("show droplet", () => SetContents(createDrawableDroplet)); AddStep("show tiny droplet", () => SetContents(createDrawableTinyDroplet)); + + foreach (FruitVisualRepresentation rep in Enum.GetValues(typeof(FruitVisualRepresentation))) + AddStep($"show hyperdash {rep}", () => SetContents(() => createDrawable(rep, true))); } private Drawable createDrawableTinyDroplet() @@ -82,9 +85,13 @@ namespace osu.Game.Rulesets.Catch.Tests }; } - private Drawable createDrawable(FruitVisualRepresentation rep) + private Drawable createDrawable(FruitVisualRepresentation rep, bool hyperdash = false) { - Fruit fruit = new TestCatchFruit(rep) { Scale = 1.5f }; + Fruit fruit = new TestCatchFruit(rep) + { + Scale = 1.5f, + HyperDashTarget = hyperdash ? new Banana() : null + }; return new DrawableFruit(fruit) { From e5927447fc5664c00f0092a48b1ab24913610dee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 26 Feb 2020 19:22:46 +0900 Subject: [PATCH 03/26] Fix hyperdash fruit not visible on custom skins --- .../Skinning/LegacyFruitPiece.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/osu.Game.Rulesets.Catch/Skinning/LegacyFruitPiece.cs b/osu.Game.Rulesets.Catch/Skinning/LegacyFruitPiece.cs index 2631fe5487..25ee0811d0 100644 --- a/osu.Game.Rulesets.Catch/Skinning/LegacyFruitPiece.cs +++ b/osu.Game.Rulesets.Catch/Skinning/LegacyFruitPiece.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Rulesets.Catch.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Skinning; +using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Catch.Skinning @@ -49,6 +50,23 @@ namespace osu.Game.Rulesets.Catch.Skinning Origin = Anchor.Centre, }, }; + + if (drawableCatchObject.HitObject.HyperDash) + { + var hyperDash = new Sprite + { + Texture = skin.GetTexture(lookupName), + Colour = Color4.Red, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Blending = BlendingParameters.Additive, + Depth = 1, + Alpha = 0.7f, + Scale = new Vector2(1.2f) + }; + + AddInternal(hyperDash); + } } protected override void LoadComplete() From 2aa649e073d75b0d7b9df8880096f510135d279e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 26 Feb 2020 19:31:49 +0900 Subject: [PATCH 04/26] Fix catcher dropping juice streams due to it considering ignored judgements --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 0b3809150a..b977d46611 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -50,6 +50,9 @@ namespace osu.Game.Rulesets.Catch.UI public void OnResult(DrawableCatchHitObject fruit, JudgementResult result) { + if (result.Judgement is IgnoreJudgement) + return; + void runAfterLoaded(Action action) { if (lastPlateableFruit == null) From ed2bdd7106da3abb8bf04bf9bbb47bbc20ef2b96 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 26 Feb 2020 20:45:57 +0900 Subject: [PATCH 05/26] Fix stutter when showing game HUD after being hidden for a while --- osu.Game/Screens/Play/HUD/HealthDisplay.cs | 7 ------- .../Screens/Play/HUD/StandardHealthDisplay.cs | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/HealthDisplay.cs b/osu.Game/Screens/Play/HUD/HealthDisplay.cs index acd8656fb2..37038ad58c 100644 --- a/osu.Game/Screens/Play/HUD/HealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/HealthDisplay.cs @@ -13,12 +13,5 @@ namespace osu.Game.Screens.Play.HUD MinValue = 0, MaxValue = 1 }; - - protected HealthDisplay() - { - Current.ValueChanged += health => SetHealth((float)health.NewValue); - } - - protected abstract void SetHealth(float value); } } diff --git a/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs b/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs index 315bc27a79..7736541c92 100644 --- a/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs @@ -12,6 +12,7 @@ using osu.Game.Rulesets.Judgements; using osuTK; using osuTK.Graphics; using osu.Framework.Graphics.Shapes; +using osu.Framework.Utils; using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play.HUD @@ -108,11 +109,23 @@ namespace osu.Game.Screens.Play.HUD if (result.Type == HitResult.Miss) return; + Scheduler.AddOnce(flash); + } + + private void flash() + { fill.FadeEdgeEffectTo(Math.Min(1, fill.EdgeEffect.Colour.Linear.A + (1f - base_glow_opacity) / glow_max_hits), 50, Easing.OutQuint) .Delay(glow_fade_delay) .FadeEdgeEffectTo(base_glow_opacity, glow_fade_time, Easing.OutQuint); } - protected override void SetHealth(float value) => fill.ResizeTo(new Vector2(value, 1), 200, Easing.OutQuint); + protected override void Update() + { + base.Update(); + + fill.Width = Interpolation.ValueAt( + Math.Clamp(Clock.ElapsedFrameTime, 0, 200), + fill.Width, (float)Current.Value, 0, 200, Easing.OutQuint); + } } } From 54d83eff94dc357a4ffb1d2443f42f170023f022 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 26 Feb 2020 19:35:20 +0300 Subject: [PATCH 06/26] Use OverlayColourProfider for VotePill component --- osu.Game.Tests/Visual/Online/TestSceneVotePill.cs | 5 +++++ osu.Game/Overlays/Comments/VotePill.cs | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneVotePill.cs b/osu.Game.Tests/Visual/Online/TestSceneVotePill.cs index 8197cf72de..770cef8f1b 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneVotePill.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneVotePill.cs @@ -7,6 +7,8 @@ using NUnit.Framework; using osu.Framework.Graphics; using osu.Game.Overlays.Comments; using osu.Game.Online.API.Requests.Responses; +using osu.Framework.Allocation; +using osu.Game.Overlays; namespace osu.Game.Tests.Visual.Online { @@ -18,6 +20,9 @@ namespace osu.Game.Tests.Visual.Online typeof(VotePill) }; + [Cached] + private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue); + private VotePill votePill; [Test] diff --git a/osu.Game/Overlays/Comments/VotePill.cs b/osu.Game/Overlays/Comments/VotePill.cs index 978846549e..aa9723ea85 100644 --- a/osu.Game/Overlays/Comments/VotePill.cs +++ b/osu.Game/Overlays/Comments/VotePill.cs @@ -33,6 +33,9 @@ namespace osu.Game.Overlays.Comments [Resolved] private IAPIProvider api { get; set; } + [Resolved] + private OverlayColourProvider colourProvider { get; set; } + private readonly Comment comment; private Box background; private Box hoverLayer; @@ -68,7 +71,7 @@ namespace osu.Game.Overlays.Comments base.LoadComplete(); isVoted.Value = comment.IsVoted; votesCount.Value = comment.VotesCount; - isVoted.BindValueChanged(voted => background.Colour = voted.NewValue ? AccentColour : OsuColour.Gray(0.05f), true); + isVoted.BindValueChanged(voted => background.Colour = voted.NewValue ? AccentColour : colourProvider.Background6, true); votesCount.BindValueChanged(count => votesCounter.Text = $"+{count.NewValue}", true); } From a4edd3b8a18a7a197f39d3db98ae1997f5e02a74 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 09:24:45 +0900 Subject: [PATCH 07/26] Fix iOS/Android lockups by disabling LLVM --- osu.Android.props | 2 -- osu.Android/osu.Android.csproj | 3 ++- osu.iOS.props | 3 --- osu.iOS/osu.iOS.csproj | 3 ++- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index 24afbb86fb..28fbdb3367 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -25,7 +25,6 @@ portable False DEBUG;TRACE - false false true false @@ -34,7 +33,6 @@ false None True - true false False true diff --git a/osu.Android/osu.Android.csproj b/osu.Android/osu.Android.csproj index ac3905a372..0598a50530 100644 --- a/osu.Android/osu.Android.csproj +++ b/osu.Android/osu.Android.csproj @@ -13,6 +13,7 @@ osu.Android Properties\AndroidManifest.xml armeabi-v7a;x86;arm64-v8a + false cjk;mideast;other;rare;west @@ -52,4 +53,4 @@ - \ No newline at end of file + diff --git a/osu.iOS.props b/osu.iOS.props index 9574b8cba9..abd562dc81 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -49,9 +49,6 @@ true 28126 - - true - Static diff --git a/osu.iOS/osu.iOS.csproj b/osu.iOS/osu.iOS.csproj index d60a3475e7..1e9a21865d 100644 --- a/osu.iOS/osu.iOS.csproj +++ b/osu.iOS/osu.iOS.csproj @@ -7,6 +7,7 @@ {3F082D0B-A964-43D7-BDF7-C256D76A50D0} osu.iOS osu.iOS + false @@ -116,4 +117,4 @@ - \ No newline at end of file + From c06db5a54acbb72d90c1a208f35b3e8b289c1fd5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Feb 2020 11:28:29 +0900 Subject: [PATCH 08/26] Remove legacy DrawableHitObject state management --- .../Objects/Drawables/DrawableHitObject.cs | 69 +++++-------------- 1 file changed, 17 insertions(+), 52 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 9a5e25c8ac..aa29e42fac 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -221,18 +221,6 @@ namespace osu.Game.Rulesets.Objects.Drawables /// public event Action ApplyCustomUpdateState; -#pragma warning disable 618 // (legacy state management) - can be removed 20200227 - - /// - /// Enables automatic transform management of this hitobject. Implementation of transforms should be done in and only. Rewinding and removing previous states is done automatically. - /// - /// - /// Going forward, this is the preferred way of implementing s. Previous functionality - /// is offered as a compatibility layer until all rulesets have been migrated across. - /// - [Obsolete("Use UpdateInitialTransforms()/UpdateStateTransforms() instead")] // can be removed 20200227 - protected virtual bool UseTransformStateManagement => true; - protected override void ClearInternal(bool disposeChildren = true) => throw new InvalidOperationException($"Should never clear a {nameof(DrawableHitObject)}"); private void updateState(ArmedState newState, bool force = false) @@ -240,35 +228,28 @@ namespace osu.Game.Rulesets.Objects.Drawables if (State.Value == newState && !force) return; - if (UseTransformStateManagement) + LifetimeEnd = double.MaxValue; + + double transformTime = HitObject.StartTime - InitialLifetimeOffset; + + base.ApplyTransformsAt(double.MinValue, true); + base.ClearTransformsAfter(double.MinValue, true); + + using (BeginAbsoluteSequence(transformTime, true)) { - LifetimeEnd = double.MaxValue; + UpdateInitialTransforms(); - double transformTime = HitObject.StartTime - InitialLifetimeOffset; + var judgementOffset = Result?.TimeOffset ?? 0; - base.ApplyTransformsAt(double.MinValue, true); - base.ClearTransformsAfter(double.MinValue, true); - - using (BeginAbsoluteSequence(transformTime, true)) + using (BeginDelayedSequence(InitialLifetimeOffset + judgementOffset, true)) { - UpdateInitialTransforms(); - - var judgementOffset = Result?.TimeOffset ?? 0; - - using (BeginDelayedSequence(InitialLifetimeOffset + judgementOffset, true)) - { - UpdateStateTransforms(newState); - state.Value = newState; - } + UpdateStateTransforms(newState); + state.Value = newState; } - - if (state.Value != ArmedState.Idle && LifetimeEnd == double.MaxValue || HitObject.HitWindows == null) - Expire(); } - else - state.Value = newState; - UpdateState(newState); + if (state.Value != ArmedState.Idle && LifetimeEnd == double.MaxValue || HitObject.HitWindows == null) + Expire(); // apply any custom state overrides ApplyCustomUpdateState?.Invoke(this, newState); @@ -303,30 +284,14 @@ namespace osu.Game.Rulesets.Objects.Drawables public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) { - // When we are using automatic state management, parent calls to this should be blocked for safety. - if (!UseTransformStateManagement) - base.ClearTransformsAfter(time, propagateChildren, targetMember); + // Parent calls to this should be blocked for safety, as we are manually handling this in updateState. } public override void ApplyTransformsAt(double time, bool propagateChildren = false) { - // When we are using automatic state management, parent calls to this should be blocked for safety. - if (!UseTransformStateManagement) - base.ApplyTransformsAt(time, propagateChildren); + // Parent calls to this should be blocked for safety, as we are manually handling this in updateState. } - /// - /// Legacy method to handle state changes. - /// Should generally not be used when is true; use instead. - /// - /// The new armed state. - [Obsolete("Use UpdateInitialTransforms()/UpdateStateTransforms() instead")] // can be removed 20200227 - protected virtual void UpdateState(ArmedState state) - { - } - -#pragma warning restore 618 - #endregion protected sealed override void SkinChanged(ISkinSource skin, bool allowFallback) From 101a5876419b52fe97028b8f86620c8d04b78afe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 15:51:55 +0900 Subject: [PATCH 09/26] Disable triangles in triangles intro --- osu.Game/Screens/Menu/IntroTriangles.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroTriangles.cs b/osu.Game/Screens/Menu/IntroTriangles.cs index 29f32406e8..4e51ff939a 100644 --- a/osu.Game/Screens/Menu/IntroTriangles.cs +++ b/osu.Game/Screens/Menu/IntroTriangles.cs @@ -54,8 +54,6 @@ namespace osu.Game.Screens.Menu { base.LogoArriving(logo, resuming); - logo.Triangles = true; - if (!resuming) { PrepareMenuLoad(); From 3f5c4633bc235a6ed0add44b72295be71833c7a9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 16:40:56 +0900 Subject: [PATCH 10/26] Remove workarounds for CreateRoomRequest shortcomings --- osu.Game/Online/Multiplayer/PlaylistItem.cs | 4 +--- osu.Game/Online/Multiplayer/Room.cs | 9 --------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/osu.Game/Online/Multiplayer/PlaylistItem.cs b/osu.Game/Online/Multiplayer/PlaylistItem.cs index 11e4854174..9d6e8eb8e3 100644 --- a/osu.Game/Online/Multiplayer/PlaylistItem.cs +++ b/osu.Game/Online/Multiplayer/PlaylistItem.cs @@ -65,9 +65,7 @@ namespace osu.Game.Online.Multiplayer public void MapObjects(BeatmapManager beatmaps, RulesetStore rulesets) { - // If we don't have an api beatmap, the request occurred as a result of room creation, so we can query the local beatmap instead - // Todo: Is this a bug? Room creation only returns the beatmap ID - Beatmap.Value = apiBeatmap == null ? beatmaps.QueryBeatmap(b => b.OnlineBeatmapID == BeatmapID) : apiBeatmap.ToBeatmap(rulesets); + Beatmap.Value = apiBeatmap.ToBeatmap(rulesets); Ruleset.Value = rulesets.GetRuleset(RulesetID); Ruleset rulesetInstance = Ruleset.Value.CreateInstance(); diff --git a/osu.Game/Online/Multiplayer/Room.cs b/osu.Game/Online/Multiplayer/Room.cs index 2bfcc019fa..c55822c407 100644 --- a/osu.Game/Online/Multiplayer/Room.cs +++ b/osu.Game/Online/Multiplayer/Room.cs @@ -118,15 +118,6 @@ namespace osu.Game.Online.Multiplayer if (DateTimeOffset.Now >= EndDate.Value) Status.Value = new RoomStatusEnded(); - // transfer local beatmaps across to ensure we have Metadata available (CreateRoomRequest does not give us metadata as expected) - foreach (var item in other.Playlist) - { - var localItem = Playlist.FirstOrDefault(i => i.BeatmapID == item.BeatmapID); - - if (localItem != null) - item.Beatmap.Value.Metadata = localItem.Beatmap.Value.Metadata; - } - if (!Playlist.SequenceEqual(other.Playlist)) { Playlist.Clear(); From ffa8a50c6bcddfd643c6a5abd3c213b4fb750e2e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 19:21:59 +0900 Subject: [PATCH 11/26] Make User IEquatable --- osu.Game/Users/User.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index c573fdd089..d25c552160 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -9,7 +9,7 @@ using osu.Framework.Bindables; namespace osu.Game.Users { - public class User + public class User : IEquatable { [JsonProperty(@"id")] public long Id = 1; @@ -244,5 +244,13 @@ namespace osu.Game.Users [Description("Touch Screen")] Touch, } + + public bool Equals(User other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return Id == other.Id; + } } } From 99442ec9c322f66c450b059698d41e696a64e102 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 19:23:21 +0900 Subject: [PATCH 12/26] Implement single-room multiplayer room polling --- .../Online/API/Requests/GetRoomRequest.cs | 19 ++ .../Multi/Lounge/Components/RoomsContainer.cs | 4 +- .../Screens/Multi/Lounge/LoungeSubScreen.cs | 8 +- osu.Game/Screens/Multi/Multiplayer.cs | 37 ++- osu.Game/Screens/Multi/RoomManager.cs | 211 ++++++++++++++---- 5 files changed, 223 insertions(+), 56 deletions(-) create mode 100644 osu.Game/Online/API/Requests/GetRoomRequest.cs diff --git a/osu.Game/Online/API/Requests/GetRoomRequest.cs b/osu.Game/Online/API/Requests/GetRoomRequest.cs new file mode 100644 index 0000000000..531e1857de --- /dev/null +++ b/osu.Game/Online/API/Requests/GetRoomRequest.cs @@ -0,0 +1,19 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Online.Multiplayer; + +namespace osu.Game.Online.API.Requests +{ + public class GetRoomRequest : APIRequest + { + private readonly int roomId; + + public GetRoomRequest(int roomId) + { + this.roomId = roomId; + } + + protected override string Target => $"rooms/{roomId}"; + } +} diff --git a/osu.Game/Screens/Multi/Lounge/Components/RoomsContainer.cs b/osu.Game/Screens/Multi/Lounge/Components/RoomsContainer.cs index 64618a1d85..f14aa5fd8c 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/RoomsContainer.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/RoomsContainer.cs @@ -28,7 +28,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components private Bindable filter { get; set; } [Resolved] - private Bindable currentRoom { get; set; } + private Bindable selectedRoom { get; set; } [Resolved] private IRoomManager roomManager { get; set; } @@ -122,7 +122,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components else roomFlow.Children.ForEach(r => r.State = r.Room == room ? SelectionState.Selected : SelectionState.NotSelected); - currentRoom.Value = room; + selectedRoom.Value = room; } protected override void Dispose(bool isDisposing) diff --git a/osu.Game/Screens/Multi/Lounge/LoungeSubScreen.cs b/osu.Game/Screens/Multi/Lounge/LoungeSubScreen.cs index e2e5b1b549..7c10f0f975 100644 --- a/osu.Game/Screens/Multi/Lounge/LoungeSubScreen.cs +++ b/osu.Game/Screens/Multi/Lounge/LoungeSubScreen.cs @@ -26,7 +26,7 @@ namespace osu.Game.Screens.Multi.Lounge private readonly LoadingLayer loadingLayer; [Resolved] - private Bindable currentRoom { get; set; } + private Bindable selectedRoom { get; set; } public LoungeSubScreen() { @@ -101,8 +101,8 @@ namespace osu.Game.Screens.Multi.Lounge { base.OnResuming(last); - if (currentRoom.Value?.RoomID.Value == null) - currentRoom.Value = new Room(); + if (selectedRoom.Value?.RoomID.Value == null) + selectedRoom.Value = new Room(); onReturning(); } @@ -143,7 +143,7 @@ namespace osu.Game.Screens.Multi.Lounge if (!this.IsCurrentScreen()) return; - currentRoom.Value = room; + selectedRoom.Value = room; this.Push(new MatchSubScreen(room)); } diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 1219919425..20b1f860a9 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -48,7 +48,7 @@ namespace osu.Game.Screens.Multi private readonly IBindable isIdle = new BindableBool(); [Cached] - private readonly Bindable currentRoom = new Bindable(); + private readonly Bindable selectedRoom = new Bindable(); [Cached] private readonly Bindable currentFilter = new Bindable(new FilterCriteria()); @@ -163,14 +163,39 @@ namespace osu.Game.Screens.Multi protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { var dependencies = new CachedModelDependencyContainer(base.CreateChildDependencies(parent)); - dependencies.Model.BindTo(currentRoom); + dependencies.Model.BindTo(selectedRoom); return dependencies; } private void updatePollingRate(bool idle) { - roomManager.TimeBetweenPolls = !this.IsCurrentScreen() || !(screenStack.CurrentScreen is LoungeSubScreen) ? 0 : (idle ? 120000 : 15000); - Logger.Log($"Polling adjusted to {roomManager.TimeBetweenPolls}"); + if (!this.IsCurrentScreen()) + { + roomManager.TimeBetweenListingPolls = 0; + roomManager.TimeBetweenSelectionPolls = 0; + } + else + { + switch (screenStack.CurrentScreen) + { + case LoungeSubScreen _: + roomManager.TimeBetweenListingPolls = idle ? 120000 : 15000; + roomManager.TimeBetweenSelectionPolls = idle ? 30000 : 5000; + break; + + case MatchSubScreen _: + roomManager.TimeBetweenListingPolls = 0; + roomManager.TimeBetweenSelectionPolls = idle ? 30000 : 5000; + break; + + default: + roomManager.TimeBetweenListingPolls = 0; + roomManager.TimeBetweenSelectionPolls = 0; + break; + } + } + + Logger.Log($"Polling adjusted (listing: {roomManager.TimeBetweenListingPolls}, selection: {roomManager.TimeBetweenSelectionPolls})"); } /// @@ -222,6 +247,8 @@ namespace osu.Game.Screens.Multi base.OnResuming(last); beginHandlingTrack(); + + updatePollingRate(isIdle.Value); } public override void OnSuspending(IScreen next) @@ -231,7 +258,7 @@ namespace osu.Game.Screens.Multi endHandlingTrack(); - roomManager.TimeBetweenPolls = 0; + updatePollingRate(isIdle.Value); } public override bool OnExiting(IScreen next) diff --git a/osu.Game/Screens/Multi/RoomManager.cs b/osu.Game/Screens/Multi/RoomManager.cs index cdaba85b9e..ef1e50d2ac 100644 --- a/osu.Game/Screens/Multi/RoomManager.cs +++ b/osu.Game/Screens/Multi/RoomManager.cs @@ -2,10 +2,13 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Logging; using osu.Game.Beatmaps; using osu.Game.Online; @@ -17,20 +20,24 @@ using osu.Game.Screens.Multi.Lounge.Components; namespace osu.Game.Screens.Multi { - public class RoomManager : PollingComponent, IRoomManager + public class RoomManager : CompositeDrawable, IRoomManager { public event Action RoomsUpdated; private readonly BindableList rooms = new BindableList(); public IBindableList Rooms => rooms; - private Room joinedRoom; + public double TimeBetweenListingPolls + { + get => listingPollingComponent.TimeBetweenPolls; + set => listingPollingComponent.TimeBetweenPolls = value; + } - [Resolved] - private Bindable currentFilter { get; set; } - - [Resolved] - private IAPIProvider api { get; set; } + public double TimeBetweenSelectionPolls + { + get => selectionPollingComponent.TimeBetweenPolls; + set => selectionPollingComponent.TimeBetweenPolls = value; + } [Resolved] private RulesetStore rulesets { get; set; } @@ -38,14 +45,26 @@ namespace osu.Game.Screens.Multi [Resolved] private BeatmapManager beatmaps { get; set; } - [BackgroundDependencyLoader] - private void load() + [Resolved] + private IAPIProvider api { get; set; } + + [Resolved] + private Bindable selectedRoom { get; set; } + + private readonly ListingPollingComponent listingPollingComponent; + private readonly SelectionPollingComponent selectionPollingComponent; + + private Room joinedRoom; + + public RoomManager() { - currentFilter.BindValueChanged(_ => + RelativeSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] { - if (IsLoaded) - PollImmediately(); - }); + listingPollingComponent = new ListingPollingComponent { RoomsReceived = onRoomsReceived }, + selectionPollingComponent = new SelectionPollingComponent { RoomReceived = onRoomReceived } + }; } protected override void Dispose(bool isDisposing) @@ -116,45 +135,52 @@ namespace osu.Game.Screens.Multi joinedRoom = null; } - private GetRoomsRequest pollReq; - - protected override Task Poll() + /// + /// Invoked when the listing of all s is received from the server. + /// + /// The listing. + private void onRoomsReceived(List listing) { - if (!api.IsLoggedIn) - return base.Poll(); - - var tcs = new TaskCompletionSource(); - - pollReq?.Cancel(); - pollReq = new GetRoomsRequest(currentFilter.Value.PrimaryFilter); - - pollReq.Success += result => + // Remove past matches + foreach (var r in rooms.ToList()) { - // Remove past matches - foreach (var r in rooms.ToList()) + if (listing.All(e => e.RoomID.Value != r.RoomID.Value)) + rooms.Remove(r); + } + + for (int i = 0; i < listing.Count; i++) + { + if (selectedRoom.Value?.RoomID?.Value == listing[i].RoomID.Value) { - if (result.All(e => e.RoomID.Value != r.RoomID.Value)) - rooms.Remove(r); + // The listing request contains less data than the selection request, so data from the selection request is always preferred while the room is selected. + continue; } - for (int i = 0; i < result.Count; i++) + var r = listing[i]; + r.Position.Value = i; + + update(r, r); + addRoom(r); + } + + RoomsUpdated?.Invoke(); + } + + /// + /// Invoked when a is received from the server. + /// + /// The received . + private void onRoomReceived(Room toUpdate) + { + foreach (var room in rooms) + { + if (room.RoomID.Value == toUpdate.RoomID.Value) { - var r = result[i]; - r.Position.Value = i; - - update(r, r); - addRoom(r); + toUpdate.Position.Value = room.Position.Value; + update(room, toUpdate); + break; } - - RoomsUpdated?.Invoke(); - tcs.SetResult(true); - }; - - pollReq.Failure += _ => tcs.SetResult(false); - - api.Queue(pollReq); - - return tcs.Task; + } } /// @@ -182,5 +208,100 @@ namespace osu.Game.Screens.Multi else existing.CopyFrom(room); } + + private class SelectionPollingComponent : PollingComponent + { + public Action RoomReceived; + + [Resolved] + private IAPIProvider api { get; set; } + + [Resolved] + private Bindable selectedRoom { get; set; } + + [BackgroundDependencyLoader] + private void load() + { + selectedRoom.BindValueChanged(_ => + { + if (IsLoaded) + PollImmediately(); + }); + } + + private GetRoomRequest pollReq; + + protected override Task Poll() + { + if (!api.IsLoggedIn) + return base.Poll(); + + if (selectedRoom.Value?.RoomID.Value == null) + return base.Poll(); + + var tcs = new TaskCompletionSource(); + + pollReq?.Cancel(); + pollReq = new GetRoomRequest(selectedRoom.Value.RoomID.Value.Value); + + pollReq.Success += result => + { + RoomReceived?.Invoke(result); + tcs.SetResult(true); + }; + + pollReq.Failure += _ => tcs.SetResult(false); + + api.Queue(pollReq); + + return tcs.Task; + } + } + + private class ListingPollingComponent : PollingComponent + { + public Action> RoomsReceived; + + [Resolved] + private IAPIProvider api { get; set; } + + [Resolved] + private Bindable currentFilter { get; set; } + + [BackgroundDependencyLoader] + private void load() + { + currentFilter.BindValueChanged(_ => + { + if (IsLoaded) + PollImmediately(); + }); + } + + private GetRoomsRequest pollReq; + + protected override Task Poll() + { + if (!api.IsLoggedIn) + return base.Poll(); + + var tcs = new TaskCompletionSource(); + + pollReq?.Cancel(); + pollReq = new GetRoomsRequest(currentFilter.Value.PrimaryFilter); + + pollReq.Success += result => + { + RoomsReceived?.Invoke(result); + tcs.SetResult(true); + }; + + pollReq.Failure += _ => tcs.SetResult(false); + + api.Queue(pollReq); + + return tcs.Task; + } + } } } From 97c07281d8a1f1b1ba647340425b7ed3bfda6b35 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 19:24:13 +0900 Subject: [PATCH 13/26] Make ParticipantsList use the new participants property --- osu.Game/Online/Multiplayer/Room.cs | 2 +- .../Multi/Components/ParticipantsList.cs | 91 +++++++++---------- 2 files changed, 42 insertions(+), 51 deletions(-) diff --git a/osu.Game/Online/Multiplayer/Room.cs b/osu.Game/Online/Multiplayer/Room.cs index 2bfcc019fa..327f2c75da 100644 --- a/osu.Game/Online/Multiplayer/Room.cs +++ b/osu.Game/Online/Multiplayer/Room.cs @@ -59,7 +59,7 @@ namespace osu.Game.Online.Multiplayer public Bindable MaxParticipants { get; private set; } = new Bindable(); [Cached] - [JsonIgnore] + [JsonProperty("recent_participants")] public BindableList Participants { get; private set; } = new BindableList(); [Cached] diff --git a/osu.Game/Screens/Multi/Components/ParticipantsList.cs b/osu.Game/Screens/Multi/Components/ParticipantsList.cs index e383e0414b..16ab905322 100644 --- a/osu.Game/Screens/Multi/Components/ParticipantsList.cs +++ b/osu.Game/Screens/Multi/Components/ParticipantsList.cs @@ -7,9 +7,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Framework.Threading; using osu.Game.Graphics; -using osu.Game.Online.API; -using osu.Game.Online.API.Requests; using osu.Game.Users; using osu.Game.Users.Drawables; using osuTK; @@ -46,73 +45,69 @@ namespace osu.Game.Screens.Multi.Components set => fill.Direction = value; } - private readonly FillFlowContainer fill; + private readonly FillFlowContainer fill; public ParticipantsList() { - InternalChild = fill = new FillFlowContainer { Spacing = new Vector2(10) }; + InternalChild = fill = new FillFlowContainer { Spacing = new Vector2(10) }; } [BackgroundDependencyLoader] private void load() { - RoomID.BindValueChanged(_ => updateParticipants(), true); + Participants.CollectionChanged += (_, __) => updateParticipants(); + updateParticipants(); } - [Resolved] - private IAPIProvider api { get; set; } - - private GetRoomScoresRequest request; + private ScheduledDelegate scheduledUpdate; private void updateParticipants() { - var roomId = RoomID.Value ?? 0; - - request?.Cancel(); - - // nice little progressive fade - int time = 500; - - foreach (var c in fill.Children) + scheduledUpdate?.Cancel(); + scheduledUpdate = Schedule(() => { - c.Delay(500 - time).FadeOut(time, Easing.Out); - time = Math.Max(20, time - 20); - c.Expire(); - } + // Remove all extra tiles with a nice, progressive fade + int time = 500; - if (roomId == 0) return; + for (int i = Participants.Count; i < fill.Count; i++) + { + var tile = fill[i]; - request = new GetRoomScoresRequest(roomId); - request.Success += scores => Schedule(() => - { - if (roomId != RoomID.Value) - return; + tile.Delay(500 - time).FadeOut(time, Easing.Out); + time = Math.Max(20, time - 20); + tile.Expire(); + } - fill.Clear(); - foreach (var s in scores) - fill.Add(new UserTile(s.User)); + // Add new tiles for all new players + for (int i = fill.Count; i < Participants.Count; i++) + { + var tile = new UserTile(); + fill.Add(tile); - fill.FadeInFromZero(1000, Easing.OutQuint); + tile.ClearTransforms(); + tile.LifetimeEnd = double.MaxValue; + tile.FadeInFromZero(250, Easing.OutQuint); + } + + for (int i = 0; i < Participants.Count; i++) + fill[i].User = Participants[i]; }); - - api.Queue(request); - } - - protected override void Dispose(bool isDisposing) - { - request?.Cancel(); - base.Dispose(isDisposing); } private class UserTile : CompositeDrawable, IHasTooltip { - private readonly User user; - - public string TooltipText => user.Username; - - public UserTile(User user) + public User User + { + get => avatar.User; + set => avatar.User = value; + } + + public string TooltipText => User?.Username ?? string.Empty; + + private readonly UpdateableAvatar avatar; + + public UserTile() { - this.user = user; Size = new Vector2(TILE_SIZE); CornerRadius = 5f; Masking = true; @@ -124,11 +119,7 @@ namespace osu.Game.Screens.Multi.Components RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex(@"27252d"), }, - new UpdateableAvatar - { - RelativeSizeAxes = Axes.Both, - User = user, - }, + avatar = new UpdateableAvatar { RelativeSizeAxes = Axes.Both }, }; } } From fe10a64137ec868a5e97fa087b79f2787d5553de Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 19:37:04 +0900 Subject: [PATCH 14/26] Improve participants list transforms --- .../Multi/Components/ParticipantsList.cs | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/osu.Game/Screens/Multi/Components/ParticipantsList.cs b/osu.Game/Screens/Multi/Components/ParticipantsList.cs index 16ab905322..13de0202e1 100644 --- a/osu.Game/Screens/Multi/Components/ParticipantsList.cs +++ b/osu.Game/Screens/Multi/Components/ParticipantsList.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -25,7 +24,9 @@ namespace osu.Game.Screens.Multi.Components set { base.RelativeSizeAxes = value; - fill.RelativeSizeAxes = value; + + if (tiles != null) + tiles.RelativeSizeAxes = value; } } @@ -35,21 +36,24 @@ namespace osu.Game.Screens.Multi.Components set { base.AutoSizeAxes = value; - fill.AutoSizeAxes = value; + + if (tiles != null) + tiles.AutoSizeAxes = value; } } + private FillDirection direction = FillDirection.Full; + public FillDirection Direction { - get => fill.Direction; - set => fill.Direction = value; - } + get => direction; + set + { + direction = value; - private readonly FillFlowContainer fill; - - public ParticipantsList() - { - InternalChild = fill = new FillFlowContainer { Spacing = new Vector2(10) }; + if (tiles != null) + tiles.Direction = value; + } } [BackgroundDependencyLoader] @@ -60,37 +64,30 @@ namespace osu.Game.Screens.Multi.Components } private ScheduledDelegate scheduledUpdate; + private FillFlowContainer tiles; private void updateParticipants() { scheduledUpdate?.Cancel(); scheduledUpdate = Schedule(() => { - // Remove all extra tiles with a nice, progressive fade - int time = 500; + tiles?.FadeOut(250, Easing.Out).Expire(); - for (int i = Participants.Count; i < fill.Count; i++) + tiles = new FillFlowContainer { - var tile = fill[i]; - - tile.Delay(500 - time).FadeOut(time, Easing.Out); - time = Math.Max(20, time - 20); - tile.Expire(); - } - - // Add new tiles for all new players - for (int i = fill.Count; i < Participants.Count; i++) - { - var tile = new UserTile(); - fill.Add(tile); - - tile.ClearTransforms(); - tile.LifetimeEnd = double.MaxValue; - tile.FadeInFromZero(250, Easing.OutQuint); - } + Alpha = 0, + Direction = Direction, + AutoSizeAxes = AutoSizeAxes, + RelativeSizeAxes = RelativeSizeAxes, + Spacing = new Vector2(10) + }; for (int i = 0; i < Participants.Count; i++) - fill[i].User = Participants[i]; + tiles.Add(new UserTile { User = Participants[i] }); + + AddInternal(tiles); + + tiles.Delay(250).FadeIn(250, Easing.OutQuint); }); } From 22862256c1fc519bc5ae5150501b5edcdeca1446 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 19:42:19 +0900 Subject: [PATCH 15/26] Increase time between polls --- osu.Game/Screens/Multi/Multiplayer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 20b1f860a9..b0d773869a 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -180,7 +180,7 @@ namespace osu.Game.Screens.Multi { case LoungeSubScreen _: roomManager.TimeBetweenListingPolls = idle ? 120000 : 15000; - roomManager.TimeBetweenSelectionPolls = idle ? 30000 : 5000; + roomManager.TimeBetweenSelectionPolls = idle ? 120000 : 15000; break; case MatchSubScreen _: From 085968dd7fe8b96d71d0c55b6dbebc932d94e63b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 19:42:28 +0900 Subject: [PATCH 16/26] Rename recent participants --- osu.Game/Online/Multiplayer/Room.cs | 8 ++++---- .../Screens/Multi/Components/OverlinedParticipants.cs | 2 +- osu.Game/Screens/Multi/Components/ParticipantsList.cs | 6 +++--- osu.Game/Screens/Multi/MultiplayerComposite.cs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game/Online/Multiplayer/Room.cs b/osu.Game/Online/Multiplayer/Room.cs index 327f2c75da..fd700bff0b 100644 --- a/osu.Game/Online/Multiplayer/Room.cs +++ b/osu.Game/Online/Multiplayer/Room.cs @@ -60,7 +60,7 @@ namespace osu.Game.Online.Multiplayer [Cached] [JsonProperty("recent_participants")] - public BindableList Participants { get; private set; } = new BindableList(); + public BindableList RecentParticipants { get; private set; } = new BindableList(); [Cached] public Bindable ParticipantCount { get; private set; } = new Bindable(); @@ -133,10 +133,10 @@ namespace osu.Game.Online.Multiplayer Playlist.AddRange(other.Playlist); } - if (!Participants.SequenceEqual(other.Participants)) + if (!RecentParticipants.SequenceEqual(other.RecentParticipants)) { - Participants.Clear(); - Participants.AddRange(other.Participants); + RecentParticipants.Clear(); + RecentParticipants.AddRange(other.RecentParticipants); } Position = other.Position; diff --git a/osu.Game/Screens/Multi/Components/OverlinedParticipants.cs b/osu.Game/Screens/Multi/Components/OverlinedParticipants.cs index a709c6a57a..eb1782d147 100644 --- a/osu.Game/Screens/Multi/Components/OverlinedParticipants.cs +++ b/osu.Game/Screens/Multi/Components/OverlinedParticipants.cs @@ -16,7 +16,7 @@ namespace osu.Game.Screens.Multi.Components } public OverlinedParticipants(Direction direction) - : base("Participants") + : base("Recent participants") { OsuScrollContainer scroll; ParticipantsList list; diff --git a/osu.Game/Screens/Multi/Components/ParticipantsList.cs b/osu.Game/Screens/Multi/Components/ParticipantsList.cs index 13de0202e1..5a2dc19b66 100644 --- a/osu.Game/Screens/Multi/Components/ParticipantsList.cs +++ b/osu.Game/Screens/Multi/Components/ParticipantsList.cs @@ -59,7 +59,7 @@ namespace osu.Game.Screens.Multi.Components [BackgroundDependencyLoader] private void load() { - Participants.CollectionChanged += (_, __) => updateParticipants(); + RecentParticipants.CollectionChanged += (_, __) => updateParticipants(); updateParticipants(); } @@ -82,8 +82,8 @@ namespace osu.Game.Screens.Multi.Components Spacing = new Vector2(10) }; - for (int i = 0; i < Participants.Count; i++) - tiles.Add(new UserTile { User = Participants[i] }); + for (int i = 0; i < RecentParticipants.Count; i++) + tiles.Add(new UserTile { User = RecentParticipants[i] }); AddInternal(tiles); diff --git a/osu.Game/Screens/Multi/MultiplayerComposite.cs b/osu.Game/Screens/Multi/MultiplayerComposite.cs index 3f048eceab..e612e77748 100644 --- a/osu.Game/Screens/Multi/MultiplayerComposite.cs +++ b/osu.Game/Screens/Multi/MultiplayerComposite.cs @@ -31,7 +31,7 @@ namespace osu.Game.Screens.Multi protected BindableList Playlist { get; private set; } [Resolved(typeof(Room))] - protected BindableList Participants { get; private set; } + protected BindableList RecentParticipants { get; private set; } [Resolved(typeof(Room))] protected Bindable ParticipantCount { get; private set; } From dd2bd5c19dd5ab57c01953cfdc029ce713e28678 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 20:01:23 +0900 Subject: [PATCH 17/26] Add delay for loading multiplayer beatmap covers --- .../Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs index 30346a8a96..eb05cbaf85 100644 --- a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs +++ b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs @@ -16,6 +16,8 @@ namespace osu.Game.Beatmaps.Drawables { public readonly Bindable Beatmap = new Bindable(); + protected override double LoadDelay => 500; + [Resolved] private BeatmapManager beatmaps { get; set; } From b3220476d73db0798f1d583048c18481c7f1d8df Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 27 Feb 2020 20:05:12 +0900 Subject: [PATCH 18/26] Rename methods --- osu.Game/Screens/Multi/RoomManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Multi/RoomManager.cs b/osu.Game/Screens/Multi/RoomManager.cs index ef1e50d2ac..ad461af57f 100644 --- a/osu.Game/Screens/Multi/RoomManager.cs +++ b/osu.Game/Screens/Multi/RoomManager.cs @@ -62,8 +62,8 @@ namespace osu.Game.Screens.Multi InternalChildren = new Drawable[] { - listingPollingComponent = new ListingPollingComponent { RoomsReceived = onRoomsReceived }, - selectionPollingComponent = new SelectionPollingComponent { RoomReceived = onRoomReceived } + listingPollingComponent = new ListingPollingComponent { RoomsReceived = onListingReceived }, + selectionPollingComponent = new SelectionPollingComponent { RoomReceived = onSelectedRoomReceived } }; } @@ -139,7 +139,7 @@ namespace osu.Game.Screens.Multi /// Invoked when the listing of all s is received from the server. /// /// The listing. - private void onRoomsReceived(List listing) + private void onListingReceived(List listing) { // Remove past matches foreach (var r in rooms.ToList()) @@ -170,7 +170,7 @@ namespace osu.Game.Screens.Multi /// Invoked when a is received from the server. /// /// The received . - private void onRoomReceived(Room toUpdate) + private void onSelectedRoomReceived(Room toUpdate) { foreach (var room in rooms) { From 32dc4501c189bf10e3f22bd86aa31ab2fbaa751e Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 27 Feb 2020 14:16:35 +0300 Subject: [PATCH 19/26] Fix incorrect RepliesButton presentation --- osu.Game/Overlays/Comments/DrawableComment.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Comments/DrawableComment.cs b/osu.Game/Overlays/Comments/DrawableComment.cs index cb9e32f1ad..46f600615a 100644 --- a/osu.Game/Overlays/Comments/DrawableComment.cs +++ b/osu.Game/Overlays/Comments/DrawableComment.cs @@ -384,7 +384,7 @@ namespace osu.Game.Overlays.Comments protected override void OnExpandedChanged(ValueChangedEvent expanded) { - text.Text = $@"{(expanded.NewValue ? "[+]" : "[-]")} replies ({count})"; + text.Text = $@"{(expanded.NewValue ? "[-]" : "[+]")} replies ({count})"; } } From f486db48de22a4638c1eb1d00c1cb3d5ae27caaf Mon Sep 17 00:00:00 2001 From: voidedWarranties Date: Thu, 27 Feb 2020 17:30:06 -0800 Subject: [PATCH 20/26] Add labels and fix dropdown bindable values --- osu.Game/Configuration/SettingSourceAttribute.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Configuration/SettingSourceAttribute.cs b/osu.Game/Configuration/SettingSourceAttribute.cs index 4bdbb5fc24..fe487cb1d0 100644 --- a/osu.Game/Configuration/SettingSourceAttribute.cs +++ b/osu.Game/Configuration/SettingSourceAttribute.cs @@ -8,7 +8,6 @@ using System.Reflection; using JetBrains.Annotations; using osu.Framework.Bindables; using osu.Framework.Graphics; -using osu.Framework.Graphics.UserInterface; using osu.Game.Overlays.Settings; namespace osu.Game.Configuration @@ -105,7 +104,8 @@ namespace osu.Game.Configuration var dropdownType = typeof(SettingsEnumDropdown<>).MakeGenericType(bindable.GetType().GetGenericArguments()[0]); var dropdown = (Drawable)Activator.CreateInstance(dropdownType); - dropdown.GetType().GetProperty(nameof(IHasCurrentValue.Current))?.SetValue(dropdown, obj); + dropdownType.GetProperty(nameof(SettingsDropdown.LabelText))?.SetValue(dropdown, attr.Label); + dropdownType.GetProperty(nameof(SettingsDropdown.Bindable))?.SetValue(dropdown, bindable); yield return dropdown; From 7b9937b851bebad05ba6f9b06cee7759f24f48f3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Feb 2020 22:15:39 +0900 Subject: [PATCH 21/26] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index 28fbdb3367..2a6bfa0f88 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -52,6 +52,6 @@ - + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c5ebf0f712..ca62a959d9 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -23,7 +23,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index abd562dc81..11e7991dfa 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -71,7 +71,7 @@ - + @@ -79,7 +79,7 @@ - + From 4ad2d0cfb606835a9fe82ddb3b22181588e04e33 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Feb 2020 16:07:08 +0900 Subject: [PATCH 22/26] Remove deprecated debug setting --- osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs index 457f064f89..9edb18e065 100644 --- a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs @@ -22,11 +22,6 @@ namespace osu.Game.Overlays.Settings.Sections.Debug Bindable = frameworkConfig.GetBindable(FrameworkSetting.ShowLogOverlay) }, new SettingsCheckbox - { - LabelText = "Performance logging", - Bindable = config.GetBindable(DebugSetting.PerformanceLogging) - }, - new SettingsCheckbox { LabelText = "Bypass front-to-back render pass", Bindable = config.GetBindable(DebugSetting.BypassFrontToBackPass) From 394b88aa65d704cf602fb6f7bae4e2f6d0f95640 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Feb 2020 19:11:18 +0900 Subject: [PATCH 23/26] Add thread mode dropdown --- .../Overlays/Settings/Sections/Graphics/RendererSettings.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs index 7317076c54..69ff9b43e5 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs @@ -4,6 +4,7 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; +using osu.Framework.Platform; using osu.Game.Configuration; namespace osu.Game.Overlays.Settings.Sections.Graphics @@ -24,6 +25,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics LabelText = "Frame limiter", Bindable = config.GetBindable(FrameworkSetting.FrameSync) }, + new SettingsEnumDropdown + { + LabelText = "Threading mode", + Bindable = config.GetBindable(FrameworkSetting.ExecutionMode) + }, new SettingsCheckbox { LabelText = "Show FPS", From f18a1cde53e840b35646a5e946a8218f0d9b5507 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 29 Feb 2020 08:39:27 +0900 Subject: [PATCH 24/26] Fix crash when reaching results screen on single threaded execution mode --- osu.Game/Screens/Play/Player.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index bd43b23a9f..11ca36e25f 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -609,9 +609,9 @@ namespace osu.Game.Screens.Play { var score = CreateScore(); if (DrawableRuleset.ReplayScore == null) - scoreManager.Import(score).Wait(); - - this.Push(CreateResults(score)); + scoreManager.Import(score).ContinueWith(_ => Schedule(() => this.Push(CreateResults(score)))); + else + this.Push(CreateResults(score)); }); } From a332b6980bc1dc250a6effcb4fa5e18b15f40ac0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 29 Feb 2020 14:28:26 +0900 Subject: [PATCH 25/26] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index 2a6bfa0f88..651d1beda1 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -52,6 +52,6 @@ - + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ca62a959d9..168a358e47 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -23,7 +23,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index 11e7991dfa..3c2a67e908 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -71,7 +71,7 @@ - + @@ -79,7 +79,7 @@ - + From b9fef4f715717851998ec403582e46e6bf62207e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 1 Mar 2020 09:26:16 +0900 Subject: [PATCH 26/26] Update link location for appimage --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ae57b1d954..77c7eb9d2d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ If you are looking to install or test osu! without setting up a development envi **Latest build:** -| [Windows (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | [macOS 10.12+](https://github.com/ppy/osu/releases/latest/download/osu.app.zip) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.x86_64.AppImage) | [iOS(iOS 10+)](https://osu.ppy.sh/home/testflight) | [Android (5+)](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk) +| [Windows (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | [macOS 10.12+](https://github.com/ppy/osu/releases/latest/download/osu.app.zip) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.AppImage) | [iOS(iOS 10+)](https://osu.ppy.sh/home/testflight) | [Android (5+)](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk) | ------------- | ------------- | ------------- | ------------- | ------------- | - When running on Windows 7 or 8.1, **[additional prerequisites](https://docs.microsoft.com/en-us/dotnet/core/install/dependencies?tabs=netcore31&pivots=os-windows)** may be required to correctly run .NET Core applications if your operating system is not up-to-date with the latest service packs.