Add panning to certain overlay pop-in/pop-outs

This commit is contained in:
Jamie Taylor 2023-08-17 11:37:07 +09:00
parent b15a54c914
commit 04a1f6a508
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C
4 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;