From 5ad96afea0680e2aad8f417ea2e45b300d579b46 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 20 Nov 2018 18:09:23 +0900 Subject: [PATCH 1/2] Fix crashes when importing/deleting from model managers --- osu.Game/Beatmaps/Drawables/BeatmapSetDownloader.cs | 8 ++++---- osu.Game/Overlays/Direct/DirectPanel.cs | 4 ++-- osu.Game/Overlays/Music/PlaylistList.cs | 8 ++++---- osu.Game/Overlays/MusicController.cs | 4 ++-- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetDownloader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetDownloader.cs index 5b5dbec9c8..160d081b8a 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetDownloader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetDownloader.cs @@ -78,17 +78,17 @@ namespace osu.Game.Beatmaps.Drawables } } - private void setAdded(BeatmapSetInfo s) + private void setAdded(BeatmapSetInfo s) => Schedule(() => { if (s.OnlineBeatmapSetID == set.OnlineBeatmapSetID) DownloadState.Value = DownloadStatus.Downloaded; - } + }); - private void setRemoved(BeatmapSetInfo s) + private void setRemoved(BeatmapSetInfo s) => Schedule(() => { if (s.OnlineBeatmapSetID == set.OnlineBeatmapSetID) DownloadState.Value = DownloadStatus.NotDownloaded; - } + }); private void downloadBegan(DownloadBeatmapSetRequest d) { diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 5c7c34a0ed..926f60fc44 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -174,11 +174,11 @@ namespace osu.Game.Overlays.Direct }; } - private void setAdded(BeatmapSetInfo s) + private void setAdded(BeatmapSetInfo s) => Schedule(() => { if (s.OnlineBeatmapSetID == SetInfo.OnlineBeatmapSetID) progressBar.FadeOut(500); - } + }); protected override void LoadComplete() { diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs index 17c8d2f154..39e5d5f780 100644 --- a/osu.Game/Overlays/Music/PlaylistList.cs +++ b/osu.Game/Overlays/Music/PlaylistList.cs @@ -83,20 +83,20 @@ namespace osu.Game.Overlays.Music beatmapBacking.ValueChanged += _ => updateSelectedSet(); } - private void addBeatmapSet(BeatmapSetInfo obj) + private void addBeatmapSet(BeatmapSetInfo obj) => Schedule(() => { var newItem = new PlaylistItem(obj) { OnSelect = set => Selected?.Invoke(set) }; items.Add(newItem); items.SetLayoutPosition(newItem, items.Count - 1); - } + }); - private void removeBeatmapSet(BeatmapSetInfo obj) + private void removeBeatmapSet(BeatmapSetInfo obj) => Schedule(() => { var itemToRemove = items.FirstOrDefault(i => i.BeatmapSetInfo.ID == obj.ID); if (itemToRemove != null) items.Remove(itemToRemove); - } + }); private void updateSelectedSet() { diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index f282b757cd..c282fc67cd 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -214,8 +214,8 @@ namespace osu.Game.Overlays beatmapSets.Insert(index, beatmapSetInfo); } - private void handleBeatmapAdded(BeatmapSetInfo obj) => beatmapSets.Add(obj); - private void handleBeatmapRemoved(BeatmapSetInfo obj) => beatmapSets.RemoveAll(s => s.ID == obj.ID); + private void handleBeatmapAdded(BeatmapSetInfo obj) => Schedule(() => beatmapSets.Add(obj)); + private void handleBeatmapRemoved(BeatmapSetInfo obj) => Schedule(() => beatmapSets.RemoveAll(s => s.ID == obj.ID)); protected override void LoadComplete() { diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index af7864836b..7d55ee4769 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -70,8 +70,8 @@ namespace osu.Game.Overlays.Settings.Sections dropdownBindable.BindValueChanged(v => configBindable.Value = v.ID); } - private void itemRemoved(SkinInfo s) => skinDropdown.Items = skinDropdown.Items.Where(i => i.ID != s.ID).ToArray(); - private void itemAdded(SkinInfo s) => skinDropdown.Items = skinDropdown.Items.Append(s).ToArray(); + private void itemRemoved(SkinInfo s) => Schedule(() => skinDropdown.Items = skinDropdown.Items.Where(i => i.ID != s.ID).ToArray()); + private void itemAdded(SkinInfo s) => Schedule(() => skinDropdown.Items = skinDropdown.Items.Append(s).ToArray()); protected override void Dispose(bool isDisposing) { From ab2c969122e78f4a9f3d2c87d4463fff89f88c83 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 21 Nov 2018 12:58:45 +0900 Subject: [PATCH 2/2] Add private channel types --- osu.Game/Online/Chat/ChannelType.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Online/Chat/ChannelType.cs b/osu.Game/Online/Chat/ChannelType.cs index 8439638c46..c8b9463ded 100644 --- a/osu.Game/Online/Chat/ChannelType.cs +++ b/osu.Game/Online/Chat/ChannelType.cs @@ -6,6 +6,7 @@ namespace osu.Game.Online.Chat public enum ChannelType { Public, + Private, Multiplayer, Spectator, Temporary,