機能追加: Bakin・NW.jsエンジンおよびセーブ編集対応、ES3パスワード解決機能とRPGツクールMZ修正サービスの追加
This commit is contained in:
1 parent
f50976a6c0
commit
152abae1f8
33 files changed
+11356
-175
No files matched your search
+217
-8
@@ -24,6 +24,7 @@ using GameLauncher.Engines.Tyrano;
|
||||
using GameLauncher.Engines.Wolf;
|
||||
using GameLauncher.Engines.Unity;
|
||||
using GameLauncher.Engines.Nwjs;
|
||||
using GameLauncher.Engines.Bakin;
|
||||
using GameLauncher.Engines.Common;
|
||||
using GameLauncher.Engines.Evb;
|
||||
|
||||
@@ -150,6 +151,7 @@ namespace GameLauncher
|
||||
case 8: this.tabSrpg.IsChecked = true; break;
|
||||
case 9: this.tabNwjs.IsChecked = true; break;
|
||||
case 10: this.tabOther.IsChecked = true; break;
|
||||
case 11: this.tabBakin.IsChecked = true; break;
|
||||
default: this.tabAll.IsChecked = true; break;
|
||||
}
|
||||
|
||||
@@ -185,6 +187,7 @@ namespace GameLauncher
|
||||
else if (this.tabWolf.IsChecked == true) tabIndex = 7;
|
||||
else if (this.tabSrpg.IsChecked == true) tabIndex = 8;
|
||||
else if (this.tabNwjs.IsChecked == true) tabIndex = 9;
|
||||
else if (this.tabBakin.IsChecked == true) tabIndex = 11;
|
||||
else if (this.tabOther.IsChecked == true) tabIndex = 10;
|
||||
|
||||
this._config.SelectedTab = tabIndex;
|
||||
@@ -245,6 +248,15 @@ namespace GameLauncher
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var nwjsPlugin in TkoolGameItem.DefaultNwjsPlugins)
|
||||
{
|
||||
if (!this._config.DefaultPluginSettings.ContainsKey(nwjsPlugin.Id))
|
||||
{
|
||||
this._config.DefaultPluginSettings[nwjsPlugin.Id] = nwjsPlugin.DefaultEnabled;
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var rgssPlugin in TkoolGameItem.DefaultRgssPlugins)
|
||||
{
|
||||
if (!this._config.DefaultPluginSettings.ContainsKey(rgssPlugin.Id))
|
||||
@@ -331,6 +343,7 @@ namespace GameLauncher
|
||||
int wolfCount = this._games.Count(g => g is TkoolGameItem tg && tg.IsWolf);
|
||||
int srpgCount = this._games.Count(g => g is TkoolGameItem tg && tg.IsSrpgStudio);
|
||||
int nwjsCount = this._games.Count(g => g is TkoolGameItem tg && tg.IsNwjs);
|
||||
int bakinCount = this._games.Count(g => g is TkoolGameItem tg && tg.IsBakin);
|
||||
int unityCount = this._games.Count(g => g is UnityGameItem);
|
||||
|
||||
this.AppendLog($"キャッシュから計 {this._games.Count} 件(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, SRPG Studio: {srpgCount}, NW.js: {nwjsCount}, Unity: {unityCount})を即時表示しました。(待たずに即起動可能です)");
|
||||
@@ -577,6 +590,10 @@ namespace GameLauncher
|
||||
{
|
||||
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.Nwjs) return false;
|
||||
}
|
||||
else if (this.tabBakin.IsChecked == true)
|
||||
{
|
||||
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.Bakin) return false;
|
||||
}
|
||||
else if (this.tabOther.IsChecked == true)
|
||||
{
|
||||
if (!game.IsOther) return false;
|
||||
@@ -588,7 +605,7 @@ namespace GameLauncher
|
||||
if (this.chkFilterAsarOnly.IsChecked == true && (game is not TkoolGameItem tgAsar || !tgAsar.IsAsar)) return false;
|
||||
if (this.chkFilterRgssOnly.IsChecked == true && (game is not TkoolGameItem tgRgss || !tgRgss.HasRgssArchive)) return false;
|
||||
if (this.chkFilterSrpgOnly.IsChecked == true && (game is not TkoolGameItem tgSrpg || !tgSrpg.HasSrpgArchive)) return false;
|
||||
if (this.chkFilterSaveOnly.IsChecked == true && (game is not UnityGameItem ugSave || !ugSave.HasSaveData)) return false;
|
||||
if (this.chkFilterSaveOnly.IsChecked == true && !game.HasSaveData) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -643,18 +660,19 @@ namespace GameLauncher
|
||||
|
||||
int total = this._games.Count;
|
||||
int visible = this._gamesView?.Count ?? 0;
|
||||
int tkoolCount = this._games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano && !tg.IsRgss && !tg.IsWolf && !tg.IsSrpgStudio && !tg.IsNwjs && !tg.IsOther);
|
||||
int tkoolCount = this._games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano && !tg.IsRgss && !tg.IsWolf && !tg.IsSrpgStudio && !tg.IsNwjs && !tg.IsBakin && !tg.IsOther);
|
||||
int rgssCount = this._games.Count(g => g is TkoolGameItem tg && tg.IsRgss);
|
||||
int tyranoCount = this._games.Count(g => g is TkoolGameItem tg && tg.EngineType == TkoolEngineType.Tyrano);
|
||||
int wolfCount = this._games.Count(g => g is TkoolGameItem tg && tg.IsWolf);
|
||||
int srpgCount = this._games.Count(g => g is TkoolGameItem tg && tg.IsSrpgStudio);
|
||||
int nwjsCount = this._games.Count(g => g is TkoolGameItem tg && tg.IsNwjs);
|
||||
int bakinCount = this._games.Count(g => g is TkoolGameItem tg && tg.IsBakin);
|
||||
int unityCount = this._games.Count(g => g is UnityGameItem);
|
||||
int otherCount = this._games.Count(g => g.IsOther);
|
||||
int bookmarkCount = this._games.Count(g => g.IsBookmarked);
|
||||
|
||||
this.lblStatusSummary.Text = $"総ゲーム数: {total} 件 | 表示: {visible} 件 | ★ ブックマーク: {bookmarkCount} 件";
|
||||
this.lblStatusBreakdown.Text = $"(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, SRPG Studio: {srpgCount}, NW.js: {nwjsCount}, Unity: {unityCount}, その他: {otherCount})";
|
||||
this.lblStatusBreakdown.Text = $"(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, SRPG Studio: {srpgCount}, NW.js: {nwjsCount}, Bakin: {bakinCount}, Unity: {unityCount}, その他: {otherCount})";
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -732,14 +750,19 @@ namespace GameLauncher
|
||||
? tkoolItem.ResolveLaunchExecutable()
|
||||
: game.ExecutablePath;
|
||||
|
||||
// 直下にexeが無い場合やパスが変わっていた場合はサブフォルダ内を再探索して救済
|
||||
if (string.IsNullOrEmpty(effectiveExe) || !File.Exists(effectiveExe))
|
||||
// 直下にexeが無い場合やパスが変わっていた場合、または補助exe(notification_helper.exe等)だった場合は再探索して救済
|
||||
if (string.IsNullOrEmpty(effectiveExe) || !File.Exists(effectiveExe) || GameScannerService.IsExcludedExe(effectiveExe))
|
||||
{
|
||||
var foundExe = GameScannerService.FindGameExecutable(game.RootDirectory);
|
||||
if (!string.IsNullOrEmpty(foundExe) && File.Exists(foundExe))
|
||||
{
|
||||
effectiveExe = foundExe;
|
||||
game.ExecutablePath = foundExe;
|
||||
var refreshedIcon = GameScannerService.LoadIcon(foundExe, game.RootDirectory);
|
||||
if (refreshedIcon != null)
|
||||
{
|
||||
game.IconImage = refreshedIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -861,6 +884,12 @@ namespace GameLauncher
|
||||
}
|
||||
}
|
||||
// スクリプト改造の適用または復元(ティラノ)
|
||||
// スクリプト改造の適用または復元(NW.js)
|
||||
else if (tg.IsNwjs)
|
||||
{
|
||||
this.ApplyOrRestoreNwjsMod(tg);
|
||||
}
|
||||
// スクリプト改造の適用または復元(ティラノ)
|
||||
else if (tg.EngineType == TkoolEngineType.Tyrano)
|
||||
{
|
||||
if (tg.ApplyMod)
|
||||
@@ -875,6 +904,10 @@ namespace GameLauncher
|
||||
}
|
||||
}
|
||||
// その他のゲーム(ツクール以外のゲーム)
|
||||
else if (tg.IsBakin)
|
||||
{
|
||||
this.AppendLog($"[Bakin起動] {tg.Title} を起動します...");
|
||||
}
|
||||
else if (tg.IsOther)
|
||||
{
|
||||
this.AppendLog($"[その他起動] {tg.Title} を起動します...");
|
||||
@@ -884,6 +917,44 @@ namespace GameLauncher
|
||||
{
|
||||
var (success, msg) = this._modService.ApplyOrRestoreMod(tg, this._config.DefaultPluginSettings);
|
||||
this.AppendLog($"[ツクール改造処理] {tg.Title}: {msg}");
|
||||
|
||||
// ツクールMZかつMzPixiErrorFixが有効な場合、マップ移動エラー修復&DevTools有効化を適用
|
||||
if (tg.IsMZ)
|
||||
{
|
||||
if (tg.MzPixiErrorFix)
|
||||
{
|
||||
var (fixSuccess, fixMsg) = TkoolMzFixService.ApplyMzPixiFix(tg.RootDirectory);
|
||||
if (fixSuccess)
|
||||
{
|
||||
this.AppendLog($"[MZエラー修復] {tg.Title}: {fixMsg}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var (restoreSuccess, restoreMsg) = TkoolMzFixService.RestoreMzPixiFix(tg.RootDirectory);
|
||||
if (restoreSuccess)
|
||||
{
|
||||
this.AppendLog($"[MZエラー修復解除] {tg.Title}: {restoreMsg}");
|
||||
}
|
||||
}
|
||||
|
||||
if (tg.MzSpineErrorFix)
|
||||
{
|
||||
var (spineFixSuccess, spineFixMsg) = TkoolMzFixService.ApplyMzSpineFix(tg.RootDirectory);
|
||||
if (spineFixSuccess && !string.IsNullOrEmpty(spineFixMsg))
|
||||
{
|
||||
this.AppendLog($"[MZ Spine修復] {tg.Title}: {spineFixMsg}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var (spineRestoreSuccess, spineRestoreMsg) = TkoolMzFixService.RestoreMzSpineFix(tg.RootDirectory);
|
||||
if (spineRestoreSuccess && !string.IsNullOrEmpty(spineRestoreMsg))
|
||||
{
|
||||
this.AppendLog($"[MZ Spine修復解除] {tg.Title}: {spineRestoreMsg}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.StartGameProcess(tg);
|
||||
@@ -914,14 +985,19 @@ namespace GameLauncher
|
||||
? evbItem.ResolveLaunchExecutable()
|
||||
: game.ExecutablePath;
|
||||
|
||||
// 直下にexeが無い場合やパスが変わっていた場合はサブフォルダ内を探索して救済
|
||||
if (string.IsNullOrEmpty(launchExe) || !File.Exists(launchExe))
|
||||
// 直下にexeが無い場合やパスが変わっていた場合、または補助exe(notification_helper.exe等)だった場合はサブフォルダ内を探索して救済
|
||||
if (string.IsNullOrEmpty(launchExe) || !File.Exists(launchExe) || GameScannerService.IsExcludedExe(launchExe))
|
||||
{
|
||||
var foundExe = GameScannerService.FindGameExecutable(game.RootDirectory);
|
||||
if (!string.IsNullOrEmpty(foundExe) && File.Exists(foundExe))
|
||||
{
|
||||
launchExe = foundExe;
|
||||
game.ExecutablePath = foundExe;
|
||||
var refreshedIcon = GameScannerService.LoadIcon(foundExe, game.RootDirectory);
|
||||
if (refreshedIcon != null)
|
||||
{
|
||||
game.IconImage = refreshedIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -942,7 +1018,7 @@ namespace GameLauncher
|
||||
// ツクール/ティラノ等のWebランタイム(NW.js / Chromium)ゲームの場合、
|
||||
// GameLauncher.exe のあるフォルダ配下の Profiles フォルダに隔離した専用プロファイルディレクトリを指定して起動
|
||||
// ※RGSS(DirectX/Ruby)やウディタ、Unity等のネイティブアプリには引数を付与しない
|
||||
if (game is TkoolGameItem tg && !tg.IsRgss && !tg.IsWolf)
|
||||
if (game is TkoolGameItem tg && !tg.IsRgss && !tg.IsWolf && !tg.IsBakin && !tg.IsSrpgStudio && !tg.IsOther)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1425,7 +1501,134 @@ namespace GameLauncher
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyOrRestoreNwjsMod(TkoolGameItem tg)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(tg.PluginsJsPath) || !File.Exists(tg.PluginsJsPath))
|
||||
{
|
||||
tg.PluginsJsPath = NwjsDetector.ResolveEntryHtmlPath(tg.RootDirectory);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(tg.PluginsJsPath) || !File.Exists(tg.PluginsJsPath))
|
||||
{
|
||||
this.AppendLog($"[NW.js改造スキップ] {tg.Title}: エントリHTMLが見つからないため通常起動します。");
|
||||
return;
|
||||
}
|
||||
|
||||
if (tg.ApplyMod)
|
||||
{
|
||||
var pluginOpts = TkoolGameItem.DefaultNwjsPlugins
|
||||
.Select(def => new ModPluginOptionItem
|
||||
{
|
||||
Definition = def,
|
||||
IsEnabled = tg.IsPluginEnabled(def.Id, this._config.DefaultPluginSettings, def.DefaultEnabled)
|
||||
})
|
||||
.ToList();
|
||||
|
||||
NwjsModService.ApplyMod(tg, tg.PluginsJsPath, pluginOpts);
|
||||
tg.IsModded = NwjsModService.CheckIsModded(tg.PluginsJsPath);
|
||||
this.AppendLog($"[NW.js改造適用] {tg.Title}: 改造スクリプトを適用しました ([F10]チートメニュー / [F6]倍速 / [F12]DevTools)。");
|
||||
}
|
||||
else
|
||||
{
|
||||
NwjsModService.RestoreOriginal(tg, tg.PluginsJsPath);
|
||||
tg.IsModded = false;
|
||||
this.AppendLog($"[NW.js復元] {tg.Title}: オリジナルの状態へ復元しました。");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.AppendLog($"[NW.js改造エラー] {tg.Title}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOpenBakinSaveEditor_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsBakin)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
this.AppendLog($"[Bakinセーブエディタ起動] {tg.Title} のセーブエディタを開きます...");
|
||||
var dlg = new BakinSaveEditorDialog(tg)
|
||||
{
|
||||
Owner = this
|
||||
};
|
||||
dlg.ShowDialog();
|
||||
|
||||
tg.HasSaveData = BakinSaveService.HasAnySaveData(tg.RootDirectory);
|
||||
this._scannerService.SaveCache(this._games);
|
||||
this._scannerService.SaveBookmarks(this._games);
|
||||
this.AppendLog($"[Bakinセーブエディタ終了] {tg.Title} のセーブエディタを閉じました。");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(this, $"Bakin セーブエディタの起動中にエラーが発生しました:\n{ex.Message}", "エラー", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
this.AppendLog($"[Bakinセーブエディタエラー] {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOpenNwjsSaveEditor_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsNwjs)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
this.AppendLog($"[NW.jsセーブエディタ起動] {tg.Title} のセーブエディタを開きます...");
|
||||
var dlg = new NwjsSaveEditorDialog(tg)
|
||||
{
|
||||
Owner = this
|
||||
};
|
||||
dlg.ShowDialog();
|
||||
|
||||
tg.HasSaveData = NwjsSaveService.HasAnySaveData(tg.RootDirectory, tg.FolderName);
|
||||
this._scannerService.SaveCache(this._games);
|
||||
this._scannerService.SaveBookmarks(this._games);
|
||||
this.AppendLog($"[NW.jsセーブエディタ終了] {tg.Title} のセーブエディタを閉じました。");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(this, $"NW.js セーブエディタの起動中にエラーが発生しました:\n{ex.Message}", "エラー", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
this.AppendLog($"[NW.jsセーブエディタエラー] {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void RestoreOriginalMod(TkoolGameItem tg)
|
||||
{
|
||||
if (tg.IsNwjs)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(tg.PluginsJsPath))
|
||||
{
|
||||
tg.PluginsJsPath = NwjsDetector.ResolveEntryHtmlPath(tg.RootDirectory);
|
||||
}
|
||||
|
||||
NwjsModService.RestoreOriginal(tg, tg.PluginsJsPath);
|
||||
tg.IsModded = false;
|
||||
this._scannerService.SaveCache(this._games);
|
||||
this._scannerService.SaveBookmarks(this._games);
|
||||
string msg = "NW.js 改造スクリプトを解除し、元の index.html へ復元しました。";
|
||||
this.AppendLog($"[改造解除] {tg.Title}: {msg}");
|
||||
MessageBox.Show(msg, "改造解除・復元完了", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"復元中にエラーが発生しました:\n{ex.Message}", "復元エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this.RestoreNonNwjsOriginalMod(tg);
|
||||
}
|
||||
|
||||
private void RestoreNonNwjsOriginalMod(TkoolGameItem tg)
|
||||
{
|
||||
var (Success, Message) = tg.IsRgss
|
||||
? this._rgssModService.RestoreOriginal(tg)
|
||||
@@ -1433,6 +1636,12 @@ namespace GameLauncher
|
||||
? this._tyranoModService.RestoreOriginal(tg)
|
||||
: this._modService.RestoreOriginal(tg));
|
||||
|
||||
if (tg.IsMZ)
|
||||
{
|
||||
TkoolMzFixService.RestoreMzPixiFix(tg.RootDirectory);
|
||||
TkoolMzFixService.RestoreMzSpineFix(tg.RootDirectory);
|
||||
}
|
||||
|
||||
tg.IsModded = false;
|
||||
this.AppendLog($"[改造解除] {tg.Title}: {Message}");
|
||||
|
||||
|
||||
Reference in new issue
Block a user