Skip to content

Commit

Permalink
Simplify scroll speed point display code now that it only serves one …
Browse files Browse the repository at this point in the history
…purpose
  • Loading branch information
peppy committed Aug 31, 2024
1 parent 225418d commit 6b8b49e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 44 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
Expand All @@ -15,6 +16,8 @@ public partial class GroupVisualisation : CompositeDrawable

private readonly IBindableList<ControlPoint> controlPoints = new BindableList<ControlPoint>();

private bool showScrollSpeed;

public GroupVisualisation(ControlPointGroup group)
{
RelativePositionAxes = Axes.X;
Expand All @@ -24,8 +27,13 @@ public GroupVisualisation(ControlPointGroup group)

Group = group;
X = (float)group.Time;
}

[BackgroundDependencyLoader]
private void load(EditorBeatmap beatmap)
{
showScrollSpeed = beatmap.BeatmapInfo.Ruleset.CreateInstance().EditorShowScrollSpeed;

// Run in constructor so IsRedundant calls can work correctly.
controlPoints.BindTo(Group.ControlPoints);
controlPoints.BindCollectionChanged((_, _) =>
{
Expand All @@ -47,8 +55,15 @@ public GroupVisualisation(ControlPointGroup group)
});
break;

case EffectControlPoint effect:
AddInternal(new EffectPointVisualisation(effect));
case EffectControlPoint:
if (!showScrollSpeed)
return;

AddInternal(new ControlPointVisualisation(point)
{
// importantly, override the x position being set since we do that above.
X = 0,
});
break;
}
}
Expand Down

0 comments on commit 6b8b49e

Please sign in to comment.