mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Make opening options shift the rest of the screen as per design.
This commit is contained in:
parent
c26587ec3a
commit
481b9d3208
@ -19,6 +19,7 @@ using osu.Framework.Logging;
|
||||
using osu.Game.Graphics.UserInterface.Volume;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.Menu;
|
||||
@ -132,6 +133,19 @@ namespace osu.Game
|
||||
overlayContent.Add(Toolbar);
|
||||
});
|
||||
|
||||
Options.StateChanged += delegate
|
||||
{
|
||||
switch (Options.State)
|
||||
{
|
||||
case Visibility.Hidden:
|
||||
intro.MoveToX(0, OptionsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
break;
|
||||
case Visibility.Visible:
|
||||
intro.MoveToX(OptionsOverlay.SIDEBAR_WIDTH / 2, OptionsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Cursor.Alpha = 0;
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,12 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
internal const float CONTENT_MARGINS = 10;
|
||||
|
||||
public const float TRANSITION_LENGTH = 600;
|
||||
|
||||
public const float SIDEBAR_WIDTH = OptionsSidebar.default_width;
|
||||
|
||||
private const float width = 400;
|
||||
private const float sidebar_width = OptionsSidebar.default_width;
|
||||
|
||||
private const float sidebar_padding = 10;
|
||||
|
||||
private ScrollContainer scrollContainer;
|
||||
@ -71,7 +75,7 @@ namespace osu.Game.Overlays
|
||||
ScrollDraggerVisible = false,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Width = width,
|
||||
Margin = new MarginPadding { Left = sidebar_width },
|
||||
Margin = new MarginPadding { Left = SIDEBAR_WIDTH },
|
||||
Children = new[]
|
||||
{
|
||||
new FlowContainer
|
||||
@ -108,7 +112,7 @@ namespace osu.Game.Overlays
|
||||
},
|
||||
sidebar = new OptionsSidebar
|
||||
{
|
||||
Width = sidebar_width,
|
||||
Width = SIDEBAR_WIDTH,
|
||||
Children = sidebarButtons = sections.Select(section =>
|
||||
new SidebarButton
|
||||
{
|
||||
@ -175,16 +179,16 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
scrollContainer.MoveToX(0, 600, EasingTypes.OutQuint);
|
||||
sidebar.MoveToX(0, 800, EasingTypes.OutQuint);
|
||||
FadeTo(1, 300);
|
||||
scrollContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
FadeTo(1, TRANSITION_LENGTH / 2);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
scrollContainer.MoveToX(-width, 600, EasingTypes.OutQuint);
|
||||
sidebar.MoveToX(-sidebar_width, 600, EasingTypes.OutQuint);
|
||||
FadeTo(0, 300);
|
||||
scrollContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
FadeTo(0, TRANSITION_LENGTH / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user