fix convert game path

This commit is contained in:
DismissedLight
2024-01-06 20:03:14 +08:00
parent d3444a9435
commit 2698761594
2 changed files with 12 additions and 2 deletions

View File

@@ -43,8 +43,7 @@ internal sealed class LaunchExecutionEnsureGameResourceHandler : ILaunchExecutio
}
await context.TaskContext.SwitchToMainThreadAsync();
ImmutableList<GamePathEntry> gamePathEntries = context.Options.GetGamePathEntries(out GamePathEntry? selected);
context.ViewModel.SetGamePathEntriesAndSelectedGamePathEntry(gamePathEntries, selected);
context.UpdateGamePathEntry();
}
}

View File

@@ -2,8 +2,10 @@
// Licensed under the MIT license.
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Service.Game.PathAbstraction;
using Snap.Hutao.Service.Game.Scheme;
using Snap.Hutao.ViewModel.Game;
using System.Collections.Immutable;
namespace Snap.Hutao.Service.Game.Launching;
@@ -68,4 +70,13 @@ internal sealed partial class LaunchExecutionContext
this.gameFileSystem = gameFileSystem;
return true;
}
public void UpdateGamePathEntry()
{
ImmutableList<GamePathEntry> gamePathEntries = Options.GetGamePathEntries(out GamePathEntry? selectedEntry);
ViewModel.SetGamePathEntriesAndSelectedGamePathEntry(gamePathEntries, selectedEntry);
// invalidate game file system
gameFileSystem = null;
}
}