From e28a6107578ae52d17298a6fc929d49ce17e5ca1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 4 Jul 2018 12:40:55 +0900 Subject: [PATCH 1/5] Fix mods not correctly resetting when changing ruleset at song select --- .../ManiaSettingsSubsection.cs | 5 ++- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 7 +++- .../Settings/RulesetSettingsSubsection.cs | 9 +++-- osu.Game/Rulesets/Mods/ModAutoplay.cs | 2 +- osu.Game/Screens/Select/PlaySongSelect.cs | 4 +- osu.Game/Screens/Select/SongSelect.cs | 38 +++++++++++++------ osu.Game/osu.Game.csproj | 2 +- 7 files changed, 46 insertions(+), 21 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs b/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs index 54a7bf954ddd..8d1fad8a8269 100644 --- a/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs +++ b/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs @@ -4,6 +4,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Overlays.Settings; +using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Mania.Configuration; using osu.Game.Rulesets.Mania.UI; @@ -19,14 +20,14 @@ public ManiaSettingsSubsection(ManiaRuleset ruleset) } [BackgroundDependencyLoader] - private void load(ManiaConfigManager config) + private void load() { Children = new Drawable[] { new SettingsEnumDropdown { LabelText = "Scrolling direction", - Bindable = config.GetBindable(ManiaSetting.ScrollDirection) + Bindable = (Config as RulesetConfigManager)?.GetBindable(ManiaSetting.ScrollDirection) } }; } diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index c584a32a827d..98cf111ba00c 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -44,6 +44,8 @@ public class ModSelectOverlay : WaveOverlayContainer private void rulesetChanged(RulesetInfo newRuleset) { + if (newRuleset == null) return; + var instance = newRuleset.CreateInstance(); foreach (ModSection section in ModSectionsContainer.Children) @@ -173,7 +175,10 @@ private void modButtonPressed(Mod selectedMod) refreshSelectedMods(); } - private void refreshSelectedMods() => SelectedMods.Value = ModSectionsContainer.Children.SelectMany(s => s.SelectedMods).ToArray(); + private void refreshSelectedMods() + { + SelectedMods.Value = ModSectionsContainer.Children.SelectMany(s => s.SelectedMods).ToArray(); + } public ModSelectOverlay() { diff --git a/osu.Game/Overlays/Settings/RulesetSettingsSubsection.cs b/osu.Game/Overlays/Settings/RulesetSettingsSubsection.cs index 05104018cdb7..5340a0174350 100644 --- a/osu.Game/Overlays/Settings/RulesetSettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/RulesetSettingsSubsection.cs @@ -3,6 +3,7 @@ using osu.Framework.Allocation; using osu.Game.Rulesets; +using osu.Game.Rulesets.Configuration; namespace osu.Game.Overlays.Settings { @@ -14,6 +15,8 @@ public abstract class RulesetSettingsSubsection : SettingsSubsection { private readonly Ruleset ruleset; + protected IRulesetConfigManager Config; + protected RulesetSettingsSubsection(Ruleset ruleset) { this.ruleset = ruleset; @@ -25,9 +28,9 @@ protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnl { dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); - var config = dependencies.Get().GetConfigFor(ruleset); - if (config != null) - dependencies.Cache(config); + Config = dependencies.Get().GetConfigFor(ruleset); + if (Config != null) + dependencies.Cache(Config); return dependencies; } diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index 7058d1bed647..8f73ff4c2d04 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods { - public class ModAutoplay : ModAutoplay, IApplicableToRulesetContainer + public abstract class ModAutoplay : ModAutoplay, IApplicableToRulesetContainer where T : HitObject { protected virtual Score CreateReplayScore(Beatmap beatmap) => new Score { Replay = new Replay() }; diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 8ce40fcfa0ba..a346911ca228 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -84,10 +84,10 @@ private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps protected override void UpdateBeatmap(WorkingBeatmap beatmap) { - base.UpdateBeatmap(beatmap); - beatmap.Mods.BindTo(SelectedMods); + base.UpdateBeatmap(beatmap); + BeatmapDetails.Beatmap = beatmap; if (beatmap.Track != null) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 94c16f1797ff..e940cac41997 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; using OpenTK; using OpenTK.Input; using osu.Framework.Allocation; @@ -19,6 +20,7 @@ using osu.Game.Graphics.Containers; using osu.Game.Overlays; using osu.Game.Rulesets; +using osu.Game.Rulesets.Mods; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Edit; using osu.Game.Screens.Menu; @@ -67,8 +69,17 @@ public abstract class SongSelect : OsuScreen protected new readonly Bindable Ruleset = new Bindable(); private DependencyContainer dependencies; + protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) - => dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); + { + dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); + + dependencies.CacheAs(this); + dependencies.CacheAs(Ruleset); + dependencies.CacheAs>(Ruleset); + + return dependencies; + } protected SongSelect() { @@ -183,11 +194,9 @@ protected SongSelect() [BackgroundDependencyLoader(true)] private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuColour colours) { - dependencies.CacheAs(this); - dependencies.CacheAs(Ruleset); - dependencies.CacheAs>(Ruleset); - + // manual binding to parent ruleset to allow for delayed load in the incoming direction. base.Ruleset.ValueChanged += r => updateSelectedBeatmap(beatmapNoDebounce); + Ruleset.ValueChanged += r => base.Ruleset.Value = r; if (Footer != null) { @@ -263,7 +272,7 @@ private void workingBeatmapChanged(WorkingBeatmap beatmap) // If selecting new beatmap without bypassing filters failed, there's possibly a ruleset mismatch if (beatmap?.BeatmapInfo?.Ruleset != null && beatmap.BeatmapInfo.Ruleset != Ruleset.Value) { - Ruleset.Value = beatmap.BeatmapInfo.Ruleset; + base.Ruleset.Value = beatmap.BeatmapInfo.Ruleset; Carousel.SelectBeatmap(beatmap.BeatmapInfo); } } @@ -281,16 +290,22 @@ private void updateSelectedBeatmap(BeatmapInfo beatmap) void performLoad() { + WorkingBeatmap working = Beatmap.Value; + bool preview = false; + // We may be arriving here due to another component changing the bindable Beatmap. // In these cases, the other component has already loaded the beatmap, so we don't need to do so again. if (beatmap?.Equals(Beatmap.Value.BeatmapInfo) != true) { - bool preview = beatmap?.BeatmapSetInfoID != Beatmap.Value?.BeatmapInfo.BeatmapSetInfoID; - - Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); - ensurePlayingSelected(preview); + preview = beatmap?.BeatmapSetInfoID != Beatmap.Value?.BeatmapInfo.BeatmapSetInfoID; + working = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); } + ensurePlayingSelected(preview); + + working.Mods.Value = Enumerable.Empty(); + + Beatmap.Value = working; Ruleset.Value = ruleset; UpdateBeatmap(Beatmap.Value); @@ -464,7 +479,8 @@ private void ensurePlayingSelected(bool preview = false) private void carouselBeatmapsLoaded() { - if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false && Beatmap.Value.BeatmapSetInfo?.Protected == false && Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo, false)) + if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false && Beatmap.Value.BeatmapSetInfo?.Protected == false + && Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo, false)) return; if (Carousel.SelectedBeatmapSet == null && !Carousel.SelectNextRandom()) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 56c33c47af8e..74da553bfedf 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 63c40e9051c0125aa41cdb50902873d65aca98a1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 13 Jul 2018 21:45:42 +0900 Subject: [PATCH 2/5] Remove unnecessary cache operations --- osu.Game/Screens/Select/SongSelect.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index a695aedda700..e6f33a7d297d 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -202,10 +202,6 @@ private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dia base.Ruleset.ValueChanged += r => updateSelectedBeatmap(beatmapNoDebounce); Ruleset.ValueChanged += r => base.Ruleset.Value = r; - dependencies.CacheAs(this); - dependencies.CacheAs(Ruleset); - dependencies.CacheAs>(Ruleset); - if (Footer != null) { Footer.AddButton(@"random", colours.Green, triggerRandom, Key.F2); From 4f5578245efc81f29a81a86b178150ad036ba2e7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 13 Jul 2018 21:45:49 +0900 Subject: [PATCH 3/5] Fix regression causing previews to not play --- osu.Game/Screens/Select/SongSelect.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index e6f33a7d297d..234508a1952c 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -315,13 +315,14 @@ void performLoad() working = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); } - ensurePlayingSelected(preview); working.Mods.Value = Enumerable.Empty(); Beatmap.Value = working; Ruleset.Value = ruleset; + ensurePlayingSelected(preview); + UpdateBeatmap(Beatmap.Value); } From b967fe714b8ef7b13c6266efe52043ad94a488d1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 17 Jul 2018 14:29:22 +0900 Subject: [PATCH 4/5] Fix lead-in time now being long enough in many cases --- osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs | 10 ++++++++++ osu.Game/Rulesets/UI/RulesetContainer.cs | 6 ++++++ osu.Game/Screens/Play/Player.cs | 7 +++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs index 33d4e1666273..c18d18078303 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Linq; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; using OpenTK; @@ -46,6 +47,15 @@ protected override DrawableHitObject GetVisualRepresentation(OsuHi protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuReplayInputHandler(replay); + public override double GameplayStartTime + { + get + { + var first = (OsuHitObject)Objects.First(); + return first.StartTime - first.TimePreempt; + } + } + protected override Vector2 GetAspectAdjustedSize() { var aspectSize = DrawSize.X * 0.75f < DrawSize.Y ? new Vector2(DrawSize.X, DrawSize.X * 0.75f) : new Vector2(DrawSize.Y * 4f / 3f, DrawSize.Y); diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 0bfde148e74d..d68afdfedc4b 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -56,6 +56,12 @@ public abstract class RulesetContainer : Container public abstract IEnumerable Objects { get; } + /// + /// The point in time at which gameplay starts, including any required lead-in for display purposes. + /// Defaults to two seconds before the first . Override as necessary. + /// + public virtual double GameplayStartTime => Objects.First().StartTime - 2000; + private readonly Lazy playfield; /// diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 49a180902bce..fc439a48c5e0 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -138,10 +138,9 @@ private void load(AudioManager audio, APIAccess api, OsuConfigManager config) sourceClock = (IAdjustableClock)working.Track ?? new StopwatchClock(); adjustableClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; - var firstObjectTime = RulesetContainer.Objects.First().StartTime; adjustableClock.Seek(AllowLeadIn - ? Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn)) - : firstObjectTime); + ? Math.Min(RulesetContainer.GameplayStartTime, beatmap.HitObjects.First().StartTime - beatmap.BeatmapInfo.AudioLeadIn) + : RulesetContainer.GameplayStartTime); adjustableClock.ProcessFrame(); @@ -199,7 +198,7 @@ private void load(AudioManager audio, APIAccess api, OsuConfigManager config) Anchor = Anchor.Centre, Origin = Anchor.Centre }, - new SkipOverlay(firstObjectTime) + new SkipOverlay(RulesetContainer.GameplayStartTime) { Clock = Clock, // skip button doesn't want to use the audio clock directly ProcessCustomClock = false, From 827c5c4939e1a2abbcc5888fe9754f2a9fd1e086 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 17 Jul 2018 15:14:03 +0900 Subject: [PATCH 5/5] Remove scroll direction from ScrolingPlayfield constructor --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 4 +++- osu.Game.Rulesets.Mania.Tests/TestCaseColumn.cs | 2 +- osu.Game.Rulesets.Mania.Tests/TestCaseStage.cs | 2 +- osu.Game.Rulesets.Mania/UI/Column.cs | 3 +-- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 6 ++---- osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaScrollingPlayfield.cs | 5 ----- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 5 ++--- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 3 ++- osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs | 1 - osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs | 7 ++++--- 11 files changed, 17 insertions(+), 23 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 9eca8f687157..ea3b6fb0e0e5 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -23,8 +23,10 @@ public class CatchPlayfield : ScrollingPlayfield private readonly CatcherArea catcherArea; public CatchPlayfield(BeatmapDifficulty difficulty, Func> getVisualRepresentation) - : base(ScrollingDirection.Down, BASE_WIDTH) + : base(BASE_WIDTH) { + Direction.Value = ScrollingDirection.Down; + Container explodingFruitContainer; Anchor = Anchor.TopCentre; diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseColumn.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseColumn.cs index de2bfaed9c21..cceee718ca06 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestCaseColumn.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestCaseColumn.cs @@ -86,7 +86,7 @@ private void createHoldNote() private Drawable createColumn(ScrollingDirection direction, ManiaAction action) { - var column = new Column(direction) + var column = new Column { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseStage.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseStage.cs index 8046c46fc10f..b1bb7f5187cf 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestCaseStage.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestCaseStage.cs @@ -105,7 +105,7 @@ private Drawable createStage(ScrollingDirection direction, ManiaAction action) { var specialAction = ManiaAction.Special1; - var stage = new ManiaStage(direction, 0, new StageDefinition { Columns = 2 }, ref action, ref specialAction) { VisibleTimeRange = { Value = 2000 } }; + var stage = new ManiaStage(0, new StageDefinition { Columns = 2 }, ref action, ref specialAction) { VisibleTimeRange = { Value = 2000 } }; stages.Add(stage); return new ScrollingTestContainer(direction) diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 84652580551f..063531da4525 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -32,8 +32,7 @@ public class Column : ManiaScrollingPlayfield, IKeyBindingHandler, protected override Container Content => hitObjectArea; - public Column(ScrollingDirection direction) - : base(direction) + public Column() { RelativeSizeAxes = Axes.Y; Width = column_width; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 2f8ad7b17ef9..d6781a6e8fcd 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -12,7 +12,6 @@ using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Mania.Configuration; -using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Mania.UI { @@ -21,8 +20,7 @@ public class ManiaPlayfield : ManiaScrollingPlayfield public List Columns => stages.SelectMany(x => x.Columns).ToList(); private readonly List stages = new List(); - public ManiaPlayfield(ScrollingDirection direction, List stageDefinitions) - : base(direction) + public ManiaPlayfield(List stageDefinitions) { if (stageDefinitions == null) throw new ArgumentNullException(nameof(stageDefinitions)); @@ -42,7 +40,7 @@ public ManiaPlayfield(ScrollingDirection direction, List stageD int firstColumnIndex = 0; for (int i = 0; i < stageDefinitions.Count; i++) { - var newStage = new ManiaStage(direction, firstColumnIndex, stageDefinitions[i], ref normalColumnAction, ref specialColumnAction); + var newStage = new ManiaStage(firstColumnIndex, stageDefinitions[i], ref normalColumnAction, ref specialColumnAction); newStage.VisibleTimeRange.BindTo(VisibleTimeRange); playfieldGrid.Content[0][i] = newStage; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index abc970511940..aaa4505b5e01 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -87,7 +87,7 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl return dependencies; } - protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(scrollingInfo.Direction, Beatmap.Stages) + protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.Stages) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game.Rulesets.Mania/UI/ManiaScrollingPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaScrollingPlayfield.cs index f1ff0665cd06..4d6c5a747a3c 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaScrollingPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaScrollingPlayfield.cs @@ -11,11 +11,6 @@ public class ManiaScrollingPlayfield : ScrollingPlayfield { private readonly IBindable direction = new Bindable(); - public ManiaScrollingPlayfield(ScrollingDirection direction) - : base(direction) - { - } - [BackgroundDependencyLoader] private void load(IScrollingInfo scrollingInfo) { diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index 4c7deb45674f..a0ff8780adf0 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -43,8 +43,7 @@ internal class ManiaStage : ManiaScrollingPlayfield private readonly int firstColumnIndex; - public ManiaStage(ScrollingDirection direction, int firstColumnIndex, StageDefinition definition, ref ManiaAction normalColumnStartAction, ref ManiaAction specialColumnStartAction) - : base(direction) + public ManiaStage(int firstColumnIndex, StageDefinition definition, ref ManiaAction normalColumnStartAction, ref ManiaAction specialColumnStartAction) { this.firstColumnIndex = firstColumnIndex; @@ -124,7 +123,7 @@ public ManiaStage(ScrollingDirection direction, int firstColumnIndex, StageDefin for (int i = 0; i < definition.Columns; i++) { var isSpecial = definition.IsSpecialColumn(i); - var column = new Column(direction) + var column = new Column { IsSpecial = isSpecial, Action = { Value = isSpecial ? specialColumnStartAction++ : normalColumnStartAction++ } diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 7fdd3cd1e218..a47c433631bb 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -58,8 +58,9 @@ public class TaikoPlayfield : ScrollingPlayfield private readonly Box background; public TaikoPlayfield(ControlPointInfo controlPoints) - : base(ScrollingDirection.Left) { + Direction.Value = ScrollingDirection.Left; + AddRangeInternal(new Drawable[] { backgroundContainer = new Container diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 9b48ec17bd54..bbc9d2b8601f 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -117,7 +117,6 @@ private class TestPlayfield : ScrollingPlayfield public new readonly ScrollingDirection Direction; public TestPlayfield(ScrollingDirection direction) - : base(direction) { Direction = direction; diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs index cfcfca157bc2..7146ad8064a6 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs @@ -57,22 +57,23 @@ public abstract class ScrollingPlayfield : Playfield, IKeyBindingHandler public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)base.HitObjects; + /// + /// The direction in which s in this should scroll. + /// protected readonly Bindable Direction = new Bindable(); /// /// Creates a new . /// - /// The direction in which s in this container should scroll. /// The width to scale the internal coordinate space to. /// May be null if scaling based on is desired. If is also null, no scaling will occur. /// /// The height to scale the internal coordinate space to. /// May be null if scaling based on is desired. If is also null, no scaling will occur. /// - protected ScrollingPlayfield(ScrollingDirection direction, float? customWidth = null, float? customHeight = null) + protected ScrollingPlayfield(float? customWidth = null, float? customHeight = null) : base(customWidth, customHeight) { - Direction.Value = direction; } [BackgroundDependencyLoader]