Add basic track reloading support while inside the editor

This commit is contained in:
Dean Herbert
2020-09-24 18:55:49 +09:00
parent 65e6dd2ac3
commit 978f6edf38
4 changed files with 38 additions and 4 deletions

View File

@ -18,6 +18,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.IO;
using osu.Game.Overlays;
using osuTK;
using FileInfo = System.IO.FileInfo;
@ -139,6 +140,12 @@ namespace osu.Game.Screens.Edit.Setup
[Resolved]
private FileStore files { get; set; }
[Resolved]
private MusicController music { get; set; }
[Resolved]
private Editor editor { get; set; }
private void audioTrackChanged(ValueChangedEvent<string> filePath)
{
var info = new FileInfo(filePath.NewValue);
@ -173,6 +180,10 @@ namespace osu.Game.Screens.Edit.Setup
});
Beatmap.Value.Metadata.AudioFile = info.Name;
music.ForceReloadCurrentBeatmap();
editor.UpdateClockSource();
}
private void onCommit(TextBox sender, bool newText)