diff --git a/osu-framework b/osu-framework index bb8c723ad1..85541286b8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit bb8c723ad135a2935a499c45f23c45bd14f3daa4 +Subproject commit 85541286b805120b8fa371eea60b15a4bcaff867 diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index 59c4ac4a61..95906464ec 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -113,8 +113,11 @@ namespace osu.Game.Overlays.Toolbar { base.UpdateAfterChildren(); - if (!activeMode.EnsureValid()) - activeMode.Refresh(() => modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, EasingTypes.OutQuint)); + if (!activeMode.IsValid) + { + modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, EasingTypes.OutQuint); + activeMode.Validate(); + } } } } diff --git a/osu.Game/Rulesets/Timing/DrawableTimingSection.cs b/osu.Game/Rulesets/Timing/DrawableTimingSection.cs index 3ad9f23605..1dc7099aa8 100644 --- a/osu.Game/Rulesets/Timing/DrawableTimingSection.cs +++ b/osu.Game/Rulesets/Timing/DrawableTimingSection.cs @@ -81,13 +81,8 @@ namespace osu.Game.Rulesets.Timing } private Cached durationBacking = new Cached(); - /// - /// The maximum duration of any one hit object inside this . This is calculated as the maximum - /// end time between all hit objects relative to this 's . - /// - public double Duration => durationBacking.EnsureValid() - ? durationBacking.Value - : durationBacking.Refresh(() => + + private double computeDuration() { if (!Children.Any()) return 0; @@ -117,7 +112,13 @@ namespace osu.Game.Rulesets.Timing baseDuration *= 1 + maxAbsoluteSize / ourAbsoluteSize; return baseDuration; - }); + } + + /// + /// The maximum duration of any one hit object inside this . This is calculated as the maximum + /// end time between all hit objects relative to this 's . + /// + public double Duration => durationBacking.IsValid ? durationBacking : (durationBacking.Value = computeDuration()); protected override void Update() { diff --git a/osu.Game/Screens/Play/SquareGraph.cs b/osu.Game/Screens/Play/SquareGraph.cs index cd1e9c78c6..f3bb523611 100644 --- a/osu.Game/Screens/Play/SquareGraph.cs +++ b/osu.Game/Screens/Play/SquareGraph.cs @@ -77,7 +77,12 @@ namespace osu.Game.Screens.Play protected override void Update() { base.Update(); - layout.Refresh(recreateGraph); + + if (!layout.IsValid) + { + recreateGraph(); + layout.Validate(); + } } ///