mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Combine and simplify beatmap change logic
This commit is contained in:
@ -6,7 +6,6 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Screens;
|
using osu.Game.Screens;
|
||||||
using osu.Game.Screens.Backgrounds;
|
using osu.Game.Screens.Backgrounds;
|
||||||
@ -155,15 +154,6 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
private class ScalingBackgroundScreen : BackgroundScreenDefault
|
private class ScalingBackgroundScreen : BackgroundScreenDefault
|
||||||
{
|
{
|
||||||
private IBindable<WorkingBeatmap> beatmap;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(IBindable<WorkingBeatmap> beatmap)
|
|
||||||
{
|
|
||||||
this.beatmap = beatmap.GetBoundCopy();
|
|
||||||
this.beatmap.ValueChanged += _ => Next();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnEntering(IScreen last)
|
public override void OnEntering(IScreen last)
|
||||||
{
|
{
|
||||||
this.FadeInFromZero(4000, Easing.OutQuint);
|
this.FadeInFromZero(4000, Easing.OutQuint);
|
||||||
|
@ -46,6 +46,7 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
user.ValueChanged += _ => Next();
|
user.ValueChanged += _ => Next();
|
||||||
skin.ValueChanged += _ => Next();
|
skin.ValueChanged += _ => Next();
|
||||||
mode.ValueChanged += _ => Next();
|
mode.ValueChanged += _ => Next();
|
||||||
|
beatmap.ValueChanged += _ => Next();
|
||||||
|
|
||||||
currentDisplay = RNG.Next(0, background_count);
|
currentDisplay = RNG.Next(0, background_count);
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -170,8 +169,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
track.Start();
|
track.Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Beatmap.ValueChanged += beatmap_ValueChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool exitConfirmed;
|
private bool exitConfirmed;
|
||||||
@ -220,14 +217,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
seq.OnAbort(_ => buttons.SetOsuLogo(null));
|
seq.OnAbort(_ => buttons.SetOsuLogo(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beatmap_ValueChanged(ValueChangedEvent<WorkingBeatmap> e)
|
|
||||||
{
|
|
||||||
if (!this.IsCurrentScreen())
|
|
||||||
return;
|
|
||||||
|
|
||||||
((BackgroundScreenDefault)Background).Next();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnSuspending(IScreen next)
|
public override void OnSuspending(IScreen next)
|
||||||
{
|
{
|
||||||
base.OnSuspending(next);
|
base.OnSuspending(next);
|
||||||
|
Reference in New Issue
Block a user