mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Apply a few minor refactors
This commit is contained in:
parent
5169f7a43c
commit
371166955e
@ -53,8 +53,6 @@ namespace osu.Game.Tests.Visual
|
||||
private BeatmapManager manager;
|
||||
private RulesetStore rulesets;
|
||||
|
||||
private OsuScreenStack screenStack;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(GameHost host)
|
||||
{
|
||||
@ -81,8 +79,10 @@ namespace osu.Game.Tests.Visual
|
||||
[SetUp]
|
||||
public virtual void SetUp() => Schedule(() =>
|
||||
{
|
||||
Child = screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both };
|
||||
screenStack.Push(songSelect = new DummySongSelect());
|
||||
Child = new OsuScreenStack(songSelect = new DummySongSelect())
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
};
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
|
@ -120,6 +120,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ClearInternal(bool disposeChildren = true) => throw new InvalidOperationException($"Should never clear a {nameof(DrawableHitObject)}");
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
@ -36,11 +36,11 @@ namespace osu.Game.Screens
|
||||
Child = backgroundScreenStack = new BackgroundScreenStack { RelativeSizeAxes = Axes.Both },
|
||||
};
|
||||
|
||||
ScreenPushed += setParallax;
|
||||
ScreenExited += setParallax;
|
||||
ScreenPushed += onScreenChange;
|
||||
ScreenExited += onScreenChange;
|
||||
}
|
||||
|
||||
private void setParallax(IScreen prev, IScreen next)
|
||||
private void onScreenChange(IScreen prev, IScreen next)
|
||||
{
|
||||
parallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * ((IOsuScreen)next)?.BackgroundParallaxAmount ?? 1.0f;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user