mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Add panning to certain overlay pop-in/pop-outs
This commit is contained in:
parent
b15a54c914
commit
04a1f6a508
@ -24,6 +24,7 @@ namespace osu.Game.Graphics.Containers
|
||||
private Sample samplePopOut;
|
||||
protected virtual string PopInSampleName => "UI/overlay-pop-in";
|
||||
protected virtual string PopOutSampleName => "UI/overlay-pop-out";
|
||||
protected virtual double PopInOutSampleBalance => 0;
|
||||
|
||||
protected override bool BlockNonPositionalInput => true;
|
||||
|
||||
@ -133,15 +134,21 @@ namespace osu.Game.Graphics.Containers
|
||||
return;
|
||||
}
|
||||
|
||||
if (didChange)
|
||||
samplePopIn?.Play();
|
||||
if (didChange && samplePopIn != null)
|
||||
{
|
||||
samplePopIn.Balance.Value = PopInOutSampleBalance;
|
||||
samplePopIn.Play();
|
||||
}
|
||||
|
||||
if (BlockScreenWideMouse && DimMainContent) overlayManager?.ShowBlockingOverlay(this);
|
||||
break;
|
||||
|
||||
case Visibility.Hidden:
|
||||
if (didChange)
|
||||
samplePopOut?.Play();
|
||||
if (didChange && samplePopOut != null)
|
||||
{
|
||||
samplePopOut.Balance.Value = PopInOutSampleBalance;
|
||||
samplePopOut.Play();
|
||||
}
|
||||
|
||||
if (BlockScreenWideMouse) overlayManager?.HideBlockingOverlay(this);
|
||||
break;
|
||||
|
@ -20,6 +20,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
private const float transition_time = 400;
|
||||
|
||||
protected override double PopInOutSampleBalance => OsuGameBase.SFX_STEREO_STRENGTH;
|
||||
|
||||
[Cached]
|
||||
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
|
||||
|
||||
|
@ -31,6 +31,8 @@ namespace osu.Game.Overlays
|
||||
public LocalisableString Title => NotificationsStrings.HeaderTitle;
|
||||
public LocalisableString Description => NotificationsStrings.HeaderDescription;
|
||||
|
||||
protected override double PopInOutSampleBalance => OsuGameBase.SFX_STEREO_STRENGTH;
|
||||
|
||||
public const float WIDTH = 320;
|
||||
|
||||
public const float TRANSITION_LENGTH = 600;
|
||||
|
@ -56,6 +56,7 @@ namespace osu.Game.Overlays
|
||||
private SeekLimitedSearchTextBox searchTextBox;
|
||||
|
||||
protected override string PopInSampleName => "UI/settings-pop-in";
|
||||
protected override double PopInOutSampleBalance => -OsuGameBase.SFX_STEREO_STRENGTH;
|
||||
|
||||
private readonly bool showSidebar;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user