From 6ca974bf0cda60d8ef93af05b869645d9f50c192 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 18:37:11 +0900 Subject: [PATCH 01/14] Re-namespace options, adjust font sizes + more. --- .../UserInterface/OsuCheckbox.cs} | 21 +++--- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 3 +- osu.Game/Overlays/LoginOverlay.cs | 2 +- .../{DropdownOption.cs => OptionDropdown.cs} | 37 ++++++---- osu.Game/Overlays/Options/OptionLabel.cs | 23 +++++++ .../{SliderOption.cs => OptionSlider.cs} | 11 +-- .../{TextBoxOption.cs => OptionTextBox.cs} | 2 +- .../Audio/AudioDevicesOptions.cs | 6 +- .../Audio/OffsetAdjustmentOptions.cs | 17 +++-- .../{ => Sections}/Audio/VolumeOptions.cs | 14 ++-- .../{Audio => Sections}/AudioSection.cs | 11 +-- .../Options/{ => Sections}/EditorSection.cs | 19 +++--- .../Gameplay/GeneralGameplayOptions.cs | 32 +++++---- .../Gameplay/SongSelectGameplayOptions.cs | 19 +++--- .../{Gameplay => Sections}/GameplaySection.cs | 9 +-- .../{ => Sections}/General/LanguageOptions.cs | 13 ++-- .../{ => Sections}/General/LoginOptions.cs | 18 +++-- .../{ => Sections}/General/UpdateOptions.cs | 8 +-- .../{General => Sections}/GeneralSection.cs | 9 +-- .../{ => Sections}/Graphics/DetailOptions.cs | 22 +++--- .../{ => Sections}/Graphics/LayoutOptions.cs | 17 ++--- .../Graphics/MainMenuOptions.cs | 15 ++--- .../Graphics/RendererOptions.cs | 14 ++-- .../Graphics/SongSelectGraphicsOptions.cs | 7 +- .../{Graphics => Sections}/GraphicsSection.cs | 9 +-- .../{ => Sections}/Input/KeyboardOptions.cs | 8 +-- .../{ => Sections}/Input/MouseOptions.cs | 20 +++--- .../{ => Sections}/Input/OtherInputOptions.cs | 9 ++- .../{Input => Sections}/InputSection.cs | 9 +-- .../{ => Sections}/MaintenanceSection.cs | 15 ++--- .../Online/InGameChatOptions.cs | 26 ++++--- .../Online/NotificationsOptions.cs | 17 +++-- .../Online/OnlineIntegrationOptions.cs | 13 ++-- .../{ => Sections}/Online/PrivacyOptions.cs | 9 ++- .../{Online => Sections}/OnlineSection.cs | 9 +-- .../Options/{ => Sections}/SkinSection.cs | 25 +++---- osu.Game/Overlays/Options/SidebarButton.cs | 1 + osu.Game/Overlays/OptionsOverlay.cs | 9 +-- osu.Game/osu.Game.csproj | 67 ++++++++++--------- 39 files changed, 305 insertions(+), 290 deletions(-) rename osu.Game/{Overlays/Options/CheckBoxOption.cs => Graphics/UserInterface/OsuCheckbox.cs} (89%) rename osu.Game/Overlays/Options/{DropdownOption.cs => OptionDropdown.cs} (87%) create mode 100644 osu.Game/Overlays/Options/OptionLabel.cs rename osu.Game/Overlays/Options/{SliderOption.cs => OptionSlider.cs} (92%) rename osu.Game/Overlays/Options/{TextBoxOption.cs => OptionTextBox.cs} (96%) rename osu.Game/Overlays/Options/{ => Sections}/Audio/AudioDevicesOptions.cs (71%) rename osu.Game/Overlays/Options/{ => Sections}/Audio/OffsetAdjustmentOptions.cs (87%) rename osu.Game/Overlays/Options/{ => Sections}/Audio/VolumeOptions.cs (68%) rename osu.Game/Overlays/Options/{Audio => Sections}/AudioSection.cs (88%) rename osu.Game/Overlays/Options/{ => Sections}/EditorSection.cs (82%) rename osu.Game/Overlays/Options/{ => Sections}/Gameplay/GeneralGameplayOptions.cs (79%) rename osu.Game/Overlays/Options/{ => Sections}/Gameplay/SongSelectGameplayOptions.cs (80%) rename osu.Game/Overlays/Options/{Gameplay => Sections}/GameplaySection.cs (86%) rename osu.Game/Overlays/Options/{ => Sections}/General/LanguageOptions.cs (77%) rename osu.Game/Overlays/Options/{ => Sections}/General/LoginOptions.cs (94%) rename osu.Game/Overlays/Options/{ => Sections}/General/UpdateOptions.cs (78%) rename osu.Game/Overlays/Options/{General => Sections}/GeneralSection.cs (86%) rename osu.Game/Overlays/Options/{ => Sections}/Graphics/DetailOptions.cs (80%) rename osu.Game/Overlays/Options/{ => Sections}/Graphics/LayoutOptions.cs (74%) rename osu.Game/Overlays/Options/{ => Sections}/Graphics/MainMenuOptions.cs (79%) rename osu.Game/Overlays/Options/{ => Sections}/Graphics/RendererOptions.cs (80%) rename osu.Game/Overlays/Options/{ => Sections}/Graphics/SongSelectGraphicsOptions.cs (80%) rename osu.Game/Overlays/Options/{Graphics => Sections}/GraphicsSection.cs (88%) rename osu.Game/Overlays/Options/{ => Sections}/Input/KeyboardOptions.cs (93%) rename osu.Game/Overlays/Options/{ => Sections}/Input/MouseOptions.cs (79%) rename osu.Game/Overlays/Options/{ => Sections}/Input/OtherInputOptions.cs (80%) rename osu.Game/Overlays/Options/{Input => Sections}/InputSection.cs (87%) rename osu.Game/Overlays/Options/{ => Sections}/MaintenanceSection.cs (93%) rename osu.Game/Overlays/Options/{ => Sections}/Online/InGameChatOptions.cs (70%) rename osu.Game/Overlays/Options/{ => Sections}/Online/NotificationsOptions.cs (82%) rename osu.Game/Overlays/Options/{ => Sections}/Online/OnlineIntegrationOptions.cs (82%) rename osu.Game/Overlays/Options/{ => Sections}/Online/PrivacyOptions.cs (81%) rename osu.Game/Overlays/Options/{Online => Sections}/OnlineSection.cs (87%) rename osu.Game/Overlays/Options/{ => Sections}/SkinSection.cs (82%) diff --git a/osu.Game/Overlays/Options/CheckBoxOption.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs similarity index 89% rename from osu.Game/Overlays/Options/CheckBoxOption.cs rename to osu.Game/Graphics/UserInterface/OsuCheckbox.cs index cc1af1e3c9..c6e8559f7f 100644 --- a/osu.Game/Overlays/Options/CheckBoxOption.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -13,14 +13,14 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.UserInterface; +using osu.Framework.Input; +using osu.Game.Overlays; using OpenTK; using OpenTK.Graphics; -using osu.Framework.Input; -using osu.Game.Graphics; -namespace osu.Game.Overlays.Options +namespace osu.Game.Graphics.UserInterface { - public class CheckBoxOption : CheckBox + public class OsuCheckbox : CheckBox { private Bindable bindable; @@ -70,15 +70,18 @@ namespace osu.Game.Overlays.Options private AudioSample sampleChecked; private AudioSample sampleUnchecked; - public CheckBoxOption() + public OsuCheckbox() { AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; Children = new Drawable[] { - labelSpriteText = new SpriteText(), - light = new Light() + labelSpriteText = new SpriteText + { + TextSize = OptionsOverlay.FONT_SIZE, + }, + light = new Light { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, @@ -145,7 +148,7 @@ namespace osu.Game.Overlays.Options public Light() { - Size = new Vector2(40, 12); + Size = new Vector2(20, 12); Masking = true; @@ -187,11 +190,13 @@ namespace osu.Game.Overlays.Options { if (value) { + ResizeTo(new Vector2(40, 12), 500, EasingTypes.OutQuint); FadeColour(glowingColour, 500, EasingTypes.OutQuint); FadeGlowTo(1, 500, EasingTypes.OutQuint); } else { + ResizeTo(new Vector2(20, 12), 500, EasingTypes.OutQuint); FadeGlowTo(0, 500); FadeColour(idleColour, 500); } diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 5041e7ded9..52b5d88e26 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -5,6 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; +using osu.Game.Overlays; using OpenTK.Graphics; namespace osu.Game.Graphics.UserInterface @@ -14,7 +15,7 @@ namespace osu.Game.Graphics.UserInterface public OsuTextBox() { Height = 40; - TextContainer.Height = 0.6f; + TextContainer.Height = OptionsOverlay.FONT_SIZE / Height; CornerRadius = 5; } diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index 91bea093db..5f8c60ff9b 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Game.Graphics; -using osu.Game.Overlays.Options.General; +using osu.Game.Overlays.Options.Sections.General; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/Overlays/Options/DropdownOption.cs b/osu.Game/Overlays/Options/OptionDropdown.cs similarity index 87% rename from osu.Game/Overlays/Options/DropdownOption.cs rename to osu.Game/Overlays/Options/OptionDropdown.cs index 6262673734..f154db71ff 100644 --- a/osu.Game/Overlays/Options/DropdownOption.cs +++ b/osu.Game/Overlays/Options/OptionDropdown.cs @@ -12,16 +12,15 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Game.Configuration; using osu.Game.Graphics; namespace osu.Game.Overlays.Options { - public class DropdownOption : FlowContainer + public class OptionDropdown : FlowContainer { private DropDownMenu dropdown; private SpriteText text; - + public string LabelText { get { return text.Text; } @@ -31,7 +30,7 @@ namespace osu.Game.Overlays.Options text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1; } } - + public Bindable Bindable { get { return bindable; } @@ -56,7 +55,7 @@ namespace osu.Game.Overlays.Options { bindable.Value = dropdown.SelectedValue; } - + protected override void Dispose(bool isDisposing) { bindable.ValueChanged -= Bindable_ValueChanged; @@ -64,7 +63,7 @@ namespace osu.Game.Overlays.Options base.Dispose(isDisposing); } - public DropdownOption() + public OptionDropdown() { if (!typeof(T).IsEnum) throw new InvalidOperationException("OptionsDropdown only supports enums as the generic type argument"); @@ -73,7 +72,10 @@ namespace osu.Game.Overlays.Options AutoSizeAxes = Axes.Y; Children = new Drawable[] { - text = new SpriteText { Alpha = 0 }, + text = new SpriteText { + Alpha = 0, + TextSize = OptionsOverlay.FONT_SIZE + }, dropdown = new StyledDropDownMenu { Margin = new MarginPadding { Top = 5 }, @@ -83,7 +85,7 @@ namespace osu.Game.Overlays.Options }; dropdown.ValueChanged += Dropdown_ValueChanged; } - + private class StyledDropDownMenu : DropDownMenu { protected override float DropDownListSpacing => 4; @@ -92,7 +94,7 @@ namespace osu.Game.Overlays.Options { return new StyledDropDownComboBox(); } - + protected override IEnumerable> GetDropDownItems(IEnumerable values) { return values.Select(v => @@ -101,7 +103,7 @@ namespace osu.Game.Overlays.Options return new StyledDropDownMenuItem( field.GetCustomAttribute()?.Description ?? field.Name, v); }); - + } public StyledDropDownMenu() @@ -143,9 +145,17 @@ namespace osu.Game.Overlays.Options { Foreground.Padding = new MarginPadding(4); + AutoSizeAxes = Axes.None; + Height = 40; + Children = new[] { - label = new SpriteText(), + label = new SpriteText() + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + TextSize = OptionsOverlay.FONT_SIZE, + }, new TextAwesome { Icon = FontAwesome.fa_chevron_down, @@ -189,7 +199,10 @@ namespace osu.Game.Overlays.Options Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, - new SpriteText { Text = text } + new SpriteText { + Text = text, + TextSize = OptionsOverlay.FONT_SIZE, + } } } }; diff --git a/osu.Game/Overlays/Options/OptionLabel.cs b/osu.Game/Overlays/Options/OptionLabel.cs new file mode 100644 index 0000000000..e6a7f6ab90 --- /dev/null +++ b/osu.Game/Overlays/Options/OptionLabel.cs @@ -0,0 +1,23 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; + +namespace osu.Game.Overlays.Options +{ + class OptionLabel : SpriteText + { + public OptionLabel() + { + TextSize = OptionsOverlay.FONT_SIZE; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colour) + { + Colour = colour.Gray6; + } + } +} diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/OptionSlider.cs similarity index 92% rename from osu.Game/Overlays/Options/SliderOption.cs rename to osu.Game/Overlays/Options/OptionSlider.cs index e2e387d348..6c14d3dfeb 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -21,7 +21,7 @@ using System.Linq; namespace osu.Game.Overlays.Options { - public class SliderOption : FlowContainer where T : struct + public class OptionSlider : FlowContainer where T : struct { private SliderBar slider; private SpriteText text; @@ -42,14 +42,17 @@ namespace osu.Game.Overlays.Options set { slider.Bindable = value; } } - public SliderOption() + public OptionSlider() { Direction = FlowDirection.VerticalOnly; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Children = new Drawable[] { - text = new SpriteText { Alpha = 0 }, + text = new SpriteText { + Alpha = 0, + TextSize = OptionsOverlay.FONT_SIZE, + }, slider = new OsuSliderBar { Margin = new MarginPadding { Top = 5 }, @@ -76,7 +79,7 @@ namespace osu.Game.Overlays.Options public OsuSliderBar() { - Height = 22; + Height = 20; Padding = new MarginPadding { Left = Height / 2, Right = Height / 2 }; Children = new Drawable[] { diff --git a/osu.Game/Overlays/Options/TextBoxOption.cs b/osu.Game/Overlays/Options/OptionTextBox.cs similarity index 96% rename from osu.Game/Overlays/Options/TextBoxOption.cs rename to osu.Game/Overlays/Options/OptionTextBox.cs index 6edd34e318..101ba2c0c9 100644 --- a/osu.Game/Overlays/Options/TextBoxOption.cs +++ b/osu.Game/Overlays/Options/OptionTextBox.cs @@ -8,7 +8,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options { - public class TextBoxOption : OsuTextBox + public class OptionTextBox : OsuTextBox { private Bindable bindable; diff --git a/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/AudioDevicesOptions.cs similarity index 71% rename from osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs rename to osu.Game/Overlays/Options/Sections/Audio/AudioDevicesOptions.cs index 5ad57bef53..b9171cd6f6 100644 --- a/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/AudioDevicesOptions.cs @@ -1,9 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics.Sprites; - -namespace osu.Game.Overlays.Options.Audio +namespace osu.Game.Overlays.Options.Sections.Audio { public class AudioDevicesOptions : OptionsSubsection { @@ -13,7 +11,7 @@ namespace osu.Game.Overlays.Options.Audio { Children = new[] { - new SpriteText { Text = "Output device: TODO dropdown" } + new OptionLabel { Text = "Output device: TODO dropdown" } }; } } diff --git a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/OffsetAdjustmentOptions.cs similarity index 87% rename from osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs rename to osu.Game/Overlays/Options/Sections/Audio/OffsetAdjustmentOptions.cs index df1d6aa9f9..0c3436ab53 100644 --- a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/OffsetAdjustmentOptions.cs @@ -1,14 +1,13 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //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.Framework.Graphics.Sprites; -using osu.Game.Configuration; -using osu.Game.Graphics.UserInterface; - -namespace osu.Game.Overlays.Options.Audio +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options.Sections.Audio { public class OffsetAdjustmentOptions : OptionsSubsection { @@ -19,7 +18,7 @@ namespace osu.Game.Overlays.Options.Audio { Children = new Drawable[] { - new SliderOption + new OptionSlider { LabelText = "Universal Offset", Bindable = (BindableInt)config.GetBindable(OsuConfig.Offset) diff --git a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs similarity index 68% rename from osu.Game/Overlays/Options/Audio/VolumeOptions.cs rename to osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs index 216e2e866d..45c26f4f4d 100644 --- a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs @@ -1,15 +1,13 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Audio +namespace osu.Game.Overlays.Options.Sections.Audio { public class VolumeOptions : OptionsSubsection { @@ -20,10 +18,10 @@ namespace osu.Game.Overlays.Options.Audio { Children = new Drawable[] { - new SliderOption { LabelText = "Master", Bindable = audio.Volume }, - new SliderOption { LabelText = "Effect", Bindable = audio.VolumeSample }, - new SliderOption { LabelText = "Music", Bindable = audio.VolumeTrack }, - new CheckBoxOption + new OptionSlider { LabelText = "Master", Bindable = audio.Volume }, + new OptionSlider { LabelText = "Effect", Bindable = audio.VolumeSample }, + new OptionSlider { LabelText = "Music", Bindable = audio.VolumeTrack }, + new OsuCheckbox { LabelText = "Ignore beatmap hitsounds", Bindable = config.GetBindable(OsuConfig.IgnoreBeatmapSamples) diff --git a/osu.Game/Overlays/Options/Audio/AudioSection.cs b/osu.Game/Overlays/Options/Sections/AudioSection.cs similarity index 88% rename from osu.Game/Overlays/Options/Audio/AudioSection.cs rename to osu.Game/Overlays/Options/Sections/AudioSection.cs index 6b55944a5c..613b265446 100644 --- a/osu.Game/Overlays/Options/Audio/AudioSection.cs +++ b/osu.Game/Overlays/Options/Sections/AudioSection.cs @@ -1,11 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; -using osu.Framework.Graphics; -using osu.Game.Graphics; - -namespace osu.Game.Overlays.Options.Audio +using osu.Framework; +using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Overlays.Options.Sections.Audio; + +namespace osu.Game.Overlays.Options.Sections { public class AudioSection : OptionsSection { diff --git a/osu.Game/Overlays/Options/EditorSection.cs b/osu.Game/Overlays/Options/Sections/EditorSection.cs similarity index 82% rename from osu.Game/Overlays/Options/EditorSection.cs rename to osu.Game/Overlays/Options/Sections/EditorSection.cs index 9d7d9bde95..2cdb0e7816 100644 --- a/osu.Game/Overlays/Options/EditorSection.cs +++ b/osu.Game/Overlays/Options/Sections/EditorSection.cs @@ -1,15 +1,14 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; +using OpenTK; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Sections { public class EditorSection : OptionsSection { @@ -22,32 +21,32 @@ namespace osu.Game.Overlays.Options content.Spacing = new Vector2(0, 5); Children = new Drawable[] { - new CheckBoxOption + new OsuCheckbox { LabelText = "Background video", Bindable = config.GetBindable(OsuConfig.VideoEditor) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Always use default skin", Bindable = config.GetBindable(OsuConfig.EditorDefaultSkin) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Snaking sliders", Bindable = config.GetBindable(OsuConfig.EditorSnakingSliders) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Hit animations", Bindable = config.GetBindable(OsuConfig.EditorHitAnimations) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Follow points", Bindable = config.GetBindable(OsuConfig.EditorFollowPoints) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Stacking", Bindable = config.GetBindable(OsuConfig.EditorStacking) diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralGameplayOptions.cs similarity index 79% rename from osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs rename to osu.Game/Overlays/Options/Sections/Gameplay/GeneralGameplayOptions.cs index 15ee80102d..17b81c3af7 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralGameplayOptions.cs @@ -1,15 +1,13 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; -using osu.Framework.Allocation; -using osu.Framework.Configuration; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; -using osu.Game.Configuration; - -namespace osu.Game.Overlays.Options.Gameplay +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options.Sections.Gameplay { public class GeneralGameplayOptions : OptionsSubsection { @@ -20,42 +18,42 @@ namespace osu.Game.Overlays.Options.Gameplay { Children = new Drawable[] { - new SliderOption + new OptionSlider { LabelText = "Background dim", Bindable = (BindableInt)config.GetBindable(OsuConfig.DimLevel) }, - new DropdownOption + new OptionDropdown { LabelText = "Progress display", Bindable = config.GetBindable(OsuConfig.ProgressBarType) }, - new DropdownOption + new OptionDropdown { LabelText = "Score meter type", Bindable = config.GetBindable(OsuConfig.ScoreMeter) }, - new SliderOption + new OptionSlider { LabelText = "Score meter size", Bindable = (BindableDouble)config.GetBindable(OsuConfig.ScoreMeterScale) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Always show key overlay", Bindable = config.GetBindable(OsuConfig.KeyOverlay) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Show approach circle on first \"Hidden\" object", Bindable = config.GetBindable(OsuConfig.HiddenShowFirstApproach) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Scale osu!mania scroll speed with BPM", Bindable = config.GetBindable(OsuConfig.ManiaSpeedBPMScale) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Remember osu!mania scroll speed per beatmap", Bindable = config.GetBindable(OsuConfig.UsePerBeatmapManiaSpeed) diff --git a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectGameplayOptions.cs similarity index 80% rename from osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs rename to osu.Game/Overlays/Options/Sections/Gameplay/SongSelectGameplayOptions.cs index e0f25cfea7..e8e3cc817e 100644 --- a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectGameplayOptions.cs @@ -1,15 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using osu.Framework.Allocation; -using osu.Framework.Configuration; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Game.Configuration; -using osu.Game.Graphics.UserInterface; - -namespace osu.Game.Overlays.Options.Gameplay +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Game.Configuration; + +namespace osu.Game.Overlays.Options.Sections.Gameplay { public class SongSelectGameplayOptions : OptionsSubsection { @@ -20,12 +17,12 @@ namespace osu.Game.Overlays.Options.Gameplay { Children = new Drawable[] { - new SliderOption + new OptionSlider { LabelText = "Display beatmaps from", Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMinimum) }, - new SliderOption + new OptionSlider { LabelText = "up to", Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMaximum) diff --git a/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs b/osu.Game/Overlays/Options/Sections/GameplaySection.cs similarity index 86% rename from osu.Game/Overlays/Options/Gameplay/GameplaySection.cs rename to osu.Game/Overlays/Options/Sections/GameplaySection.cs index 3216d55837..d109963c3b 100644 --- a/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs +++ b/osu.Game/Overlays/Options/Sections/GameplaySection.cs @@ -1,10 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics; -using osu.Game.Graphics; - -namespace osu.Game.Overlays.Options.Gameplay +using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Overlays.Options.Sections.Gameplay; + +namespace osu.Game.Overlays.Options.Sections { public class GameplaySection : OptionsSection { diff --git a/osu.Game/Overlays/Options/General/LanguageOptions.cs b/osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs similarity index 77% rename from osu.Game/Overlays/Options/General/LanguageOptions.cs rename to osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs index 351d541bd9..d47299616f 100644 --- a/osu.Game/Overlays/Options/General/LanguageOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs @@ -1,13 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; using osu.Framework.Allocation; +using osu.Framework.Graphics; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.General +namespace osu.Game.Overlays.Options.Sections.General { public class LanguageOptions : OptionsSubsection { @@ -18,13 +17,13 @@ namespace osu.Game.Overlays.Options.General { Children = new Drawable[] { - new SpriteText { Text = "TODO: Dropdown" }, - new CheckBoxOption + new OptionLabel { Text = "TODO: Dropdown" }, + new OsuCheckbox { LabelText = "Prefer metadata in original language", Bindable = config.GetBindable(OsuConfig.ShowUnicode) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Use alternative font for chat display", Bindable = config.GetBindable(OsuConfig.AlternativeChatFont) diff --git a/osu.Game/Overlays/Options/General/LoginOptions.cs b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs similarity index 94% rename from osu.Game/Overlays/Options/General/LoginOptions.cs rename to osu.Game/Overlays/Options/Sections/General/LoginOptions.cs index 6556c238a4..7c88b1af52 100644 --- a/osu.Game/Overlays/Options/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs @@ -1,20 +1,18 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using OpenTK; -using osu.Framework; using osu.Framework.Allocation; 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.Configuration; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; -using osu.Game.Configuration; -using osu.Framework.Graphics.Primitives; +using OpenTK; -namespace osu.Game.Overlays.Options.General +namespace osu.Game.Overlays.Options.Sections.General { public class LoginOptions : OptionsSubsection, IOnlineComponent { @@ -92,8 +90,8 @@ namespace osu.Game.Overlays.Options.General private TextBox password; private APIAccess api; - private CheckBoxOption saveUsername; - private CheckBoxOption savePassword; + private OsuCheckbox saveUsername; + private OsuCheckbox savePassword; private void performLogin() { @@ -122,12 +120,12 @@ namespace osu.Game.Overlays.Options.General { RelativeSizeAxes = Axes.X }, - saveUsername = new CheckBoxOption + saveUsername = new OsuCheckbox { LabelText = "Remember username", Bindable = config.GetBindable(OsuConfig.SaveUsername), }, - savePassword = new CheckBoxOption + savePassword = new OsuCheckbox { LabelText = "Stay logged in", Bindable = config.GetBindable(OsuConfig.SavePassword), diff --git a/osu.Game/Overlays/Options/General/UpdateOptions.cs b/osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs similarity index 78% rename from osu.Game/Overlays/Options/General/UpdateOptions.cs rename to osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs index 77cfd11273..0438e40761 100644 --- a/osu.Game/Overlays/Options/General/UpdateOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs @@ -1,15 +1,13 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; using osu.Framework.Platform; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.General +namespace osu.Game.Overlays.Options.Sections.General { public class UpdateOptions : OptionsSubsection { @@ -20,12 +18,12 @@ namespace osu.Game.Overlays.Options.General { Children = new Drawable[] { - new DropdownOption + new OptionDropdown { LabelText = "Release stream", Bindable = config.GetBindable(OsuConfig.ReleaseStream), }, - new SpriteText { Text = "Your osu! is up to date" }, // TODO: map this to reality + new OptionLabel { Text = "Your osu! is up to date" }, // TODO: map this to reality new OsuButton { RelativeSizeAxes = Axes.X, diff --git a/osu.Game/Overlays/Options/General/GeneralSection.cs b/osu.Game/Overlays/Options/Sections/GeneralSection.cs similarity index 86% rename from osu.Game/Overlays/Options/General/GeneralSection.cs rename to osu.Game/Overlays/Options/Sections/GeneralSection.cs index cbcb1857a6..4952dfeef2 100644 --- a/osu.Game/Overlays/Options/General/GeneralSection.cs +++ b/osu.Game/Overlays/Options/Sections/GeneralSection.cs @@ -1,10 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics; -using osu.Game.Graphics; - -namespace osu.Game.Overlays.Options.General +using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Overlays.Options.Sections.General; + +namespace osu.Game.Overlays.Options.Sections { public class GeneralSection : OptionsSection { diff --git a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs similarity index 80% rename from osu.Game/Overlays/Options/Graphics/DetailOptions.cs rename to osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs index 51720410a9..ff1fcf05c3 100644 --- a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs @@ -3,10 +3,10 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Graphics +namespace osu.Game.Overlays.Options.Sections.Graphics { public class DetailOptions : OptionsSubsection { @@ -17,47 +17,47 @@ namespace osu.Game.Overlays.Options.Graphics { Children = new Drawable[] { - new CheckBoxOption + new OsuCheckbox { LabelText = "Snaking in sliders", Bindable = config.GetBindable(OsuConfig.SnakingInSliders) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Snaking out sliders", Bindable = config.GetBindable(OsuConfig.SnakingOutSliders) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Background video", Bindable = config.GetBindable(OsuConfig.Video) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Storyboards", Bindable = config.GetBindable(OsuConfig.ShowStoryboard) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Combo bursts", Bindable = config.GetBindable(OsuConfig.ComboBurst) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Hit lighting", Bindable = config.GetBindable(OsuConfig.HitLighting) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Shaders", Bindable = config.GetBindable(OsuConfig.Bloom) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Softening filter", Bindable = config.GetBindable(OsuConfig.BloomSoftening) }, - new DropdownOption + new OptionDropdown { LabelText = "Screenshot", Bindable = config.GetBindable(OsuConfig.ScreenshotFormat) diff --git a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs similarity index 74% rename from osu.Game/Overlays/Options/Graphics/LayoutOptions.cs rename to osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs index 3235088551..bb9388b3a0 100644 --- a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs @@ -1,15 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; -using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Graphics +namespace osu.Game.Overlays.Options.Sections.Graphics { public class LayoutOptions : OptionsSubsection { @@ -20,23 +17,23 @@ namespace osu.Game.Overlays.Options.Graphics { Children = new Drawable[] { - new SpriteText { Text = "Resolution: TODO dropdown" }, - new CheckBoxOption + new OptionLabel { Text = "Resolution: TODO dropdown" }, + new OsuCheckbox { LabelText = "Fullscreen mode", Bindable = config.GetBindable(FrameworkConfig.Fullscreen), }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Letterboxing", Bindable = config.GetBindable(FrameworkConfig.Letterboxing), }, - new SliderOption + new OptionSlider { LabelText = "Horizontal position", Bindable = (BindableInt)config.GetBindable(FrameworkConfig.LetterboxPositionX) }, - new SliderOption + new OptionSlider { LabelText = "Vertical position", Bindable = (BindableInt)config.GetBindable(FrameworkConfig.LetterboxPositionY) diff --git a/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs similarity index 79% rename from osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs rename to osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs index 58f1bfb3b7..c91b6f5071 100644 --- a/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs @@ -1,12 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Graphics +namespace osu.Game.Overlays.Options.Sections.Graphics { public class MainMenuOptions : OptionsSubsection { @@ -17,27 +16,27 @@ namespace osu.Game.Overlays.Options.Graphics { Children = new[] { - new CheckBoxOption + new OsuCheckbox { LabelText = "Snow", Bindable = config.GetBindable(OsuConfig.MenuSnow) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Parallax", Bindable = config.GetBindable(OsuConfig.MenuParallax) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Menu tips", Bindable = config.GetBindable(OsuConfig.ShowMenuTips) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Interface voices", Bindable = config.GetBindable(OsuConfig.MenuVoice) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "osu! music theme", Bindable = config.GetBindable(OsuConfig.MenuMusic) diff --git a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs similarity index 80% rename from osu.Game/Overlays/Options/Graphics/RendererOptions.cs rename to osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs index 505881315d..2ef84ca8ac 100644 --- a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs @@ -1,15 +1,13 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Graphics +namespace osu.Game.Overlays.Options.Sections.Graphics { public class RendererOptions : OptionsSubsection { @@ -22,22 +20,22 @@ namespace osu.Game.Overlays.Options.Graphics Children = new Drawable[] { // TODO: this needs to be a custom dropdown at some point - new DropdownOption + new OptionDropdown { LabelText = "Frame limiter", Bindable = config.GetBindable(FrameworkConfig.FrameSync) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Show FPS counter", Bindable = osuConfig.GetBindable(OsuConfig.FpsCounter), }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Reduce dropped frames", Bindable = osuConfig.GetBindable(OsuConfig.ForceFrameFlush), }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Detect performance issues", Bindable = osuConfig.GetBindable(OsuConfig.DetectPerformanceIssues), diff --git a/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/SongSelectGraphicsOptions.cs similarity index 80% rename from osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs rename to osu.Game/Overlays/Options/Sections/Graphics/SongSelectGraphicsOptions.cs index 0dee3544a1..7295ff2d13 100644 --- a/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/SongSelectGraphicsOptions.cs @@ -1,12 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Graphics +namespace osu.Game.Overlays.Options.Sections.Graphics { public class SongSelectGraphicsOptions : OptionsSubsection { @@ -17,7 +16,7 @@ namespace osu.Game.Overlays.Options.Graphics { Children = new[] { - new CheckBoxOption + new OsuCheckbox { LabelText = "Show thumbnails", Bindable = config.GetBindable(OsuConfig.SongSelectThumbnails) diff --git a/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs b/osu.Game/Overlays/Options/Sections/GraphicsSection.cs similarity index 88% rename from osu.Game/Overlays/Options/Graphics/GraphicsSection.cs rename to osu.Game/Overlays/Options/Sections/GraphicsSection.cs index 9c8c8043bf..2f5b7fad64 100644 --- a/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs +++ b/osu.Game/Overlays/Options/Sections/GraphicsSection.cs @@ -1,10 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics; -using osu.Game.Graphics; - -namespace osu.Game.Overlays.Options.Graphics +using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Overlays.Options.Sections.Graphics; + +namespace osu.Game.Overlays.Options.Sections { public class GraphicsSection : OptionsSection { diff --git a/osu.Game/Overlays/Options/Input/KeyboardOptions.cs b/osu.Game/Overlays/Options/Sections/Input/KeyboardOptions.cs similarity index 93% rename from osu.Game/Overlays/Options/Input/KeyboardOptions.cs rename to osu.Game/Overlays/Options/Sections/Input/KeyboardOptions.cs index 521dfb88e6..cdd7924110 100644 --- a/osu.Game/Overlays/Options/Input/KeyboardOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/KeyboardOptions.cs @@ -1,10 +1,10 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics; -using osu.Game.Graphics.UserInterface; - -namespace osu.Game.Overlays.Options.Input +using osu.Framework.Graphics; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options.Sections.Input { public class KeyboardOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs similarity index 79% rename from osu.Game/Overlays/Options/Input/MouseOptions.cs rename to osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs index 56b34c5396..6a4f26ce25 100644 --- a/osu.Game/Overlays/Options/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs @@ -1,15 +1,13 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Input +namespace osu.Game.Overlays.Options.Sections.Input { public class MouseOptions : OptionsSubsection { @@ -20,37 +18,37 @@ namespace osu.Game.Overlays.Options.Input { Children = new Drawable[] { - new SliderOption + new OptionSlider { LabelText = "Sensitivity", Bindable = (BindableDouble)config.GetBindable(OsuConfig.MouseSpeed), }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Raw input", Bindable = config.GetBindable(OsuConfig.RawInput) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Map absolute raw input to the osu! window", Bindable = config.GetBindable(OsuConfig.AbsoluteToOsuWindow) }, - new DropdownOption + new OptionDropdown { LabelText = "Confine mouse cursor", Bindable = config.GetBindable(OsuConfig.ConfineMouse), }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Disable mouse wheel in play mode", Bindable = config.GetBindable(OsuConfig.MouseDisableWheel) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Disable mouse buttons in play mode", Bindable = config.GetBindable(OsuConfig.MouseDisableButtons) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Cursor ripples", Bindable = config.GetBindable(OsuConfig.CursorRipple) diff --git a/osu.Game/Overlays/Options/Input/OtherInputOptions.cs b/osu.Game/Overlays/Options/Sections/Input/OtherInputOptions.cs similarity index 80% rename from osu.Game/Overlays/Options/Input/OtherInputOptions.cs rename to osu.Game/Overlays/Options/Sections/Input/OtherInputOptions.cs index 02eb17c9b4..bb888d26f1 100644 --- a/osu.Game/Overlays/Options/Input/OtherInputOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/OtherInputOptions.cs @@ -1,13 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Input +namespace osu.Game.Overlays.Options.Sections.Input { public class OtherInputOptions : OptionsSubsection { @@ -18,12 +17,12 @@ namespace osu.Game.Overlays.Options.Input { Children = new Drawable[] { - new CheckBoxOption + new OsuCheckbox { LabelText = "OS TabletPC support", Bindable = config.GetBindable(OsuConfig.Tablet) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Wiimote/TaTaCon Drum Support", Bindable = config.GetBindable(OsuConfig.Wiimote) diff --git a/osu.Game/Overlays/Options/Input/InputSection.cs b/osu.Game/Overlays/Options/Sections/InputSection.cs similarity index 87% rename from osu.Game/Overlays/Options/Input/InputSection.cs rename to osu.Game/Overlays/Options/Sections/InputSection.cs index c436a7439f..f21dd81cb4 100644 --- a/osu.Game/Overlays/Options/Input/InputSection.cs +++ b/osu.Game/Overlays/Options/Sections/InputSection.cs @@ -1,10 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics; -using osu.Game.Graphics; - -namespace osu.Game.Overlays.Options.Input +using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Overlays.Options.Sections.Input; + +namespace osu.Game.Overlays.Options.Sections { public class InputSection : OptionsSection { diff --git a/osu.Game/Overlays/Options/MaintenanceSection.cs b/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs similarity index 93% rename from osu.Game/Overlays/Options/MaintenanceSection.cs rename to osu.Game/Overlays/Options/Sections/MaintenanceSection.cs index dcd90b8e50..4347c839a6 100644 --- a/osu.Game/Overlays/Options/MaintenanceSection.cs +++ b/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs @@ -1,13 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics; -using osu.Game.Graphics.UserInterface; - -namespace osu.Game.Overlays.Options +using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; +using OpenTK; + +namespace osu.Game.Overlays.Options.Sections { public class MaintenanceSection : OptionsSection { @@ -39,7 +38,7 @@ namespace osu.Game.Overlays.Options RelativeSizeAxes = Axes.X, Text = "Run osu! updater", }, - new SpriteText + new OptionLabel { Text = "TODO: osu version here", Anchor = Anchor.TopCentre, diff --git a/osu.Game/Overlays/Options/Online/InGameChatOptions.cs b/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs similarity index 70% rename from osu.Game/Overlays/Options/Online/InGameChatOptions.cs rename to osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs index 8a04d2cec3..2236498495 100644 --- a/osu.Game/Overlays/Options/Online/InGameChatOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs @@ -1,19 +1,17 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Online +namespace osu.Game.Overlays.Options.Sections.Online { public class InGameChatOptions : OptionsSubsection { - private TextBoxOption chatIgnoreList; - private TextBoxOption chatHighlightWords; + private OptionTextBox chatIgnoreList; + private OptionTextBox chatHighlightWords; protected override string Header => "In-game Chat"; [BackgroundDependencyLoader] @@ -21,33 +19,33 @@ namespace osu.Game.Overlays.Options.Online { Children = new Drawable[] { - new CheckBoxOption + new OsuCheckbox { LabelText = "Filter offensive words", Bindable = config.GetBindable(OsuConfig.ChatFilter) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Filter foreign characters", Bindable = config.GetBindable(OsuConfig.ChatRemoveForeign) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Log private messages", Bindable = config.GetBindable(OsuConfig.LogPrivateMessages) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Block private messages from non-friends", Bindable = config.GetBindable(OsuConfig.BlockNonFriendPM) }, - new SpriteText { Text = "Chat ignore list (space-seperated list)" }, - chatIgnoreList = new TextBoxOption { + new OptionLabel { Text = "Chat ignore list (space-seperated list)" }, + chatIgnoreList = new OptionTextBox { RelativeSizeAxes = Axes.X, Bindable = config.GetBindable(OsuConfig.IgnoreList) }, - new SpriteText { Text = "Chat highlight words (space-seperated list)" }, - chatHighlightWords = new TextBoxOption { + new OptionLabel { Text = "Chat highlight words (space-seperated list)" }, + chatHighlightWords = new OptionTextBox { RelativeSizeAxes = Axes.X, Bindable = config.GetBindable(OsuConfig.HighlightWords) }, diff --git a/osu.Game/Overlays/Options/Online/NotificationsOptions.cs b/osu.Game/Overlays/Options/Sections/Online/NotificationsOptions.cs similarity index 82% rename from osu.Game/Overlays/Options/Online/NotificationsOptions.cs rename to osu.Game/Overlays/Options/Sections/Online/NotificationsOptions.cs index 1648d23528..659e50241f 100644 --- a/osu.Game/Overlays/Options/Online/NotificationsOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/NotificationsOptions.cs @@ -1,13 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Online +namespace osu.Game.Overlays.Options.Sections.Online { public class NotificationsOptions : OptionsSubsection { @@ -18,32 +17,32 @@ namespace osu.Game.Overlays.Options.Online { Children = new Drawable[] { - new CheckBoxOption + new OsuCheckbox { LabelText = "Enable chat ticker", Bindable = config.GetBindable(OsuConfig.Ticker) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Show a notification popup when someone says your name", Bindable = config.GetBindable(OsuConfig.ChatHighlightName) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Show chat message notifications", Bindable = config.GetBindable(OsuConfig.ChatMessageNotification) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Play a sound when someone says your name", Bindable = config.GetBindable(OsuConfig.ChatAudibleHighlight) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Show notification popups instantly during gameplay", Bindable = config.GetBindable(OsuConfig.PopupDuringGameplay) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Show notification popups when friends change status", Bindable = config.GetBindable(OsuConfig.NotifyFriends) diff --git a/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs b/osu.Game/Overlays/Options/Sections/Online/OnlineIntegrationOptions.cs similarity index 82% rename from osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs rename to osu.Game/Overlays/Options/Sections/Online/OnlineIntegrationOptions.cs index 4799c5d5ca..be404c15a9 100644 --- a/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/OnlineIntegrationOptions.cs @@ -1,13 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Online +namespace osu.Game.Overlays.Options.Sections.Online { public class OnlineIntegrationOptions : OptionsSubsection { @@ -18,22 +17,22 @@ namespace osu.Game.Overlays.Options.Online { Children = new Drawable[] { - new CheckBoxOption + new OsuCheckbox { LabelText = "Integrate with Yahoo! status display", Bindable = config.GetBindable(OsuConfig.YahooIntegration) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Integrate with MSN Live status display", Bindable = config.GetBindable(OsuConfig.MsnIntegration) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Automatically start osu!direct downloads", Bindable = config.GetBindable(OsuConfig.AutomaticDownload) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Prefer no-video downloads", Bindable = config.GetBindable(OsuConfig.AutomaticDownloadNoVideo) diff --git a/osu.Game/Overlays/Options/Online/PrivacyOptions.cs b/osu.Game/Overlays/Options/Sections/Online/PrivacyOptions.cs similarity index 81% rename from osu.Game/Overlays/Options/Online/PrivacyOptions.cs rename to osu.Game/Overlays/Options/Sections/Online/PrivacyOptions.cs index ac654cb3d4..b68d061802 100644 --- a/osu.Game/Overlays/Options/Online/PrivacyOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/PrivacyOptions.cs @@ -1,13 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Online +namespace osu.Game.Overlays.Options.Sections.Online { public class PrivacyOptions : OptionsSubsection { @@ -18,12 +17,12 @@ namespace osu.Game.Overlays.Options.Online { Children = new Drawable[] { - new CheckBoxOption + new OsuCheckbox { LabelText = "Share your city location with others", Bindable = config.GetBindable(OsuConfig.DisplayCityLocation) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Allow multiplayer game invites from all users", Bindable = config.GetBindable(OsuConfig.AllowPublicInvites) diff --git a/osu.Game/Overlays/Options/Online/OnlineSection.cs b/osu.Game/Overlays/Options/Sections/OnlineSection.cs similarity index 87% rename from osu.Game/Overlays/Options/Online/OnlineSection.cs rename to osu.Game/Overlays/Options/Sections/OnlineSection.cs index d07c6e89df..ebc04e118a 100644 --- a/osu.Game/Overlays/Options/Online/OnlineSection.cs +++ b/osu.Game/Overlays/Options/Sections/OnlineSection.cs @@ -1,10 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics; -using osu.Game.Graphics; - -namespace osu.Game.Overlays.Options.Online +using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Overlays.Options.Sections.Online; + +namespace osu.Game.Overlays.Options.Sections { public class OnlineSection : OptionsSection { diff --git a/osu.Game/Overlays/Options/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs similarity index 82% rename from osu.Game/Overlays/Options/SkinSection.cs rename to osu.Game/Overlays/Options/Sections/SkinSection.cs index f9f7587e72..720b3f35a2 100644 --- a/osu.Game/Overlays/Options/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -1,18 +1,15 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using osu.Framework; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; +using OpenTK; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Sections { public class SkinSection : OptionsSection { @@ -25,8 +22,8 @@ namespace osu.Game.Overlays.Options content.Spacing = new Vector2(0, 5); Children = new Drawable[] { - new SpriteText { Text = "TODO: Skin preview textures" }, - new SpriteText { Text = "Current skin: TODO dropdown" }, + new OptionLabel { Text = "TODO: Skin preview textures" }, + new OptionLabel { Text = "Current skin: TODO dropdown" }, new OsuButton { RelativeSizeAxes = Axes.X, @@ -42,32 +39,32 @@ namespace osu.Game.Overlays.Options RelativeSizeAxes = Axes.X, Text = "Export as .osk", }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Ignore all beatmap skins", Bindable = config.GetBindable(OsuConfig.IgnoreBeatmapSkins) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Use skin's sound samples", Bindable = config.GetBindable(OsuConfig.SkinSamples) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Use Taiko skin for Taiko mode", Bindable = config.GetBindable(OsuConfig.UseTaikoSkin) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Always use skin cursor", Bindable = config.GetBindable(OsuConfig.UseSkinCursor) }, - new SliderOption + new OptionSlider { LabelText = "Cursor size", Bindable = (BindableDouble)config.GetBindable(OsuConfig.CursorSize) }, - new CheckBoxOption + new OsuCheckbox { LabelText = "Automatic cursor size", Bindable = config.GetBindable(OsuConfig.AutomaticCursorSizing) diff --git a/osu.Game/Overlays/Options/SidebarButton.cs b/osu.Game/Overlays/Options/SidebarButton.cs index da2704ee60..4128bdfd7d 100644 --- a/osu.Game/Overlays/Options/SidebarButton.cs +++ b/osu.Game/Overlays/Options/SidebarButton.cs @@ -79,6 +79,7 @@ namespace osu.Game.Overlays.Options headerText = new SpriteText { Position = new Vector2(OptionsSidebar.default_width + 10, 0), + TextSize = OptionsOverlay.FONT_SIZE, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index 0767a70739..a53fd6743f 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -16,19 +16,16 @@ using osu.Framework.Graphics.Transformations; using osu.Framework.Input; using osu.Game.Configuration; using osu.Game.Overlays.Options; -using osu.Game.Overlays.Options.Audio; -using osu.Game.Overlays.Options.Gameplay; -using osu.Game.Overlays.Options.General; -using osu.Game.Overlays.Options.Graphics; -using osu.Game.Overlays.Options.Input; -using osu.Game.Overlays.Options.Online; using System; using osu.Game.Graphics; +using osu.Game.Overlays.Options.Sections; namespace osu.Game.Overlays { public class OptionsOverlay : OverlayContainer { + public const float FONT_SIZE = 16; + internal const float CONTENT_MARGINS = 10; public const float TRANSITION_LENGTH = 600; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 3b355c153d..34ad6706f5 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -95,6 +95,7 @@ + @@ -192,45 +193,45 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + From 687b634fb330594466779c3293aaa9905e6d0227 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 18:40:04 +0900 Subject: [PATCH 02/14] Adjust button font size. --- osu.Game/Graphics/UserInterface/OsuButton.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index 7314d0006e..a199153e37 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -7,6 +7,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Backgrounds; +using osu.Game.Overlays; namespace osu.Game.Graphics.UserInterface { @@ -15,6 +16,7 @@ namespace osu.Game.Graphics.UserInterface public OsuButton() { Height = 40; + SpriteText.TextSize = OptionsOverlay.FONT_SIZE; } [BackgroundDependencyLoader] From 9e5000d4481b48c06a96ff4dc0ed45beb1fabae6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 18:40:18 +0900 Subject: [PATCH 03/14] Remove (soon-to-be) redundant labels. --- osu.Game/Overlays/Options/Sections/General/LoginOptions.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs index 7c88b1af52..e67b63ada3 100644 --- a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs @@ -109,13 +109,11 @@ namespace osu.Game.Overlays.Options.Sections.General Spacing = new Vector2(0, 5); Children = new Drawable[] { - new SpriteText { Text = "Username" }, username = new OsuTextBox { RelativeSizeAxes = Axes.X, Text = api?.Username ?? string.Empty }, - new SpriteText { Text = "Password" }, password = new OsuPasswordTextBox { RelativeSizeAxes = Axes.X From 6b66ecc131b71be9bcae81aac644a4a30224eeda Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 18:53:52 +0900 Subject: [PATCH 04/14] Global shadows and more sane font size setting. --- osu.Game/Beatmaps/Drawables/BeatmapPanel.cs | 7 ++++--- .../Beatmaps/Drawables/BeatmapSetHeader.cs | 5 +++-- osu.Game/Graphics/Sprites/OsuSpriteText.cs | 18 ++++++++++++++++++ osu.Game/Graphics/UserInterface/BackButton.cs | 3 ++- osu.Game/Graphics/UserInterface/KeyCounter.cs | 5 +++-- osu.Game/Graphics/UserInterface/OsuButton.cs | 12 ++++++++++-- osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 6 ++---- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 3 ++- .../Graphics/UserInterface/RollingCounter.cs | 3 ++- .../UserInterface/Volume/VolumeMeter.cs | 3 ++- osu.Game/Modes/UI/ComboCounter.cs | 5 +++-- .../Online/Chat/Drawables/ChannelDisplay.cs | 3 ++- osu.Game/Online/Chat/Drawables/ChatLine.cs | 7 ++++--- osu.Game/Overlays/ChatOverlay.cs | 3 ++- osu.Game/Overlays/MusicController.cs | 5 +++-- osu.Game/Overlays/Options/OptionDropdown.cs | 10 ++++------ osu.Game/Overlays/Options/OptionLabel.cs | 8 ++------ osu.Game/Overlays/Options/OptionSlider.cs | 4 ++-- osu.Game/Overlays/Options/OptionsSection.cs | 3 ++- osu.Game/Overlays/Options/OptionsSubsection.cs | 13 +++++++------ .../Options/Sections/General/LoginOptions.cs | 7 ++++--- osu.Game/Overlays/Options/SidebarButton.cs | 4 ++-- osu.Game/Overlays/OptionsOverlay.cs | 7 +++---- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 7 ++++--- osu.Game/Screens/GameModeWhiteBox.cs | 5 +++-- osu.Game/Screens/Menu/Button.cs | 3 ++- osu.Game/Screens/Play/FailDialog.cs | 3 ++- osu.Game/Screens/Ranking/Results.cs | 7 ++++--- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 13 +++++++------ osu.Game/Screens/Select/FooterButton.cs | 3 ++- osu.Game/osu.Game.csproj | 1 + 31 files changed, 113 insertions(+), 73 deletions(-) create mode 100644 osu.Game/Graphics/Sprites/OsuSpriteText.cs diff --git a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs index fdbf7430fb..a8e2dc87d0 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs @@ -17,6 +17,7 @@ using osu.Game.Graphics.UserInterface; using OpenTK; using OpenTK.Graphics; using osu.Framework.Input; +using osu.Game.Graphics.Sprites; using osu.Game.Modes; namespace osu.Game.Beatmaps.Drawables @@ -105,7 +106,7 @@ namespace osu.Game.Beatmaps.Drawables Spacing = new Vector2(4, 0), Children = new[] { - new SpriteText + new OsuSpriteText { Font = @"Exo2.0-Medium", Text = beatmap.Version, @@ -113,7 +114,7 @@ namespace osu.Game.Beatmaps.Drawables Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, - new SpriteText + new OsuSpriteText { Font = @"Exo2.0-Medium", Text = "mapped by", @@ -121,7 +122,7 @@ namespace osu.Game.Beatmaps.Drawables Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, - new SpriteText + new OsuSpriteText { Font = @"Exo2.0-MediumItalic", Text = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}", diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index b15942c5bb..e3aef76b75 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; @@ -43,14 +44,14 @@ namespace osu.Game.Beatmaps.Drawables AutoSizeAxes = Axes.Both, Children = new[] { - title = new SpriteText + title = new OsuSpriteText { Font = @"Exo2.0-BoldItalic", Text = beatmap.BeatmapSetInfo.Metadata.Title, TextSize = 22, Shadow = true, }, - artist = new SpriteText + artist = new OsuSpriteText { Margin = new MarginPadding { Top = -1 }, Font = @"Exo2.0-SemiBoldItalic", diff --git a/osu.Game/Graphics/Sprites/OsuSpriteText.cs b/osu.Game/Graphics/Sprites/OsuSpriteText.cs new file mode 100644 index 0000000000..7e91ae8966 --- /dev/null +++ b/osu.Game/Graphics/Sprites/OsuSpriteText.cs @@ -0,0 +1,18 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Graphics.Sprites +{ + class OsuSpriteText : SpriteText + { + public const float FONT_SIZE = 16; + + public OsuSpriteText() + { + Shadow = true; + TextSize = FONT_SIZE; + } + } +} diff --git a/osu.Game/Graphics/UserInterface/BackButton.cs b/osu.Game/Graphics/UserInterface/BackButton.cs index 7663c74f95..d82e6e0852 100644 --- a/osu.Game/Graphics/UserInterface/BackButton.cs +++ b/osu.Game/Graphics/UserInterface/BackButton.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; +using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface { @@ -133,7 +134,7 @@ namespace osu.Game.Graphics.UserInterface Shear = new Vector2(shear, 0), EdgeSmoothness = new Vector2(1.5f, 0), }, - new SpriteText + new OsuSpriteText { Origin = Anchor.Centre, Anchor = Anchor.Centre, diff --git a/osu.Game/Graphics/UserInterface/KeyCounter.cs b/osu.Game/Graphics/UserInterface/KeyCounter.cs index 5a7fe65925..1df1f11a0f 100644 --- a/osu.Game/Graphics/UserInterface/KeyCounter.cs +++ b/osu.Game/Graphics/UserInterface/KeyCounter.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; +using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface { @@ -86,7 +87,7 @@ namespace osu.Game.Graphics.UserInterface RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - new SpriteText + new OsuSpriteText { Text = Name, Anchor = Anchor.Centre, @@ -95,7 +96,7 @@ namespace osu.Game.Graphics.UserInterface Position = new Vector2(0, -0.25f), Colour = KeyUpTextColor }, - countSpriteText = new SpriteText + countSpriteText = new OsuSpriteText { Text = Count.ToString(@"#,0"), Anchor = Anchor.Centre, diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index a199153e37..a36f43c1c8 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -5,8 +5,10 @@ using System; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Backgrounds; +using osu.Game.Graphics.Sprites; using osu.Game.Overlays; namespace osu.Game.Graphics.UserInterface @@ -16,9 +18,15 @@ namespace osu.Game.Graphics.UserInterface public OsuButton() { Height = 40; - SpriteText.TextSize = OptionsOverlay.FONT_SIZE; } - + + protected override SpriteText CreateText() => new OsuSpriteText + { + Depth = -1, + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + }; + [BackgroundDependencyLoader] private void load(OsuColour colours) { diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index c6e8559f7f..0c3869e848 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -14,6 +14,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; +using osu.Game.Graphics.Sprites; using osu.Game.Overlays; using OpenTK; using OpenTK.Graphics; @@ -77,10 +78,7 @@ namespace osu.Game.Graphics.UserInterface Children = new Drawable[] { - labelSpriteText = new SpriteText - { - TextSize = OptionsOverlay.FONT_SIZE, - }, + labelSpriteText = new OsuSpriteText(), light = new Light { Anchor = Anchor.CentreRight, diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 52b5d88e26..814cf3dbdb 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -5,6 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; +using osu.Game.Graphics.Sprites; using osu.Game.Overlays; using OpenTK.Graphics; @@ -15,7 +16,7 @@ namespace osu.Game.Graphics.UserInterface public OsuTextBox() { Height = 40; - TextContainer.Height = OptionsOverlay.FONT_SIZE / Height; + TextContainer.Height = OsuSpriteText.FONT_SIZE / Height; CornerRadius = 5; } diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index e55001fd99..98c9941665 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Transformations; using System; using System.Collections.Generic; using System.Diagnostics; +using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface { @@ -106,7 +107,7 @@ namespace osu.Game.Graphics.UserInterface { Children = new Drawable[] { - DisplayedCountSpriteText = new SpriteText(), + DisplayedCountSpriteText = new OsuSpriteText(), }; TextSize = 40; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index 37259289ce..66d946c967 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; +using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; @@ -51,7 +52,7 @@ namespace osu.Game.Graphics.UserInterface.Volume } } }, - new SpriteText + new OsuSpriteText { Text = meterName, Anchor = Anchor.BottomCentre, diff --git a/osu.Game/Modes/UI/ComboCounter.cs b/osu.Game/Modes/UI/ComboCounter.cs index b150111387..5fbc98d8f8 100644 --- a/osu.Game/Modes/UI/ComboCounter.cs +++ b/osu.Game/Modes/UI/ComboCounter.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.MathUtils; +using osu.Game.Graphics.Sprites; namespace osu.Game.Modes.UI { @@ -100,11 +101,11 @@ namespace osu.Game.Modes.UI Children = new Drawable[] { - DisplayedCountSpriteText = new SpriteText + DisplayedCountSpriteText = new OsuSpriteText { Alpha = 0, }, - PopOutCount = new SpriteText + PopOutCount = new OsuSpriteText { Alpha = 0, Margin = new MarginPadding(0.05f), diff --git a/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs b/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs index 041163b19a..b9437ae811 100644 --- a/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs +++ b/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs @@ -8,6 +8,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Sprites; using OpenTK; namespace osu.Game.Online.Chat.Drawables @@ -27,7 +28,7 @@ namespace osu.Game.Online.Chat.Drawables Children = new Drawable[] { - new SpriteText + new OsuSpriteText { Text = channel.Name, TextSize = 50, diff --git a/osu.Game/Online/Chat/Drawables/ChatLine.cs b/osu.Game/Online/Chat/Drawables/ChatLine.cs index 2dd3425bda..64fc031669 100644 --- a/osu.Game/Online/Chat/Drawables/ChatLine.cs +++ b/osu.Game/Online/Chat/Drawables/ChatLine.cs @@ -5,6 +5,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; @@ -31,13 +32,13 @@ namespace osu.Game.Online.Chat.Drawables Size = new Vector2(padding, text_size), Children = new Drawable[] { - new SpriteText + new OsuSpriteText { Text = Message.Timestamp.LocalDateTime.ToLongTimeString(), TextSize = text_size, Colour = Color4.Gray }, - new SpriteText + new OsuSpriteText { Text = Message.User.Name, TextSize = text_size, @@ -53,7 +54,7 @@ namespace osu.Game.Online.Chat.Drawables Padding = new MarginPadding { Left = padding + 10 }, Children = new Drawable[] { - new SpriteText + new OsuSpriteText { Text = Message.Content, TextSize = text_size, diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 17a1a2604a..804cd9f0ab 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -14,6 +14,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Threading; using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.Chat; @@ -137,7 +138,7 @@ namespace osu.Game.Overlays // return; SpriteText loading; - Add(loading = new SpriteText + Add(loading = new OsuSpriteText { Text = @"Loading available channels...", Anchor = Anchor.Centre, diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index fa70841e5c..36410d6a76 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -23,6 +23,7 @@ using osu.Game.Configuration; using osu.Game.Database; using osu.Game.Graphics; using osu.Framework.Graphics.Primitives; +using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays { @@ -95,7 +96,7 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - title = new SpriteText + title = new OsuSpriteText { Origin = Anchor.BottomCentre, Anchor = Anchor.TopCentre, @@ -105,7 +106,7 @@ namespace osu.Game.Overlays Text = @"Nothing to play", Font = @"Exo2.0-MediumItalic" }, - artist = new SpriteText + artist = new OsuSpriteText { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, diff --git a/osu.Game/Overlays/Options/OptionDropdown.cs b/osu.Game/Overlays/Options/OptionDropdown.cs index f154db71ff..6c3dc35ae9 100644 --- a/osu.Game/Overlays/Options/OptionDropdown.cs +++ b/osu.Game/Overlays/Options/OptionDropdown.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays.Options { @@ -72,9 +73,8 @@ namespace osu.Game.Overlays.Options AutoSizeAxes = Axes.Y; Children = new Drawable[] { - text = new SpriteText { + text = new OsuSpriteText { Alpha = 0, - TextSize = OptionsOverlay.FONT_SIZE }, dropdown = new StyledDropDownMenu { @@ -150,11 +150,10 @@ namespace osu.Game.Overlays.Options Children = new[] { - label = new SpriteText() + label = new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - TextSize = OptionsOverlay.FONT_SIZE, }, new TextAwesome { @@ -199,9 +198,8 @@ namespace osu.Game.Overlays.Options Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, - new SpriteText { + new OsuSpriteText { Text = text, - TextSize = OptionsOverlay.FONT_SIZE, } } } diff --git a/osu.Game/Overlays/Options/OptionLabel.cs b/osu.Game/Overlays/Options/OptionLabel.cs index e6a7f6ab90..9cc548c7ff 100644 --- a/osu.Game/Overlays/Options/OptionLabel.cs +++ b/osu.Game/Overlays/Options/OptionLabel.cs @@ -4,16 +4,12 @@ using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays.Options { - class OptionLabel : SpriteText + class OptionLabel : OsuSpriteText { - public OptionLabel() - { - TextSize = OptionsOverlay.FONT_SIZE; - } - [BackgroundDependencyLoader] private void load(OsuColour colour) { diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 6c14d3dfeb..d48dd1d234 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -18,6 +18,7 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; using osu.Game.Graphics; using System.Linq; +using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays.Options { @@ -49,9 +50,8 @@ namespace osu.Game.Overlays.Options AutoSizeAxes = Axes.Y; Children = new Drawable[] { - text = new SpriteText { + text = new OsuSpriteText { Alpha = 0, - TextSize = OptionsOverlay.FONT_SIZE, }, slider = new OsuSliderBar { diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index 5a5f22275b..7c598a92f2 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays.Options { @@ -51,7 +52,7 @@ namespace osu.Game.Overlays.Options AutoSizeAxes = Axes.Y, Children = new[] { - headerLabel = new SpriteText + headerLabel = new OsuSpriteText { TextSize = headerSize, Text = Header, diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs index b7b1ff4570..8199011cc2 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -1,11 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; - +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Sprites; + namespace osu.Game.Overlays.Options { public abstract class OptionsSubsection : Container @@ -29,7 +30,7 @@ namespace osu.Game.Overlays.Options Spacing = new Vector2(0, 5), Children = new[] { - new SpriteText + new OsuSpriteText { TextSize = 17, Text = Header.ToUpper(), diff --git a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs index e67b63ada3..63417c1f0c 100644 --- a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; +using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using OpenTK; @@ -51,7 +52,7 @@ namespace osu.Game.Overlays.Options.Sections.General case APIState.Failing: Children = new Drawable[] { - new SpriteText + new OsuSpriteText { Text = "Connection failing :(", }, @@ -60,7 +61,7 @@ namespace osu.Game.Overlays.Options.Sections.General case APIState.Connecting: Children = new Drawable[] { - new SpriteText + new OsuSpriteText { Text = "Connecting...", }, @@ -69,7 +70,7 @@ namespace osu.Game.Overlays.Options.Sections.General case APIState.Online: Children = new Drawable[] { - new SpriteText + new OsuSpriteText { Text = $"Connected as {api.Username}!", }, diff --git a/osu.Game/Overlays/Options/SidebarButton.cs b/osu.Game/Overlays/Options/SidebarButton.cs index 4128bdfd7d..bfe6db5252 100644 --- a/osu.Game/Overlays/Options/SidebarButton.cs +++ b/osu.Game/Overlays/Options/SidebarButton.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays.Options { @@ -76,10 +77,9 @@ namespace osu.Game.Overlays.Options }, } }, - headerText = new SpriteText + headerText = new OsuSpriteText { Position = new Vector2(OptionsSidebar.default_width + 10, 0), - TextSize = OptionsOverlay.FONT_SIZE, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index a53fd6743f..2565056c1a 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -18,14 +18,13 @@ using osu.Game.Configuration; using osu.Game.Overlays.Options; using System; using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; using osu.Game.Overlays.Options.Sections; namespace osu.Game.Overlays { public class OptionsOverlay : OverlayContainer { - public const float FONT_SIZE = 16; - internal const float CONTENT_MARGINS = 10; public const float TRANSITION_LENGTH = 600; @@ -87,13 +86,13 @@ namespace osu.Game.Overlays Children = new Drawable[] { - new SpriteText + new OsuSpriteText { Text = "settings", TextSize = 40, Margin = new MarginPadding { Left = CONTENT_MARGINS, Top = 30 }, }, - new SpriteText + new OsuSpriteText { Colour = colours.Pink, Text = "Change the way osu! behaves", diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index cfdb71f3ce..e817ce7526 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.Transformations; using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; +using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; @@ -90,7 +91,7 @@ namespace osu.Game.Overlays.Toolbar Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, - DrawableText = new SpriteText + DrawableText = new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, @@ -106,13 +107,13 @@ namespace osu.Game.Overlays.Toolbar Alpha = 0, Children = new[] { - tooltip1 = new SpriteText + tooltip1 = new OsuSpriteText { Shadow = true, TextSize = 22, Font = @"Exo2.0-Bold", }, - tooltip2 = new SpriteText + tooltip2 = new OsuSpriteText { Shadow = true, TextSize = 16 diff --git a/osu.Game/Screens/GameModeWhiteBox.cs b/osu.Game/Screens/GameModeWhiteBox.cs index b05ac614c6..f3400ea376 100644 --- a/osu.Game/Screens/GameModeWhiteBox.cs +++ b/osu.Game/Screens/GameModeWhiteBox.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics.Sprites; using osu.Game.Screens.Backgrounds; using osu.Game.Graphics.UserInterface; using OpenTK; @@ -98,14 +99,14 @@ namespace osu.Game.Screens Origin = Anchor.Centre, Children = new[] { - new SpriteText + new OsuSpriteText { Text = GetType().Name, Anchor = Anchor.Centre, Origin = Anchor.Centre, TextSize = 50, }, - new SpriteText + new OsuSpriteText { Text = GetType().Namespace, Anchor = Anchor.Centre, diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index ebdb89b169..8a480faf18 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; @@ -100,7 +101,7 @@ namespace osu.Game.Screens.Menu Position = new Vector2(0, 0), Icon = symbol }, - new SpriteText + new OsuSpriteText { Shadow = true, Direction = FlowDirection.HorizontalOnly, diff --git a/osu.Game/Screens/Play/FailDialog.cs b/osu.Game/Screens/Play/FailDialog.cs index c8718c1618..fd2ec702f1 100644 --- a/osu.Game/Screens/Play/FailDialog.cs +++ b/osu.Game/Screens/Play/FailDialog.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; +using osu.Game.Graphics.Sprites; using osu.Game.Modes; using osu.Game.Screens.Backgrounds; using OpenTK; @@ -21,7 +22,7 @@ namespace osu.Game.Screens.Play public FailDialog() { - Add(new SpriteText + Add(new OsuSpriteText { Text = "You failed!", Anchor = Anchor.Centre, diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index a4219daf54..778b1c4db1 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; +using osu.Game.Graphics.Sprites; using osu.Game.Modes; using osu.Game.Screens.Backgrounds; using OpenTK; @@ -71,17 +72,17 @@ namespace osu.Game.Screens.Ranking Direction = FlowDirection.VerticalOnly, Children = new Drawable[] { - new SpriteText + new OsuSpriteText { TextSize = 40, Text = $@"Accuracy: {s.Accuracy:#0.00%}", }, - new SpriteText + new OsuSpriteText { TextSize = 40, Text = $@"Score: {s.TotalScore}", }, - new SpriteText + new OsuSpriteText { TextSize = 40, Text = $@"MaxCombo: {s.MaxCombo}", diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 964f4552ba..9be84003fe 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -20,6 +20,7 @@ using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.MathUtils; using osu.Game.Graphics; using osu.Game.Beatmaps.Timing; +using osu.Game.Graphics.Sprites; using osu.Game.Modes; namespace osu.Game.Screens.Select @@ -131,14 +132,14 @@ namespace osu.Game.Screens.Select AutoSizeAxes = Axes.Both, Children = new Drawable[] { - new SpriteText + new OsuSpriteText { Font = @"Exo2.0-MediumItalic", Text = beatmapSetInfo.Metadata.Artist + " -- " + beatmapSetInfo.Metadata.Title, TextSize = 28, Shadow = true, }, - new SpriteText + new OsuSpriteText { Font = @"Exo2.0-MediumItalic", Text = beatmapInfo.Version, @@ -152,14 +153,14 @@ namespace osu.Game.Screens.Select AutoSizeAxes = Axes.Both, Children = new [] { - new SpriteText + new OsuSpriteText { Font = @"Exo2.0-Medium", Text = "mapped by ", TextSize = 15, Shadow = true, }, - new SpriteText + new OsuSpriteText { Font = @"Exo2.0-Bold", Text = beatmapSetInfo.Metadata.Author, @@ -204,7 +205,7 @@ namespace osu.Game.Screens.Select public InfoLabel(BeatmapStatistic statistic) { AutoSizeAxes = Axes.Both; - Children = new[] + Children = new Drawable[] { new TextAwesome { @@ -218,7 +219,7 @@ namespace osu.Game.Screens.Select Colour = new Color4(255, 221, 85, 255), Scale = new Vector2(0.8f) }, - new SpriteText + new OsuSpriteText { Margin = new MarginPadding { Left = 13 }, Font = @"Exo2.0-Bold", diff --git a/osu.Game/Screens/Select/FooterButton.cs b/osu.Game/Screens/Select/FooterButton.cs index 9d49e88716..bf592396bb 100644 --- a/osu.Game/Screens/Select/FooterButton.cs +++ b/osu.Game/Screens/Select/FooterButton.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using System; using osu.Framework.Graphics.Transformations; +using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Select { @@ -72,7 +73,7 @@ namespace osu.Game.Screens.Select EdgeSmoothness = new Vector2(2, 0), RelativeSizeAxes = Axes.X, }, - spriteText = new SpriteText + spriteText = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 34ad6706f5..382d0203ac 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -66,6 +66,7 @@ + From a2dd5f09d33694ba711c8130bd601794be174ef3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 19:19:01 +0900 Subject: [PATCH 05/14] Fix subsection headers not being displayed in many cases. + spacing tweaks. --- osu.Game/Overlays/Options/OptionsSection.cs | 2 +- .../Overlays/Options/OptionsSubsection.cs | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index 7c598a92f2..ac2e1182a9 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -61,7 +61,7 @@ namespace osu.Game.Overlays.Options { Margin = new MarginPadding { Top = headerSize + headerMargin }, Direction = FlowDirection.VerticalOnly, - Spacing = new Vector2(0, 50), + Spacing = new Vector2(0, 30), AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, }, diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs index 8199011cc2..42e4b50558 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -4,12 +4,13 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays.Options { - public abstract class OptionsSubsection : Container + public abstract class OptionsSubsection : FlowContainer { private Container content; protected override Container Content => content; @@ -20,23 +21,21 @@ namespace osu.Game.Overlays.Options { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; + Direction = FlowDirection.VerticalOnly; AddInternal(new Drawable[] { + new OsuSpriteText + { + Text = Header.ToUpper(), + Margin = new MarginPadding { Bottom = 10 }, + Font = @"Exo2.0-Black", + }, content = new FlowContainer { Direction = FlowDirection.VerticalOnly, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(0, 5), - Children = new[] - { - new OsuSpriteText - { - TextSize = 17, - Text = Header.ToUpper(), - Font = @"Exo2.0-Black", - } - } }, }); } From a723e6ee9c9fba8618acca5da6ab026fe0f0bd75 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 19:19:11 +0900 Subject: [PATCH 06/14] Chevron size adjustment for dropdown items. --- osu.Game/Overlays/Options/OptionDropdown.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/Options/OptionDropdown.cs b/osu.Game/Overlays/Options/OptionDropdown.cs index 6c3dc35ae9..8bd9e313c9 100644 --- a/osu.Game/Overlays/Options/OptionDropdown.cs +++ b/osu.Game/Overlays/Options/OptionDropdown.cs @@ -194,12 +194,15 @@ namespace osu.Game.Overlays.Options { Icon = FontAwesome.fa_chevron_right, Colour = Color4.Black, + TextSize = 12, Margin = new MarginPadding { Right = 3 }, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, new OsuSpriteText { Text = text, + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, } } } From 0d529cb636183fa89ea85dff7df26ee8a344edc8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 19:23:52 +0900 Subject: [PATCH 07/14] General tidy-ups. --- .../{OffsetAdjustmentOptions.cs => OffsetOptions.cs} | 2 +- osu.Game/Overlays/Options/Sections/AudioSection.cs | 2 +- .../{GeneralGameplayOptions.cs => GeneralOptions.cs} | 2 +- ...{SongSelectGameplayOptions.cs => SongSelectOptions.cs} | 2 +- osu.Game/Overlays/Options/Sections/GameplaySection.cs | 6 +++--- .../Overlays/Options/Sections/Online/InGameChatOptions.cs | 2 +- ...{OnlineIntegrationOptions.cs => IntegrationOptions.cs} | 2 +- osu.Game/Overlays/Options/Sections/OnlineSection.cs | 2 +- osu.Game/osu.Game.csproj | 8 ++++---- 9 files changed, 14 insertions(+), 14 deletions(-) rename osu.Game/Overlays/Options/Sections/Audio/{OffsetAdjustmentOptions.cs => OffsetOptions.cs} (92%) rename osu.Game/Overlays/Options/Sections/Gameplay/{GeneralGameplayOptions.cs => GeneralOptions.cs} (95%) rename osu.Game/Overlays/Options/Sections/Gameplay/{SongSelectGameplayOptions.cs => SongSelectOptions.cs} (92%) rename osu.Game/Overlays/Options/Sections/Online/{OnlineIntegrationOptions.cs => IntegrationOptions.cs} (93%) diff --git a/osu.Game/Overlays/Options/Sections/Audio/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs similarity index 92% rename from osu.Game/Overlays/Options/Sections/Audio/OffsetAdjustmentOptions.cs rename to osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs index 0c3436ab53..2f7acdc8c0 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/OffsetAdjustmentOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.Sections.Audio { - public class OffsetAdjustmentOptions : OptionsSubsection + public class OffsetOptions : OptionsSubsection { protected override string Header => "Offset Adjustment"; diff --git a/osu.Game/Overlays/Options/Sections/AudioSection.cs b/osu.Game/Overlays/Options/Sections/AudioSection.cs index 613b265446..91145bb75d 100644 --- a/osu.Game/Overlays/Options/Sections/AudioSection.cs +++ b/osu.Game/Overlays/Options/Sections/AudioSection.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Options.Sections { new AudioDevicesOptions { Alpha = RuntimeInfo.IsWindows ? 1 : 0 }, new VolumeOptions(), - new OffsetAdjustmentOptions(), + new OffsetOptions(), }; } } diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs similarity index 95% rename from osu.Game/Overlays/Options/Sections/Gameplay/GeneralGameplayOptions.cs rename to osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs index 17b81c3af7..c40401f0ea 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.Sections.Gameplay { - public class GeneralGameplayOptions : OptionsSubsection + public class GeneralOptions : OptionsSubsection { protected override string Header => "General"; diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs similarity index 92% rename from osu.Game/Overlays/Options/Sections/Gameplay/SongSelectGameplayOptions.cs rename to osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs index e8e3cc817e..a1ea4e2286 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs @@ -8,7 +8,7 @@ using osu.Game.Configuration; namespace osu.Game.Overlays.Options.Sections.Gameplay { - public class SongSelectGameplayOptions : OptionsSubsection + public class SongSelectOptions : OptionsSubsection { protected override string Header => "Song Select"; diff --git a/osu.Game/Overlays/Options/Sections/GameplaySection.cs b/osu.Game/Overlays/Options/Sections/GameplaySection.cs index d109963c3b..875fa18fa6 100644 --- a/osu.Game/Overlays/Options/Sections/GameplaySection.cs +++ b/osu.Game/Overlays/Options/Sections/GameplaySection.cs @@ -14,10 +14,10 @@ namespace osu.Game.Overlays.Options.Sections public GameplaySection() { - Children = new Drawable[] + base.Children = new Drawable[] { - new GeneralGameplayOptions(), - new SongSelectGameplayOptions(), + new Gameplay.GeneralOptions(), + new SongSelectOptions(), }; } } diff --git a/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs b/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs index 2236498495..6e41933738 100644 --- a/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs @@ -12,7 +12,7 @@ namespace osu.Game.Overlays.Options.Sections.Online { private OptionTextBox chatIgnoreList; private OptionTextBox chatHighlightWords; - protected override string Header => "In-game Chat"; + protected override string Header => "Chat"; [BackgroundDependencyLoader] private void load(OsuConfigManager config) diff --git a/osu.Game/Overlays/Options/Sections/Online/OnlineIntegrationOptions.cs b/osu.Game/Overlays/Options/Sections/Online/IntegrationOptions.cs similarity index 93% rename from osu.Game/Overlays/Options/Sections/Online/OnlineIntegrationOptions.cs rename to osu.Game/Overlays/Options/Sections/Online/IntegrationOptions.cs index be404c15a9..b115d3d5fb 100644 --- a/osu.Game/Overlays/Options/Sections/Online/OnlineIntegrationOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/IntegrationOptions.cs @@ -8,7 +8,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.Sections.Online { - public class OnlineIntegrationOptions : OptionsSubsection + public class IntegrationOptions : OptionsSubsection { protected override string Header => "Integration"; diff --git a/osu.Game/Overlays/Options/Sections/OnlineSection.cs b/osu.Game/Overlays/Options/Sections/OnlineSection.cs index ebc04e118a..e204c5a81a 100644 --- a/osu.Game/Overlays/Options/Sections/OnlineSection.cs +++ b/osu.Game/Overlays/Options/Sections/OnlineSection.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Options.Sections new InGameChatOptions(), new PrivacyOptions(), new NotificationsOptions(), - new OnlineIntegrationOptions(), + new IntegrationOptions(), }; } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 382d0203ac..836c006b9b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -210,18 +210,18 @@ - - + + - + - + From a2cd829a2c69cca4107aeca2e81d15815722a14b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 19:40:02 +0900 Subject: [PATCH 08/14] Colour conformity pass. --- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 3 +++ osu.Game/Overlays/LoginOverlay.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 814cf3dbdb..7d9c0b6e4b 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -13,6 +13,9 @@ namespace osu.Game.Graphics.UserInterface { public class OsuTextBox : TextBox { + protected override Color4 BackgroundUnfocused => Color4.Black.Opacity(0.5f); + protected override Color4 BackgroundFocused => OsuColour.Gray(0.3f).Opacity(0.8f); + public OsuTextBox() { Height = 40; diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index 5f8c60ff9b..0c2c00d3f0 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -33,7 +33,7 @@ namespace osu.Game.Overlays new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, - Alpha = 0.8f, + Alpha = 0.6f, }, new Container { From 86b61cab8ede7fbeb05a16bfbe6e7d9f405ac92a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 19:58:22 +0900 Subject: [PATCH 09/14] Pink -> Yellow. --- osu.Game/Overlays/Options/OptionsSection.cs | 2 +- osu.Game/Overlays/Options/SidebarButton.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index ac2e1182a9..af483d2b88 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -73,7 +73,7 @@ namespace osu.Game.Overlays.Options [BackgroundDependencyLoader] private void load(OsuColour colours) { - headerLabel.Colour = colours.Pink; + headerLabel.Colour = colours.Yellow; } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/SidebarButton.cs b/osu.Game/Overlays/Options/SidebarButton.cs index bfe6db5252..de415cdef3 100644 --- a/osu.Game/Overlays/Options/SidebarButton.cs +++ b/osu.Game/Overlays/Options/SidebarButton.cs @@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Options [BackgroundDependencyLoader] private void load(OsuColour colours) { - selectionIndicator.Colour = colours.Pink; + selectionIndicator.Colour = colours.Yellow; } protected override bool OnClick(InputState state) From 6803b1a8db93a65f99056604e5c63cc9253a1603 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 19:58:38 +0900 Subject: [PATCH 10/14] Sidebar button style pass. --- .../Options/{OptionsSidebar.cs => Sidebar.cs} | 4 +-- osu.Game/Overlays/Options/SidebarButton.cs | 25 ++++++++++++------- osu.Game/Overlays/OptionsOverlay.cs | 6 ++--- osu.Game/osu.Game.csproj | 2 +- 4 files changed, 22 insertions(+), 15 deletions(-) rename osu.Game/Overlays/Options/{OptionsSidebar.cs => Sidebar.cs} (93%) diff --git a/osu.Game/Overlays/Options/OptionsSidebar.cs b/osu.Game/Overlays/Options/Sidebar.cs similarity index 93% rename from osu.Game/Overlays/Options/OptionsSidebar.cs rename to osu.Game/Overlays/Options/Sidebar.cs index 201d7878ab..d4a5b41ac9 100644 --- a/osu.Game/Overlays/Options/OptionsSidebar.cs +++ b/osu.Game/Overlays/Options/Sidebar.cs @@ -14,13 +14,13 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Options { - public class OptionsSidebar : Container + public class Sidebar : Container { private FlowContainer content; internal const int default_width = 60, expanded_width = 200; protected override Container Content => content; - public OptionsSidebar() + public Sidebar() { RelativeSizeAxes = Axes.Y; InternalChildren = new Drawable[] diff --git a/osu.Game/Overlays/Options/SidebarButton.cs b/osu.Game/Overlays/Options/SidebarButton.cs index de415cdef3..5ec53c57b6 100644 --- a/osu.Game/Overlays/Options/SidebarButton.cs +++ b/osu.Game/Overlays/Options/SidebarButton.cs @@ -20,6 +20,7 @@ namespace osu.Game.Overlays.Options private SpriteText headerText; private Box backgroundBox; private Box selectionIndicator; + public Container text; public Action Action; private OptionsSection section; @@ -45,15 +46,21 @@ namespace osu.Game.Overlays.Options { selected = value; if (selected) + { selectionIndicator.FadeIn(50); + text.FadeColour(Color4.White, 50); + } else + { selectionIndicator.FadeOut(50); + text.FadeColour(OsuColour.Gray(0.6f), 50); + } } } public SidebarButton() { - Height = OptionsSidebar.default_width; + Height = Sidebar.default_width; RelativeSizeAxes = Axes.X; Children = new Drawable[] { @@ -64,12 +71,18 @@ namespace osu.Game.Overlays.Options Colour = OsuColour.Gray(60), Alpha = 0, }, - new Container + text = new Container { - Width = OptionsSidebar.default_width, + Width = Sidebar.default_width, RelativeSizeAxes = Axes.Y, Children = new[] { + headerText = new OsuSpriteText + { + Position = new Vector2(Sidebar.default_width + 10, 0), + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + }, drawableIcon = new TextAwesome { Anchor = Anchor.Centre, @@ -77,12 +90,6 @@ namespace osu.Game.Overlays.Options }, } }, - headerText = new OsuSpriteText - { - Position = new Vector2(OptionsSidebar.default_width + 10, 0), - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - }, selectionIndicator = new Box { Alpha = 0, diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index 2565056c1a..3513a1e462 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -29,14 +29,14 @@ namespace osu.Game.Overlays public const float TRANSITION_LENGTH = 600; - public const float SIDEBAR_WIDTH = OptionsSidebar.default_width; + public const float SIDEBAR_WIDTH = Sidebar.default_width; private const float width = 400; private const float sidebar_padding = 10; private ScrollContainer scrollContainer; - private OptionsSidebar sidebar; + private Sidebar sidebar; private SidebarButton[] sidebarButtons; private OptionsSection[] sections; private float lastKnownScroll; @@ -110,7 +110,7 @@ namespace osu.Game.Overlays } } }, - sidebar = new OptionsSidebar + sidebar = new Sidebar { Width = SIDEBAR_WIDTH, Children = sidebarButtons = sections.Select(section => diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 836c006b9b..bdfdfdaea3 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -198,7 +198,7 @@ - + From 1bb142d42aed405cf2743b56ada1611eab37faa8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 19:58:45 +0900 Subject: [PATCH 11/14] Bold font for OsuButtons. --- osu.Game/Graphics/UserInterface/OsuButton.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index a36f43c1c8..5ea2538def 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -25,6 +25,7 @@ namespace osu.Game.Graphics.UserInterface Depth = -1, Origin = Anchor.Centre, Anchor = Anchor.Centre, + Font = @"Exo2.0-Bold", }; [BackgroundDependencyLoader] From 9ff37e5ed9d94c7fb8e6cea9eee09e978ab7a8f5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 20:10:26 +0900 Subject: [PATCH 12/14] Change textbox commit colour to match border. --- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 7d9c0b6e4b..a311186ed7 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -15,6 +15,7 @@ namespace osu.Game.Graphics.UserInterface { protected override Color4 BackgroundUnfocused => Color4.Black.Opacity(0.5f); protected override Color4 BackgroundFocused => OsuColour.Gray(0.3f).Opacity(0.8f); + protected override Color4 BackgroundCommit => BorderColour; public OsuTextBox() { From 7008e361673a34431940aba27075b9f16617be82 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 20:32:36 +0900 Subject: [PATCH 13/14] Button hover and press effects. --- osu.Game/Graphics/UserInterface/OsuButton.cs | 53 +++++++++++++++++--- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index 5ea2538def..ed7b9ffb29 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -6,7 +6,9 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.UserInterface; +using osu.Framework.Input; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Sprites; using osu.Game.Overlays; @@ -15,6 +17,8 @@ namespace osu.Game.Graphics.UserInterface { public class OsuButton : Button { + private Box hover; + public OsuButton() { Height = 40; @@ -31,16 +35,51 @@ namespace osu.Game.Graphics.UserInterface [BackgroundDependencyLoader] private void load(OsuColour colours) { - Colour = colours.BlueDark; - Masking = true; - CornerRadius = 5; + Colour = colours.BlueDark; + + Content.Masking = true; + Content.CornerRadius = 5; - Add(new Triangles + Add(new Drawable[] { - RelativeSizeAxes = Axes.Both, - ColourDark = colours.BlueDarker, - ColourLight = colours.Blue, + new Triangles + { + RelativeSizeAxes = Axes.Both, + ColourDark = colours.BlueDarker, + ColourLight = colours.Blue, + }, + hover = new Box + { + RelativeSizeAxes = Axes.Both, + BlendingMode = BlendingMode.Additive, + Colour = Color4.White.Opacity(0.1f), + Alpha = 0, + }, }); } + + protected override bool OnHover(InputState state) + { + hover.FadeIn(200); + return base.OnHover(state); + } + + protected override void OnHoverLost(InputState state) + { + hover.FadeOut(200); + base.OnHoverLost(state); + } + + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) + { + Content.ScaleTo(0.9f, 4000, EasingTypes.OutQuint); + return base.OnMouseDown(state, args); + } + + protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) + { + Content.ScaleTo(1, 1000, EasingTypes.OutElastic); + return base.OnMouseUp(state, args); + } } } \ No newline at end of file From 36cfe54e5924ac37267fe2811925b4965f71bc70 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2017 13:16:45 +0900 Subject: [PATCH 14/14] Missing namespace. --- osu.Game/Graphics/UserInterface/TwoLayerButton.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs index 7625712063..22e11e21ad 100644 --- a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs +++ b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Transformations; using osu.Framework.Input; using OpenTK; using OpenTK.Graphics; +using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface {