Update VisibilityContainer usage in line with framework

This commit is contained in:
Dean Herbert
2019-06-11 14:28:52 +09:00
parent 164b05abd6
commit 609a82bc94
50 changed files with 150 additions and 127 deletions

View File

@ -54,7 +54,7 @@ namespace osu.Game.Graphics.Containers
samplePopIn = audio.Samples.Get(@"UI/overlay-pop-in");
samplePopOut = audio.Samples.Get(@"UI/overlay-pop-out");
StateChanged += onStateChanged;
State.ValueChanged += onStateChanged;
}
/// <summary>
@ -70,7 +70,7 @@ namespace osu.Game.Graphics.Containers
{
if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
{
State = Visibility.Hidden;
Hide();
return true;
}
@ -82,7 +82,7 @@ namespace osu.Game.Graphics.Containers
switch (action)
{
case GlobalAction.Back:
State = Visibility.Hidden;
Hide();
return true;
case GlobalAction.Select:
@ -94,9 +94,9 @@ namespace osu.Game.Graphics.Containers
public bool OnReleased(GlobalAction action) => false;
private void onStateChanged(Visibility visibility)
private void onStateChanged(ValueChangedEvent<Visibility> state)
{
switch (visibility)
switch (state.NewValue)
{
case Visibility.Visible:
if (OverlayActivationMode.Value != OverlayActivation.Disabled)
@ -105,7 +105,7 @@ namespace osu.Game.Graphics.Containers
if (BlockScreenWideMouse && DimMainContent) osuGame?.AddBlockingOverlay(this);
}
else
State = Visibility.Hidden;
Hide();
break;