mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:02:53 +08:00
Merge pull request #11531 from peppy/less-black-confirm-to-exit
This commit is contained in:
commit
fd45d8c95a
@ -24,6 +24,13 @@ namespace osu.Game.Overlays
|
||||
[Resolved]
|
||||
private AudioManager audio { get; set; }
|
||||
|
||||
private readonly float finalFillAlpha;
|
||||
|
||||
protected HoldToConfirmOverlay(float finalFillAlpha = 1)
|
||||
{
|
||||
this.finalFillAlpha = finalFillAlpha;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
@ -42,8 +49,10 @@ namespace osu.Game.Overlays
|
||||
|
||||
Progress.ValueChanged += p =>
|
||||
{
|
||||
audioVolume.Value = 1 - p.NewValue;
|
||||
overlay.Alpha = (float)p.NewValue;
|
||||
var target = p.NewValue * finalFillAlpha;
|
||||
|
||||
audioVolume.Value = 1 - target;
|
||||
overlay.Alpha = (float)target;
|
||||
};
|
||||
|
||||
audio.Tracks.AddAdjustment(AdjustableProperty.Volume, audioVolume);
|
||||
|
@ -13,6 +13,11 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
public void Abort() => AbortConfirm();
|
||||
|
||||
public ExitConfirmOverlay()
|
||||
: base(0.7f)
|
||||
{
|
||||
}
|
||||
|
||||
public bool OnPressed(GlobalAction action)
|
||||
{
|
||||
if (action == GlobalAction.Back)
|
||||
|
Loading…
Reference in New Issue
Block a user