From 83c81c06260f70c8edfcc65adae740df96f81998 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Fri, 19 May 2017 20:03:07 -0300 Subject: [PATCH] Cleanup (again) --- osu.Game/Overlays/Direct/DirectGridPanel.cs | 2 +- osu.Game/Overlays/Direct/DirectListPanel.cs | 4 ++-- osu.Game/Overlays/Direct/SortTabControl.cs | 2 +- osu.Game/Overlays/DirectOverlay.cs | 10 ++-------- osu.Game/osu.Game.csproj | 1 - 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs index 01793df1f0..fc63045e15 100644 --- a/osu.Game/Overlays/Direct/DirectGridPanel.cs +++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs @@ -148,7 +148,7 @@ namespace osu.Game.Overlays.Direct TextSize = 14, Shadow = false, Colour = colours.Gray5, - Alpha = SetInfo.Metadata.Source == @"" ? 0 : 1, + Alpha = string.IsNullOrEmpty(SetInfo.Metadata.Source) ? 0f : 1f, }, }, }, diff --git a/osu.Game/Overlays/Direct/DirectListPanel.cs b/osu.Game/Overlays/Direct/DirectListPanel.cs index 7f215b7447..02930a9e7b 100644 --- a/osu.Game/Overlays/Direct/DirectListPanel.cs +++ b/osu.Game/Overlays/Direct/DirectListPanel.cs @@ -136,7 +136,7 @@ namespace osu.Game.Overlays.Direct Anchor = Anchor.TopRight, Origin = Anchor.TopRight, TextSize = 14, - Alpha = SetInfo.Metadata.Source == @"" ? 0 : 1, + Alpha = string.IsNullOrEmpty(SetInfo.Metadata.Source) ? 0f : 1f, }, }, }, @@ -190,7 +190,7 @@ namespace osu.Game.Overlays.Direct protected override void OnHoverLost(InputState state) { - icon.ScaleTo(1, 500, EasingTypes.OutElastic); + icon.ScaleTo(1f, 500, EasingTypes.OutElastic); } } } diff --git a/osu.Game/Overlays/Direct/SortTabControl.cs b/osu.Game/Overlays/Direct/SortTabControl.cs index 7eb6ba4e88..4d4e02d875 100644 --- a/osu.Game/Overlays/Direct/SortTabControl.cs +++ b/osu.Game/Overlays/Direct/SortTabControl.cs @@ -58,7 +58,7 @@ namespace osu.Game.Overlays.Direct Margin = new MarginPadding { Top = 8, Bottom = 8 }, Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, - Text = (value as Enum)?.GetDescription() ?? value.ToString(), + Text = (value as Enum).GetDescription() ?? value.ToString(), TextSize = 14, Font = @"Exo2.0-Bold", }, diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index 46d19c724b..9f2d56a2dc 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -52,7 +52,7 @@ namespace osu.Game.Overlays ThirdWaveColour = OsuColour.FromHex(@"005774"); FourthWaveColour = OsuColour.FromHex(@"003a4e"); - Header header = null; + Header header; Children = new Drawable[] { new Box @@ -119,13 +119,7 @@ namespace osu.Game.Overlays private void recreatePanels(PanelDisplayStyle displayStyle) { - var p = new List(); - - foreach (BeatmapSetInfo b in BeatmapSets) - p.Add(displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : - new DirectListPanel(b)); - - panels.Children = p; + panels.Children = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b)); } protected override void PopIn() diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 37dc36f59f..c7b3290a08 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -460,7 +460,6 @@ -