mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:35:35 +08:00
Merge pull request #13509 from bdach/fix-seasonal-backgrounds
Fix seasonal backgrounds not cycling
This commit is contained in:
commit
cb80577922
@ -161,15 +161,18 @@ namespace osu.Game.Tests.Visual.Background
|
|||||||
|
|
||||||
private void loadNextBackground()
|
private void loadNextBackground()
|
||||||
{
|
{
|
||||||
|
SeasonalBackground previousBackground = null;
|
||||||
SeasonalBackground background = null;
|
SeasonalBackground background = null;
|
||||||
|
|
||||||
AddStep("create next background", () =>
|
AddStep("create next background", () =>
|
||||||
{
|
{
|
||||||
|
previousBackground = (SeasonalBackground)backgroundContainer.SingleOrDefault();
|
||||||
background = backgroundLoader.LoadNextBackground();
|
background = backgroundLoader.LoadNextBackground();
|
||||||
LoadComponentAsync(background, bg => backgroundContainer.Child = bg);
|
LoadComponentAsync(background, bg => backgroundContainer.Child = bg);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("background loaded", () => background.IsLoaded);
|
AddUntilStep("background loaded", () => background.IsLoaded);
|
||||||
|
AddAssert("background is different", () => !background.Equals(previousBackground));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertAnyBackground()
|
private void assertAnyBackground()
|
||||||
|
@ -99,5 +99,14 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
// ensure we're not loading in without a transition.
|
// ensure we're not loading in without a transition.
|
||||||
this.FadeInFromZero(200, Easing.InOutSine);
|
this.FadeInFromZero(200, Easing.InOutSine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool Equals(Background other)
|
||||||
|
{
|
||||||
|
if (ReferenceEquals(null, other)) return false;
|
||||||
|
if (ReferenceEquals(this, other)) return true;
|
||||||
|
|
||||||
|
return other.GetType() == GetType()
|
||||||
|
&& ((SeasonalBackground)other).url == url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user