mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Disallow selecting storage root as a valid directory.
This commit is contained in:
@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
/// <param name="directory">The selected directory</param>
|
/// <param name="directory">The selected directory</param>
|
||||||
protected abstract void OnSelection(DirectoryInfo directory);
|
protected abstract void OnSelection(DirectoryInfo directory);
|
||||||
|
|
||||||
protected virtual bool IsValidDirectory(DirectoryInfo info) => info != null;
|
protected virtual bool IsValidDirectory(DirectoryInfo info) => true;
|
||||||
|
|
||||||
protected virtual DirectoryInfo InitialPath => null;
|
protected virtual DirectoryInfo InitialPath => null;
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
if (InitialPath != null)
|
if (InitialPath != null)
|
||||||
directorySelector.CurrentPath.Value = InitialPath;
|
directorySelector.CurrentPath.Value = InitialPath;
|
||||||
|
|
||||||
directorySelector.CurrentPath.BindValueChanged(e => selectionButton.Enabled.Value = IsValidDirectory(e.NewValue), true);
|
directorySelector.CurrentPath.BindValueChanged(e => selectionButton.Enabled.Value = e.NewValue != null ? IsValidDirectory(e.NewValue) : false, true);
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user