mirror of
https://github.com/ppy/osu
synced 2025-02-03 03:42:15 +00:00
Revert wrong not-null track changes
This reverts commitf9d99a9882
. This reverts commit71547bece0
.
This commit is contained in:
parent
71547bece0
commit
37f44d2e37
@ -298,7 +298,6 @@ namespace osu.Game.Beatmaps
|
||||
/// Get the loaded audio track instance. <see cref="LoadTrack"/> must have first been called.
|
||||
/// This generally happens via MusicController when changing the global beatmap.
|
||||
/// </summary>
|
||||
[NotNull]
|
||||
public Track Track
|
||||
{
|
||||
get
|
||||
|
@ -17,6 +17,7 @@ using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
@ -306,7 +307,11 @@ namespace osu.Game.Screens.Edit
|
||||
/// <summary>
|
||||
/// If the beatmap's track has changed, this method must be called to keep the editor in a valid state.
|
||||
/// </summary>
|
||||
public void UpdateClockSource() => clock.ChangeSource(Beatmap.Value.Track);
|
||||
public void UpdateClockSource()
|
||||
{
|
||||
var sourceClock = (IAdjustableClock)Beatmap.Value.Track ?? new StopwatchClock();
|
||||
clock.ChangeSource(sourceClock);
|
||||
}
|
||||
|
||||
protected void Save()
|
||||
{
|
||||
@ -577,7 +582,7 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
private void resetTrack(bool seekToStart = false)
|
||||
{
|
||||
Beatmap.Value.Track.Stop();
|
||||
Beatmap.Value.Track?.Stop();
|
||||
|
||||
if (seekToStart)
|
||||
{
|
||||
|
@ -4,6 +4,7 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Screens.Edit;
|
||||
@ -45,7 +46,7 @@ namespace osu.Game.Tests.Visual
|
||||
private void beatmapChanged(ValueChangedEvent<WorkingBeatmap> e)
|
||||
{
|
||||
Clock.ControlPointInfo = e.NewValue.Beatmap.ControlPointInfo;
|
||||
Clock.ChangeSource(e.NewValue.Track);
|
||||
Clock.ChangeSource((IAdjustableClock)e.NewValue.Track ?? new StopwatchClock());
|
||||
Clock.ProcessFrame();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user