-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always show control points in timing mode #29196
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,15 +82,16 @@ public Timeline(Drawable userContent) | |
private Container mainContent; | ||
|
||
private Bindable<float> waveformOpacity; | ||
private Bindable<bool> controlPointsVisible; | ||
private Bindable<bool> alwaysShowControlPoints; | ||
private readonly Bindable<bool> controlPointsVisible = new Bindable<bool>(); | ||
private Bindable<bool> ticksVisible; | ||
|
||
private double trackLengthForZoom; | ||
|
||
private readonly IBindable<Track> track = new Bindable<Track>(); | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(IBindable<WorkingBeatmap> beatmap, OsuColour colours, OsuConfigManager config) | ||
private void load(IBindable<WorkingBeatmap> beatmap, OsuColour colours, OsuConfigManager config, Editor editor) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{ | ||
CentreMarker centreMarker; | ||
|
||
|
@@ -141,9 +142,13 @@ private void load(IBindable<WorkingBeatmap> beatmap, OsuColour colours, OsuConfi | |
}); | ||
|
||
waveformOpacity = config.GetBindable<float>(OsuSetting.EditorWaveformOpacity); | ||
controlPointsVisible = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTimingChanges); | ||
ticksVisible = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTicks); | ||
|
||
alwaysShowControlPoints = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTimingChanges); | ||
alwaysShowControlPoints.BindValueChanged(_ => updateControlPointsVisible(editor)); | ||
editor.Mode.BindValueChanged(_ => updateControlPointsVisible(editor)); | ||
updateControlPointsVisible(editor); | ||
|
||
track.BindTo(editorClock.Track); | ||
track.BindValueChanged(_ => | ||
{ | ||
|
@@ -154,6 +159,11 @@ private void load(IBindable<WorkingBeatmap> beatmap, OsuColour colours, OsuConfi | |
Zoom = (float)(defaultTimelineZoom * editorBeatmap.BeatmapInfo.TimelineZoom); | ||
} | ||
|
||
private void updateControlPointsVisible(Editor editor) | ||
{ | ||
controlPointsVisible.Value = alwaysShowControlPoints.Value || editor.Mode.Value == EditorScreenMode.Timing; | ||
} | ||
|
||
private void applyVisualOffset(IBindable<WorkingBeatmap> beatmap) | ||
{ | ||
waveform.RelativePositionAxes = Axes.X; | ||
|
@@ -176,25 +186,29 @@ protected override void LoadComplete() | |
|
||
ticksVisible.BindValueChanged(visible => ticks.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint), true); | ||
|
||
controlPointsVisible.BindValueChanged(visible => | ||
alwaysShowControlPoints.BindValueChanged(visible => | ||
{ | ||
if (visible.NewValue) | ||
{ | ||
this.ResizeHeightTo(timeline_expanded_height, 200, Easing.OutQuint); | ||
mainContent.MoveToY(15, 200, Easing.OutQuint); | ||
|
||
// delay the fade in else masking looks weird. | ||
controlPoints.Delay(180).FadeIn(400, Easing.OutQuint); | ||
} | ||
else | ||
{ | ||
controlPoints.FadeOut(200, Easing.OutQuint); | ||
|
||
// likewise, delay the resize until the fade is complete. | ||
// delay the resize until the fade is complete. | ||
this.Delay(180).ResizeHeightTo(timeline_height, 200, Easing.OutQuint); | ||
mainContent.Delay(180).MoveToY(0, 200, Easing.OutQuint); | ||
} | ||
}, true); | ||
|
||
controlPointsVisible.BindValueChanged(visible => | ||
{ | ||
if (visible.NewValue) | ||
// delay the fade in else masking looks weird. | ||
controlPoints.Delay(180).FadeIn(400, Easing.OutQuint); | ||
else | ||
controlPoints.FadeOut(200, Easing.OutQuint); | ||
}, true); | ||
} | ||
|
||
private void updateWaveformOpacity() => | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this new bindable, and can revert basically all your changes.
In the original
controlPointsVisible.BindValueChanged
you can just check the current editor mode and react there. Although one may argue this is too much local knowledge and the editor should be setting the value on the timeline, not vice-versa.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm unclear on how this would work, do you mind explaining to me why this is the case?
suppose we have the case of:
if we don't create a bindable on mode state, at what point can code trigger at action (5) to correctly hide the config? is there a lifecycle thing here i'm missing..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check #29211, I've redone this feature in a slightly simpler way.