mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Create InitialPath property.
This commit is contained in:
@ -34,6 +34,8 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
|
|
||||||
protected virtual bool IsValidDirectory(DirectoryInfo info) => info != null;
|
protected virtual bool IsValidDirectory(DirectoryInfo info) => info != null;
|
||||||
|
|
||||||
|
protected virtual DirectoryInfo InitialPath => null;
|
||||||
|
|
||||||
public override bool AllowExternalScreenChange => false;
|
public override bool AllowExternalScreenChange => false;
|
||||||
|
|
||||||
public override bool DisallowExternalBeatmapRulesetChanges => true;
|
public override bool DisallowExternalBeatmapRulesetChanges => true;
|
||||||
@ -101,6 +103,9 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
|
if (InitialPath != null)
|
||||||
|
DirectorySelector.CurrentPath.Value = InitialPath;
|
||||||
|
|
||||||
DirectorySelector.CurrentPath.BindValueChanged(e => selectionButton.Enabled.Value = IsValidDirectory(e.NewValue), true);
|
DirectorySelector.CurrentPath.BindValueChanged(e => selectionButton.Enabled.Value = IsValidDirectory(e.NewValue), true);
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private Storage storage { get; set; }
|
private Storage storage { get; set; }
|
||||||
|
|
||||||
|
protected override DirectoryInfo InitialPath => new DirectoryInfo(storage.GetFullPath(string.Empty)).Parent;
|
||||||
|
|
||||||
protected override OsuSpriteText CreateHeader() => new OsuSpriteText
|
protected override OsuSpriteText CreateHeader() => new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = "Please select a new location",
|
Text = "Please select a new location",
|
||||||
@ -42,12 +44,6 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
BeginMigration(target);
|
BeginMigration(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
DirectorySelector.CurrentPath.Value = new DirectoryInfo(storage.GetFullPath(string.Empty)).Parent;
|
|
||||||
base.LoadComplete();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void BeginMigration(DirectoryInfo target) => this.Push(new MigrationRunScreen(target));
|
protected virtual void BeginMigration(DirectoryInfo target) => this.Push(new MigrationRunScreen(target));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user