mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 18:13:00 +08:00
Merge pull request #335 from peppy/overlay-improvements
Overlay improvements
This commit is contained in:
commit
b7fd65070e
@ -19,6 +19,8 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
{
|
{
|
||||||
private VolumeMeter volumeMeterMaster;
|
private VolumeMeter volumeMeterMaster;
|
||||||
|
|
||||||
|
protected override bool HideOnEscape => false;
|
||||||
|
|
||||||
private void volumeChanged(object sender, EventArgs e)
|
private void volumeChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
|
@ -72,6 +72,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
{
|
{
|
||||||
|
base.PopOut();
|
||||||
|
|
||||||
optionsSection.Bounding = false;
|
optionsSection.Bounding = false;
|
||||||
FadeOut(transition_time);
|
FadeOut(transition_time);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public class MusicController : OverlayContainer
|
public class MusicController : FocusedOverlayContainer
|
||||||
{
|
{
|
||||||
private MusicControllerBackground backgroundSprite;
|
private MusicControllerBackground backgroundSprite;
|
||||||
private DragBar progress;
|
private DragBar progress;
|
||||||
@ -86,6 +86,8 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
dragContainer = new Container
|
dragContainer = new Container
|
||||||
{
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
Masking = true,
|
Masking = true,
|
||||||
CornerRadius = 5,
|
CornerRadius = 5,
|
||||||
EdgeEffect = new EdgeEffect
|
EdgeEffect = new EdgeEffect
|
||||||
@ -388,14 +390,23 @@ namespace osu.Game.Overlays
|
|||||||
base.Dispose(isDisposing);
|
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
|
FadeIn(transition_length, EasingTypes.OutQuint);
|
||||||
protected override void PopIn() => FadeIn(100);
|
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 }
|
private enum TransformDirection { None, Next, Prev }
|
||||||
|
|
||||||
|
@ -170,6 +170,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
{
|
{
|
||||||
|
base.PopOut();
|
||||||
|
|
||||||
scrollContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
scrollContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||||
sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||||
FadeTo(0, TRANSITION_LENGTH / 2);
|
FadeTo(0, TRANSITION_LENGTH / 2);
|
||||||
|
@ -22,6 +22,8 @@ namespace osu.Game.Overlays.Pause
|
|||||||
private const int button_height = 70;
|
private const int button_height = 70;
|
||||||
private const float background_alpha = 0.75f;
|
private const float background_alpha = 0.75f;
|
||||||
|
|
||||||
|
protected override bool HideOnEscape => false;
|
||||||
|
|
||||||
public Action OnResume;
|
public Action OnResume;
|
||||||
public Action OnRetry;
|
public Action OnRetry;
|
||||||
public Action OnQuit;
|
public Action OnQuit;
|
||||||
@ -83,6 +85,7 @@ namespace osu.Game.Overlays.Pause
|
|||||||
resume();
|
resume();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.OnKeyDown(state, args);
|
return base.OnKeyDown(state, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,10 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
private ToolbarModeSelector modeSelector;
|
private ToolbarModeSelector modeSelector;
|
||||||
private ToolbarUserArea userArea;
|
private ToolbarUserArea userArea;
|
||||||
|
|
||||||
|
protected override bool HideOnEscape => false;
|
||||||
|
|
||||||
|
protected override bool BlockPassThroughInput => false;
|
||||||
|
|
||||||
private const int transition_time = 500;
|
private const int transition_time = 500;
|
||||||
|
|
||||||
private const float alpha_hovering = 0.8f;
|
private const float alpha_hovering = 0.8f;
|
||||||
|
Loading…
Reference in New Issue
Block a user