From e7a64126a39ccf3d30729940c67418bc99e501b3 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Fri, 19 May 2017 20:13:59 -0300 Subject: [PATCH] Formatting and remove magic number --- osu.Game/Overlays/Direct/DirectPanel.cs | 2 +- osu.Game/Overlays/Direct/FilterControl.cs | 8 +++++--- osu.Game/Overlays/DirectOverlay.cs | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 6959a3f421..0ea2e48073 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -54,7 +54,7 @@ namespace osu.Game.Overlays.Direct set { this.value = value; - text.Text = string.Format("{0:n0}", Value); + text.Text = string.Format(@"{0:n0}", Value); } } diff --git a/osu.Game/Overlays/Direct/FilterControl.cs b/osu.Game/Overlays/Direct/FilterControl.cs index 7ea1f2a8e1..28450718b2 100644 --- a/osu.Game/Overlays/Direct/FilterControl.cs +++ b/osu.Game/Overlays/Direct/FilterControl.cs @@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Direct Origin = Anchor.TopRight, Spacing = new Vector2(10f, 0f), Direction = FillDirection.Horizontal, - Margin = new MarginPadding { Top = Height - 25 - padding, Right = DirectOverlay.WIDTH_PADDING }, + Margin = new MarginPadding { Top = Height - SlimEnumDropdown.HEIGHT - padding, Right = DirectOverlay.WIDTH_PADDING }, Children = new Drawable[] { new FillFlowContainer @@ -255,7 +255,7 @@ namespace osu.Game.Overlays.Direct { this.bindable = bindable; this.style = style; - Size = new Vector2(25f); + Size = new Vector2(SlimEnumDropdown.HEIGHT); Children = new Drawable[] { @@ -288,6 +288,8 @@ namespace osu.Game.Overlays.Direct private class SlimEnumDropdown : OsuEnumDropdown { + public const float HEIGHT = 25; + protected override DropdownHeader CreateHeader() => new SlimDropdownHeader { AccentColour = AccentColour }; protected override Menu CreateMenu() => new SlimMenu(); @@ -295,7 +297,7 @@ namespace osu.Game.Overlays.Direct { public SlimDropdownHeader() { - Height = 25; + Height = HEIGHT; Icon.TextSize = 16; Foreground.Padding = new MarginPadding { Top = 4, Bottom = 4, Left = 8, Right = 4 }; } diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index 9f2d56a2dc..ea56d656aa 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -28,7 +28,7 @@ namespace osu.Game.Overlays get { return beatmapSets; } set { - if (value == beatmapSets) return; + if (beatmapSets?.Equals(value) ?? false) return; beatmapSets = value; recreatePanels(filter.DisplayStyle.Value);