1
0
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:
Dean Herbert 2019-03-25 12:39:40 +09:00
parent 5169f7a43c
commit 371166955e
3 changed files with 9 additions and 7 deletions

View File

@ -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>

View File

@ -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();

View File

@ -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;
} }