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 @@ - +