diff --git a/osu-framework b/osu-framework index b2d10ab19b..05a8b26376 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit b2d10ab19b74ecd38911f8bdf278b42379da0530 +Subproject commit 05a8b2637623bd8ac6c1619b728ea9b4cca35b8a diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs b/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs index bab471ed6a..ea2f0464c4 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs @@ -17,7 +17,7 @@ namespace osu.Desktop.VisualTests.Tests { Add(new Box { - ColourInfo = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke), + Colour = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke), RelativeSizeAxes = Framework.Graphics.Axes.Both, }); Add(new ButtonSystem()); diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 5b79ecfaf1..71ae5a6697 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -207,7 +207,7 @@ namespace osu.Desktop.Overlays new Box { RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientVertical(colours.YellowDark, colours.Yellow) + Colour = ColourInfo.GradientVertical(colours.YellowDark, colours.Yellow) }, new TextAwesome { diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index a4d292ec45..94cf6a4337 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -122,7 +122,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Key gradient", RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientVertical(Color4.Black, Color4.Black.Opacity(0)), + Colour = ColourInfo.GradientVertical(Color4.Black, Color4.Black.Opacity(0)), Alpha = 0.5f }, keyIcon = new Container diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index bb679e5150..b0fb9d7f28 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -158,7 +158,7 @@ namespace osu.Game.Rulesets.Taiko.UI Anchor = Anchor.TopRight, RelativeSizeAxes = Axes.Y, Width = 10, - ColourInfo = Framework.Graphics.Colour.ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.6f), Color4.Black.Opacity(0)), + Colour = Framework.Graphics.Colour.ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.6f), Color4.Black.Opacity(0)), }, } }, diff --git a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs index cfa98da3c8..8e928391fb 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs @@ -34,7 +34,7 @@ namespace osu.Game.Beatmaps.Drawables GainedSelection?.Invoke(this); - background.ColourInfo = ColourInfo.GradientVertical( + background.Colour = ColourInfo.GradientVertical( new Color4(20, 43, 51, 255), new Color4(40, 86, 102, 255)); diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 5b263e4798..a2457ba78e 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -119,21 +119,21 @@ namespace osu.Game.Beatmaps.Drawables new Box { RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientHorizontal( + Colour = ColourInfo.GradientHorizontal( Color4.Black, new Color4(0f, 0f, 0f, 0.9f)), Width = 0.05f, }, new Box { RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientHorizontal( + Colour = ColourInfo.GradientHorizontal( new Color4(0f, 0f, 0f, 0.9f), new Color4(0f, 0f, 0f, 0.1f)), Width = 0.2f, }, new Box { RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientHorizontal( + Colour = ColourInfo.GradientHorizontal( new Color4(0f, 0f, 0f, 0.1f), new Color4(0, 0, 0, 0)), Width = 0.05f, }, diff --git a/osu.Game/Graphics/UserInterface/DialogButton.cs b/osu.Game/Graphics/UserInterface/DialogButton.cs index 4e688999dc..1cbf77d8f2 100644 --- a/osu.Game/Graphics/UserInterface/DialogButton.cs +++ b/osu.Game/Graphics/UserInterface/DialogButton.cs @@ -148,9 +148,9 @@ namespace osu.Game.Graphics.UserInterface private void updateGlow() { - leftGlow.ColourInfo = ColourInfo.GradientHorizontal(new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f), ButtonColour); + leftGlow.Colour = ColourInfo.GradientHorizontal(new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f), ButtonColour); centerGlow.Colour = ButtonColour; - rightGlow.ColourInfo = ColourInfo.GradientHorizontal(ButtonColour, new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f)); + rightGlow.Colour = ColourInfo.GradientHorizontal(ButtonColour, new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f)); } public DialogButton() diff --git a/osu.Game/Overlays/Direct/DirectListPanel.cs b/osu.Game/Overlays/Direct/DirectListPanel.cs index 8319270b8e..0a445e49d4 100644 --- a/osu.Game/Overlays/Direct/DirectListPanel.cs +++ b/osu.Game/Overlays/Direct/DirectListPanel.cs @@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Direct new Box { RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.25f), Color4.Black.Opacity(0.75f)), + Colour = ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.25f), Color4.Black.Opacity(0.75f)), }, new Container { diff --git a/osu.Game/Overlays/MedalOverlay.cs b/osu.Game/Overlays/MedalOverlay.cs index 064f42ecaf..880b607e78 100644 --- a/osu.Game/Overlays/MedalOverlay.cs +++ b/osu.Game/Overlays/MedalOverlay.cs @@ -261,7 +261,7 @@ namespace osu.Game.Overlays { RelativeSizeAxes = Axes.Both; Width = 0f; - ColourInfo = ColourInfo.GradientHorizontal(Color4.White.Opacity(start), Color4.White.Opacity(end)); + Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(start), Color4.White.Opacity(end)); Masking = true; Children = new[] diff --git a/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs b/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs index cd1ce56011..d70868046b 100644 --- a/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs @@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Notifications [BackgroundDependencyLoader] private void load(OsuColour colours) { - IconBackgound.ColourInfo = ColourInfo.GradientVertical(colours.GreenDark, colours.GreenLight); + IconBackgound.Colour = ColourInfo.GradientVertical(colours.GreenDark, colours.GreenLight); } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Notifications/SimpleNotification.cs b/osu.Game/Overlays/Notifications/SimpleNotification.cs index 42604658de..44e6d92aef 100644 --- a/osu.Game/Overlays/Notifications/SimpleNotification.cs +++ b/osu.Game/Overlays/Notifications/SimpleNotification.cs @@ -47,7 +47,7 @@ namespace osu.Game.Overlays.Notifications IconBackgound = new Box { RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientVertical(OsuColour.Gray(0.2f), OsuColour.Gray(0.6f)) + Colour = ColourInfo.GradientVertical(OsuColour.Gray(0.2f), OsuColour.Gray(0.6f)) }, iconDrawable = new TextAwesome { diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index d42ebc3384..93044315cc 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -58,7 +58,7 @@ namespace osu.Game.Overlays.Profile new Box { RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.75f)) + Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.75f)) }, new Container { @@ -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/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index bef9de6b6b..1ecfe90aa1 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -99,7 +99,7 @@ namespace osu.Game.Overlays.Toolbar Anchor = Anchor.BottomLeft, Alpha = 0, Height = 90, - ColourInfo = ColourInfo.GradientVertical( + Colour = ColourInfo.GradientVertical( OsuColour.Gray(0.1f).Opacity(0.5f), OsuColour.Gray(0.1f).Opacity(0)), }, }; diff --git a/osu.Game/Screens/Menu/MenuSideFlashes.cs b/osu.Game/Screens/Menu/MenuSideFlashes.cs index 4ecf78e764..49c777f09a 100644 --- a/osu.Game/Screens/Menu/MenuSideFlashes.cs +++ b/osu.Game/Screens/Menu/MenuSideFlashes.cs @@ -73,8 +73,8 @@ namespace osu.Game.Screens.Menu Color4 gradientDark = colours.Blue.Opacity(0).ToLinear(); Color4 gradientLight = colours.Blue.Opacity(0.3f).ToLinear(); - leftBox.ColourInfo = ColourInfo.GradientHorizontal(gradientLight, gradientDark); - rightBox.ColourInfo = ColourInfo.GradientHorizontal(gradientDark, gradientLight); + leftBox.Colour = ColourInfo.GradientHorizontal(gradientLight, gradientDark); + rightBox.Colour = ColourInfo.GradientHorizontal(gradientDark, gradientLight); } protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) 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/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index 5a9b3e4d11..18fad53b51 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -112,7 +112,7 @@ namespace osu.Game.Screens.Multiplayer new Box { RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0)), + Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0)), }, new Container { diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index c5b7b85cf4..00cc031ec6 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -133,7 +133,7 @@ namespace osu.Game.Screens.Ranking { new Box { - ColourInfo = ColourInfo.GradientHorizontal( + Colour = ColourInfo.GradientHorizontal( colours.GrayC.Opacity(0), colours.GrayC.Opacity(0.9f)), RelativeSizeAxes = Axes.Both, @@ -143,7 +143,7 @@ namespace osu.Game.Screens.Ranking { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - ColourInfo = ColourInfo.GradientHorizontal( + Colour = ColourInfo.GradientHorizontal( colours.GrayC.Opacity(0.9f), colours.GrayC.Opacity(0)), RelativeSizeAxes = Axes.Both, diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 7f49109bd0..1940cdef6e 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; @@ -177,6 +178,9 @@ namespace osu.Game.Screens.Select public void SelectNextRandom() { + if (groups.Count == 0) + return; + randomSelectedBeatmaps.Push(new KeyValuePair(selectedGroup, selectedGroup.SelectedPanel)); var visibleGroups = getVisibleGroups(); @@ -310,6 +314,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/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index c2282beae8..8aa2796189 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -140,7 +140,7 @@ namespace osu.Game.Screens.Select new Container { RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientVertical(Color4.White, Color4.White.Opacity(0.3f)), + Colour = ColourInfo.GradientVertical(Color4.White, Color4.White.Opacity(0.3f)), Children = new[] { // Zoomed-in and cropped beatmap background diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 91bc55f143..57c333138f 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -163,7 +163,7 @@ namespace osu.Game.Screens.Select.Leaderboards c.Colour = Color4.Transparent; else { - c.ColourInfo = ColourInfo.GradientVertical( + c.Colour = ColourInfo.GradientVertical( Color4.White.Opacity(Math.Min(1 - (topY - fadeStart) / LeaderboardScore.HEIGHT, 1)), Color4.White.Opacity(Math.Min(1 - (bottomY - fadeStart) / LeaderboardScore.HEIGHT, 1))); } 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/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)); } diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index 964fa4457c..2eb0dacec3 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -68,7 +68,7 @@ namespace osu.Game.Screens.Tournament Origin = Anchor.BottomCentre, Size = new Vector2(2, 55), - ColourInfo = ColourInfo.GradientVertical(Color4.Transparent, Color4.White) + Colour = ColourInfo.GradientVertical(Color4.Transparent, Color4.White) }, new Box { @@ -76,7 +76,7 @@ namespace osu.Game.Screens.Tournament Origin = Anchor.TopCentre, Size = new Vector2(2, 55), - ColourInfo = ColourInfo.GradientVertical(Color4.White, Color4.Transparent) + Colour = ColourInfo.GradientVertical(Color4.White, Color4.Transparent) } } } 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,