Add "onCurrentDirectoryChanged"

This commit is contained in:
MATRIX-feather 2020-12-04 19:52:25 +08:00
parent fb080284d2
commit 7104230ae3

View File

@ -126,15 +126,17 @@ namespace osu.Game.Screens.Import
fileNameScroll.ScrollContent.Origin = Anchor.Centre;
currentFile.BindValueChanged(updateFileSelectionText, true);
currentDirectory.BindValueChanged(_ =>
{
currentFile.Value = null;
});
currentDirectory.BindValueChanged(onCurrentDirectoryChanged);
currentDirectory.BindTo(fileSelector.CurrentPath);
currentFile.BindTo(fileSelector.CurrentFile);
}
private void onCurrentDirectoryChanged(ValueChangedEvent<DirectoryInfo> v)
{
currentFile.Value = null;
}
private void updateFileSelectionText(ValueChangedEvent<FileInfo> v)
{
currentFileText.Text = v.NewValue?.Name ?? "Select a file";