diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index d731115c91..5f1bf5aafd 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -80,7 +80,7 @@ namespace osu.Game Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black")); Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic")); - (Options = new OptionsOverlay { Depth = float.MaxValue / 2}).Preload(game, Add); + (Options = new OptionsOverlay { Depth = float.MaxValue / 2 }).Preload(game, Add); API = new APIAccess() { diff --git a/osu.Game/Overlays/Options/OptionsSideNav.cs b/osu.Game/Overlays/Options/OptionsSideNav.cs index c578d138a6..94c599fe68 100644 --- a/osu.Game/Overlays/Options/OptionsSideNav.cs +++ b/osu.Game/Overlays/Options/OptionsSideNav.cs @@ -19,13 +19,19 @@ namespace osu.Game.Overlays.Options RelativeSizeAxes = Axes.Y; InternalChildren = new Drawable[] { - content = new FlowContainer + new SidebarScrollContainer { - AutoSizeAxes = Axes.Y, - RelativeSizeAxes = Axes.X, - Origin = Anchor.CentreLeft, - Anchor = Anchor.CentreLeft, - Direction = FlowDirection.VerticalOnly + Children = new [] + { + content = new FlowContainer + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Direction = FlowDirection.VerticalOnly + } + } }, new Box { @@ -38,18 +44,27 @@ namespace osu.Game.Overlays.Options }; } + private class SidebarScrollContainer : ScrollContainer + { + public SidebarScrollContainer() + { + Content.Anchor = Anchor.CentreLeft; + Content.Origin = Anchor.CentreLeft; + } + } + public class SidebarButton : Container { private TextAwesome drawableIcon; private Box backgroundBox; public Action Action; - + public FontAwesome Icon { get { return drawableIcon.Icon; } set { drawableIcon.Icon = value; } } - + public SidebarButton() { Size = new Vector2(60); @@ -69,20 +84,20 @@ namespace osu.Game.Overlays.Options }, }; } - + 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);