mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 16:43:52 +09:00
Fix disabled bindable woes by not using TimingControlPoint.DEFAULT
This commit is contained in:
@ -34,7 +34,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
private IBindable<WorkingBeatmap> beatmap { get; set; } = null!;
|
private IBindable<WorkingBeatmap> beatmap { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private Bindable<ControlPointGroup> selectedGroup { get; set; } = null!;
|
private Bindable<ControlPointGroup?> selectedGroup { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorClock editorClock { get; set; } = null!;
|
private EditorClock editorClock { get; set; } = null!;
|
||||||
@ -46,6 +46,8 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
private int lastDisplayedBeatIndex;
|
private int lastDisplayedBeatIndex;
|
||||||
|
|
||||||
|
private double offsetZeroTime => selectedGroup.Value?.Time ?? 0;
|
||||||
|
|
||||||
public WaveformComparisonDisplay()
|
public WaveformComparisonDisplay()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
@ -93,10 +95,10 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
beatLength.BindValueChanged(_ => showFrom(lastDisplayedBeatIndex), true);
|
beatLength.BindValueChanged(_ => showFrom(lastDisplayedBeatIndex), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectedGroupChanged(ValueChangedEvent<ControlPointGroup> group)
|
private void selectedGroupChanged(ValueChangedEvent<ControlPointGroup?> group)
|
||||||
{
|
{
|
||||||
timingPoint = selectedGroup.Value?.ControlPoints.OfType<TimingControlPoint>().FirstOrDefault()
|
timingPoint = selectedGroup.Value?.ControlPoints.OfType<TimingControlPoint>().FirstOrDefault()
|
||||||
?? TimingControlPoint.DEFAULT;
|
?? new TimingControlPoint();
|
||||||
|
|
||||||
beatLength.UnbindBindings();
|
beatLength.UnbindBindings();
|
||||||
beatLength.BindTo(timingPoint.BeatLengthBindable);
|
beatLength.BindTo(timingPoint.BeatLengthBindable);
|
||||||
@ -120,7 +122,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
if (!IsHovered)
|
if (!IsHovered)
|
||||||
{
|
{
|
||||||
int beatOffset = (int)Math.Max(0, ((editorClock.CurrentTime - selectedGroup.Value.Time) / timingPoint.BeatLength));
|
int beatOffset = (int)Math.Max(0, ((editorClock.CurrentTime - offsetZeroTime) / timingPoint.BeatLength));
|
||||||
|
|
||||||
showFrom(beatOffset);
|
showFrom(beatOffset);
|
||||||
}
|
}
|
||||||
@ -138,7 +140,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
foreach (var waveform in InternalChildren.OfType<WaveformGraph>())
|
foreach (var waveform in InternalChildren.OfType<WaveformGraph>())
|
||||||
{
|
{
|
||||||
// offset to the required beat index.
|
// offset to the required beat index.
|
||||||
float offset = (float)(selectedGroup.Value.Time + (beatIndex * timingPoint.BeatLength - (visible_width / 2))) / trackLength * scale;
|
float offset = (float)(offsetZeroTime + (beatIndex * timingPoint.BeatLength - (visible_width / 2))) / trackLength * scale;
|
||||||
|
|
||||||
waveform.X = -offset;
|
waveform.X = -offset;
|
||||||
waveform.Scale = new Vector2(scale, 1);
|
waveform.Scale = new Vector2(scale, 1);
|
||||||
|
Reference in New Issue
Block a user