mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
prevent Overlays from showing in intro/outro sequences
This commit is contained in:
parent
cdd43f7909
commit
67db539172
@ -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,13 +16,17 @@ namespace osu.Game.Graphics.Containers
|
||||
private SampleChannel samplePopIn;
|
||||
private SampleChannel samplePopOut;
|
||||
|
||||
protected BindableBool ShowOverlays = new BindableBool();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
private void load(OsuGame osuGame, AudioManager audio)
|
||||
{
|
||||
samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in");
|
||||
samplePopOut = audio.Sample.Get(@"UI/overlay-pop-out");
|
||||
|
||||
StateChanged += onStateChanged;
|
||||
|
||||
ShowOverlays.BindTo(osuGame.ShowOverlays);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -46,6 +51,9 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
private void onStateChanged(Visibility visibility)
|
||||
{
|
||||
if (!ShowOverlays)
|
||||
State = Visibility.Hidden;
|
||||
|
||||
switch (visibility)
|
||||
{
|
||||
case Visibility.Visible:
|
||||
|
Loading…
Reference in New Issue
Block a user