Merge pull request #12271 from hbnrmx/filechooser-preselect-folder

Open editor file selector in the directory of the previous selection
This commit is contained in:
Dean Herbert 2021-04-03 14:31:19 +09:00 committed by GitHub
commit dc3163ccf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -54,7 +54,7 @@ namespace osu.Game.Screens.Edit.Setup
{
FileSelector fileSelector;
Target.Child = fileSelector = new FileSelector(validFileExtensions: ResourcesSection.AudioExtensions)
Target.Child = fileSelector = new FileSelector(currentFile.Value?.DirectoryName, ResourcesSection.AudioExtensions)
{
RelativeSizeAxes = Axes.X,
Height = 400,

View File

@ -73,7 +73,8 @@ namespace osu.Game.Screens.Edit.Setup
audioTrackTextBox = new FileChooserLabelledTextBox
{
Label = "Audio Track",
Current = { Value = working.Value.Metadata.AudioFile ?? "Click to select a track" },
PlaceholderText = "Click to select a track",
Current = { Value = working.Value.Metadata.AudioFile },
Target = audioTrackFileChooserContainer,
TabbableContentContainer = this
},