1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 15:05:34 +08:00

Merge pull request #335 from peppy/overlay-improvements

Overlay improvements
This commit is contained in:
Thomas Müller 2017-02-09 08:43:58 +01:00 committed by GitHub
commit b7fd65070e
6 changed files with 30 additions and 6 deletions

View File

@ -19,6 +19,8 @@ namespace osu.Game.Graphics.UserInterface.Volume
{
private VolumeMeter volumeMeterMaster;
protected override bool HideOnEscape => false;
private void volumeChanged(object sender, EventArgs e)
{
Show();

View File

@ -72,6 +72,8 @@ namespace osu.Game.Overlays
protected override void PopOut()
{
base.PopOut();
optionsSection.Bounding = false;
FadeOut(transition_time);
}

View File

@ -28,7 +28,7 @@ using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays
{
public class MusicController : OverlayContainer
public class MusicController : FocusedOverlayContainer
{
private MusicControllerBackground backgroundSprite;
private DragBar progress;
@ -86,6 +86,8 @@ namespace osu.Game.Overlays
{
dragContainer = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Masking = true,
CornerRadius = 5,
EdgeEffect = new EdgeEffect
@ -388,14 +390,23 @@ namespace osu.Game.Overlays
base.Dispose(isDisposing);
}
protected override bool OnClick(InputState state) => true;
const float transition_length = 800;
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
protected override void PopIn()
{
base.PopIn();
//placeholder for toggling
protected override void PopIn() => FadeIn(100);
FadeIn(transition_length, EasingTypes.OutQuint);
dragContainer.ScaleTo(1, transition_length, EasingTypes.OutElastic);
}
protected override void PopOut() => FadeOut(100);
protected override void PopOut()
{
base.PopOut();
FadeOut(transition_length, EasingTypes.OutQuint);
dragContainer.ScaleTo(0.9f, transition_length, EasingTypes.OutQuint);
}
private enum TransformDirection { None, Next, Prev }

View File

@ -170,6 +170,8 @@ namespace osu.Game.Overlays
protected override void PopOut()
{
base.PopOut();
scrollContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint);
sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint);
FadeTo(0, TRANSITION_LENGTH / 2);

View File

@ -22,6 +22,8 @@ namespace osu.Game.Overlays.Pause
private const int button_height = 70;
private const float background_alpha = 0.75f;
protected override bool HideOnEscape => false;
public Action OnResume;
public Action OnRetry;
public Action OnQuit;
@ -83,6 +85,7 @@ namespace osu.Game.Overlays.Pause
resume();
return true;
}
return base.OnKeyDown(state, args);
}

View File

@ -24,6 +24,10 @@ namespace osu.Game.Overlays.Toolbar
private ToolbarModeSelector modeSelector;
private ToolbarUserArea userArea;
protected override bool HideOnEscape => false;
protected override bool BlockPassThroughInput => false;
private const int transition_time = 500;
private const float alpha_hovering = 0.8f;