From 388fcfb295084a5efd47becabb9380f4f3b808c7 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 21 Jul 2017 13:13:53 +0300 Subject: [PATCH 1/5] Make BeatmapCarousel inherit from OsuScrollContainer --- osu.Game/Screens/Select/BeatmapCarousel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index b696d637e6..231d2de5de 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -18,10 +18,11 @@ using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Threading; using osu.Framework.Configuration; +using osu.Game.Graphics.Containers; namespace osu.Game.Screens.Select { - internal class BeatmapCarousel : ScrollContainer + internal class BeatmapCarousel : OsuScrollContainer { public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap; From c80f5c708a424f85d0b1ed3cf10fb0bceaf052c7 Mon Sep 17 00:00:00 2001 From: Nabile Rahmani Date: Mon, 24 Jul 2017 09:25:49 +0200 Subject: [PATCH 2/5] Less verbose DrawableFlag constructor. --- osu.Game/Overlays/Profile/ProfileHeader.cs | 2 +- osu.Game/Screens/Multiplayer/ParticipantInfo.cs | 2 +- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 2 +- osu.Game/Users/Country.cs | 4 ++-- osu.Game/Users/UserPanel.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index d42ebc3384..25d28c1744 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -129,7 +129,7 @@ namespace osu.Game.Overlays.Profile Origin = Anchor.BottomLeft, Y = -48 }, - countryFlag = new DrawableFlag(user.Country?.FlagName ?? "__") + countryFlag = new DrawableFlag(user.Country?.FlagName) { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, diff --git a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs index 639f29567f..fa48287ce1 100644 --- a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs +++ b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs @@ -27,7 +27,7 @@ namespace osu.Game.Screens.Multiplayer set { host.Text = value.Username; - flagContainer.Children = new[] { new DrawableFlag(value.Country?.FlagName ?? @"__") { RelativeSizeAxes = Axes.Both } }; + flagContainer.Children = new[] { new DrawableFlag(value.Country?.FlagName) { RelativeSizeAxes = Axes.Both } }; } } diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index c2d2f82b5c..39c948f8d3 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -191,7 +191,7 @@ namespace osu.Game.Screens.Select.Leaderboards Masking = true, Children = new Drawable[] { - new DrawableFlag(Score.User?.Country?.FlagName ?? "__") + new DrawableFlag(Score.User?.Country?.FlagName) { Width = 30, RelativeSizeAxes = Axes.Y, diff --git a/osu.Game/Users/Country.cs b/osu.Game/Users/Country.cs index ac95d22329..bf06d9f8bc 100644 --- a/osu.Game/Users/Country.cs +++ b/osu.Game/Users/Country.cs @@ -49,9 +49,9 @@ namespace osu.Game.Users sprite.Texture = textures.Get($@"Flags/{flagName}"); } - public DrawableFlag(string name = @"__") + public DrawableFlag(string name = null) { - flagName = name; + flagName = name ?? @"__"; Children = new Drawable[] { diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index d51df8ccaa..cd9ca582fc 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -102,7 +102,7 @@ namespace osu.Game.Users Spacing = new Vector2(5f, 0f), Children = new Drawable[] { - new DrawableFlag(user.Country?.FlagName ?? @"__") + new DrawableFlag(user.Country?.FlagName) { Width = 30f, RelativeSizeAxes = Axes.Y, From 5d30efc0908f22f8cbc099ef73307fe4629f7fad Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Mon, 24 Jul 2017 09:57:12 +0200 Subject: [PATCH 3/5] Do not trigger Random if no Beatmaps are imported --- osu.Game/Screens/Select/BeatmapCarousel.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 7f49109bd0..06ad7c1aa9 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -177,6 +177,9 @@ namespace osu.Game.Screens.Select public void SelectNextRandom() { + if (groups.Count == 0) + return; + randomSelectedBeatmaps.Push(new KeyValuePair(selectedGroup, selectedGroup.SelectedPanel)); var visibleGroups = getVisibleGroups(); From d0e99f0c95cc4101fb8b8246d13cce91e6b9864a Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Mon, 24 Jul 2017 10:25:33 +0200 Subject: [PATCH 4/5] check removed beatmap being null, check promptdelete beatmap being default --- osu.Game/Screens/Select/BeatmapCarousel.cs | 3 +++ osu.Game/Screens/Select/SongSelect.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 06ad7c1aa9..d46d093263 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -313,6 +313,9 @@ namespace osu.Game.Screens.Select private void removeGroup(BeatmapGroup group) { + if (group == null) + return; + groups.Remove(group); panels.Remove(group.Header); foreach (var p in group.BeatmapPanels) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 09fd22ecbe..b2311d6561 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -384,7 +384,7 @@ namespace osu.Game.Screens.Select private void promptDelete() { - if (Beatmap != null) + if (Beatmap != null && !Beatmap.IsDefault) dialogOverlay?.Push(new BeatmapDeleteDialog(Beatmap)); } From 32a6975521ea06cf5e382b970757f2eab6d037ab Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Jul 2017 10:16:10 +0900 Subject: [PATCH 5/5] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index d6ccab3776..05a8b26376 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit d6ccab37765ea0dfb3f7a589903760e8d7a1e26d +Subproject commit 05a8b2637623bd8ac6c1619b728ea9b4cca35b8a