1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 20:47:51 +08:00

Move showstoryboard into player

This commit is contained in:
David Zhao 2019-03-19 13:13:19 +09:00
parent 27a92e017c
commit df37973e84
2 changed files with 5 additions and 10 deletions

View File

@ -73,6 +73,8 @@ namespace osu.Game.Screens.Play
private DrawableStoryboard storyboard;
protected UserDimContainer StoryboardContainer { get; private set; }
private Bindable<bool> showStoryboard;
protected virtual UserDimContainer CreateStoryboardContainer() => new UserDimContainer(true)
{
RelativeSizeAxes = Axes.Both,
@ -97,6 +99,7 @@ namespace osu.Game.Screens.Play
sampleRestart = audio.Sample.Get(@"Gameplay/restart");
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
showStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
ScoreProcessor = RulesetContainer.CreateScoreProcessor();
if (!ScoreProcessor.Mode.Disabled)
@ -169,7 +172,7 @@ namespace osu.Game.Screens.Play
// bind clock into components that require it
RulesetContainer.IsPaused.BindTo(gameplayClockContainer.IsPaused);
if (ShowStoryboard.Value)
if (showStoryboard.Value)
initializeStoryboard(false);
// Bind ScoreProcessor to ourselves
@ -313,7 +316,7 @@ namespace osu.Game.Screens.Play
.Delay(250)
.FadeIn(250);
ShowStoryboard.ValueChanged += enabled =>
showStoryboard.ValueChanged += enabled =>
{
if (enabled.NewValue) initializeStoryboard(true);
};

View File

@ -13,13 +13,5 @@ namespace osu.Game.Screens.Play
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap.Value);
protected new BackgroundScreenBeatmap Background => (BackgroundScreenBeatmap)base.Background;
protected Bindable<bool> ShowStoryboard;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
}
}
}