diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index b3139fa..d7ad29c 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -399,6 +399,12 @@ namespace GameLauncher }); }, ct: ct); + + this.Dispatcher.Invoke(() => + { + this.UpdateStatusLabels(); + this._gamesView.Refresh(); + }); } // 2-2. 差分スキャン(新規フォルダの走査) @@ -2209,4 +2215,3 @@ namespace GameLauncher #endregion } } - diff --git a/Services/GameScannerService.cs b/Services/GameScannerService.cs index 97539e5..f73d759 100644 --- a/Services/GameScannerService.cs +++ b/Services/GameScannerService.cs @@ -54,6 +54,7 @@ namespace GameLauncher.Services public int TkoolEngineType { get; set; } public bool HasCustomApplyMod { get; set; } public bool ApplyMod { get; set; } = true; + public bool IsModded { get; set; } public Dictionary? PluginSettings { get; set; } public bool IsAsar { get; set; } public bool IsAsarExtracted { get; set; } @@ -198,7 +199,7 @@ namespace GameLauncher.Services LastLaunched = entry.LastLaunched, FolderLastModified = entry.FolderLastModified, IsBookmarked = entry.IsBookmarked, - IsModded = false, + IsModded = entry.IsModded, IsAsar = entry.IsAsar, IsAsarExtracted = entry.IsAsarExtracted, AsarPath = entry.AsarPath, @@ -471,6 +472,7 @@ namespace GameLauncher.Services TkoolEngineType = (int)tg.EngineType, HasCustomApplyMod = tg.HasCustomApplyMod, ApplyMod = tg.ApplyMod, + IsModded = tg.IsModded, PluginSettings = tg.PluginSettings.Count > 0 ? tg.PluginSettings : null, IsAsar = tg.IsAsar, IsAsarExtracted = tg.IsAsarExtracted, @@ -637,14 +639,45 @@ namespace GameLauncher.Services onProgress(current, total, $"実在検証中... ({current}/{total})"); } - // 実在検証 - if (!Directory.Exists(game.RootDirectory)) + // 実在検証および更新日時の取得 + DateTime currentLastWrite; + try + { + if (!Directory.Exists(game.RootDirectory)) + { + onGameRemoved(game); + Interlocked.Exchange(ref cacheNeedsSave, 1); + return; + } + currentLastWrite = Directory.GetLastWriteTime(game.RootDirectory); + } + catch { - onGameRemoved(game); - Interlocked.Exchange(ref cacheNeedsSave, 1); return; } + // キャッシュのフォルダ更新日時と完全一致している場合、内部構成(exe/plugins/アーカイブ/EVB等)は不変のため + // 重いディスクI/O(EVBバイナリ解析、plugins.js読み取り、wolf走査等)を完全にスキップして超高速化 + bool isUnchanged = game.FolderLastModified.HasValue && game.FolderLastModified.Value == currentLastWrite; + if (isUnchanged) + { + // 未ロードのアイコンのみ必要に応じてロード + if (game.IconImage == null) + { + var icon = LoadIcon(game.ExecutablePath, game.RootDirectory); + if (icon != null) + { + game.IconImage = icon; + onGameUpdated(game); + } + } + return; + } + + // 更新があった、または初回検証の場合は更新日時を最新化 + game.FolderLastModified = currentLastWrite; + Interlocked.Exchange(ref cacheNeedsSave, 1); + if (game is UnityGameItem ug) { if (!File.Exists(ug.ExecutablePath))