mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Merge branch 'master' into ParallaxContainerImprovement
This commit is contained in:
@ -7,6 +7,7 @@ using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input;
|
||||
using OpenTK;
|
||||
using osu.Framework.Configuration;
|
||||
|
||||
namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
@ -15,9 +16,14 @@ namespace osu.Game.Graphics.Containers
|
||||
private SampleChannel samplePopIn;
|
||||
private SampleChannel samplePopOut;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
private readonly BindableBool allowOpeningOverlays = new BindableBool(true);
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame osuGame, AudioManager audio)
|
||||
{
|
||||
if (osuGame != null)
|
||||
allowOpeningOverlays.BindTo(osuGame.AllowOpeningOverlays);
|
||||
|
||||
samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in");
|
||||
samplePopOut = audio.Sample.Get(@"UI/overlay-pop-out");
|
||||
|
||||
@ -46,15 +52,20 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
private void onStateChanged(Visibility visibility)
|
||||
{
|
||||
switch (visibility)
|
||||
if (allowOpeningOverlays)
|
||||
{
|
||||
case Visibility.Visible:
|
||||
samplePopIn?.Play();
|
||||
break;
|
||||
case Visibility.Hidden:
|
||||
samplePopOut?.Play();
|
||||
break;
|
||||
switch (visibility)
|
||||
{
|
||||
case Visibility.Visible:
|
||||
samplePopIn?.Play();
|
||||
break;
|
||||
case Visibility.Hidden:
|
||||
samplePopOut?.Play();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
State = Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user