From 8cea2a147d24337f653ffdce540e00076b044d06 Mon Sep 17 00:00:00 2001 From: uduki Date: Wed, 7 Oct 2026 02:30:49 +0900 Subject: [PATCH] refactor: reorganize engine-based structure and add agent rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Engines/ 配下へエンジン別に再編 (Common/Rgss/Tkool/Tyrano/Wolf/Unity/Nwjs) - ゲーム個別処理を Engines//Games// へ分離し、共通処理から明示呼び出し - 外部ツールを Engines//Tools/ へ移動し、AppPathHelper 経由で解決 - 旧 Tools/ 直下参照と不要な参照ファイル/バックアップを削除 - エージェント規則 AGENTS.md を追加し、README から参照 - publish.ps1 を Engines//Tools/ の再帰配置に対応 --- AGENTS.md | 63 ++ AddKeyDialog.xaml.cs | 1 + ConfigDialog.xaml | 20 + ConfigDialog.xaml.cs | 23 + Engines/Common/EngineDetectionHelper.cs | 193 +++++++ Engines/Common/IEngineModule.cs | 28 + .../Nwjs}/AsarArchiveService.cs | 6 +- Engines/Nwjs/NwjsPackageUnpacker.cs | 378 ++++++++++++ Engines/Nwjs/NwjsUnpackerToolProvider.cs | 341 +++++++++++ Engines/Nwjs/Tools/README-nwjs-unpacker.md | 33 ++ .../IiniTitleRepair/GameIniTitleRepair.cs | 115 ++++ {Services => Engines/Rgss}/RgssModService.cs | 44 +- .../Rgss}/SrpgArchiveService.cs | 18 +- {Services => Engines/Rgss}/SrpgModService.cs | 12 +- {Models => Engines/Tkool}/TkoolGameItem.cs | 76 ++- Engines/Tkool/TkoolInjectionService.cs | 208 +++++++ .../Tkool}/TkoolModService.cs | 4 +- .../Tkool/TkoolPackagedExtractionService.cs | 249 ++++++++ .../Tyrano}/TyranoModService.cs | 7 +- {Models => Engines/Unity}/UnityEnums.cs | 2 +- {Models => Engines/Unity}/UnityGameItem.cs | 5 +- {Models => Engines/Unity}/UnitySaveItem.cs | 5 +- .../Unity}/UnitySaveManagerService.cs | 4 +- .../Wolf}/WolfArchiveService.cs | 24 +- {Services => Engines/Wolf}/WolfModService.cs | 25 +- {Services => Engines/Wolf}/WolfSaveService.cs | 4 +- GameLauncher.csproj | 1 + Helpers/AppPathHelper.cs | 73 +++ Helpers/Converters.cs | 2 + MainWindow.xaml | 37 ++ MainWindow.xaml.cs | 188 +++++- Models/GameItemBase.cs | 2 + Models/LauncherConfig.cs | 5 + README.md | 96 +++- SaveEditorWindow.xaml | 3 +- SaveEditorWindow.xaml.cs | 5 + Services/Codecs/EasySave3Codec.cs | 1 + Services/Codecs/ISaveDataCodec.cs | 1 + Services/Codecs/YurisSaveCodec.cs | 1 + Services/GameScannerService.cs | 543 +++++++++++++++--- Services/SaveDataCodecManager.cs | 2 + Services/WindowResizeService.cs | 160 ++++++ Tools/speedhack-i686.zip | Bin 1082442 -> 0 bytes WolfSaveEditorDialog.xaml.cs | 2 + plugins/GameLauncher_Mod.js | 99 ++++ publish.bat | 5 - publish.ps1 | 38 +- 47 files changed, 2976 insertions(+), 176 deletions(-) create mode 100644 AGENTS.md create mode 100644 Engines/Common/EngineDetectionHelper.cs create mode 100644 Engines/Common/IEngineModule.cs rename {Services => Engines/Nwjs}/AsarArchiveService.cs (99%) create mode 100644 Engines/Nwjs/NwjsPackageUnpacker.cs create mode 100644 Engines/Nwjs/NwjsUnpackerToolProvider.cs create mode 100644 Engines/Nwjs/Tools/README-nwjs-unpacker.md create mode 100644 Engines/Rgss/Games/IiniTitleRepair/GameIniTitleRepair.cs rename {Services => Engines/Rgss}/RgssModService.cs (94%) rename {Services => Engines/Rgss}/SrpgArchiveService.cs (95%) rename {Services => Engines/Rgss}/SrpgModService.cs (99%) rename {Models => Engines/Tkool}/TkoolGameItem.cs (87%) create mode 100644 Engines/Tkool/TkoolInjectionService.cs rename {Services => Engines/Tkool}/TkoolModService.cs (99%) create mode 100644 Engines/Tkool/TkoolPackagedExtractionService.cs rename {Services => Engines/Tyrano}/TyranoModService.cs (99%) rename {Models => Engines/Unity}/UnityEnums.cs (97%) rename {Models => Engines/Unity}/UnityGameItem.cs (98%) rename {Models => Engines/Unity}/UnitySaveItem.cs (98%) rename {Services => Engines/Unity}/UnitySaveManagerService.cs (99%) rename {Services => Engines/Wolf}/WolfArchiveService.cs (91%) rename {Services => Engines/Wolf}/WolfModService.cs (91%) rename {Services => Engines/Wolf}/WolfSaveService.cs (99%) create mode 100644 Services/WindowResizeService.cs delete mode 100644 Tools/speedhack-i686.zip create mode 100644 plugins/GameLauncher_Mod.js delete mode 100644 publish.bat diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..bfb31c4 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,63 @@ +# AGENTS.md — GameLauncher エージェント規則 + +このファイルは **GameLauncher プロジェクトの AI エージェント向け規則** である。 +本プロジェクトでのすべての変更(コード追加・修正・削除・発行)は、必ず以下の規則に従って実施すること。 + +> 注意: 本規則は今後も追加・変更され得る。作業を開始する前に必ず本ファイルを確認し、 +> 最新の規則に従うこと。 + +--- + +## 1. フォルダ構成の原則(エンジン別集約) + +- エンジン別の処理は `Engines//` に集約する。 + - 例: `Engines/Rgss/`, `Engines/Tkool/`, `Engines/Tyrano/`, `Engines/Wolf/`, `Engines/Unity/`, `Engines/Nwjs/` + - エンジン共通の基盤は `Engines/Common/`(例: `IEngineModule.cs`, `EngineDetectionHelper.cs`)。 +- エンジン別クラスの名前空間は `GameLauncher.Engines.` とする。 + - 例: `GameLauncher.Engines.Rgss`, `GameLauncher.Engines.Wolf` +- エンジンに依存しない共通処理のみ `Services/` / `Models/` / `Helpers/` に置く。 + - 例: `Services/GameScannerService.cs`, `Models/GameItemBase.cs`, `Helpers/AppPathHelper.cs` + +## 2. ゲーム個別対応の規則(他ゲームへ影響させない) + +- 特定ゲーム専用の処理は `Engines//Games//` に作成する。 +- 名前空間は `GameLauncher.Engines..Games.` とする。 + - 例: `Engines/Rgss/Games/IiniTitleRepair/GameIniTitleRepair.cs` + → `namespace GameLauncher.Engines.Rgss.Games.IiniTitleRepair` +- ゲーム個別処理は共通処理から **明示的に呼び出す** こと(暗黙のグローバル副作用を持たせない)。 +- **特定ゲーム専用の改造が他ゲームへ影響を与えてはならない(必須要件)。** +- 可能な限りバックアップからの復元手段を用意し、後で元に戻せるようにする。 +- プラグインで対応できない場合は、バックアップ・復元可能な直接ファイル変更を許容する。 + +## 3. 外部ツール・外部ファイルの規則(エンジン単位で参照) + +- エンジン専用の外部ツール/ファイルは `Engines//Tools/` に配置する。 + - 例: `Engines/Rgss/Tools/SRPG_Unpacker.exe`, `Engines/Wolf/Tools/UberWolfCli.exe`, + `Engines/Nwjs/Tools/speedhack-i686/` +- パス解決には共通ヘルパーを使用する。 + - `AppPathHelper.ResolveEngineTool(string engineName, string toolFileName)` + - `AppPathHelper.GetEngineToolsDirectory(string engineName)` +- **エンジン間でツールを共有しない。旧 `Tools/` 直下を参照するコードを新規に書かない。** +- 外部ツールの配置は `publish.ps1` が `Engines//Tools/` を再帰的に発行先へコピーする。 + +## 4. ビルド・発行の規則 + +- 変更後は **必ずビルドを成功させる**(`build_solution` を使用)。 +- 発行は `publish.ps1` で行い、`Z:\自作ソフト\GameLauncher` へ配置して起動確認まで行う。 +- 単一ファイル発行(`PublishSingleFile`)の設定を維持する。 + +## 5. コメント・表記の規則 + +- コードコメントは既存コードに合わせて日本語/英語を適切に使い分ける。 +- 新規ファイルには冒頭に説明コメントを付ける。 +- ファイル名・シンボル参照はバッククォートで囲む。 + +--- + +## 6. 変更時のチェックリスト + +1. 本ファイル(`AGENTS.md`)の最新規則を確認したか。 +2. エンジン別の処理は `Engines//` 配下に置いたか。 +3. ゲーム個別処理は `Engines//Games//` に分離し、他ゲームへ影響しないか。 +4. 外部ツールは `Engines//Tools/` にあり、`AppPathHelper` 経由で参照しているか。 +5. ビルドが成功し、`publish.ps1` で発行できるか。 diff --git a/AddKeyDialog.xaml.cs b/AddKeyDialog.xaml.cs index 2a07e80..0a39489 100644 --- a/AddKeyDialog.xaml.cs +++ b/AddKeyDialog.xaml.cs @@ -1,6 +1,7 @@ using System.Windows; using System.Windows.Controls; using GameLauncher.Models; +using GameLauncher.Engines.Unity; namespace GameLauncher { diff --git a/ConfigDialog.xaml b/ConfigDialog.xaml index 08c264d..7e7eceb 100644 --- a/ConfigDialog.xaml +++ b/ConfigDialog.xaml @@ -113,6 +113,26 @@ + + + + + + + + + + + + + +