mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:42:58 +08:00
Fix WaveOverlayContainer being always present (#5210)
Fix WaveOverlayContainer being always present
This commit is contained in:
commit
db3e9c7e60
@ -15,7 +15,7 @@ using osu.Game.Overlays;
|
||||
|
||||
namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
public class OsuFocusedOverlayContainer : FocusedOverlayContainer, IPreviewTrackOwner, IKeyBindingHandler<GlobalAction>
|
||||
public abstract class OsuFocusedOverlayContainer : FocusedOverlayContainer, IPreviewTrackOwner, IKeyBindingHandler<GlobalAction>
|
||||
{
|
||||
private SampleChannel samplePopIn;
|
||||
private SampleChannel samplePopOut;
|
||||
|
@ -29,6 +29,8 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
protected override Container<Drawable> Content => contentContainer;
|
||||
|
||||
protected override bool StartHidden => true;
|
||||
|
||||
public Color4 FirstWaveColour
|
||||
{
|
||||
get => firstWave.Colour;
|
||||
@ -95,6 +97,7 @@ namespace osu.Game.Graphics.Containers
|
||||
AddInternal(contentContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RelativePositionAxes = Axes.Both,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Origin = Anchor.BottomCentre,
|
||||
});
|
||||
@ -105,21 +108,15 @@ namespace osu.Game.Graphics.Containers
|
||||
foreach (var w in wavesContainer.Children)
|
||||
w.Show();
|
||||
|
||||
this.FadeIn(100, Easing.OutQuint);
|
||||
contentContainer.MoveToY(0, APPEAR_DURATION, Easing.OutQuint);
|
||||
|
||||
this.FadeIn(100, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
this.FadeOut(DISAPPEAR_DURATION, Easing.InQuint);
|
||||
contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, Easing.In);
|
||||
|
||||
foreach (var w in wavesContainer.Children)
|
||||
w.Hide();
|
||||
|
||||
this.FadeOut(DISAPPEAR_DURATION, Easing.InQuint);
|
||||
contentContainer.MoveToY(2, DISAPPEAR_DURATION, Easing.In);
|
||||
}
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
@ -128,7 +125,8 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
// This is done as an optimization, such that invisible parts of the waves
|
||||
// are masked away, and thus do not consume fill rate.
|
||||
wavesContainer.Height = Math.Max(0, DrawHeight - (contentContainer.DrawHeight - contentContainer.Y));
|
||||
// todo: revert https://github.com/ppy/osu/commit/aff9e3617da0c8fe252169fae287e39b44575b5e after FTB is fixed on iOS.
|
||||
wavesContainer.Height = Math.Max(0, DrawHeight - (contentContainer.DrawHeight - contentContainer.Y * DrawHeight));
|
||||
}
|
||||
|
||||
private class Wave : VisibilityContainer
|
||||
|
@ -14,6 +14,8 @@ namespace osu.Game.Overlays
|
||||
protected override bool BlockNonPositionalInput => true;
|
||||
protected override Container<Drawable> Content => Waves;
|
||||
|
||||
protected override bool StartHidden => true;
|
||||
|
||||
protected WaveOverlayContainer()
|
||||
{
|
||||
AddInternal(Waves = new WaveContainer
|
||||
@ -25,13 +27,17 @@ namespace osu.Game.Overlays
|
||||
protected override void PopIn()
|
||||
{
|
||||
base.PopIn();
|
||||
|
||||
Waves.Show();
|
||||
this.FadeIn(100, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
|
||||
Waves.Hide();
|
||||
this.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.InQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user