mirror of
https://github.com/ppy/osu.git
synced 2025-02-01 22:03:01 +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 BeatmapManager manager;
|
||||||
private RulesetStore rulesets;
|
private RulesetStore rulesets;
|
||||||
|
|
||||||
private OsuScreenStack screenStack;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(GameHost host)
|
private void load(GameHost host)
|
||||||
{
|
{
|
||||||
@ -81,8 +79,10 @@ namespace osu.Game.Tests.Visual
|
|||||||
[SetUp]
|
[SetUp]
|
||||||
public virtual void SetUp() => Schedule(() =>
|
public virtual void SetUp() => Schedule(() =>
|
||||||
{
|
{
|
||||||
Child = screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both };
|
Child = new OsuScreenStack(songSelect = new DummySongSelect())
|
||||||
screenStack.Push(songSelect = new DummySongSelect());
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
/// <summary>
|
/// <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()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
@ -36,11 +36,11 @@ namespace osu.Game.Screens
|
|||||||
Child = backgroundScreenStack = new BackgroundScreenStack { RelativeSizeAxes = Axes.Both },
|
Child = backgroundScreenStack = new BackgroundScreenStack { RelativeSizeAxes = Axes.Both },
|
||||||
};
|
};
|
||||||
|
|
||||||
ScreenPushed += setParallax;
|
ScreenPushed += onScreenChange;
|
||||||
ScreenExited += setParallax;
|
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;
|
parallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * ((IOsuScreen)next)?.BackgroundParallaxAmount ?? 1.0f;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user