diff --git a/.gitignore b/.gitignore
index 271a9d0..a6793de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,8 @@ Backups/
Profiles/
config.json
games_cache.json
+
+# Temporary reverse-engineering / analysis reference artifacts
+WolfDec_*.json
+WolfDec_main.cpp
+*_ref.h
diff --git a/App.xaml.cs b/App.xaml.cs
index b01e531..2284df1 100644
--- a/App.xaml.cs
+++ b/App.xaml.cs
@@ -14,6 +14,9 @@ namespace GameLauncher
{
base.OnStartup(e);
+ // Shift_JIS等のコードページを有効化
+ System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
+
// 作業ディレクトリを exe のあるフォルダに確実に設定
AppPathHelper.SetCurrentDirectoryToExeDirectory();
diff --git a/ConfigDialog.xaml b/ConfigDialog.xaml
index db1f815..08c264d 100644
--- a/ConfigDialog.xaml
+++ b/ConfigDialog.xaml
@@ -93,6 +93,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ConfigDialog.xaml.cs b/ConfigDialog.xaml.cs
index fee9b34..fa7c777 100644
--- a/ConfigDialog.xaml.cs
+++ b/ConfigDialog.xaml.cs
@@ -23,6 +23,7 @@ namespace GameLauncher
_config = config;
txtRgssExtractorPath.Text = _config.RgssExtractorPath ?? @"C:\Soft\RGSS-Extractor-v1.0\RGSS Extractor.exe";
+ txtWolfExtractorPath.Text = _config.WolfExtractorPath ?? string.Empty;
txtBackupsPath.Text = AppPathHelper.GetBackupsDirectory();
chkDefaultApplyMod.IsChecked = _config.DefaultApplyMod;
}
@@ -48,6 +49,27 @@ namespace GameLauncher
}
}
+ private void btnBrowseWolfExtractor_Click(object sender, RoutedEventArgs e)
+ {
+ var ofd = new OpenFileDialog
+ {
+ Title = "Wolf RPG 解凍ツール (UberWolfCli.exe / WolfDec.exe) を選択してください",
+ Filter = "実行ファイル (*.exe)|*.exe|すべてのファイル (*.*)|*.*",
+ FileName = "UberWolfCli.exe"
+ };
+
+ var currentDir = Path.GetDirectoryName(txtWolfExtractorPath.Text);
+ if (!string.IsNullOrEmpty(currentDir) && Directory.Exists(currentDir))
+ {
+ ofd.InitialDirectory = currentDir;
+ }
+
+ if (ofd.ShowDialog() == true)
+ {
+ txtWolfExtractorPath.Text = ofd.FileName;
+ }
+ }
+
private void btnOpenBackupsDir_Click(object sender, RoutedEventArgs e)
{
try
@@ -68,6 +90,7 @@ namespace GameLauncher
private void btnSave_Click(object sender, RoutedEventArgs e)
{
_config.RgssExtractorPath = txtRgssExtractorPath.Text.Trim();
+ _config.WolfExtractorPath = txtWolfExtractorPath.Text.Trim();
_config.DefaultApplyMod = chkDefaultApplyMod.IsChecked == true;
IsSaved = true;
DialogResult = true;
diff --git a/Helpers/AppPathHelper.cs b/Helpers/AppPathHelper.cs
index 81e622e..d7aad17 100644
--- a/Helpers/AppPathHelper.cs
+++ b/Helpers/AppPathHelper.cs
@@ -164,6 +164,24 @@ namespace GameLauncher.Helpers
///
public static string GetBackupsDirectory()
{
+ // ユーザー指定ルール: バックアップは全て Z:\自作ソフト\GameLauncher\Backups (exe直下のBackupsフォルダ) で行う
+ var prodBackups = @"Z:\自作ソフト\GameLauncher\Backups";
+ if (Directory.Exists(@"Z:\自作ソフト\GameLauncher"))
+ {
+ try
+ {
+ if (!Directory.Exists(prodBackups))
+ {
+ Directory.CreateDirectory(prodBackups);
+ }
+ if (Directory.Exists(prodBackups))
+ {
+ return prodBackups;
+ }
+ }
+ catch { }
+ }
+
var exeBackups = Path.Combine(GetExeDirectory(), "Backups");
try
diff --git a/MainWindow.xaml b/MainWindow.xaml
index d9f66de..a4c3104 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -38,6 +38,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -793,6 +840,21 @@
+
+
+
+
+
+
+
+
@@ -816,6 +878,12 @@
+
+
+
+
+
@@ -852,7 +920,17 @@
-
+
@@ -946,6 +1024,15 @@
+
+
+
@@ -977,6 +1064,216 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index f1e6548..81836ff 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -31,6 +31,11 @@ namespace GameLauncher
private readonly AsarArchiveService _asarService = new();
private readonly UnitySaveManagerService _unitySaveService = new();
private readonly RgssModService _rgssModService = new();
+ private readonly WolfSaveService _wolfSaveService = new();
+ private readonly WolfArchiveService _wolfArchiveService = new();
+ private readonly WolfModService _wolfModService = new();
+ private readonly SrpgArchiveService _srpgArchiveService = new();
+ private readonly SrpgModService _srpgModService = new();
private readonly ObservableCollection _games = [];
private ListCollectionView _gamesView = null!;
@@ -117,6 +122,8 @@ namespace GameLauncher
case 4: tabVX.IsChecked = true; break;
case 5: tabTyrano.IsChecked = true; break;
case 6: tabUnity.IsChecked = true; break;
+ case 7: tabWolf.IsChecked = true; break;
+ case 8: tabSrpg.IsChecked = true; break;
default: tabAll.IsChecked = true; break;
}
@@ -151,6 +158,8 @@ namespace GameLauncher
else if (tabVX.IsChecked == true) tabIndex = 4;
else if (tabTyrano.IsChecked == true) tabIndex = 5;
else if (tabUnity.IsChecked == true) tabIndex = 6;
+ else if (tabWolf.IsChecked == true) tabIndex = 7;
+ else if (tabSrpg.IsChecked == true) tabIndex = 8;
_config.SelectedTab = tabIndex;
_config.UnityBackendFilter = rbUnityIL2CPP.IsChecked == true ? "IL2CPP" : (rbUnityMono.IsChecked == true ? "Mono" : "All");
@@ -259,11 +268,13 @@ namespace GameLauncher
if (_games.Count > 0)
{
- int tkoolCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano);
+ int tkoolCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano && !tg.IsRgss && !tg.IsWolf);
+ int rgssCount = _games.Count(g => g is TkoolGameItem tg && tg.IsRgss);
int tyranoCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType == TkoolEngineType.Tyrano);
+ int wolfCount = _games.Count(g => g is TkoolGameItem tg && tg.IsWolf);
int unityCount = _games.Count(g => g is UnityGameItem);
- AppendLog($"キャッシュから計 {_games.Count} 件(ツクール: {tkoolCount}, ティラノ: {tyranoCount}, Unity: {unityCount})を即時表示しました。(待たずに即起動可能です)");
+ AppendLog($"キャッシュから計 {_games.Count} 件(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, Unity: {unityCount})を即時表示しました。(待たずに即起動可能です)");
lblStatusEngine.Text = "裏で更新・実在検証を実行中...";
}
else
@@ -434,6 +445,14 @@ namespace GameLauncher
{
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.Tyrano) return false;
}
+ else if (tabWolf.IsChecked == true)
+ {
+ if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.Wolf) return false;
+ }
+ else if (tabSrpg.IsChecked == true)
+ {
+ if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.SrpgStudio) return false;
+ }
else if (tabUnity.IsChecked == true)
{
if (game is not UnityGameItem ug) return false;
@@ -445,6 +464,7 @@ namespace GameLauncher
if (chkFilterModdedOnly.IsChecked == true && !game.IsModded) return false;
if (chkFilterAsarOnly.IsChecked == true && (game is not TkoolGameItem tgAsar || !tgAsar.IsAsar)) return false;
if (chkFilterRgssOnly.IsChecked == true && (game is not TkoolGameItem tgRgss || !tgRgss.HasRgssArchive)) return false;
+ if (chkFilterSrpgOnly.IsChecked == true && (game is not TkoolGameItem tgSrpg || !tgSrpg.HasSrpgArchive)) return false;
if (chkFilterSaveOnly.IsChecked == true && (game is not UnityGameItem ugSave || !ugSave.HasSaveData)) return false;
return true;
@@ -503,13 +523,15 @@ namespace GameLauncher
int total = _games.Count;
int visible = _gamesView?.Count ?? 0;
- int tkoolCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano && !tg.IsRgss);
+ int tkoolCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano && !tg.IsRgss && !tg.IsWolf && !tg.IsSrpgStudio);
int rgssCount = _games.Count(g => g is TkoolGameItem tg && tg.IsRgss);
int tyranoCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType == TkoolEngineType.Tyrano);
+ int wolfCount = _games.Count(g => g is TkoolGameItem tg && tg.IsWolf);
+ int srpgCount = _games.Count(g => g is TkoolGameItem tg && tg.IsSrpgStudio);
int unityCount = _games.Count(g => g is UnityGameItem);
lblStatusSummary.Text = $"総ゲーム数: {total} 件 | 表示: {visible} 件";
- lblStatusBreakdown.Text = $"(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, Unity: {unityCount})";
+ lblStatusBreakdown.Text = $"(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, SRPG Studio: {srpgCount}, Unity: {unityCount})";
}
#endregion
@@ -609,6 +631,46 @@ namespace GameLauncher
private async Task LaunchTkoolGameAsync(TkoolGameItem tg)
{
+ // ウディタゲームの場合の起動処理
+ if (tg.IsWolf)
+ {
+ // プロキシDLLの適用または解除の同期
+ if (tg.WolfProxyDll)
+ {
+ var (pSuccess, pMsg) = _wolfModService.ApplyProxyDll(tg, 1.0, tg.WolfSpeedMultiplier > 0 ? tg.WolfSpeedMultiplier : 3.0, 5.0);
+ AppendLog($"[ウディタ プロキシDLL] {pMsg.Replace("\n", " ")}");
+ }
+ else if (_wolfModService.IsProxyDllInstalled(tg))
+ {
+ var (pSuccess, pMsg) = _wolfModService.RemoveProxyDll(tg);
+ AppendLog($"[ウディタ プロキシDLL] {pMsg}");
+ }
+
+ AppendLog($"[ウディタ起動] {tg.Title} を起動します...");
+ StartGameProcess(tg);
+ return;
+ }
+
+ // SRPG Studioゲームの場合の起動処理
+ if (tg.IsSrpgStudio)
+ {
+ // プロキシDLLの適用または解除の同期
+ if (tg.SrpgProxyDll)
+ {
+ bool ok = _srpgModService.EnableProxyDll(tg.RootDirectory, tg.SrpgSpeedMultiplier > 0 ? tg.SrpgSpeedMultiplier : 3.0);
+ AppendLog($"[SRPG Studio プロキシDLL] 倍速プロキシDLLを配置しました (倍率: {(tg.SrpgSpeedMultiplier > 0 ? tg.SrpgSpeedMultiplier : 3.0):F1}x)");
+ }
+ else if (SrpgModService.IsProxyDllEnabled(tg.RootDirectory))
+ {
+ _srpgModService.DisableProxyDll(tg.RootDirectory);
+ AppendLog("[SRPG Studio プロキシDLL] プロキシDLLを解除しました");
+ }
+
+ AppendLog($"[SRPG Studio起動] {tg.Title} を起動します...");
+ StartGameProcess(tg);
+ return;
+ }
+
// ASAR形式ゲームで未解凍かつ改造適用ONの場合、解凍を促す
if (tg.IsAsar && !tg.IsAsarExtracted && tg.ApplyMod)
{
@@ -689,8 +751,8 @@ namespace GameLauncher
// ツクール/ティラノ等のWebランタイム(NW.js / Chromium)ゲームの場合、
// GameLauncher.exe のあるフォルダ配下の Profiles フォルダに隔離した専用プロファイルディレクトリを指定して起動
- // ※RGSS(DirectX/Ruby)やUnity等のネイティブアプリには引数を付与しない
- if (game is TkoolGameItem tg && !tg.IsRgss)
+ // ※RGSS(DirectX/Ruby)やウディタ、Unity等のネイティブアプリには引数を付与しない
+ if (game is TkoolGameItem tg && !tg.IsRgss && !tg.IsWolf)
{
try
{
@@ -708,6 +770,14 @@ namespace GameLauncher
}
}
+ // ウディタでデバッグ(テストプレイ)モードがONの場合、公式デバッグ引数を付与
+ if (game is TkoolGameItem tgWolf && tgWolf.IsWolf && tgWolf.WolfDebugMode)
+ {
+ var debugArgs = _wolfModService.GetDebugArguments(tgWolf.WolfDebugWindow);
+ startInfo.Arguments = debugArgs;
+ AppendLog($"[ウディタ デバッグ起動] テストプレイモード引数を指定: {debugArgs}");
+ }
+
Process.Start(startInfo);
game.LastLaunched = DateTime.Now;
@@ -1242,6 +1312,446 @@ namespace GameLauncher
#endregion
+ #region WOLF RPGエディター専用アクション
+
+ private void btnOpenWolfSaveEditor_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is TkoolGameItem tg && tg.IsWolf)
+ {
+ var dialog = new WolfSaveEditorDialog(tg, _wolfSaveService)
+ {
+ Owner = this
+ };
+ dialog.ShowDialog();
+ }
+ }
+
+ private void chkWolfProxyDll_Checked(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is TkoolGameItem tg && tg.IsWolf)
+ {
+ var (success, msg) = _wolfModService.ApplyProxyDll(tg, 1.0, tg.WolfSpeedMultiplier > 0 ? tg.WolfSpeedMultiplier : 3.0, 5.0);
+ AppendLog($"[ウディタ プロキシDLL] {msg.Replace("\n", " ")}");
+ _scannerService.SaveCache(_games);
+ }
+ }
+
+ private void chkWolfProxyDll_Unchecked(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is TkoolGameItem tg && tg.IsWolf)
+ {
+ var (success, msg) = _wolfModService.RemoveProxyDll(tg);
+ AppendLog($"[ウディタ プロキシDLL] {msg}");
+ _scannerService.SaveCache(_games);
+ }
+ }
+
+ private void btnApplyWolfProxyDll_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is TkoolGameItem tg && tg.IsWolf)
+ {
+ var (success, msg) = _wolfModService.ApplyProxyDll(tg, 1.0, tg.WolfSpeedMultiplier > 0 ? tg.WolfSpeedMultiplier : 3.0, 5.0);
+ tg.WolfProxyDll = true;
+ AppendLog($"[ウディタ プロキシDLL] {msg.Replace("\n", " ")}");
+ MessageBox.Show(msg, "プロキシDLL適用", MessageBoxButton.OK, MessageBoxImage.Information);
+ _scannerService.SaveCache(_games);
+ }
+ }
+
+ private void btnRemoveWolfProxyDll_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is TkoolGameItem tg && tg.IsWolf)
+ {
+ var (success, msg) = _wolfModService.RemoveProxyDll(tg);
+ tg.WolfProxyDll = false;
+ AppendLog($"[ウディタ プロキシDLL] {msg}");
+ MessageBox.Show(msg, "プロキシDLL解除", MessageBoxButton.OK, MessageBoxImage.Information);
+ _scannerService.SaveCache(_games);
+ }
+ }
+
+ private async void btnExtractWolf_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsWolf) return;
+
+ var confirm = MessageBox.Show(
+ $"Data.wolf アーカイブを解凍・抽出しますか?\n\n対象: {tg.Title}\n展開先: {Path.Combine(tg.RootDirectory, "Data")}\n\n解凍すると、ウディタのエディタやファイル直接編集によるデータ改造が可能になります。",
+ "Data.wolf 解凍の確認", MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (confirm != MessageBoxResult.Yes) return;
+
+ pbWolfProgress.Visibility = Visibility.Visible;
+ pbWolfProgress.IsIndeterminate = true;
+ lblWolfProgressStatus.Visibility = Visibility.Visible;
+ lblWolfProgressStatus.Text = "Data.wolf を解凍しています...";
+ btnExtractWolf.IsEnabled = false;
+
+ var progress = new Progress(status =>
+ {
+ Dispatcher.Invoke(() =>
+ {
+ lblWolfProgressStatus.Text = status;
+ AppendLog($"[ウディタ解凍] {status}");
+ });
+ });
+
+ try
+ {
+ var (success, msg) = await _wolfArchiveService.ExtractArchiveAsync(tg, _config.WolfExtractorPath, progress);
+ if (success)
+ {
+ tg.IsWolfExtracted = true;
+ MessageBox.Show(msg, "解凍完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ MessageBox.Show(msg, "解凍エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
+ }
+ _scannerService.SaveCache(_games);
+ }
+ finally
+ {
+ pbWolfProgress.Visibility = Visibility.Collapsed;
+ lblWolfProgressStatus.Visibility = Visibility.Collapsed;
+ btnExtractWolf.IsEnabled = true;
+ }
+ }
+
+ private void btnRestoreWolfArchive_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsWolf) return;
+
+ var confirm = MessageBox.Show(
+ "解凍された Data フォルダを Backups フォルダへ退避し、元の Data.wolf アーカイブ優先読み込みに復元しますか?",
+ "アーカイブ状態復元の確認", MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (confirm != MessageBoxResult.Yes) return;
+
+ var (success, msg) = _wolfArchiveService.RestoreArchiveState(tg);
+ if (success)
+ {
+ tg.IsWolfExtracted = false;
+ AppendLog($"[ウディタ復元] {tg.Title}: {msg.Replace("\n", " ")}");
+ MessageBox.Show(msg, "復元完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ _scannerService.SaveCache(_games);
+ }
+ else
+ {
+ MessageBox.Show(msg, "復元エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
+ }
+ }
+
+ private void btnRestoreWolfAll_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsWolf) return;
+
+ var confirm = MessageBox.Show(
+ $"【完全復元】\n{tg.Title} に対するすべての改造(プロキシDLL、パッチ等)を解除し、元の状態に戻しますか?\n※セーブデータはそのまま維持されます。",
+ "完全復元の確認", MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (confirm != MessageBoxResult.Yes) return;
+
+ var (success, msg) = _wolfModService.RestoreAllMods(tg);
+ tg.WolfProxyDll = false;
+ AppendLog($"[ウディタ完全復元] {tg.Title}:\n{msg}");
+ MessageBox.Show($"すべての改造を解除しました:\n\n{msg}", "復元完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+
+ #endregion
+
+ #region SRPG Studio関連イベント
+
+ private void chkSrpgProxyDll_Checked(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsSrpgStudio) return;
+ tg.SrpgProxyDll = true;
+ bool ok = _srpgModService.EnableProxyDll(tg.RootDirectory, tg.SrpgSpeedMultiplier > 0 ? tg.SrpgSpeedMultiplier : 3.0);
+ if (ok)
+ {
+ AppendLog($"[SRPG Studio 倍速] {tg.Title}: プロキシDLLを有効化しました (F6で倍速切替)");
+ }
+ _scannerService.SaveCache(_games);
+ }
+
+ private void chkSrpgProxyDll_Unchecked(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsSrpgStudio) return;
+ tg.SrpgProxyDll = false;
+ _srpgModService.DisableProxyDll(tg.RootDirectory);
+ AppendLog($"[SRPG Studio 倍速] {tg.Title}: プロキシDLLを解除しました");
+ _scannerService.SaveCache(_games);
+ }
+
+ private void btnApplySrpgProxyDll_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsSrpgStudio) return;
+ tg.SrpgProxyDll = true;
+ bool ok = _srpgModService.EnableProxyDll(tg.RootDirectory, tg.SrpgSpeedMultiplier > 0 ? tg.SrpgSpeedMultiplier : 3.0);
+ if (ok)
+ {
+ AppendLog($"[SRPG Studio 倍速] {tg.Title}: プロキシDLL (version.dll) を配置しました");
+ MessageBox.Show("プロキシDLL (version.dll) を配置しました。\nゲーム起動後、[F6] キーで倍速切替、[Ctrl] キー押し続けで早送りができます。", "プロキシDLL配置完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ MessageBox.Show("プロキシDLLの配置に失敗しました。\nTools/speedhack-i686/version.dll が存在するか確認してください。", "エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
+ }
+ _scannerService.SaveCache(_games);
+ }
+
+ private void btnRemoveSrpgProxyDll_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsSrpgStudio) return;
+ tg.SrpgProxyDll = false;
+ bool ok = _srpgModService.DisableProxyDll(tg.RootDirectory);
+ AppendLog($"[SRPG Studio 倍速] {tg.Title}: プロキシDLL (version.dll) を解除しました");
+ MessageBox.Show("プロキシDLL (version.dll) を解除しました。", "プロキシDLL解除完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ _scannerService.SaveCache(_games);
+ }
+
+ private async void btnApplySrpgMod_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsSrpgStudio) return;
+
+ var enabledMods = tg.SrpgModOptions.Where(m => m.IsEnabled).ToList();
+ if (enabledMods.Count == 0)
+ {
+ MessageBox.Show("適用する改造項目にチェックを入れてください。", "改造項目の選択", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+
+ var confirm = MessageBox.Show(
+ $"選択された {enabledMods.Count} 件の改造項目を適用し、data.dts を再構築しますか?\n(元の data.dts は Backups フォルダに自動保存されます)\n\n対象: {tg.Title}",
+ "改造プラグイン適用&再構築の確認", MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (confirm != MessageBoxResult.Yes) return;
+
+ pbSrpgProgress.Visibility = Visibility.Visible;
+ pbSrpgProgress.IsIndeterminate = true;
+ lblSrpgProgressStatus.Visibility = Visibility.Visible;
+ lblSrpgProgressStatus.Text = "改造プラグインを適用・再パック中...";
+ btnApplySrpgMod.IsEnabled = false;
+
+ var progress = new Progress(status =>
+ {
+ Dispatcher.Invoke(() =>
+ {
+ lblSrpgProgressStatus.Text = status;
+ AppendLog($"[SRPG Studio 改造] {status}");
+ });
+ });
+
+ try
+ {
+ var (success, msg) = await _srpgModService.ApplyModAndRepackAsync(tg, progress);
+ if (success)
+ {
+ AppendLog($"[SRPG Studio 改造成功] {tg.Title}: {msg}");
+ MessageBox.Show(msg, "改造適用完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ AppendLog($"[SRPG Studio 改造失敗] {tg.Title}: {msg}");
+ MessageBox.Show(msg, "改造適用エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
+ }
+ _scannerService.SaveCache(_games);
+ }
+ finally
+ {
+ pbSrpgProgress.Visibility = Visibility.Collapsed;
+ lblSrpgProgressStatus.Visibility = Visibility.Collapsed;
+ btnApplySrpgMod.IsEnabled = true;
+ }
+ }
+
+ private async void btnRemoveSrpgMod_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsSrpgStudio) return;
+
+ var confirm = MessageBox.Show(
+ $"改造プラグインを解除し、元のアーカイブへ復元しますか?\n\n対象: {tg.Title}",
+ "改造プラグイン解除の確認", MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (confirm != MessageBoxResult.Yes) return;
+
+ pbSrpgProgress.Visibility = Visibility.Visible;
+ pbSrpgProgress.IsIndeterminate = true;
+ lblSrpgProgressStatus.Visibility = Visibility.Visible;
+ lblSrpgProgressStatus.Text = "改造プラグインを解除中...";
+ btnRemoveSrpgMod.IsEnabled = false;
+
+ var progress = new Progress(status =>
+ {
+ Dispatcher.Invoke(() =>
+ {
+ lblSrpgProgressStatus.Text = status;
+ AppendLog($"[SRPG Studio 解除] {status}");
+ });
+ });
+
+ try
+ {
+ var (success, msg) = await _srpgModService.RemoveModAndRepackAsync(tg, progress);
+ if (success)
+ {
+ // チェックをすべてオフにする
+ foreach (var mod in tg.SrpgModOptions) mod.IsEnabled = false;
+ AppendLog($"[SRPG Studio 解除成功] {tg.Title}: {msg}");
+ MessageBox.Show(msg, "改造解除完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ AppendLog($"[SRPG Studio 解除失敗] {tg.Title}: {msg}");
+ MessageBox.Show(msg, "改造解除エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
+ }
+ _scannerService.SaveCache(_games);
+ }
+ finally
+ {
+ pbSrpgProgress.Visibility = Visibility.Collapsed;
+ lblSrpgProgressStatus.Visibility = Visibility.Collapsed;
+ btnRemoveSrpgMod.IsEnabled = true;
+ }
+ }
+
+ private async void btnUnpackSrpg_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsSrpgStudio) return;
+
+ var confirm = MessageBox.Show(
+ $"data.dts アーカイブを解凍・抽出しますか?\n\n対象: {tg.Title}\n展開先: {Path.Combine(tg.RootDirectory, SrpgArchiveService.ExtractedDirName)}\n\n解凍すると、ゲーム内のスクリプト (Script) やプラグイン (Plugin) を自由に編集できるようになります。",
+ "data.dts 解凍の確認", MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (confirm != MessageBoxResult.Yes) return;
+
+ pbSrpgProgress.Visibility = Visibility.Visible;
+ pbSrpgProgress.IsIndeterminate = true;
+ lblSrpgProgressStatus.Visibility = Visibility.Visible;
+ lblSrpgProgressStatus.Text = "data.dts を解凍しています...";
+ btnUnpackSrpg.IsEnabled = false;
+
+ var progress = new Progress(status =>
+ {
+ Dispatcher.Invoke(() =>
+ {
+ lblSrpgProgressStatus.Text = status;
+ AppendLog($"[SRPG Studio 解凍] {status}");
+ });
+ });
+
+ try
+ {
+ var (success, msg) = await _srpgArchiveService.UnpackDataDtsAsync(tg.RootDirectory, progress);
+ if (success)
+ {
+ tg.IsSrpgExtracted = true;
+ AppendLog($"[SRPG Studio 解凍成功] {tg.Title}: {msg.Replace("\n", " ")}");
+ MessageBox.Show(msg, "解凍完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ AppendLog($"[SRPG Studio 解凍失敗] {tg.Title}: {msg}");
+ MessageBox.Show(msg, "解凍エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
+ }
+ _scannerService.SaveCache(_games);
+ }
+ finally
+ {
+ pbSrpgProgress.Visibility = Visibility.Collapsed;
+ lblSrpgProgressStatus.Visibility = Visibility.Collapsed;
+ btnUnpackSrpg.IsEnabled = true;
+ }
+ }
+
+ private async void btnRepackSrpg_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsSrpgStudio) return;
+
+ var confirm = MessageBox.Show(
+ $"解凍フォルダの内容から data.dts を再構築(再パック)しますか?\n(現在の data.dts は Backups フォルダに自動保存されます)\n\n対象: {tg.Title}",
+ "data.dts 再構築の確認", MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (confirm != MessageBoxResult.Yes) return;
+
+ pbSrpgProgress.Visibility = Visibility.Visible;
+ pbSrpgProgress.IsIndeterminate = true;
+ lblSrpgProgressStatus.Visibility = Visibility.Visible;
+ lblSrpgProgressStatus.Text = "data.dts を再構築中...";
+ btnRepackSrpg.IsEnabled = false;
+
+ var progress = new Progress(status =>
+ {
+ Dispatcher.Invoke(() =>
+ {
+ lblSrpgProgressStatus.Text = status;
+ AppendLog($"[SRPG Studio 再構築] {status}");
+ });
+ });
+
+ try
+ {
+ var (success, msg) = await _srpgArchiveService.RepackDataDtsAsync(tg.RootDirectory, progress);
+ if (success)
+ {
+ AppendLog($"[SRPG Studio 再構築成功] {tg.Title}: {msg.Replace("\n", " ")}");
+ MessageBox.Show(msg, "再構築完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ AppendLog($"[SRPG Studio 再構築失敗] {tg.Title}: {msg}");
+ MessageBox.Show(msg, "再構築エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
+ }
+ _scannerService.SaveCache(_games);
+ }
+ finally
+ {
+ pbSrpgProgress.Visibility = Visibility.Collapsed;
+ lblSrpgProgressStatus.Visibility = Visibility.Collapsed;
+ btnRepackSrpg.IsEnabled = true;
+ }
+ }
+
+ private async void btnRestoreSrpgAll_Click(object sender, RoutedEventArgs e)
+ {
+ if (lstGames.SelectedItem is not TkoolGameItem tg || !tg.IsSrpgStudio) return;
+
+ var confirm = MessageBox.Show(
+ $"【完全復元】\n{tg.Title} に対するすべての改造(プロキシDLL・Modプラグイン・解凍フォルダ退避等)を解除し、元の安全な状態に戻しますか?\n※セーブデータはそのまま維持されます。\n※解凍データは Backups フォルダに安全退避されます。",
+ "完全復元の確認", MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (confirm != MessageBoxResult.Yes) return;
+
+ pbSrpgProgress.Visibility = Visibility.Visible;
+ pbSrpgProgress.IsIndeterminate = true;
+ lblSrpgProgressStatus.Visibility = Visibility.Visible;
+ lblSrpgProgressStatus.Text = "すべての改造を解除中...";
+
+ var progress = new Progress(status =>
+ {
+ Dispatcher.Invoke(() =>
+ {
+ lblSrpgProgressStatus.Text = status;
+ AppendLog($"[SRPG Studio 完全復元] {status}");
+ });
+ });
+
+ try
+ {
+ var (success, msg) = await _srpgModService.RestoreAllModsAsync(tg, progress);
+ foreach (var mod in tg.SrpgModOptions) mod.IsEnabled = false;
+ AppendLog($"[SRPG Studio 完全復元] {tg.Title}:\n{msg}");
+ MessageBox.Show($"すべての改造を解除しました:\n\n{msg}", "復元完了", MessageBoxButton.OK, MessageBoxImage.Information);
+ _scannerService.SaveCache(_games);
+ }
+ finally
+ {
+ pbSrpgProgress.Visibility = Visibility.Collapsed;
+ lblSrpgProgressStatus.Visibility = Visibility.Collapsed;
+ }
+ }
+
+ #endregion
+
#region 共通アクション (フォルダを開く・ログ操作)
private void btnOpenFolder_Click(object sender, RoutedEventArgs e)
diff --git a/Models/GameItemBase.cs b/Models/GameItemBase.cs
index cd269f9..1b141a4 100644
--- a/Models/GameItemBase.cs
+++ b/Models/GameItemBase.cs
@@ -146,6 +146,12 @@ namespace GameLauncher.Models
/// ティラノスクリプトか
public virtual bool IsTyrano => false;
+ /// WOLF RPGエディター(ウディタ)か
+ public virtual bool IsWolf => false;
+
+ /// SRPG Studioか
+ public virtual bool IsSrpgStudio => false;
+
/// RGSSアーカイブ(rgss3a/rgss2a等)を持つか
public virtual bool HasRgssArchive
{
@@ -160,6 +166,34 @@ namespace GameLauncher.Models
set { }
}
+ /// Wolfアーカイブ(Data.wolf等)を持つか
+ public virtual bool HasWolfArchive
+ {
+ get => false;
+ set { }
+ }
+
+ /// Wolfアーカイブが解凍済み(Dataフォルダが存在)か
+ public virtual bool IsWolfExtracted
+ {
+ get => false;
+ set { }
+ }
+
+ /// SRPG Studioアーカイブ(data.dts)を持つか
+ public virtual bool HasSrpgArchive
+ {
+ get => false;
+ set { }
+ }
+
+ /// SRPG Studioアーカイブが解凍済み(data_extracted等が存在)か
+ public virtual bool IsSrpgExtracted
+ {
+ get => false;
+ set { }
+ }
+
/// RGSSバッジのテキスト
public virtual string RgssBadgeText => string.Empty;
@@ -172,6 +206,18 @@ namespace GameLauncher.Models
/// RGSS詳細状態テキスト
public virtual string RgssDetailStatusText => string.Empty;
+ /// SRPG Studioバッジのテキスト
+ public virtual string SrpgBadgeText => string.Empty;
+
+ /// SRPG Studioバッジの背景色
+ public virtual Brush SrpgBadgeBackground => Brushes.Transparent;
+
+ /// SRPG Studioバッジの可視性
+ public virtual Visibility SrpgBadgeVisibility => Visibility.Collapsed;
+
+ /// SRPG Studio詳細状態テキスト
+ public virtual string SrpgDetailStatusText => string.Empty;
+
/// Unity IL2CPPか
public virtual bool IsIL2CPP => false;
diff --git a/Models/LauncherConfig.cs b/Models/LauncherConfig.cs
index 1e5fb2d..1789a79 100644
--- a/Models/LauncherConfig.cs
+++ b/Models/LauncherConfig.cs
@@ -26,6 +26,9 @@ namespace GameLauncher.Models
/// RGSS Extractor の実行ファイルパス(ツクールVX/VX Ace暗号化アーカイブ展開用)
public string RgssExtractorPath { get; set; } = @"C:\Soft\RGSS-Extractor-v1.0\RGSS Extractor.exe";
+ /// Wolf RPG アーカイブ解凍ツールの実行ファイルパス(UberWolfCli.exe / WolfDec.exe など)
+ public string WolfExtractorPath { get; set; } = string.Empty;
+
// フィルター状態の保存(再起動時復元用)
public string TkoolEngineFilter { get; set; } = "All";
public bool TkoolFilterModdedOnly { get; set; }
diff --git a/Models/TkoolGameItem.cs b/Models/TkoolGameItem.cs
index 8181f18..9751f7d 100644
--- a/Models/TkoolGameItem.cs
+++ b/Models/TkoolGameItem.cs
@@ -112,9 +112,13 @@ namespace GameLauncher.Models
private string? _asarExtractedDirPath;
private string? _relativePluginsJsInAsar;
- public override GameEngineKind EngineKind => EngineType == TkoolEngineType.Tyrano
- ? GameEngineKind.Tyrano
- : GameEngineKind.Tkool;
+ public override GameEngineKind EngineKind => EngineType switch
+ {
+ TkoolEngineType.Tyrano => GameEngineKind.Tyrano,
+ TkoolEngineType.Wolf => GameEngineKind.Wolf,
+ TkoolEngineType.SrpgStudio => GameEngineKind.SrpgStudio,
+ _ => GameEngineKind.Tkool
+ };
public string PluginsJsPath
{
@@ -133,8 +137,66 @@ namespace GameLauncher.Models
public override bool IsTyrano => EngineType == TkoolEngineType.Tyrano;
public override bool IsVX => EngineType == TkoolEngineType.VX;
public override bool IsVXAce => EngineType == TkoolEngineType.VXAce;
+ public override bool IsWolf => EngineType == TkoolEngineType.Wolf;
+ public override bool IsSrpgStudio => EngineType == TkoolEngineType.SrpgStudio;
public override bool IsRgss => EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce;
+ // SRPG Studio アーカイブ関連プロパティ
+ private bool _hasSrpgArchive;
+ private bool _isSrpgExtracted;
+ private string? _srpgArchivePath;
+
+ public override bool HasSrpgArchive
+ {
+ get => _hasSrpgArchive;
+ set
+ {
+ if (_hasSrpgArchive != value)
+ {
+ _hasSrpgArchive = value;
+ OnPropertyChanged();
+ OnPropertyChanged(nameof(SrpgBadgeVisibility));
+ OnPropertyChanged(nameof(SrpgBadgeText));
+ OnPropertyChanged(nameof(SrpgBadgeBackground));
+ OnPropertyChanged(nameof(SrpgDetailStatusText));
+ }
+ }
+ }
+
+ public override bool IsSrpgExtracted
+ {
+ get => _isSrpgExtracted;
+ set
+ {
+ if (_isSrpgExtracted != value)
+ {
+ _isSrpgExtracted = value;
+ OnPropertyChanged();
+ OnPropertyChanged(nameof(SrpgBadgeText));
+ OnPropertyChanged(nameof(SrpgBadgeBackground));
+ OnPropertyChanged(nameof(SrpgDetailStatusText));
+ }
+ }
+ }
+
+ public string? SrpgArchivePath
+ {
+ get => _srpgArchivePath;
+ set { if (_srpgArchivePath != value) { _srpgArchivePath = value; OnPropertyChanged(); } }
+ }
+
+ public override Visibility SrpgBadgeVisibility => HasSrpgArchive ? Visibility.Visible : Visibility.Collapsed;
+
+ public override string SrpgBadgeText => !HasSrpgArchive ? string.Empty : (IsSrpgExtracted ? "SRPG (抽出済)" : "SRPG (暗号化)");
+
+ public override Brush SrpgBadgeBackground => IsSrpgExtracted
+ ? new SolidColorBrush(Color.FromRgb(0x00, 0x89, 0x7B))
+ : new SolidColorBrush(Color.FromRgb(0x09, 0x84, 0xE3));
+
+ public override string SrpgDetailStatusText => !HasSrpgArchive
+ ? string.Empty
+ : (IsSrpgExtracted ? "📦 SRPGアーカイブ(スクリプト/リソース抽出済み・改造可能)" : "🔒 SRPG暗号化アーカイブ(ボタンで抽出・改造・再構築可能)");
+
// RGSS (VX / VX Ace) アーカイブ関連プロパティ
private bool _hasRgssArchive;
private bool _isRgssExtracted;
@@ -207,11 +269,113 @@ namespace GameLauncher.Models
OnPropertyChanged(nameof(IsTyrano));
OnPropertyChanged(nameof(IsVX));
OnPropertyChanged(nameof(IsVXAce));
+ OnPropertyChanged(nameof(IsWolf));
+ OnPropertyChanged(nameof(IsSrpgStudio));
OnPropertyChanged(nameof(IsRgss));
}
}
}
+ // ================= WOLF RPGエディター関連プロパティ =================
+ private bool _wolfDebugMode = false;
+ private bool _wolfDebugWindow = false;
+ private bool _wolfProxyDll = false;
+ private double _wolfSpeedMultiplier = 3.0;
+ private bool _hasWolfArchive = false;
+ private bool _isWolfExtracted = false;
+
+ /// テストプレイ(デバッグ)モードで起動するか
+ public bool WolfDebugMode
+ {
+ get => _wolfDebugMode;
+ set { if (_wolfDebugMode != value) { _wolfDebugMode = value; OnPropertyChanged(); } }
+ }
+
+ /// デバッグウィンドウ(F3)を起動時に表示するか
+ public bool WolfDebugWindow
+ {
+ get => _wolfDebugWindow;
+ set { if (_wolfDebugWindow != value) { _wolfDebugWindow = value; OnPropertyChanged(); } }
+ }
+
+ /// プロキシDLL(version.dll 倍速/メモリフック)を適用するか
+ public bool WolfProxyDll
+ {
+ get => _wolfProxyDll;
+ set { if (_wolfProxyDll != value) { _wolfProxyDll = value; OnPropertyChanged(); } }
+ }
+
+ /// プロキシDLLのスピード倍率
+ public double WolfSpeedMultiplier
+ {
+ get => _wolfSpeedMultiplier;
+ set { if (_wolfSpeedMultiplier != value) { _wolfSpeedMultiplier = value; OnPropertyChanged(); } }
+ }
+
+ /// Data.wolf アーカイブが存在するか
+ public override bool HasWolfArchive
+ {
+ get => _hasWolfArchive;
+ set
+ {
+ if (_hasWolfArchive != value)
+ {
+ _hasWolfArchive = value;
+ OnPropertyChanged();
+ OnPropertyChanged(nameof(WolfArchiveBadgeVisibility));
+ OnPropertyChanged(nameof(WolfArchiveBadgeText));
+ OnPropertyChanged(nameof(WolfArchiveBadgeBackground));
+ OnPropertyChanged(nameof(WolfArchiveDetailStatusText));
+ }
+ }
+ }
+
+ /// Data.wolf が解凍済み(Dataフォルダが存在)か
+ public override bool IsWolfExtracted
+ {
+ get => _isWolfExtracted;
+ set
+ {
+ if (_isWolfExtracted != value)
+ {
+ _isWolfExtracted = value;
+ OnPropertyChanged();
+ OnPropertyChanged(nameof(WolfArchiveBadgeVisibility));
+ OnPropertyChanged(nameof(WolfArchiveBadgeText));
+ OnPropertyChanged(nameof(WolfArchiveBadgeBackground));
+ OnPropertyChanged(nameof(WolfArchiveDetailStatusText));
+ }
+ }
+ }
+
+ public Visibility WolfArchiveBadgeVisibility => IsWolf && HasWolfArchive ? Visibility.Visible : Visibility.Collapsed;
+ public string WolfArchiveBadgeText => IsWolfExtracted ? "Data解凍済" : "Data.wolf保護";
+ public string WolfArchiveBadgeBackground => IsWolfExtracted ? "#00B894" : "#636E72";
+ public string WolfArchiveDetailStatusText => IsWolfExtracted
+ ? "Data フォルダに解凍・抽出済みです。ウディタは Data フォルダのマップ・イベント・データベース等を優先して読み込みます。直接ファイルを改造できます。"
+ : "Data.wolf アーカイブで暗号化・保護されています。下の「Data.wolf を解凍」を実行すると、全データを展開して直接編集・改造可能になります。";
+
+ // ================= SRPG Studio関連プロパティ =================
+ private bool _srpgProxyDll = false;
+ private double _srpgSpeedMultiplier = 3.0;
+
+ /// SRPG Studio プロキシDLL(version.dll 倍速機能)を適用するか
+ public bool SrpgProxyDll
+ {
+ get => _srpgProxyDll;
+ set { if (_srpgProxyDll != value) { _srpgProxyDll = value; OnPropertyChanged(); } }
+ }
+
+ /// SRPG Studio プロキシDLLのスピード倍率
+ public double SrpgSpeedMultiplier
+ {
+ get => _srpgSpeedMultiplier;
+ set { if (_srpgSpeedMultiplier != value) { _srpgSpeedMultiplier = value; OnPropertyChanged(); } }
+ }
+
+ /// SRPG Studio プラグイン改造オプション(PluginOptionsのエイリアス)
+ public ObservableCollection SrpgModOptions => PluginOptions;
+
public override bool IsModded
{
get => _isModded;
@@ -384,9 +548,25 @@ namespace GameLauncher.Models
new() { Id = "RgssCommandMemory", Name = "🧠 コマンド位置記憶 (ツクールMV風)", Description = "メニュー画面や戦闘中のアクターコマンドのカーソル選択位置を記憶して次回遷移時に復元します。" }
];
+ /// SRPG Studio用スクリプト改造定義一覧
+ public static readonly ModPluginDefinition[] DefaultSrpgPlugins =
+ [
+ new() { Id = "SrpgExpBoost", Name = "📈 獲得経験値最大化 (即LvUP / 100Exp固定)", Description = "戦闘やアイテム使用時の獲得経験値を最大(100Exp)にして毎回即座にレベルアップします。" },
+ new() { Id = "SrpgMaxGold", Name = "💰 所持金最大化 (999,999G)", Description = "自軍ターン開始時および戦闘勝利時に所持金を常に最大(999,999G)に設定します。" },
+ new() { Id = "SrpgInfDurability", Name = "♾️ 武器・アイテム耐久度無限", Description = "武器やアイテムを使用しても耐久度が減少しないようにします。" },
+ new() { Id = "SrpgTurnRecoverHp", Name = "💖 自軍ターン開始時 全味方HP全回復", Description = "プレイヤーのターン開始時に生存している全味方ユニットのHPを満タンまで回復します。" },
+ new() { Id = "SrpgMoveBoost", Name = "👟 味方移動力大幅強化 (+5)", Description = "自軍味方ユニットの基本移動力を+5加算し、広大なマップでも自在に行動できるようにします。" },
+ new() { Id = "SrpgItemAllDrop", Name = "🎁 敵撃破時アイテム100%ドロップ", Description = "敵ユニットが所持しているドロップ可能アイテムのドロップ率を100%にします。" }
+ ];
+
public void SyncPluginOptions(IEnumerable availablePlugins, Dictionary? defaultSettings = null)
{
_pluginOptions.Clear();
+ if (EngineType == TkoolEngineType.Wolf)
+ {
+ return;
+ }
+
IEnumerable targetDefs;
if (EngineType == TkoolEngineType.Tyrano)
{
@@ -396,6 +576,10 @@ namespace GameLauncher.Models
{
targetDefs = DefaultRgssPlugins;
}
+ else if (IsSrpgStudio)
+ {
+ targetDefs = DefaultSrpgPlugins;
+ }
else
{
targetDefs = availablePlugins;
@@ -433,6 +617,8 @@ namespace GameLauncher.Models
TkoolEngineType.Tyrano => "ティラノスクリプト",
TkoolEngineType.VX => "RPGツクールVX",
TkoolEngineType.VXAce => "RPGツクールVX Ace",
+ TkoolEngineType.Wolf => "WOLF RPGエディター",
+ TkoolEngineType.SrpgStudio => "SRPG Studio",
_ => "ツクール/ティラノ"
};
}
diff --git a/Models/UnityEnums.cs b/Models/UnityEnums.cs
index 36d169b..4b71b0e 100644
--- a/Models/UnityEnums.cs
+++ b/Models/UnityEnums.cs
@@ -7,11 +7,13 @@ namespace GameLauncher.Models
{
Tkool,
Tyrano,
- Unity
+ Unity,
+ Wolf,
+ SrpgStudio
}
///
- /// ツクールのエンジンの種類
+ /// エンジンの種類
///
public enum TkoolEngineType
{
@@ -20,6 +22,8 @@ namespace GameLauncher.Models
Tyrano,
VX,
VXAce,
+ Wolf,
+ SrpgStudio,
Unknown
}
diff --git a/Services/GameScannerService.cs b/Services/GameScannerService.cs
index e616c09..9683f9e 100644
--- a/Services/GameScannerService.cs
+++ b/Services/GameScannerService.cs
@@ -48,6 +48,17 @@ namespace GameLauncher.Services
public bool HasRgssArchive { get; set; }
public bool IsRgssExtracted { get; set; }
public string? RgssArchivePath { get; set; }
+ public bool HasWolfArchive { get; set; }
+ public bool IsWolfExtracted { get; set; }
+ public bool WolfDebugMode { get; set; }
+ public bool WolfDebugWindow { get; set; }
+ public bool WolfProxyDll { get; set; }
+ public double WolfSpeedMultiplier { get; set; } = 3.0;
+ public bool HasSrpgArchive { get; set; }
+ public bool IsSrpgExtracted { get; set; }
+ public string? SrpgArchivePath { get; set; }
+ public bool SrpgProxyDll { get; set; }
+ public double SrpgSpeedMultiplier { get; set; } = 3.0;
// Unity専用
public string DataDirectoryPath { get; set; } = string.Empty;
@@ -73,6 +84,15 @@ namespace GameLauncher.Services
private readonly string _cacheFilePath;
private readonly AsarArchiveService _asarService = new();
+ static GameScannerService()
+ {
+ try
+ {
+ System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
+ }
+ catch { }
+ }
+
public GameScannerService()
{
var baseDir = AppPathHelper.GetExeDirectory();
@@ -139,12 +159,65 @@ namespace GameLauncher.Services
RelativePluginsJsInAsar = entry.RelativePluginsJsInAsar,
HasRgssArchive = entry.HasRgssArchive,
IsRgssExtracted = entry.IsRgssExtracted,
- RgssArchivePath = entry.RgssArchivePath
+ RgssArchivePath = entry.RgssArchivePath,
+ HasWolfArchive = entry.HasWolfArchive,
+ IsWolfExtracted = entry.IsWolfExtracted,
+ WolfDebugMode = entry.WolfDebugMode,
+ WolfDebugWindow = entry.WolfDebugWindow,
+ WolfProxyDll = entry.WolfProxyDll,
+ WolfSpeedMultiplier = entry.WolfSpeedMultiplier > 0 ? entry.WolfSpeedMultiplier : 3.0,
+ HasSrpgArchive = entry.HasSrpgArchive,
+ IsSrpgExtracted = entry.IsSrpgExtracted,
+ SrpgArchivePath = entry.SrpgArchivePath,
+ SrpgProxyDll = entry.SrpgProxyDll,
+ SrpgSpeedMultiplier = entry.SrpgSpeedMultiplier > 0 ? entry.SrpgSpeedMultiplier : 3.0
};
if (entry.PluginSettings != null)
{
item.PluginSettings = new Dictionary(entry.PluginSettings, StringComparer.OrdinalIgnoreCase);
}
+
+ // 既存キャッシュの自動修復: ウディタの誤判定を修正
+ if (item.EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce && HasWolfGame(item.RootDirectory, out var wolfDir))
+ {
+ item.EngineType = TkoolEngineType.Wolf;
+ item.HasRgssArchive = false;
+ item.IsRgssExtracted = false;
+ item.RgssArchivePath = null;
+ item.PluginsJsPath = string.Empty;
+ item.PluginsDirPath = string.Empty;
+ item.HasWolfArchive = File.Exists(Path.Combine(wolfDir, "Data.wolf")) ||
+ (Directory.Exists(wolfDir) && Directory.GetFiles(wolfDir, "*.wolf", SearchOption.TopDirectoryOnly).Length > 0);
+ item.IsWolfExtracted = Directory.Exists(Path.Combine(wolfDir, "Data"));
+ item.WolfProxyDll = File.Exists(Path.Combine(wolfDir, WolfModService.ProxyDllName));
+ item.IsModded = item.WolfProxyDll;
+ }
+
+ // 既存キャッシュの自動修復: SRPG Studio の誤判定 (VX/VXAce) を修正
+ if (item.EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce && HasSrpgStudioGame(item.RootDirectory, out var srpgDir))
+ {
+ item.EngineType = TkoolEngineType.SrpgStudio;
+ item.HasRgssArchive = false;
+ item.IsRgssExtracted = false;
+ item.RgssArchivePath = null;
+ item.PluginsJsPath = string.Empty;
+ item.PluginsDirPath = string.Empty;
+ item.HasSrpgArchive = File.Exists(Path.Combine(srpgDir, "data.dts"));
+ item.IsSrpgExtracted = Directory.Exists(Path.Combine(srpgDir, "data_extracted")) || (Directory.Exists(Path.Combine(srpgDir, "Script")) && Directory.Exists(Path.Combine(srpgDir, "Plugin")));
+ item.SrpgArchivePath = item.HasSrpgArchive ? Path.Combine(srpgDir, "data.dts") : null;
+ item.SrpgProxyDll = File.Exists(Path.Combine(srpgDir, SrpgModService.ProxyDllName));
+ item.IsModded = item.SrpgProxyDll || SrpgModService.IsModScriptApplied(srpgDir);
+ }
+
+ // 既存キャッシュの自動修復: 文字化けタイトルの復元
+ if (item.EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce)
+ {
+ if (item.Title.Contains('\uFFFD') || item.Title.Contains("◆G◆"))
+ {
+ FixRgssTitleFromIni(item);
+ }
+ }
+
list.Add(item);
}
}
@@ -214,6 +287,27 @@ namespace GameLauncher.Services
AsarExtractedDirPath = asarExtP,
RelativePluginsJsInAsar = relJs
};
+
+ // 既存キャッシュの自動修復: ウディタの誤判定を修正
+ if (item.EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce && HasWolfGame(item.RootDirectory, out _))
+ {
+ item.EngineType = TkoolEngineType.Wolf;
+ item.HasRgssArchive = false;
+ item.IsRgssExtracted = false;
+ item.RgssArchivePath = null;
+ item.PluginsJsPath = string.Empty;
+ item.PluginsDirPath = string.Empty;
+ }
+
+ // 既存キャッシュの自動修復: 文字化けタイトルの復元
+ if (item.EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce)
+ {
+ if (item.Title.Contains('\uFFFD') || item.Title.Contains("◆G◆"))
+ {
+ FixRgssTitleFromIni(item);
+ }
+ }
+
list.Add(item);
imported = true;
}
@@ -342,7 +436,18 @@ namespace GameLauncher.Services
RelativePluginsJsInAsar = tg.RelativePluginsJsInAsar,
HasRgssArchive = tg.HasRgssArchive,
IsRgssExtracted = tg.IsRgssExtracted,
- RgssArchivePath = tg.RgssArchivePath
+ RgssArchivePath = tg.RgssArchivePath,
+ HasWolfArchive = tg.HasWolfArchive,
+ IsWolfExtracted = tg.IsWolfExtracted,
+ WolfDebugMode = tg.WolfDebugMode,
+ WolfDebugWindow = tg.WolfDebugWindow,
+ WolfProxyDll = tg.WolfProxyDll,
+ WolfSpeedMultiplier = tg.WolfSpeedMultiplier,
+ HasSrpgArchive = tg.HasSrpgArchive,
+ IsSrpgExtracted = tg.IsSrpgExtracted,
+ SrpgArchivePath = tg.SrpgArchivePath,
+ SrpgProxyDll = tg.SrpgProxyDll,
+ SrpgSpeedMultiplier = tg.SrpgSpeedMultiplier
});
}
}
@@ -427,8 +532,84 @@ namespace GameLauncher.Services
}
else if (game is TkoolGameItem tg)
{
- // ASAR形式ゲームの実在検証
- if (tg.IsAsar)
+ // 既存キャッシュの自動修復: ウディタの誤判定を修正
+ if (tg.EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce && HasWolfGame(tg.RootDirectory, out _))
+ {
+ tg.EngineType = TkoolEngineType.Wolf;
+ tg.HasRgssArchive = false;
+ tg.IsRgssExtracted = false;
+ tg.RgssArchivePath = null;
+ tg.PluginsJsPath = string.Empty;
+ tg.PluginsDirPath = string.Empty;
+ cacheNeedsSave = true;
+ onGameUpdated(tg);
+ }
+
+ // 既存キャッシュの自動修復: 文字化けタイトルの復元
+ if (tg.EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce &&
+ (tg.Title.Contains('\uFFFD') || tg.Title.Contains("◆G◆")))
+ {
+ var oldTitle = tg.Title;
+ FixRgssTitleFromIni(tg);
+ if (tg.Title != oldTitle)
+ {
+ cacheNeedsSave = true;
+ onGameUpdated(tg);
+ }
+ }
+
+ // 実在検証
+ if (tg.IsWolf)
+ {
+ if (!File.Exists(tg.ExecutablePath))
+ {
+ onGameRemoved(tg);
+ cacheNeedsSave = true;
+ continue;
+ }
+
+ // アーカイブ・解凍状態・プロキシDLLの最新同期
+ var wolfDir = tg.RootDirectory;
+ bool hasWolfArchive = File.Exists(Path.Combine(wolfDir, "Data.wolf")) ||
+ (Directory.Exists(wolfDir) && Directory.GetFiles(wolfDir, "*.wolf", SearchOption.TopDirectoryOnly).Length > 0);
+ bool isWolfExtracted = Directory.Exists(Path.Combine(wolfDir, "Data"));
+ bool isProxyDll = File.Exists(Path.Combine(wolfDir, WolfModService.ProxyDllName));
+
+ if (tg.HasWolfArchive != hasWolfArchive || tg.IsWolfExtracted != isWolfExtracted || tg.WolfProxyDll != isProxyDll)
+ {
+ tg.HasWolfArchive = hasWolfArchive;
+ tg.IsWolfExtracted = isWolfExtracted;
+ tg.WolfProxyDll = isProxyDll;
+ tg.IsModded = isProxyDll;
+ cacheNeedsSave = true;
+ }
+ }
+ else if (tg.IsSrpgStudio)
+ {
+ if (!File.Exists(tg.ExecutablePath))
+ {
+ onGameRemoved(tg);
+ cacheNeedsSave = true;
+ continue;
+ }
+
+ // アーカイブ・解凍状態・プロキシDLL・Modスクリプトの最新同期
+ var srpgDir = tg.RootDirectory;
+ bool hasSrpgArchive = File.Exists(Path.Combine(srpgDir, "data.dts"));
+ bool isSrpgExtracted = Directory.Exists(Path.Combine(srpgDir, "data_extracted")) || (Directory.Exists(Path.Combine(srpgDir, "Script")) && Directory.Exists(Path.Combine(srpgDir, "Plugin")));
+ bool isProxyDll = File.Exists(Path.Combine(srpgDir, SrpgModService.ProxyDllName));
+ bool isModScript = SrpgModService.IsModScriptApplied(srpgDir);
+
+ if (tg.HasSrpgArchive != hasSrpgArchive || tg.IsSrpgExtracted != isSrpgExtracted || tg.SrpgProxyDll != isProxyDll)
+ {
+ tg.HasSrpgArchive = hasSrpgArchive;
+ tg.IsSrpgExtracted = isSrpgExtracted;
+ tg.SrpgProxyDll = isProxyDll;
+ tg.IsModded = isProxyDll || isModScript;
+ cacheNeedsSave = true;
+ }
+ }
+ else if (tg.IsAsar)
{
var asarExists = !string.IsNullOrEmpty(tg.AsarPath) &&
(File.Exists(tg.AsarPath) || File.Exists(tg.AsarPath + AsarArchiveService.AsarBackupSuffix));
@@ -499,7 +680,11 @@ namespace GameLauncher.Services
}
// 改造状態の確認
- if (tg.IsAsar && !tg.IsAsarExtracted)
+ if (tg.IsWolf)
+ {
+ tg.IsModded = false;
+ }
+ else if (tg.IsAsar && !tg.IsAsarExtracted)
{
tg.IsModded = false;
}
@@ -754,7 +939,21 @@ namespace GameLauncher.Services
}
}
- // 4. ツクールVX / VX Ace (RGSS2 / RGSS3) ゲームの検出
+ // 4. WOLF RPGエディター(ウディタ)ゲームの検出
+ var wolfGame = DetectWolfGameInDirectory(dirPath, folderName, folderModified);
+ if (wolfGame != null)
+ {
+ return wolfGame;
+ }
+
+ // 5. SRPG Studio ゲームの検出
+ var srpgGame = DetectSrpgGameInDirectory(dirPath, folderName, folderModified);
+ if (srpgGame != null)
+ {
+ return srpgGame;
+ }
+
+ // 6. ツクールVX / VX Ace (RGSS2 / RGSS3) ゲームの検出
var rgssGame = DetectRgssGameInDirectory(dirPath, folderName, folderModified);
if (rgssGame != null)
{
@@ -766,11 +965,499 @@ namespace GameLauncher.Services
return null;
}
+ #region WOLF RPGエディター(ウディタ)検出ロジック
+
+ ///
+ /// 指定されたディレクトリがウディタのゲームであるかを判定し、TkoolGameItemを生成します。
+ ///
+ public TkoolGameItem? DetectWolfGameInDirectory(string dirPath, string folderName, DateTime? folderModified)
+ {
+ try
+ {
+ if (!HasWolfGame(dirPath, out var targetDir))
+ {
+ return null;
+ }
+
+ // 実行ファイルの探索 (Game.exe を最優先)
+ string? exePath = null;
+ var directExe = Path.Combine(targetDir, "Game.exe");
+ if (File.Exists(directExe))
+ {
+ exePath = directExe;
+ }
+ else
+ {
+ var rootDirectExe = Path.Combine(dirPath, "Game.exe");
+ if (File.Exists(rootDirectExe))
+ {
+ exePath = rootDirectExe;
+ }
+ else
+ {
+ var exes = Directory.GetFiles(targetDir, "*.exe", SearchOption.TopDirectoryOnly);
+ foreach (var exe in exes)
+ {
+ var name = Path.GetFileName(exe);
+ if (!name.Contains("unins", StringComparison.OrdinalIgnoreCase) &&
+ !name.Contains("config", StringComparison.OrdinalIgnoreCase) &&
+ !name.Contains("setup", StringComparison.OrdinalIgnoreCase) &&
+ !name.Contains("patch", StringComparison.OrdinalIgnoreCase))
+ {
+ exePath = exe;
+ break;
+ }
+ }
+ }
+ }
+
+ if (exePath == null)
+ {
+ return null;
+ }
+
+ var icon = LoadIcon(exePath, dirPath);
+
+ // タイトル取得 (フォルダ名をデフォルトとし、Game.iniにTitle指定があれば優先)
+ string title = folderName;
+ var ini = Path.Combine(targetDir, "Game.ini");
+ if (File.Exists(ini))
+ {
+ var lines = ReadIniLinesSafe(ini);
+ foreach (var line in lines)
+ {
+ var trim = line.Trim();
+ if (trim.StartsWith("Title=", StringComparison.OrdinalIgnoreCase))
+ {
+ var val = trim.Substring(6).Trim();
+ if (!string.IsNullOrWhiteSpace(val))
+ {
+ title = val;
+ break;
+ }
+ }
+ }
+ }
+
+ // アーカイブおよび解凍状態、プロキシDLL配置の確認
+ bool hasWolfArchive = File.Exists(Path.Combine(targetDir, "Data.wolf")) ||
+ (Directory.Exists(targetDir) && Directory.GetFiles(targetDir, "*.wolf", SearchOption.TopDirectoryOnly).Length > 0);
+ bool isWolfExtracted = Directory.Exists(Path.Combine(targetDir, "Data"));
+ bool isProxyDll = File.Exists(Path.Combine(targetDir, WolfModService.ProxyDllName));
+
+ return new TkoolGameItem
+ {
+ Title = title,
+ FolderName = folderName,
+ RootDirectory = dirPath,
+ ExecutablePath = exePath,
+ PluginsJsPath = string.Empty,
+ PluginsDirPath = string.Empty,
+ EngineType = TkoolEngineType.Wolf,
+ IsModded = isProxyDll,
+ ApplyMod = false,
+ WolfProxyDll = isProxyDll,
+ HasWolfArchive = hasWolfArchive,
+ IsWolfExtracted = isWolfExtracted,
+ IconImage = icon,
+ FolderLastModified = folderModified,
+ HasRgssArchive = false,
+ IsRgssExtracted = false,
+ RgssArchivePath = null,
+ IsAsar = false
+ };
+ }
+ catch { }
+
+ return null;
+ }
+
+ ///
+ /// 指定されたディレクトリまたはその直下にウディタのファイルが存在するかチェックします。
+ ///
+ public static bool HasWolfGame(string dir, out string wolfDir)
+ {
+ wolfDir = dir;
+ if (IsWolfDirectory(dir)) return true;
+ try
+ {
+ if (Directory.Exists(dir))
+ {
+ foreach (var sub in Directory.GetDirectories(dir))
+ {
+ if (IsWolfDirectory(sub))
+ {
+ wolfDir = sub;
+ return true;
+ }
+ }
+ }
+ }
+ catch { }
+ return false;
+ }
+
+ ///
+ /// 単一のディレクトリ内にウディタの特徴(*.wolf、ウディタ用Game.ini、Game.dat等)が存在するか判定します。
+ ///
+ public static bool IsWolfDirectory(string dir)
+ {
+ try
+ {
+ if (!Directory.Exists(dir)) return false;
+
+ // 1. *.wolf ファイルの存在 (Data.wolf, Data\*.wolf 等)
+ if (Directory.GetFiles(dir, "*.wolf", SearchOption.TopDirectoryOnly).Length > 0)
+ return true;
+
+ var dataDir = Path.Combine(dir, "Data");
+ if (Directory.Exists(dataDir))
+ {
+ if (Directory.GetFiles(dataDir, "*.wolf", SearchOption.TopDirectoryOnly).Length > 0)
+ return true;
+
+ if (Directory.Exists(Path.Combine(dataDir, "BasicData")) || Directory.Exists(Path.Combine(dataDir, "System")))
+ return true;
+ }
+
+ // 2. Game.dat または GuruguruSMF4.dll
+ if (File.Exists(Path.Combine(dir, "Game.dat")) || File.Exists(Path.Combine(dir, "GuruguruSMF4.dll")))
+ return true;
+
+ // 3. Game.ini のウディタ固有設定 ([DEFAULT], SoftModeFlag, SEandBGM)
+ var ini = Path.Combine(dir, "Game.ini");
+ if (File.Exists(ini))
+ {
+ var lines = ReadIniLinesSafe(ini);
+ foreach (var line in lines)
+ {
+ var trim = line.Trim();
+ if (trim.StartsWith("SoftModeFlag=", StringComparison.OrdinalIgnoreCase) ||
+ trim.StartsWith("SEandBGM=", StringComparison.OrdinalIgnoreCase) ||
+ trim.Equals("[DEFAULT]", StringComparison.OrdinalIgnoreCase) ||
+ trim.StartsWith("WindowModeFlag=", StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ catch { }
+
+ return false;
+ }
+
+ #endregion
+
+ #region SRPG Studio 検出ロジック
+
+ ///
+ /// 指定されたディレクトリがSRPG Studioのゲームであるかを判定し、TkoolGameItemを生成します。
+ ///
+ public TkoolGameItem? DetectSrpgGameInDirectory(string dirPath, string folderName, DateTime? folderModified)
+ {
+ try
+ {
+ if (!HasSrpgStudioGame(dirPath, out var targetDir))
+ {
+ return null;
+ }
+
+ // 実行ファイルの探索 (Game.exe, game.exe を最優先)
+ string? exePath = null;
+ var directExe = Path.Combine(targetDir, "Game.exe");
+ if (File.Exists(directExe))
+ {
+ exePath = directExe;
+ }
+ else
+ {
+ directExe = Path.Combine(targetDir, "game.exe");
+ if (File.Exists(directExe))
+ {
+ exePath = directExe;
+ }
+ else
+ {
+ var rootDirectExe = Path.Combine(dirPath, "Game.exe");
+ if (File.Exists(rootDirectExe))
+ {
+ exePath = rootDirectExe;
+ }
+ else
+ {
+ var exes = Directory.GetFiles(targetDir, "*.exe", SearchOption.TopDirectoryOnly);
+ foreach (var exe in exes)
+ {
+ var name = Path.GetFileName(exe);
+ if (!name.Contains("unins", StringComparison.OrdinalIgnoreCase) &&
+ !name.Contains("config", StringComparison.OrdinalIgnoreCase) &&
+ !name.Contains("setup", StringComparison.OrdinalIgnoreCase) &&
+ !name.Contains("patch", StringComparison.OrdinalIgnoreCase))
+ {
+ exePath = exe;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if (exePath == null)
+ {
+ return null;
+ }
+
+ var icon = LoadIcon(exePath, dirPath);
+
+ // タイトル取得 (フォルダ名をデフォルトとし、Game.iniにTitle指定があれば優先)
+ string title = folderName;
+ var ini = Path.Combine(targetDir, "Game.ini");
+ if (!File.Exists(ini)) ini = Path.Combine(targetDir, "game.ini");
+ if (File.Exists(ini))
+ {
+ var lines = ReadIniLinesSafe(ini);
+ foreach (var line in lines)
+ {
+ var trim = line.Trim();
+ if (trim.StartsWith("Title=", StringComparison.OrdinalIgnoreCase))
+ {
+ var val = trim.Substring(6).Trim();
+ if (!string.IsNullOrWhiteSpace(val))
+ {
+ title = val;
+ break;
+ }
+ }
+ }
+ }
+
+ // アーカイブおよび解凍状態、プロキシDLL配置、Modスクリプトの確認
+ bool hasSrpgArchive = File.Exists(Path.Combine(targetDir, SrpgArchiveService.ArchiveFileName));
+ bool isSrpgExtracted = Directory.Exists(Path.Combine(targetDir, SrpgArchiveService.ExtractedDirName)) ||
+ (Directory.Exists(Path.Combine(targetDir, "Script")) && Directory.Exists(Path.Combine(targetDir, "Plugin")));
+ bool isProxyDll = File.Exists(Path.Combine(targetDir, SrpgModService.ProxyDllName));
+ bool isModScript = SrpgModService.IsModScriptApplied(targetDir);
+
+ return new TkoolGameItem
+ {
+ Title = title,
+ FolderName = folderName,
+ RootDirectory = dirPath,
+ ExecutablePath = exePath,
+ PluginsJsPath = string.Empty,
+ PluginsDirPath = string.Empty,
+ EngineType = TkoolEngineType.SrpgStudio,
+ IsModded = isProxyDll || isModScript,
+ ApplyMod = false,
+ SrpgProxyDll = isProxyDll,
+ HasSrpgArchive = hasSrpgArchive,
+ IsSrpgExtracted = isSrpgExtracted,
+ SrpgArchivePath = hasSrpgArchive ? Path.Combine(targetDir, SrpgArchiveService.ArchiveFileName) : null,
+ IconImage = icon,
+ FolderLastModified = folderModified,
+ HasRgssArchive = false,
+ IsRgssExtracted = false,
+ RgssArchivePath = null,
+ IsAsar = false,
+ HasWolfArchive = false,
+ IsWolfExtracted = false
+ };
+ }
+ catch { }
+
+ return null;
+ }
+
+ ///
+ /// 指定されたディレクトリまたはその直下にSRPG Studioのファイルが存在するかチェックします。
+ ///
+ public static bool HasSrpgStudioGame(string dir, out string srpgDir)
+ {
+ srpgDir = dir;
+ if (IsSrpgStudioDirectory(dir)) return true;
+ try
+ {
+ if (Directory.Exists(dir))
+ {
+ foreach (var sub in Directory.GetDirectories(dir))
+ {
+ if (IsSrpgStudioDirectory(sub))
+ {
+ srpgDir = sub;
+ return true;
+ }
+ }
+ }
+ }
+ catch { }
+ return false;
+ }
+
+ ///
+ /// 単一のディレクトリ内にSRPG Studioの特徴(data.dts、runtime.rts、固有設定のgame.ini等)が存在するか判定します。
+ ///
+ public static bool IsSrpgStudioDirectory(string dir)
+ {
+ try
+ {
+ if (!Directory.Exists(dir)) return false;
+
+ // 1. data.dts または runtime.rts または environment.evs の存在
+ if (File.Exists(Path.Combine(dir, "data.dts")) ||
+ File.Exists(Path.Combine(dir, "runtime.rts")) ||
+ File.Exists(Path.Combine(dir, "environment.evs")))
+ {
+ return true;
+ }
+
+ // 2. 解凍済みフォルダ (project.srpgs または project.dat) の存在
+ if (File.Exists(Path.Combine(dir, "project.srpgs")) ||
+ File.Exists(Path.Combine(dir, "project.dat")) ||
+ File.Exists(Path.Combine(dir, "data_extracted", "project.srpgs")))
+ {
+ return true;
+ }
+
+ // 3. game.ini / Game.ini のSRPG Studio固有設定
+ var ini = Path.Combine(dir, "game.ini");
+ if (!File.Exists(ini)) ini = Path.Combine(dir, "Game.ini");
+ if (File.Exists(ini))
+ {
+ var lines = ReadIniLinesSafe(ini);
+ foreach (var line in lines)
+ {
+ var trim = line.Trim();
+ if (trim.StartsWith("HighPerf=", StringComparison.OrdinalIgnoreCase) ||
+ trim.StartsWith("HardwareAcceleration=", StringComparison.OrdinalIgnoreCase) ||
+ trim.StartsWith("GamePadDInput=", StringComparison.OrdinalIgnoreCase) ||
+ trim.StartsWith("NonActiveMusicPlay=", StringComparison.OrdinalIgnoreCase) ||
+ trim.StartsWith("ScriptErrorTerminate=", StringComparison.OrdinalIgnoreCase) ||
+ trim.Equals("[keyboard]", StringComparison.OrdinalIgnoreCase) ||
+ trim.Equals("[gamepad]", StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ catch { }
+
+ return false;
+ }
+
+ #endregion
+
+ #region エンコーディング安全INI読み込み & タイトル修復
+
+ ///
+ /// BOMの有無やShift_JIS (CP932) を自動判定して安全にINIファイルを行単位で読み込みます。
+ ///
+ public static string[] ReadIniLinesSafe(string filePath)
+ {
+ try
+ {
+ if (!File.Exists(filePath)) return Array.Empty();
+
+ byte[] bytes = File.ReadAllBytes(filePath);
+ if (bytes.Length == 0) return Array.Empty();
+
+ // 1. UTF-8 BOM (EF BB BF)
+ if (bytes.Length >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF)
+ {
+ var text = System.Text.Encoding.UTF8.GetString(bytes, 3, bytes.Length - 3);
+ return text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
+ }
+
+ // 2. UTF-16 LE BOM (FF FE)
+ if (bytes.Length >= 2 && bytes[0] == 0xFF && bytes[1] == 0xFE)
+ {
+ var text = System.Text.Encoding.Unicode.GetString(bytes, 2, bytes.Length - 2);
+ return text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
+ }
+
+ // 3. Shift_JIS (CP932) でデコード(ツクールVX/VX Aceおよびウディタの標準)
+ System.Text.Encoding encoding;
+ try
+ {
+ encoding = System.Text.Encoding.GetEncoding(932);
+ }
+ catch
+ {
+ encoding = System.Text.Encoding.GetEncoding("shift_jis");
+ }
+
+ var decoded = encoding.GetString(bytes);
+ return decoded.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
+ }
+ catch
+ {
+ return Array.Empty();
+ }
+ }
+
+ ///
+ /// キャッシュ内に文字化けして保存されたRGSSタイトルの修復を行います。
+ ///
+ public static void FixRgssTitleFromIni(TkoolGameItem tg)
+ {
+ try
+ {
+ string? iniPath = null;
+ var directIni = Path.Combine(tg.RootDirectory, "Game.ini");
+ if (File.Exists(directIni))
+ {
+ iniPath = directIni;
+ }
+ else
+ {
+ if (Directory.Exists(tg.RootDirectory))
+ {
+ foreach (var sub in Directory.GetDirectories(tg.RootDirectory))
+ {
+ var subIni = Path.Combine(sub, "Game.ini");
+ if (File.Exists(subIni))
+ {
+ iniPath = subIni;
+ break;
+ }
+ }
+ }
+ }
+
+ if (iniPath != null)
+ {
+ var lines = ReadIniLinesSafe(iniPath);
+ foreach (var line in lines)
+ {
+ var trim = line.Trim();
+ if (trim.StartsWith("Title=", StringComparison.OrdinalIgnoreCase))
+ {
+ var val = trim.Substring(6).Trim();
+ if (!string.IsNullOrWhiteSpace(val) && !val.Contains('\uFFFD'))
+ {
+ tg.Title = val;
+ break;
+ }
+ }
+ }
+ }
+ }
+ catch { }
+ }
+
+ #endregion
+
private TkoolGameItem? DetectRgssGameInDirectory(string dirPath, string folderName, DateTime? folderModified)
{
try
{
- // 1. Game.ini または RGSS アーカイブ / スクリプトファイルの存在チェック
+ // 1. ウディタおよび SRPG Studio の場合は絶対に RGSS にしない
+ if (IsWolfDirectory(dirPath) || IsSrpgStudioDirectory(dirPath))
+ {
+ return null;
+ }
+
string? gameIniPath = null;
string searchDir = dirPath;
@@ -785,6 +1472,7 @@ namespace GameLauncher.Services
{
foreach (var sub in Directory.GetDirectories(dirPath))
{
+ if (IsWolfDirectory(sub) || IsSrpgStudioDirectory(sub)) continue;
var subIni = Path.Combine(sub, "Game.ini");
if (File.Exists(subIni))
{
@@ -802,16 +1490,21 @@ namespace GameLauncher.Services
string? scriptsPath = null;
TkoolEngineType engineType = TkoolEngineType.Unknown;
string? title = null;
+ bool isRgssIni = false;
if (gameIniPath != null)
{
try
{
- var lines = File.ReadAllLines(gameIniPath);
+ var lines = ReadIniLinesSafe(gameIniPath);
foreach (var line in lines)
{
var trim = line.Trim();
- if (trim.StartsWith("Title=", StringComparison.OrdinalIgnoreCase))
+ if (trim.Equals("[Game]", StringComparison.OrdinalIgnoreCase))
+ {
+ isRgssIni = true;
+ }
+ else if (trim.StartsWith("Title=", StringComparison.OrdinalIgnoreCase))
{
var val = trim.Substring(6).Trim();
if (!string.IsNullOrEmpty(val)) title = val;
@@ -820,25 +1513,54 @@ namespace GameLauncher.Services
{
var val = trim.Substring(4).Trim();
if (val.Contains("RPGVXAce", StringComparison.OrdinalIgnoreCase))
+ {
engineType = TkoolEngineType.VXAce;
+ isRgssIni = true;
+ }
else if (val.Contains("RPGVX", StringComparison.OrdinalIgnoreCase))
+ {
engineType = TkoolEngineType.VX;
+ isRgssIni = true;
+ }
}
else if (trim.StartsWith("Library=", StringComparison.OrdinalIgnoreCase))
{
var val = trim.Substring(8).Trim();
- if (val.Contains("RGSS3", StringComparison.OrdinalIgnoreCase) && engineType == TkoolEngineType.Unknown)
+ if (val.Contains("RGSS3", StringComparison.OrdinalIgnoreCase))
+ {
engineType = TkoolEngineType.VXAce;
- else if (val.Contains("RGSS2", StringComparison.OrdinalIgnoreCase) && engineType == TkoolEngineType.Unknown)
+ isRgssIni = true;
+ }
+ else if (val.Contains("RGSS2", StringComparison.OrdinalIgnoreCase))
+ {
engineType = TkoolEngineType.VX;
+ isRgssIni = true;
+ }
+ else if (val.Contains("RGSS", StringComparison.OrdinalIgnoreCase))
+ {
+ isRgssIni = true;
+ }
}
else if (trim.StartsWith("Scripts=", StringComparison.OrdinalIgnoreCase))
{
var val = trim.Substring(8).Trim();
- if (val.EndsWith(".rvdata2", StringComparison.OrdinalIgnoreCase) && engineType == TkoolEngineType.Unknown)
+ if (val.EndsWith(".rvdata2", StringComparison.OrdinalIgnoreCase))
+ {
engineType = TkoolEngineType.VXAce;
- else if (val.EndsWith(".rvdata", StringComparison.OrdinalIgnoreCase) && engineType == TkoolEngineType.Unknown)
+ isRgssIni = true;
+ }
+ else if (val.EndsWith(".rvdata", StringComparison.OrdinalIgnoreCase))
+ {
engineType = TkoolEngineType.VX;
+ isRgssIni = true;
+ }
+ }
+ else if (trim.StartsWith("SoftModeFlag=", StringComparison.OrdinalIgnoreCase) ||
+ trim.StartsWith("SEandBGM=", StringComparison.OrdinalIgnoreCase) ||
+ trim.Equals("[DEFAULT]", StringComparison.OrdinalIgnoreCase))
+ {
+ // ウディタのiniであることが判明した場合は直ちに除外
+ return null;
}
}
}
@@ -846,8 +1568,8 @@ namespace GameLauncher.Services
}
// アーカイブファイルの探索
- var rgss3aFiles = Directory.GetFiles(searchDir, "*.rgss3a", SearchOption.TopDirectoryOnly);
- var rgss2aFiles = Directory.GetFiles(searchDir, "*.rgss2a", SearchOption.TopDirectoryOnly);
+ var rgss3aFiles = Directory.Exists(searchDir) ? Directory.GetFiles(searchDir, "*.rgss3a", SearchOption.TopDirectoryOnly) : Array.Empty();
+ var rgss2aFiles = Directory.Exists(searchDir) ? Directory.GetFiles(searchDir, "*.rgss2a", SearchOption.TopDirectoryOnly) : Array.Empty();
if (rgss3aFiles.Length > 0)
{
@@ -875,8 +1597,8 @@ namespace GameLauncher.Services
if (engineType == TkoolEngineType.Unknown) engineType = TkoolEngineType.VX;
}
- // RGSS系でない場合はスキップ
- if (engineType == TkoolEngineType.Unknown && archivePath == null && scriptsPath == null && gameIniPath == null)
+ // RGSS系でない場合はスキップ(アーカイブなし、スクリプトなし、RGSS用Game.iniでもない場合は除外)
+ if (archivePath == null && scriptsPath == null && !isRgssIni)
{
return null;
}
diff --git a/publish.ps1 b/publish.ps1
index 6838a98..13e397f 100644
--- a/publish.ps1
+++ b/publish.ps1
@@ -1,20 +1,20 @@
-# GameLauncher 単一ファイル発行スクリプト
+# GameLauncher 単一ファイル発行スクリプト
# 公開先: Z:\自作ソフト\GameLauncher\
$ErrorActionPreference = 'Stop'
$projectDir = $PSScriptRoot
-$publishDir = 'Z:\自作ソフト\GameLauncher'
+$publishDir = "Z:\自作ソフト\GameLauncher"
-Write-Host '=== GameLauncher 発行処理開始 ===' -ForegroundColor Cyan
+Write-Host "=== GameLauncher 発行処理開始 (発行先: $publishDir) ===" -ForegroundColor Cyan
if (!(Test-Path $publishDir)) {
New-Item -ItemType Directory -Path $publishDir -Force | Out-Null
}
-Write-Host 'プロジェクトのビルドおよび単一ファイル発行中...' -ForegroundColor Yellow
+Write-Host "プロジェクトのビルドおよび単一ファイル発行中..." -ForegroundColor Yellow
-dotnet publish "$projectDir\GameLauncher.csproj" -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -p:PublishDir="$publishDir\"
+dotnet publish "$projectDir\GameLauncher.csproj" -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o "$publishDir"
if ($LASTEXITCODE -eq 0) {
# プラグインおよび設定ファイルの配置
@@ -27,6 +27,13 @@ if ($LASTEXITCODE -eq 0) {
if (Test-Path "$projectDir\Config.tjs") {
Copy-Item -Path "$projectDir\Config.tjs" -Destination "$publishDir\Config.tjs" -Force
}
+ # ウディタおよびSRPG Studio用ツール(UberWolfCli, SRPG_Unpacker, speedhack-i686プロキシDLL等)の配置
+ if (Test-Path "$projectDir\Tools") {
+ if (!(Test-Path "$publishDir\Tools")) {
+ New-Item -ItemType Directory -Path "$publishDir\Tools" -Force | Out-Null
+ }
+ robocopy "$projectDir\Tools" "$publishDir\Tools" /E /NP /R:1 /W:1 | Out-Null
+ }
Write-Host "発行成功: $publishDir\GameLauncher.exe" -ForegroundColor Green
} else {
Write-Host "発行失敗 (終了コード: $LASTEXITCODE)" -ForegroundColor Red