From 64b6eaa84474b526fae71a09f7bc4c53d53e6948 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 7 Mar 2019 12:16:17 +0900 Subject: [PATCH] Simplify inward bindings --- osu.Game/Screens/Play/Player.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 429b9dda91..50ecf5443a 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -118,9 +118,10 @@ namespace osu.Game.Screens.Play OnQuit = performUserRequestedExit, Start = gameplayClockContainer.Start, Stop = gameplayClockContainer.Stop, + IsPaused = { BindTarget = gameplayClockContainer.IsPaused }, CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded.Value, - Children = new Container[] + Children = new[] { StoryboardContainer = CreateStoryboardContainer(), new ScalingContainer(ScalingMode.Gameplay) @@ -137,12 +138,12 @@ namespace osu.Game.Screens.Play Origin = Anchor.Centre, Breaks = working.Beatmap.Breaks }, - new ScalingContainer(ScalingMode.Gameplay) - { - Child = RulesetContainer.Cursor?.CreateProxy() ?? new Container(), - }, + RulesetContainer.Cursor?.CreateProxy() ?? new Container(), HUDOverlay = new HUDOverlay(ScoreProcessor, RulesetContainer, working) { + HoldToQuit = { Action = performUserRequestedExit }, + PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = gameplayClockContainer.UserPlaybackRate } } }, + KeyCounter = { Visible = { BindTarget = RulesetContainer.HasReplayLoaded } }, RequestSeek = gameplayClockContainer.Seek, Anchor = Anchor.Centre, Origin = Anchor.Centre @@ -171,12 +172,7 @@ namespace osu.Game.Screens.Play }; // bind clock into components that require it - PausableGameplayContainer.IsPaused.BindTo(gameplayClockContainer.IsPaused); RulesetContainer.IsPaused.BindTo(gameplayClockContainer.IsPaused); - HUDOverlay.PlayerSettingsOverlay.PlaybackSettings.UserPlaybackRate.BindTo(gameplayClockContainer.UserPlaybackRate); - - HUDOverlay.HoldToQuit.Action = performUserRequestedExit; - HUDOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded); if (ShowStoryboard.Value) initializeStoryboard(false);