From 1d2f19b5a23923daeff1e8dbb83b2a0db65c4e00 Mon Sep 17 00:00:00 2001 From: Jorolf Date: Thu, 20 Apr 2017 14:43:30 +0200 Subject: [PATCH 1/6] change background dim from integer to double --- osu.Game/Configuration/OsuConfigManager.cs | 2 +- .../Overlays/Options/Sections/Gameplay/GeneralOptions.cs | 4 ++-- osu.Game/Screens/Play/Player.cs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index d47ed48e99..71dc076d61 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -24,7 +24,7 @@ namespace osu.Game.Configuration Set(OsuConfig.MenuCursorSize, 1.0, 0.5f, 2); Set(OsuConfig.GameplayCursorSize, 1.0, 0.5f, 2); - Set(OsuConfig.DimLevel, 30, 0, 100); + Set(OsuConfig.DimLevel, 0.3, 0, 1); Set(OsuConfig.MouseDisableButtons, false); Set(OsuConfig.MouseDisableWheel, false); diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs index ee6778a47a..167f4f0486 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs @@ -18,10 +18,10 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay { Children = new Drawable[] { - new OptionSlider + new OptionSlider { LabelText = "Background dim", - Bindable = (BindableInt)config.GetBindable(OsuConfig.DimLevel) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.DimLevel) }, new OptionEnumDropdown { diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a31ac25d60..2668c61eee 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -62,7 +62,7 @@ namespace osu.Game.Screens.Play #region User Settings - private Bindable dimLevel; + private Bindable dimLevel; private Bindable mouseWheelDisabled; private Bindable userAudioOffset; @@ -77,7 +77,7 @@ namespace osu.Game.Screens.Play [BackgroundDependencyLoader(permitNulls: true)] private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config, OsuGame osu) { - dimLevel = config.GetBindable(OsuConfig.DimLevel); + dimLevel = config.GetBindable(OsuConfig.DimLevel); mouseWheelDisabled = config.GetBindable(OsuConfig.MouseDisableWheel); Ruleset rulesetInstance; @@ -316,11 +316,11 @@ namespace osu.Game.Screens.Play base.OnEntering(last); (Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1500, EasingTypes.OutQuint); - Background?.FadeTo((100f - dimLevel) / 100, 1500, EasingTypes.OutQuint); + Background?.FadeTo(1 - (float)dimLevel, 1500, EasingTypes.OutQuint); Content.Alpha = 0; - dimLevel.ValueChanged += newDim => Background?.FadeTo((100f - newDim) / 100, 800); + dimLevel.ValueChanged += newDim => Background?.FadeTo(1 - (float)newDim, 800); Content.ScaleTo(0.7f); From 02249dcd67391a26eb82ee0c25d4df9aec7f433b Mon Sep 17 00:00:00 2001 From: Jorolf Date: Thu, 20 Apr 2017 14:52:06 +0200 Subject: [PATCH 2/6] add a function to OsuSliderBar to manually set the tooltip text --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 10 ++++++++-- osu.Game/Overlays/Options/OptionSlider.cs | 16 ++++++++++++++-- .../Options/Sections/Audio/OffsetOptions.cs | 1 + .../Sections/Gameplay/SongSelectOptions.cs | 7 +++++-- .../Options/Sections/Input/MouseOptions.cs | 2 ++ .../Overlays/Options/Sections/SkinSection.cs | 7 +++++-- 6 files changed, 35 insertions(+), 8 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 9b9a774049..cf141dd320 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -10,6 +10,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; +using System; +using System.Globalization; namespace osu.Game.Graphics.UserInterface { @@ -23,16 +25,20 @@ namespace osu.Game.Graphics.UserInterface private readonly Box leftBox; private readonly Box rightBox; + public Func TooltipTextFunc { get; set; } + public string TooltipText { get { + if (TooltipTextFunc != null) return TooltipTextFunc(Current); + var bindableDouble = CurrentNumber as BindableNumber; if (bindableDouble != null) { - if (bindableDouble.MaxValue == 1 && bindableDouble.MinValue == 0) + if (bindableDouble.MaxValue == 1 && (bindableDouble.MinValue == 0 || bindableDouble.MinValue == -1)) return bindableDouble.Value.ToString(@"P0"); - return bindableDouble.Value.ToString(@"n1"); + return bindableDouble.Value.ToString(@"n1", CultureInfo.InvariantCulture); } var bindableInt = CurrentNumber as BindableNumber; diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 5c383c74a8..b6989fb7d2 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -6,15 +6,15 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using System; namespace osu.Game.Overlays.Options { public class OptionSlider : FillFlowContainer where T : struct { - private readonly SliderBar slider; + private readonly OsuSliderBar slider; private readonly SpriteText text; public string LabelText @@ -38,6 +38,18 @@ namespace osu.Game.Overlays.Options } } + public Func TooltipText + { + get + { + return slider.TooltipTextFunc; + } + set + { + slider.TooltipTextFunc = value; + } + } + public OptionSlider() { RelativeSizeAxes = Axes.X; diff --git a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs index c1f5359585..2a4fea28d4 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs @@ -22,6 +22,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio { LabelText = "Audio Offset", Bindable = (BindableDouble)config.GetBindable(OsuConfig.AudioOffset) + TooltipText = value => value.ToString(@"0ms") }, new OsuButton { diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs index be38a9847a..3a546f5a0d 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs @@ -5,6 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Configuration; +using System.Globalization; namespace osu.Game.Overlays.Options.Sections.Gameplay { @@ -20,12 +21,14 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay new OptionSlider { LabelText = "Display beatmaps from", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMinimum) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMinimum), + TooltipText = value => value.ToString(@"0.## stars", CultureInfo.InvariantCulture) }, new OptionSlider { LabelText = "up to", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMaximum) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMaximum), + TooltipText = value => value.ToString(@"0.## stars", CultureInfo.InvariantCulture) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs index 92be00bdb0..63685aff0d 100644 --- a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -22,6 +23,7 @@ namespace osu.Game.Overlays.Options.Sections.Input { LabelText = "Sensitivity", Bindable = (BindableDouble)config.GetBindable(OsuConfig.MouseSpeed), + TooltipText = value => value.ToString(@"0.##x", CultureInfo.InvariantCulture) }, new OsuCheckbox { diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs index 78f4f1e380..aa681b94b3 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -8,6 +8,7 @@ using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; +using System.Globalization; namespace osu.Game.Overlays.Options.Sections { @@ -62,12 +63,14 @@ namespace osu.Game.Overlays.Options.Sections new OptionSlider { LabelText = "Menu cursor size", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.MenuCursorSize) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.MenuCursorSize), + TooltipText = value => value.ToString(@"0.##x", CultureInfo.InvariantCulture) }, new OptionSlider { LabelText = "Gameplay cursor size", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.GameplayCursorSize) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.GameplayCursorSize), + TooltipText = value => value.ToString(@"0.##x", CultureInfo.InvariantCulture) }, new OsuCheckbox { From e53c4be3561c85b900fffff27f0b11b330238379 Mon Sep 17 00:00:00 2001 From: Jorolf Date: Fri, 21 Apr 2017 13:59:04 +0200 Subject: [PATCH 3/6] I guess this works... --- .../Graphics/UserInterface/OsuSliderBar.cs | 10 ++------ osu.Game/Overlays/Options/OptionSlider.cs | 24 +++++++------------ .../Options/Sections/Audio/OffsetOptions.cs | 8 +++++-- .../Sections/Gameplay/SongSelectOptions.cs | 17 +++++++------ .../Options/Sections/Input/MouseOptions.cs | 11 +++++---- .../Overlays/Options/Sections/SkinSection.cs | 16 +++++++------ 6 files changed, 42 insertions(+), 44 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index cf141dd320..027473921f 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -10,8 +10,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; -using System; -using System.Globalization; namespace osu.Game.Graphics.UserInterface { @@ -25,20 +23,16 @@ namespace osu.Game.Graphics.UserInterface private readonly Box leftBox; private readonly Box rightBox; - public Func TooltipTextFunc { get; set; } - - public string TooltipText + public virtual string TooltipText { get { - if (TooltipTextFunc != null) return TooltipTextFunc(Current); - var bindableDouble = CurrentNumber as BindableNumber; if (bindableDouble != null) { if (bindableDouble.MaxValue == 1 && (bindableDouble.MinValue == 0 || bindableDouble.MinValue == -1)) return bindableDouble.Value.ToString(@"P0"); - return bindableDouble.Value.ToString(@"n1", CultureInfo.InvariantCulture); + return bindableDouble.Value.ToString(@"n1"); } var bindableInt = CurrentNumber as BindableNumber; diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index b6989fb7d2..6084a7de80 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -6,15 +6,19 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using System; namespace osu.Game.Overlays.Options { - public class OptionSlider : FillFlowContainer where T : struct + public class OptionSlider : OptionSlider> where T: struct { - private readonly OsuSliderBar slider; + } + + public class OptionSlider : FillFlowContainer where T : struct where U : SliderBar, new() + { + private readonly SliderBar slider; private readonly SpriteText text; public string LabelText @@ -38,18 +42,6 @@ namespace osu.Game.Overlays.Options } } - public Func TooltipText - { - get - { - return slider.TooltipTextFunc; - } - set - { - slider.TooltipTextFunc = value; - } - } - public OptionSlider() { RelativeSizeAxes = Axes.X; @@ -62,7 +54,7 @@ namespace osu.Game.Overlays.Options { Alpha = 0, }, - slider = new OsuSliderBar + slider = new U() { Margin = new MarginPadding { Top = 5, Bottom = 5 }, RelativeSizeAxes = Axes.X diff --git a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs index 2a4fea28d4..699a5bff81 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs @@ -18,11 +18,10 @@ namespace osu.Game.Overlays.Options.Sections.Audio { Children = new Drawable[] { - new OptionSlider + new OptionSlider { LabelText = "Audio Offset", Bindable = (BindableDouble)config.GetBindable(OsuConfig.AudioOffset) - TooltipText = value => value.ToString(@"0ms") }, new OsuButton { @@ -31,5 +30,10 @@ namespace osu.Game.Overlays.Options.Sections.Audio } }; } + + private class OffsetSlider : OsuSliderBar + { + public override string TooltipText => Current.Value.ToString(@"0ms"); + } } } diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs index 3a546f5a0d..1a994ff85b 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs @@ -5,7 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Configuration; -using System.Globalization; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.Sections.Gameplay { @@ -18,20 +18,23 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay { Children = new Drawable[] { - new OptionSlider + new OptionSlider { LabelText = "Display beatmaps from", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMinimum), - TooltipText = value => value.ToString(@"0.## stars", CultureInfo.InvariantCulture) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMinimum) }, - new OptionSlider + new OptionSlider { LabelText = "up to", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMaximum), - TooltipText = value => value.ToString(@"0.## stars", CultureInfo.InvariantCulture) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMaximum) }, }; } + + private class StarSlider : OsuSliderBar + { + public override string TooltipText => Current.Value.ToString(@"0.## stars"); + } } } diff --git a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs index 63685aff0d..0882dbab01 100644 --- a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -19,11 +18,10 @@ namespace osu.Game.Overlays.Options.Sections.Input { Children = new Drawable[] { - new OptionSlider + new OptionSlider { LabelText = "Sensitivity", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.MouseSpeed), - TooltipText = value => value.ToString(@"0.##x", CultureInfo.InvariantCulture) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.MouseSpeed) }, new OsuCheckbox { @@ -57,5 +55,10 @@ namespace osu.Game.Overlays.Options.Sections.Input }, }; } + + private class SensitivitySlider : OsuSliderBar + { + public override string TooltipText => Current.Value.ToString(@"0.##x"); + } } } diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs index aa681b94b3..d76c17f09a 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -8,7 +8,6 @@ using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; -using System.Globalization; namespace osu.Game.Overlays.Options.Sections { @@ -60,17 +59,15 @@ namespace osu.Game.Overlays.Options.Sections LabelText = "Always use skin cursor", Bindable = config.GetBindable(OsuConfig.UseSkinCursor) }, - new OptionSlider + new OptionSlider { LabelText = "Menu cursor size", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.MenuCursorSize), - TooltipText = value => value.ToString(@"0.##x", CultureInfo.InvariantCulture) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.MenuCursorSize) }, - new OptionSlider + new OptionSlider { LabelText = "Gameplay cursor size", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.GameplayCursorSize), - TooltipText = value => value.ToString(@"0.##x", CultureInfo.InvariantCulture) + Bindable = (BindableDouble)config.GetBindable(OsuConfig.GameplayCursorSize) }, new OsuCheckbox { @@ -79,5 +76,10 @@ namespace osu.Game.Overlays.Options.Sections }, }; } + + private class SizeSlider : OsuSliderBar + { + public override string TooltipText => Current.Value.ToString(@"0.##x"); + } } } From b151c71c0e244a922b23bf40e947d29b911c85f0 Mon Sep 17 00:00:00 2001 From: Jorolf Date: Fri, 21 Apr 2017 14:41:00 +0200 Subject: [PATCH 4/6] remove casts --- osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs | 2 +- .../Overlays/Options/Sections/Gameplay/SongSelectOptions.cs | 4 ++-- osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs | 2 +- osu.Game/Overlays/Options/Sections/SkinSection.cs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs index 699a5bff81..a763a57377 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio new OptionSlider { LabelText = "Audio Offset", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.AudioOffset) + Bindable = config.GetBindable(OsuConfig.AudioOffset) }, new OsuButton { diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs index 1a994ff85b..3ab844d411 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs @@ -21,12 +21,12 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay new OptionSlider { LabelText = "Display beatmaps from", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMinimum) + Bindable = config.GetBindable(OsuConfig.DisplayStarsMinimum) }, new OptionSlider { LabelText = "up to", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMaximum) + Bindable = config.GetBindable(OsuConfig.DisplayStarsMaximum) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs index 0882dbab01..fdaa03cb8d 100644 --- a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options.Sections.Input new OptionSlider { LabelText = "Sensitivity", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.MouseSpeed) + Bindable = config.GetBindable(OsuConfig.MouseSpeed) }, new OsuCheckbox { diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs index d76c17f09a..4461b59abc 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -62,12 +62,12 @@ namespace osu.Game.Overlays.Options.Sections new OptionSlider { LabelText = "Menu cursor size", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.MenuCursorSize) + Bindable = config.GetBindable(OsuConfig.MenuCursorSize) }, new OptionSlider { LabelText = "Gameplay cursor size", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.GameplayCursorSize) + Bindable = config.GetBindable(OsuConfig.GameplayCursorSize) }, new OsuCheckbox { From 60bb45358c8daf48c40cf18de1b1372704365766 Mon Sep 17 00:00:00 2001 From: Jorolf Date: Fri, 21 Apr 2017 14:50:03 +0200 Subject: [PATCH 5/6] remove more casts and usings --- osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs | 1 - .../Overlays/Options/Sections/Gameplay/GeneralOptions.cs | 5 ++--- .../Overlays/Options/Sections/Gameplay/SongSelectOptions.cs | 1 - osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs | 1 - osu.Game/Overlays/Options/Sections/SkinSection.cs | 1 - 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs index a763a57377..78c9688c93 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs index 167f4f0486..99f9ecbaed 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; @@ -21,7 +20,7 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay new OptionSlider { LabelText = "Background dim", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DimLevel) + Bindable = config.GetBindable(OsuConfig.DimLevel) }, new OptionEnumDropdown { @@ -36,7 +35,7 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay new OptionSlider { LabelText = "Score meter size", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.ScoreMeterScale) + Bindable = config.GetBindable(OsuConfig.ScoreMeterScale) }, new OsuCheckbox { diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs index 3ab844d411..3b8ec9329b 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs index fdaa03cb8d..7b34a371d6 100644 --- a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs index 4461b59abc..82ccf740d0 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics; From a6ea6738e59599df76bc24c2015d29931408e5cf Mon Sep 17 00:00:00 2001 From: Jorolf Date: Mon, 24 Apr 2017 17:10:00 +0200 Subject: [PATCH 6/6] add some spaces after commas --- osu.Game/Overlays/Options/OptionSlider.cs | 2 +- osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs | 2 +- .../Overlays/Options/Sections/Gameplay/SongSelectOptions.cs | 4 ++-- osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs | 2 +- osu.Game/Overlays/Options/Sections/SkinSection.cs | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 6084a7de80..42bf4170fa 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Options { } - public class OptionSlider : FillFlowContainer where T : struct where U : SliderBar, new() + public class OptionSlider : FillFlowContainer where T : struct where U : SliderBar, new() { private readonly SliderBar slider; private readonly SpriteText text; diff --git a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs index 78c9688c93..72c3dd071a 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs @@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio { Children = new Drawable[] { - new OptionSlider + new OptionSlider { LabelText = "Audio Offset", Bindable = config.GetBindable(OsuConfig.AudioOffset) diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs index 3b8ec9329b..910eae9a5a 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs @@ -17,12 +17,12 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay { Children = new Drawable[] { - new OptionSlider + new OptionSlider { LabelText = "Display beatmaps from", Bindable = config.GetBindable(OsuConfig.DisplayStarsMinimum) }, - new OptionSlider + new OptionSlider { LabelText = "up to", Bindable = config.GetBindable(OsuConfig.DisplayStarsMaximum) diff --git a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs index 7b34a371d6..4a48c9ec86 100644 --- a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs @@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Options.Sections.Input { Children = new Drawable[] { - new OptionSlider + new OptionSlider { LabelText = "Sensitivity", Bindable = config.GetBindable(OsuConfig.MouseSpeed) diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs index 82ccf740d0..0e533928a8 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -58,12 +58,12 @@ namespace osu.Game.Overlays.Options.Sections LabelText = "Always use skin cursor", Bindable = config.GetBindable(OsuConfig.UseSkinCursor) }, - new OptionSlider + new OptionSlider { LabelText = "Menu cursor size", Bindable = config.GetBindable(OsuConfig.MenuCursorSize) }, - new OptionSlider + new OptionSlider { LabelText = "Gameplay cursor size", Bindable = config.GetBindable(OsuConfig.GameplayCursorSize)