From e6c3fc10911382395b40f9078836738cded4a00c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 4 Nov 2016 19:27:41 -0400 Subject: [PATCH 1/9] Implement scrolling to each section --- osu.Game/Overlays/Options/OptionsSection.cs | 2 +- osu.Game/Overlays/Options/OptionsSideNav.cs | 120 ++++++++++++++++++++ osu.Game/Overlays/OptionsOverlay.cs | 60 +++++++--- osu.Game/Overlays/ToolbarButton.cs | 4 +- osu.Game/osu.Game.csproj | 1 + 5 files changed, 169 insertions(+), 18 deletions(-) create mode 100644 osu.Game/Overlays/Options/OptionsSideNav.cs diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index 79776cc800..c362e0326c 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Options { new Box { - Colour = new Color4(3, 3, 3, 255), + Colour = new Color4(30, 30, 30, 255), RelativeSizeAxes = Axes.X, Height = borderSize, }, diff --git a/osu.Game/Overlays/Options/OptionsSideNav.cs b/osu.Game/Overlays/Options/OptionsSideNav.cs new file mode 100644 index 0000000000..fab2562332 --- /dev/null +++ b/osu.Game/Overlays/Options/OptionsSideNav.cs @@ -0,0 +1,120 @@ +using System; +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Overlays.Options +{ + public class OptionsSideNav : Container + { + public Action GeneralAction; + public Action GraphicsAction; + public Action GameplayAction; + public Action AudioAction; + public Action SkinAction; + public Action InputAction; + public Action EditorAction; + public Action OnlineAction; + public Action MaintenanceAction; + + public OptionsSideNav() + { + RelativeSizeAxes = Axes.Y; + Children = new Drawable[] + { + new FlowContainer + { + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + Direction = FlowDirection.VerticalOnly, + Children = new[] + { + new SidebarButton + { + Icon = Graphics.FontAwesome.gear, + Action = () => GeneralAction(), + }, + new SidebarButton + { + Icon = Graphics.FontAwesome.laptop, + Action = () => GraphicsAction(), + }, + new SidebarButton + { + Icon = Graphics.FontAwesome.circle_o, + Action = () => GameplayAction(), + }, + new SidebarButton + { + Icon = Graphics.FontAwesome.headphones, + Action = () => AudioAction(), + }, + new SidebarButton + { + Icon = Graphics.FontAwesome.fa_paint_brush, + Action = () => SkinAction(), + }, + new SidebarButton + { + Icon = Graphics.FontAwesome.keyboard_o, + Action = () => InputAction(), + }, + new SidebarButton + { + Icon = Graphics.FontAwesome.pencil, + Action = () => EditorAction(), + }, + new SidebarButton + { + Icon = Graphics.FontAwesome.globe, + Action = () => { + OnlineAction(); + } + }, + new SidebarButton + { + Icon = Graphics.FontAwesome.wrench, + Action = () => MaintenanceAction(), + } + } + }, + new Box + { + Colour = new Color4(30, 30, 30, 255), + RelativeSizeAxes = Axes.Y, + Width = 2, + Origin = Anchor.TopRight, + Anchor = Anchor.TopRight, + } + }; + } + + private class SidebarButton : Container + { + private ToolbarButton button; + + public Action Action + { + get { return button.Action; } + set { button.Action = value; } + } + + public Graphics.FontAwesome Icon + { + get { return button.Icon; } + set { button.Icon = value; } + } + + public SidebarButton() + { + Size = new Vector2(60); + Children = new[] { button = new ToolbarButton() }; + } + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index 3774b71254..3116495109 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -24,6 +24,21 @@ namespace osu.Game.Overlays { internal const float SideMargins = 10; private const float width = 400; + private const float sideNavWidth = 60; + private const float sideNavPadding = 0; + + private ScrollContainer scrollContainer; + private FlowContainer flowContainer; + + private GeneralOptions generalOptions; + private GraphicsOptions graphicsOptions; + private GameplayOptions gameplayOptions; + private AudioOptions audioOptions; + private SkinOptions skinOptions; + private InputOptions inputOptions; + private EditorOptions editorOptions; + private OnlineOptions onlineOptions; + private MaintenanceOptions maintenanceOptions; public OptionsOverlay() { @@ -40,14 +55,16 @@ namespace osu.Game.Overlays Colour = Color4.Black, Alpha = 0.8f, }, - // TODO: Links on the side to jump to a section - new ScrollContainer + scrollContainer = new ScrollContainer { - RelativeSizeAxes = Axes.Both, ScrollDraggerAnchor = Anchor.TopLeft, + RelativeSizeAxes = Axes.Y, + Width = width - (sideNavWidth + sideNavPadding * 2), + Position = new Vector2(sideNavWidth + sideNavPadding * 2, 0), + // Note: removing this comment causes... compiler bugs? It's weird.2 Children = new[] { - new FlowContainer + flowContainer = new FlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, @@ -67,18 +84,32 @@ namespace osu.Game.Overlays TextSize = 18, Margin = new MarginPadding { Left = SideMargins, Bottom = 30 }, }, - new GeneralOptions(), - new GraphicsOptions(), - new GameplayOptions(), - new AudioOptions(), - new SkinOptions(), - new InputOptions(), - new EditorOptions(), - new OnlineOptions(), - new MaintenanceOptions(), + generalOptions = new GeneralOptions(), + graphicsOptions = new GraphicsOptions(), + gameplayOptions = new GameplayOptions(), + audioOptions = new AudioOptions(), + skinOptions = new SkinOptions(), + inputOptions = new InputOptions(), + editorOptions = new EditorOptions(), + onlineOptions = new OnlineOptions(), + maintenanceOptions = new MaintenanceOptions(), } } } + }, + new OptionsSideNav + { + Padding = new MarginPadding { Left = sideNavPadding, Right = sideNavPadding }, + Width = sideNavWidth + sideNavPadding * 2, + GeneralAction = () => scrollContainer.ScrollIntoView(generalOptions), + GraphicsAction = () => scrollContainer.ScrollIntoView(graphicsOptions), + GameplayAction = () => scrollContainer.ScrollIntoView(gameplayOptions), + AudioAction = () => scrollContainer.ScrollIntoView(audioOptions), + SkinAction = () => scrollContainer.ScrollIntoView(skinOptions), + InputAction = () => scrollContainer.ScrollIntoView(inputOptions), + EditorAction = () => scrollContainer.ScrollIntoView(editorOptions), + OnlineAction = () => scrollContainer.ScrollIntoView(onlineOptions), + MaintenanceAction = () => scrollContainer.ScrollIntoView(maintenanceOptions), } }; } @@ -91,8 +122,7 @@ namespace osu.Game.Overlays { case Key.Escape: if (State == Visibility.Hidden) return false; - - State = Visibility.Hidden; + Hide(); return true; } return base.OnKeyDown(state, args); diff --git a/osu.Game/Overlays/ToolbarButton.cs b/osu.Game/Overlays/ToolbarButton.cs index 65004a78da..dcf6b19a3d 100644 --- a/osu.Game/Overlays/ToolbarButton.cs +++ b/osu.Game/Overlays/ToolbarButton.cs @@ -102,7 +102,7 @@ namespace osu.Game.Overlays Alpha = 0, Children = new[] { - tooltip1 = new SpriteText() + tooltip1 = new SpriteText { TextSize = 22, }, @@ -126,7 +126,7 @@ namespace osu.Game.Overlays Size = new Vector2(WIDTH + (DrawableText.IsVisible ? DrawableText.DrawSize.X : 0), 1); } - protected override bool OnClick(InputState state) + protected override bool OnMouseDown(InputState state, MouseDownEventArgs e) { Action?.Invoke(); HoverBackground.FlashColour(Color4.White, 400); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 92679b7d58..872085e361 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -229,6 +229,7 @@ + From b2bbdfa2847e71c7e465e9322337cece9ab69f9b Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 7 Nov 2016 18:04:49 -0500 Subject: [PATCH 2/9] Refactor how the sidebar buttons are created/used --- osu.Game/Overlays/Options/AudioOptions.cs | 2 + osu.Game/Overlays/Options/EditorOptions.cs | 2 + osu.Game/Overlays/Options/GameplayOptions.cs | 2 + osu.Game/Overlays/Options/GeneralOptions.cs | 2 + osu.Game/Overlays/Options/GraphicsOptions.cs | 2 + osu.Game/Overlays/Options/InputOptions.cs | 2 + .../Overlays/Options/MaintenanceOptions.cs | 2 + osu.Game/Overlays/Options/OnlineOptions.cs | 2 + osu.Game/Overlays/Options/OptionsSection.cs | 2 + osu.Game/Overlays/Options/OptionsSideNav.cs | 124 +++++++----------- osu.Game/Overlays/Options/SkinOptions.cs | 2 + osu.Game/Overlays/OptionsOverlay.cs | 59 ++++----- 12 files changed, 98 insertions(+), 105 deletions(-) diff --git a/osu.Game/Overlays/Options/AudioOptions.cs b/osu.Game/Overlays/Options/AudioOptions.cs index f0d2eeebd0..61067f4ca4 100644 --- a/osu.Game/Overlays/Options/AudioOptions.cs +++ b/osu.Game/Overlays/Options/AudioOptions.cs @@ -1,11 +1,13 @@ using System; using osu.Framework.Graphics; +using osu.Game.Graphics; namespace osu.Game.Overlays.Options { public class AudioOptions : OptionsSection { protected override string Header => "Audio"; + public override FontAwesome Icon => FontAwesome.fa_headphones; public AudioOptions() { diff --git a/osu.Game/Overlays/Options/EditorOptions.cs b/osu.Game/Overlays/Options/EditorOptions.cs index 2b3f1a9743..7d3a87c0be 100644 --- a/osu.Game/Overlays/Options/EditorOptions.cs +++ b/osu.Game/Overlays/Options/EditorOptions.cs @@ -2,12 +2,14 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics; namespace osu.Game.Overlays.Options { public class EditorOptions : OptionsSection { protected override string Header => "Editor"; + public override FontAwesome Icon => FontAwesome.fa_pencil; public EditorOptions() { diff --git a/osu.Game/Overlays/Options/GameplayOptions.cs b/osu.Game/Overlays/Options/GameplayOptions.cs index 41f811708a..aca9b8ee51 100644 --- a/osu.Game/Overlays/Options/GameplayOptions.cs +++ b/osu.Game/Overlays/Options/GameplayOptions.cs @@ -1,11 +1,13 @@ using System; using osu.Framework.Graphics; +using osu.Game.Graphics; namespace osu.Game.Overlays.Options { public class GameplayOptions : OptionsSection { protected override string Header => "Gameplay"; + public override FontAwesome Icon => FontAwesome.fa_circle_o; public GameplayOptions() { diff --git a/osu.Game/Overlays/Options/GeneralOptions.cs b/osu.Game/Overlays/Options/GeneralOptions.cs index 46adbe53d6..9ffd1065b2 100644 --- a/osu.Game/Overlays/Options/GeneralOptions.cs +++ b/osu.Game/Overlays/Options/GeneralOptions.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Platform; +using osu.Game.Graphics; using osu.Game.Online.API; namespace osu.Game.Overlays.Options @@ -11,6 +12,7 @@ namespace osu.Game.Overlays.Options public class GeneralOptions : OptionsSection { protected override string Header => "General"; + public override FontAwesome Icon => FontAwesome.fa_gear; public GeneralOptions() { diff --git a/osu.Game/Overlays/Options/GraphicsOptions.cs b/osu.Game/Overlays/Options/GraphicsOptions.cs index 8051a815aa..58eba7de70 100644 --- a/osu.Game/Overlays/Options/GraphicsOptions.cs +++ b/osu.Game/Overlays/Options/GraphicsOptions.cs @@ -1,11 +1,13 @@ using System; using osu.Framework.Graphics; +using osu.Game.Graphics; namespace osu.Game.Overlays.Options { public class GraphicsOptions : OptionsSection { protected override string Header => "Graphics"; + public override FontAwesome Icon => FontAwesome.fa_laptop; public GraphicsOptions() { diff --git a/osu.Game/Overlays/Options/InputOptions.cs b/osu.Game/Overlays/Options/InputOptions.cs index 189beb86c9..c038daac16 100644 --- a/osu.Game/Overlays/Options/InputOptions.cs +++ b/osu.Game/Overlays/Options/InputOptions.cs @@ -1,11 +1,13 @@ using System; using osu.Framework.Graphics; +using osu.Game.Graphics; namespace osu.Game.Overlays.Options { public class InputOptions : OptionsSection { protected override string Header => "Input"; + public override FontAwesome Icon => FontAwesome.fa_keyboard_o; public InputOptions() { diff --git a/osu.Game/Overlays/Options/MaintenanceOptions.cs b/osu.Game/Overlays/Options/MaintenanceOptions.cs index c139804f4c..a8d19fe06e 100644 --- a/osu.Game/Overlays/Options/MaintenanceOptions.cs +++ b/osu.Game/Overlays/Options/MaintenanceOptions.cs @@ -2,6 +2,7 @@ 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 @@ -9,6 +10,7 @@ namespace osu.Game.Overlays.Options public class MaintenanceOptions : OptionsSection { protected override string Header => "Maintenance"; + public override FontAwesome Icon => FontAwesome.fa_wrench; public MaintenanceOptions() { diff --git a/osu.Game/Overlays/Options/OnlineOptions.cs b/osu.Game/Overlays/Options/OnlineOptions.cs index a22d416ab5..96ecfe67b6 100644 --- a/osu.Game/Overlays/Options/OnlineOptions.cs +++ b/osu.Game/Overlays/Options/OnlineOptions.cs @@ -1,11 +1,13 @@ using System; using osu.Framework.Graphics; +using osu.Game.Graphics; namespace osu.Game.Overlays.Options { public class OnlineOptions : OptionsSection { protected override string Header => "Online"; + public override FontAwesome Icon => FontAwesome.fa_globe; public OnlineOptions() { diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index c362e0326c..3fdd098b18 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.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; namespace osu.Game.Overlays.Options { @@ -13,6 +14,7 @@ namespace osu.Game.Overlays.Options protected FlowContainer content; protected override Container Content => content; + public abstract FontAwesome Icon { get; } protected abstract string Header { get; } public OptionsSection() diff --git a/osu.Game/Overlays/Options/OptionsSideNav.cs b/osu.Game/Overlays/Options/OptionsSideNav.cs index fab2562332..0863423114 100644 --- a/osu.Game/Overlays/Options/OptionsSideNav.cs +++ b/osu.Game/Overlays/Options/OptionsSideNav.cs @@ -5,83 +5,29 @@ 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.Framework.Input; +using osu.Game.Graphics; namespace osu.Game.Overlays.Options { public class OptionsSideNav : Container { - public Action GeneralAction; - public Action GraphicsAction; - public Action GameplayAction; - public Action AudioAction; - public Action SkinAction; - public Action InputAction; - public Action EditorAction; - public Action OnlineAction; - public Action MaintenanceAction; - + private FlowContainer content; + protected override Container Content => content; + public OptionsSideNav() { RelativeSizeAxes = Axes.Y; - Children = new Drawable[] + InternalChildren = new Drawable[] { - new FlowContainer + content = new FlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Direction = FlowDirection.VerticalOnly, - Children = new[] - { - new SidebarButton - { - Icon = Graphics.FontAwesome.gear, - Action = () => GeneralAction(), - }, - new SidebarButton - { - Icon = Graphics.FontAwesome.laptop, - Action = () => GraphicsAction(), - }, - new SidebarButton - { - Icon = Graphics.FontAwesome.circle_o, - Action = () => GameplayAction(), - }, - new SidebarButton - { - Icon = Graphics.FontAwesome.headphones, - Action = () => AudioAction(), - }, - new SidebarButton - { - Icon = Graphics.FontAwesome.fa_paint_brush, - Action = () => SkinAction(), - }, - new SidebarButton - { - Icon = Graphics.FontAwesome.keyboard_o, - Action = () => InputAction(), - }, - new SidebarButton - { - Icon = Graphics.FontAwesome.pencil, - Action = () => EditorAction(), - }, - new SidebarButton - { - Icon = Graphics.FontAwesome.globe, - Action = () => { - OnlineAction(); - } - }, - new SidebarButton - { - Icon = Graphics.FontAwesome.wrench, - Action = () => MaintenanceAction(), - } - } + Direction = FlowDirection.VerticalOnly }, new Box { @@ -94,26 +40,54 @@ namespace osu.Game.Overlays.Options }; } - private class SidebarButton : Container + public class SidebarButton : Container { - private ToolbarButton button; + private TextAwesome drawableIcon; + private Box backgroundBox; + public Action Action; - public Action Action + public FontAwesome Icon { - get { return button.Action; } - set { button.Action = value; } - } - - public Graphics.FontAwesome Icon - { - get { return button.Icon; } - set { button.Icon = value; } + get { return drawableIcon.Icon; } + set { drawableIcon.Icon = value; } } public SidebarButton() { Size = new Vector2(60); - Children = new[] { button = new ToolbarButton() }; + Children = new Drawable[] + { + backgroundBox = new Box + { + RelativeSizeAxes = Axes.Both, + BlendingMode = BlendingMode.Additive, + Colour = new Color4(60, 60, 60, 255), + Alpha = 0, + }, + drawableIcon = new TextAwesome + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }, + }; + } + + protected override bool OnMouseDown(InputState state, MouseDownEventArgs e) + { + Action?.Invoke(); + backgroundBox.FlashColour(Color4.White, 400); + return true; + } + + protected override bool OnHover(InputState state) + { + backgroundBox.FadeTo(0.4f, 200); + return true; + } + + protected override void OnHoverLost(InputState state) + { + backgroundBox.FadeTo(0, 200); } } } diff --git a/osu.Game/Overlays/Options/SkinOptions.cs b/osu.Game/Overlays/Options/SkinOptions.cs index ae7ae3f2ab..c89253abfb 100644 --- a/osu.Game/Overlays/Options/SkinOptions.cs +++ b/osu.Game/Overlays/Options/SkinOptions.cs @@ -3,6 +3,7 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options @@ -10,6 +11,7 @@ namespace osu.Game.Overlays.Options public class SkinOptions : OptionsSection { protected override string Header => "Skin"; + public override FontAwesome Icon => FontAwesome.fa_paint_brush; public SkinOptions() { diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index 3116495109..c72399c5fb 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -2,6 +2,7 @@ //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Diagnostics; +using System.Linq; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; @@ -29,16 +30,6 @@ namespace osu.Game.Overlays private ScrollContainer scrollContainer; private FlowContainer flowContainer; - - private GeneralOptions generalOptions; - private GraphicsOptions graphicsOptions; - private GameplayOptions gameplayOptions; - private AudioOptions audioOptions; - private SkinOptions skinOptions; - private InputOptions inputOptions; - private EditorOptions editorOptions; - private OnlineOptions onlineOptions; - private MaintenanceOptions maintenanceOptions; public OptionsOverlay() { @@ -47,6 +38,19 @@ namespace osu.Game.Overlays Size = new Vector2(width, 1); Position = new Vector2(-width, 0); + var sections = new OptionsSection[] + { + new GeneralOptions(), + new GraphicsOptions(), + new GameplayOptions(), + new AudioOptions(), + new SkinOptions(), + new InputOptions(), + new EditorOptions(), + new OnlineOptions(), + new MaintenanceOptions(), + }; + Children = new Drawable[] { new Box @@ -61,10 +65,9 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.Y, Width = width - (sideNavWidth + sideNavPadding * 2), Position = new Vector2(sideNavWidth + sideNavPadding * 2, 0), - // Note: removing this comment causes... compiler bugs? It's weird.2 Children = new[] { - flowContainer = new FlowContainer + new FlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, @@ -84,15 +87,12 @@ namespace osu.Game.Overlays TextSize = 18, Margin = new MarginPadding { Left = SideMargins, Bottom = 30 }, }, - generalOptions = new GeneralOptions(), - graphicsOptions = new GraphicsOptions(), - gameplayOptions = new GameplayOptions(), - audioOptions = new AudioOptions(), - skinOptions = new SkinOptions(), - inputOptions = new InputOptions(), - editorOptions = new EditorOptions(), - onlineOptions = new OnlineOptions(), - maintenanceOptions = new MaintenanceOptions(), + flowContainer = new FlowContainer + { + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Direction = FlowDirection.VerticalOnly, + } } } } @@ -101,17 +101,16 @@ namespace osu.Game.Overlays { Padding = new MarginPadding { Left = sideNavPadding, Right = sideNavPadding }, Width = sideNavWidth + sideNavPadding * 2, - GeneralAction = () => scrollContainer.ScrollIntoView(generalOptions), - GraphicsAction = () => scrollContainer.ScrollIntoView(graphicsOptions), - GameplayAction = () => scrollContainer.ScrollIntoView(gameplayOptions), - AudioAction = () => scrollContainer.ScrollIntoView(audioOptions), - SkinAction = () => scrollContainer.ScrollIntoView(skinOptions), - InputAction = () => scrollContainer.ScrollIntoView(inputOptions), - EditorAction = () => scrollContainer.ScrollIntoView(editorOptions), - OnlineAction = () => scrollContainer.ScrollIntoView(onlineOptions), - MaintenanceAction = () => scrollContainer.ScrollIntoView(maintenanceOptions), + Children = sections.Select(section => + new OptionsSideNav.SidebarButton + { + Icon = section.Icon, + Action = () => scrollContainer.ScrollIntoView(section) + } + ) } }; + flowContainer.Add(sections); } protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; From 1ce6a7285af4211bfb9555bd260e228ccc174f32 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 7 Nov 2016 21:24:41 -0500 Subject: [PATCH 3/9] Rearrange options namespaces --- .../{ => Audio}/AudioDevicesOptions.cs | 2 +- .../AudioSection.cs} | 6 +- .../{ => Audio}/OffsetAdjustmentOptions.cs | 2 +- .../Options/{ => Audio}/VolumeOptions.cs | 2 +- .../{EditorOptions.cs => EditorSection.cs} | 4 +- .../GameplaySection.cs} | 6 +- .../{ => Gameplay}/GeneralGameplayOptions.cs | 2 +- .../SongSelectGameplayOptions.cs | 2 +- .../GeneralSection.cs} | 6 +- .../Options/{ => General}/LanguageOptions.cs | 2 +- .../Options/{ => General}/LoginOptions.cs | 2 +- .../Options/{ => General}/UpdateOptions.cs | 2 +- .../Options/{ => Graphics}/DetailOptions.cs | 2 +- .../GraphicsSection.cs} | 6 +- .../Options/{ => Graphics}/LayoutOptions.cs | 2 +- .../Options/{ => Graphics}/MainMenuOptions.cs | 2 +- .../Options/{ => Graphics}/RendererOptions.cs | 2 +- .../SongSelectGraphicsOptions.cs | 2 +- .../InputSection.cs} | 6 +- .../Options/{ => Input}/KeyboardOptions.cs | 2 +- .../Options/{ => Input}/MouseOptions.cs | 2 +- .../Options/{ => Input}/OtherInputOptions.cs | 2 +- ...enanceOptions.cs => MaintenanceSection.cs} | 4 +- .../{ => Online}/AlertsPrivacyOptions.cs | 2 +- .../Options/{ => Online}/InGameChatOptions.cs | 2 +- .../{ => Online}/OnlineIntegrationOptions.cs | 2 +- .../OnlineSection.cs} | 6 +- osu.Game/Overlays/Options/OptionsSideNav.cs | 1 + .../{SkinOptions.cs => SkinSection.cs} | 4 +- osu.Game/Overlays/OptionsOverlay.cs | 24 ++++--- osu.Game/osu.Game.csproj | 62 ++++++++++--------- 31 files changed, 93 insertions(+), 80 deletions(-) rename osu.Game/Overlays/Options/{ => Audio}/AudioDevicesOptions.cs (89%) rename osu.Game/Overlays/Options/{AudioOptions.cs => Audio/AudioSection.cs} (77%) rename osu.Game/Overlays/Options/{ => Audio}/OffsetAdjustmentOptions.cs (93%) rename osu.Game/Overlays/Options/{ => Audio}/VolumeOptions.cs (93%) rename osu.Game/Overlays/Options/{EditorOptions.cs => EditorSection.cs} (91%) rename osu.Game/Overlays/Options/{GameplayOptions.cs => Gameplay/GameplaySection.cs} (75%) rename osu.Game/Overlays/Options/{ => Gameplay}/GeneralGameplayOptions.cs (95%) rename osu.Game/Overlays/Options/{ => Gameplay}/SongSelectGameplayOptions.cs (91%) rename osu.Game/Overlays/Options/{GeneralOptions.cs => General/GeneralSection.cs} (81%) rename osu.Game/Overlays/Options/{ => General}/LanguageOptions.cs (92%) rename osu.Game/Overlays/Options/{ => General}/LoginOptions.cs (97%) rename osu.Game/Overlays/Options/{ => General}/UpdateOptions.cs (95%) rename osu.Game/Overlays/Options/{ => Graphics}/DetailOptions.cs (94%) rename osu.Game/Overlays/Options/{GraphicsOptions.cs => Graphics/GraphicsSection.cs} (79%) rename osu.Game/Overlays/Options/{ => Graphics}/LayoutOptions.cs (94%) rename osu.Game/Overlays/Options/{ => Graphics}/MainMenuOptions.cs (92%) rename osu.Game/Overlays/Options/{ => Graphics}/RendererOptions.cs (93%) rename osu.Game/Overlays/Options/{ => Graphics}/SongSelectGraphicsOptions.cs (89%) rename osu.Game/Overlays/Options/{InputOptions.cs => Input/InputSection.cs} (77%) rename osu.Game/Overlays/Options/{ => Input}/KeyboardOptions.cs (93%) rename osu.Game/Overlays/Options/{ => Input}/MouseOptions.cs (95%) rename osu.Game/Overlays/Options/{ => Input}/OtherInputOptions.cs (91%) rename osu.Game/Overlays/Options/{MaintenanceOptions.cs => MaintenanceSection.cs} (93%) rename osu.Game/Overlays/Options/{ => Online}/AlertsPrivacyOptions.cs (96%) rename osu.Game/Overlays/Options/{ => Online}/InGameChatOptions.cs (95%) rename osu.Game/Overlays/Options/{ => Online}/OnlineIntegrationOptions.cs (93%) rename osu.Game/Overlays/Options/{OnlineOptions.cs => Online/OnlineSection.cs} (77%) rename osu.Game/Overlays/Options/{SkinOptions.cs => SkinSection.cs} (95%) diff --git a/osu.Game/Overlays/Options/AudioDevicesOptions.cs b/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs similarity index 89% rename from osu.Game/Overlays/Options/AudioDevicesOptions.cs rename to osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs index 99636fe4f5..3c7da3b25f 100644 --- a/osu.Game/Overlays/Options/AudioDevicesOptions.cs +++ b/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs @@ -1,7 +1,7 @@ using System; using osu.Framework.Graphics.Sprites; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Audio { public class AudioDevicesOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/AudioOptions.cs b/osu.Game/Overlays/Options/Audio/AudioSection.cs similarity index 77% rename from osu.Game/Overlays/Options/AudioOptions.cs rename to osu.Game/Overlays/Options/Audio/AudioSection.cs index 61067f4ca4..ed83ddf5ab 100644 --- a/osu.Game/Overlays/Options/AudioOptions.cs +++ b/osu.Game/Overlays/Options/Audio/AudioSection.cs @@ -2,14 +2,14 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Audio { - public class AudioOptions : OptionsSection + public class AudioSection : OptionsSection { protected override string Header => "Audio"; public override FontAwesome Icon => FontAwesome.fa_headphones; - public AudioOptions() + public AudioSection() { Children = new Drawable[] { diff --git a/osu.Game/Overlays/Options/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs similarity index 93% rename from osu.Game/Overlays/Options/OffsetAdjustmentOptions.cs rename to osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs index 62e124fa4f..8f86565f40 100644 --- a/osu.Game/Overlays/Options/OffsetAdjustmentOptions.cs +++ b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Audio { public class OffsetAdjustmentOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/VolumeOptions.cs b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs similarity index 93% rename from osu.Game/Overlays/Options/VolumeOptions.cs rename to osu.Game/Overlays/Options/Audio/VolumeOptions.cs index 654841d177..c3bc3fda3c 100644 --- a/osu.Game/Overlays/Options/VolumeOptions.cs +++ b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Audio { public class VolumeOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/EditorOptions.cs b/osu.Game/Overlays/Options/EditorSection.cs similarity index 91% rename from osu.Game/Overlays/Options/EditorOptions.cs rename to osu.Game/Overlays/Options/EditorSection.cs index 7d3a87c0be..42169bebc6 100644 --- a/osu.Game/Overlays/Options/EditorOptions.cs +++ b/osu.Game/Overlays/Options/EditorSection.cs @@ -6,12 +6,12 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Options { - public class EditorOptions : OptionsSection + public class EditorSection : OptionsSection { protected override string Header => "Editor"; public override FontAwesome Icon => FontAwesome.fa_pencil; - public EditorOptions() + public EditorSection() { content.Spacing = new Vector2(0, 5); Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/GameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs similarity index 75% rename from osu.Game/Overlays/Options/GameplayOptions.cs rename to osu.Game/Overlays/Options/Gameplay/GameplaySection.cs index aca9b8ee51..f64e838cb1 100644 --- a/osu.Game/Overlays/Options/GameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs @@ -2,14 +2,14 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Gameplay { - public class GameplayOptions : OptionsSection + public class GameplaySection : OptionsSection { protected override string Header => "Gameplay"; public override FontAwesome Icon => FontAwesome.fa_circle_o; - public GameplayOptions() + public GameplaySection() { Children = new Drawable[] { diff --git a/osu.Game/Overlays/Options/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs similarity index 95% rename from osu.Game/Overlays/Options/GeneralGameplayOptions.cs rename to osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index 920c8b3a49..c360595fe1 100644 --- a/osu.Game/Overlays/Options/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Gameplay { public class GeneralGameplayOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs similarity index 91% rename from osu.Game/Overlays/Options/SongSelectGameplayOptions.cs rename to osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs index edbb1d43c5..7988b8e8b9 100644 --- a/osu.Game/Overlays/Options/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs @@ -2,7 +2,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Gameplay { public class SongSelectGameplayOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/GeneralOptions.cs b/osu.Game/Overlays/Options/General/GeneralSection.cs similarity index 81% rename from osu.Game/Overlays/Options/GeneralOptions.cs rename to osu.Game/Overlays/Options/General/GeneralSection.cs index 9ffd1065b2..d2ec91335a 100644 --- a/osu.Game/Overlays/Options/GeneralOptions.cs +++ b/osu.Game/Overlays/Options/General/GeneralSection.cs @@ -7,14 +7,14 @@ using osu.Framework.Platform; using osu.Game.Graphics; using osu.Game.Online.API; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.General { - public class GeneralOptions : OptionsSection + public class GeneralSection : OptionsSection { protected override string Header => "General"; public override FontAwesome Icon => FontAwesome.fa_gear; - public GeneralOptions() + public GeneralSection() { Children = new Drawable[] { diff --git a/osu.Game/Overlays/Options/LanguageOptions.cs b/osu.Game/Overlays/Options/General/LanguageOptions.cs similarity index 92% rename from osu.Game/Overlays/Options/LanguageOptions.cs rename to osu.Game/Overlays/Options/General/LanguageOptions.cs index c5363c3457..c425ea2616 100644 --- a/osu.Game/Overlays/Options/LanguageOptions.cs +++ b/osu.Game/Overlays/Options/General/LanguageOptions.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.General { public class LanguageOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/LoginOptions.cs b/osu.Game/Overlays/Options/General/LoginOptions.cs similarity index 97% rename from osu.Game/Overlays/Options/LoginOptions.cs rename to osu.Game/Overlays/Options/General/LoginOptions.cs index a6ae1775cd..c63b083af8 100644 --- a/osu.Game/Overlays/Options/LoginOptions.cs +++ b/osu.Game/Overlays/Options/General/LoginOptions.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.General { public class LoginOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/UpdateOptions.cs b/osu.Game/Overlays/Options/General/UpdateOptions.cs similarity index 95% rename from osu.Game/Overlays/Options/UpdateOptions.cs rename to osu.Game/Overlays/Options/General/UpdateOptions.cs index 000d38cfb3..c14ed3c82c 100644 --- a/osu.Game/Overlays/Options/UpdateOptions.cs +++ b/osu.Game/Overlays/Options/General/UpdateOptions.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Platform; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.General { public class UpdateOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/DetailOptions.cs b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs similarity index 94% rename from osu.Game/Overlays/Options/DetailOptions.cs rename to osu.Game/Overlays/Options/Graphics/DetailOptions.cs index 482b9c86cd..eb5794a044 100644 --- a/osu.Game/Overlays/Options/DetailOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Graphics { public class DetailOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/GraphicsOptions.cs b/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs similarity index 79% rename from osu.Game/Overlays/Options/GraphicsOptions.cs rename to osu.Game/Overlays/Options/Graphics/GraphicsSection.cs index 58eba7de70..54dda63fa2 100644 --- a/osu.Game/Overlays/Options/GraphicsOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs @@ -2,14 +2,14 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Graphics { - public class GraphicsOptions : OptionsSection + public class GraphicsSection : OptionsSection { protected override string Header => "Graphics"; public override FontAwesome Icon => FontAwesome.fa_laptop; - public GraphicsOptions() + public GraphicsSection() { Children = new Drawable[] { diff --git a/osu.Game/Overlays/Options/LayoutOptions.cs b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs similarity index 94% rename from osu.Game/Overlays/Options/LayoutOptions.cs rename to osu.Game/Overlays/Options/Graphics/LayoutOptions.cs index 1d0d503549..9769d0fb81 100644 --- a/osu.Game/Overlays/Options/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Graphics { public class LayoutOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/MainMenuOptions.cs b/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs similarity index 92% rename from osu.Game/Overlays/Options/MainMenuOptions.cs rename to osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs index 6b575431f7..015ee6fbbd 100644 --- a/osu.Game/Overlays/Options/MainMenuOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs @@ -1,7 +1,7 @@ using System; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Graphics { public class MainMenuOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/RendererOptions.cs b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs similarity index 93% rename from osu.Game/Overlays/Options/RendererOptions.cs rename to osu.Game/Overlays/Options/Graphics/RendererOptions.cs index bee07de2e3..132d1a65e1 100644 --- a/osu.Game/Overlays/Options/RendererOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Graphics { public class RendererOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/SongSelectGraphicsOptions.cs b/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs similarity index 89% rename from osu.Game/Overlays/Options/SongSelectGraphicsOptions.cs rename to osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs index b6a6e0f51e..a12562367e 100644 --- a/osu.Game/Overlays/Options/SongSelectGraphicsOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs @@ -1,7 +1,7 @@ using System; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Graphics { public class SongSelectGraphicsOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/InputOptions.cs b/osu.Game/Overlays/Options/Input/InputSection.cs similarity index 77% rename from osu.Game/Overlays/Options/InputOptions.cs rename to osu.Game/Overlays/Options/Input/InputSection.cs index c038daac16..4d34b7a309 100644 --- a/osu.Game/Overlays/Options/InputOptions.cs +++ b/osu.Game/Overlays/Options/Input/InputSection.cs @@ -2,14 +2,14 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Input { - public class InputOptions : OptionsSection + public class InputSection : OptionsSection { protected override string Header => "Input"; public override FontAwesome Icon => FontAwesome.fa_keyboard_o; - public InputOptions() + public InputSection() { Children = new Drawable[] { diff --git a/osu.Game/Overlays/Options/KeyboardOptions.cs b/osu.Game/Overlays/Options/Input/KeyboardOptions.cs similarity index 93% rename from osu.Game/Overlays/Options/KeyboardOptions.cs rename to osu.Game/Overlays/Options/Input/KeyboardOptions.cs index fbcc97bebb..c6678bd5a5 100644 --- a/osu.Game/Overlays/Options/KeyboardOptions.cs +++ b/osu.Game/Overlays/Options/Input/KeyboardOptions.cs @@ -2,7 +2,7 @@ using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Input { public class KeyboardOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/MouseOptions.cs b/osu.Game/Overlays/Options/Input/MouseOptions.cs similarity index 95% rename from osu.Game/Overlays/Options/MouseOptions.cs rename to osu.Game/Overlays/Options/Input/MouseOptions.cs index a6236d515d..fadda76a44 100644 --- a/osu.Game/Overlays/Options/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Input/MouseOptions.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Input { public class MouseOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/OtherInputOptions.cs b/osu.Game/Overlays/Options/Input/OtherInputOptions.cs similarity index 91% rename from osu.Game/Overlays/Options/OtherInputOptions.cs rename to osu.Game/Overlays/Options/Input/OtherInputOptions.cs index c91dc82e20..2fe3cf272a 100644 --- a/osu.Game/Overlays/Options/OtherInputOptions.cs +++ b/osu.Game/Overlays/Options/Input/OtherInputOptions.cs @@ -2,7 +2,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Input { public class OtherInputOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/MaintenanceOptions.cs b/osu.Game/Overlays/Options/MaintenanceSection.cs similarity index 93% rename from osu.Game/Overlays/Options/MaintenanceOptions.cs rename to osu.Game/Overlays/Options/MaintenanceSection.cs index a8d19fe06e..e44d413899 100644 --- a/osu.Game/Overlays/Options/MaintenanceOptions.cs +++ b/osu.Game/Overlays/Options/MaintenanceSection.cs @@ -7,12 +7,12 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options { - public class MaintenanceOptions : OptionsSection + public class MaintenanceSection : OptionsSection { protected override string Header => "Maintenance"; public override FontAwesome Icon => FontAwesome.fa_wrench; - public MaintenanceOptions() + public MaintenanceSection() { content.Spacing = new Vector2(0, 5); Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/AlertsPrivacyOptions.cs b/osu.Game/Overlays/Options/Online/AlertsPrivacyOptions.cs similarity index 96% rename from osu.Game/Overlays/Options/AlertsPrivacyOptions.cs rename to osu.Game/Overlays/Options/Online/AlertsPrivacyOptions.cs index 61dec55107..02ff5955c3 100644 --- a/osu.Game/Overlays/Options/AlertsPrivacyOptions.cs +++ b/osu.Game/Overlays/Options/Online/AlertsPrivacyOptions.cs @@ -2,7 +2,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Online { public class AlertsPrivacyOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/InGameChatOptions.cs b/osu.Game/Overlays/Options/Online/InGameChatOptions.cs similarity index 95% rename from osu.Game/Overlays/Options/InGameChatOptions.cs rename to osu.Game/Overlays/Options/Online/InGameChatOptions.cs index 32ca68758b..e60edce990 100644 --- a/osu.Game/Overlays/Options/InGameChatOptions.cs +++ b/osu.Game/Overlays/Options/Online/InGameChatOptions.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Online { public class InGameChatOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/OnlineIntegrationOptions.cs b/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs similarity index 93% rename from osu.Game/Overlays/Options/OnlineIntegrationOptions.cs rename to osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs index 2fe2bb2e70..b8e66a580d 100644 --- a/osu.Game/Overlays/Options/OnlineIntegrationOptions.cs +++ b/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs @@ -2,7 +2,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Online { public class OnlineIntegrationOptions : OptionsSubsection { diff --git a/osu.Game/Overlays/Options/OnlineOptions.cs b/osu.Game/Overlays/Options/Online/OnlineSection.cs similarity index 77% rename from osu.Game/Overlays/Options/OnlineOptions.cs rename to osu.Game/Overlays/Options/Online/OnlineSection.cs index 96ecfe67b6..5148ed4a35 100644 --- a/osu.Game/Overlays/Options/OnlineOptions.cs +++ b/osu.Game/Overlays/Options/Online/OnlineSection.cs @@ -2,14 +2,14 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Options.Online { - public class OnlineOptions : OptionsSection + public class OnlineSection : OptionsSection { protected override string Header => "Online"; public override FontAwesome Icon => FontAwesome.fa_globe; - public OnlineOptions() + public OnlineSection() { Children = new Drawable[] { diff --git a/osu.Game/Overlays/Options/OptionsSideNav.cs b/osu.Game/Overlays/Options/OptionsSideNav.cs index 0863423114..5d7d00124f 100644 --- a/osu.Game/Overlays/Options/OptionsSideNav.cs +++ b/osu.Game/Overlays/Options/OptionsSideNav.cs @@ -68,6 +68,7 @@ namespace osu.Game.Overlays.Options { Anchor = Anchor.Centre, Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, }, }; } diff --git a/osu.Game/Overlays/Options/SkinOptions.cs b/osu.Game/Overlays/Options/SkinSection.cs similarity index 95% rename from osu.Game/Overlays/Options/SkinOptions.cs rename to osu.Game/Overlays/Options/SkinSection.cs index c89253abfb..98b329cfb6 100644 --- a/osu.Game/Overlays/Options/SkinOptions.cs +++ b/osu.Game/Overlays/Options/SkinSection.cs @@ -8,12 +8,12 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options { - public class SkinOptions : OptionsSection + public class SkinSection : OptionsSection { protected override string Header => "Skin"; public override FontAwesome Icon => FontAwesome.fa_paint_brush; - public SkinOptions() + public SkinSection() { content.Spacing = new Vector2(0, 5); Children = new Drawable[] diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index c72399c5fb..e02def7145 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -18,6 +18,12 @@ using osu.Framework.Platform; using osu.Game.Configuration; using osu.Game.Online.API; 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; namespace osu.Game.Overlays { @@ -40,15 +46,15 @@ namespace osu.Game.Overlays var sections = new OptionsSection[] { - new GeneralOptions(), - new GraphicsOptions(), - new GameplayOptions(), - new AudioOptions(), - new SkinOptions(), - new InputOptions(), - new EditorOptions(), - new OnlineOptions(), - new MaintenanceOptions(), + new GeneralSection(), + new GraphicsSection(), + new GameplaySection(), + new AudioSection(), + new SkinSection(), + new InputSection(), + new EditorSection(), + new OnlineSection(), + new MaintenanceSection(), }; Children = new Drawable[] diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 872085e361..2bc2c8c97d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -197,39 +197,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -251,6 +251,12 @@ + + + + + + - \ No newline at end of file + From 743c1bde58325877c36adc1938db738c8473bfb5 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 7 Nov 2016 22:37:21 -0500 Subject: [PATCH 9/9] Wire up alternative chat font --- osu.Game/Overlays/Options/General/LanguageOptions.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Options/General/LanguageOptions.cs b/osu.Game/Overlays/Options/General/LanguageOptions.cs index d0c11a3ffb..18ff055a92 100644 --- a/osu.Game/Overlays/Options/General/LanguageOptions.cs +++ b/osu.Game/Overlays/Options/General/LanguageOptions.cs @@ -1,15 +1,13 @@ -using System; -using osu.Framework; +using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; namespace osu.Game.Overlays.Options.General { public class LanguageOptions : OptionsSubsection { protected override string Header => "Language"; - private CheckBoxOption showUnicode; + private CheckBoxOption showUnicode, altChatFont; public LanguageOptions() { @@ -17,7 +15,7 @@ namespace osu.Game.Overlays.Options.General { new SpriteText { Text = "TODO: Dropdown" }, showUnicode = new CheckBoxOption { LabelText = "Prefer metadata in original language" }, - new BasicCheckBox { LabelText = "Use alternative font for chat display" }, + altChatFont = new CheckBoxOption { LabelText = "Use alternative font for chat display" }, }; } @@ -28,6 +26,7 @@ namespace osu.Game.Overlays.Options.General if (osuGame != null) { showUnicode.Bindable = osuGame.Config.GetBindable(Configuration.OsuConfig.ShowUnicode); + altChatFont.Bindable = osuGame.Config.GetBindable(Configuration.OsuConfig.AlternativeChatFont); } } }