feat: エンジン種別タブ(WOLF/SRPG)追加、Backupsパス統一、Shift_JIS有効化、スキャナ改善
This commit is contained in:
1 parent
a1430bbdbc
commit
01ee04b4cc
13 files changed
+1878
-34
No files matched your search
@@ -14,3 +14,8 @@ Backups/
|
||||
Profiles/
|
||||
config.json
|
||||
games_cache.json
|
||||
|
||||
# Temporary reverse-engineering / analysis reference artifacts
|
||||
WolfDec_*.json
|
||||
WolfDec_main.cpp
|
||||
*_ref.h
|
||||
@@ -14,6 +14,9 @@ namespace GameLauncher
|
||||
{
|
||||
base.OnStartup(e);
|
||||
|
||||
// Shift_JIS等のコードページを有効化
|
||||
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
|
||||
|
||||
// 作業ディレクトリを exe のあるフォルダに確実に設定
|
||||
AppPathHelper.SetCurrentDirectoryToExeDirectory();
|
||||
|
||||
|
||||
@@ -93,6 +93,26 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 1.5. Wolf RPG 解凍ツール パス設定 -->
|
||||
<Border Background="#20202E" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="8" Padding="14" Margin="0,0,0,14">
|
||||
<StackPanel>
|
||||
<TextBlock Text="🐺 Wolf RPG アーカイブ解凍ツールのパス (Data.wolf 解凍用)" FontSize="13" FontWeight="Bold" Foreground="#3B3B98"/>
|
||||
<TextBlock Text="WOLF RPGエディターの暗号化アーカイブ (*.wolf) の解凍・抽出に使用するツールのパスを設定します(未指定時は内蔵ツール Tools\UberWolfCli.exe が自動使用されます)。"
|
||||
FontSize="11" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="0,3,0,10"/>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Name="txtWolfExtractorPath" Grid.Column="0" Background="#14141C" Foreground="#FFFFFF"
|
||||
BorderBrush="{StaticResource BorderColor}" BorderThickness="1" Padding="8,6" FontSize="12"/>
|
||||
<Button Grid.Column="2" Style="{StaticResource ModernButton}" Content="📁 参照..." Click="btnBrowseWolfExtractor_Click"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 2. バックアップ保存先フォルダ -->
|
||||
<Border Background="#20202E" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="8" Padding="14" Margin="0,0,0,14">
|
||||
<StackPanel>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -164,6 +164,24 @@ namespace GameLauncher.Helpers
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
+298
-1
@@ -38,6 +38,12 @@
|
||||
<SolidColorBrush x:Key="BadgeIl2cppBg" Color="#5A368B"/>
|
||||
<SolidColorBrush x:Key="BadgeMonoBg" Color="#1E5F8B"/>
|
||||
<SolidColorBrush x:Key="BadgeSaveBg" Color="#0D735E"/>
|
||||
<SolidColorBrush x:Key="BadgeWolfBg" Color="#3B3B98"/>
|
||||
<SolidColorBrush x:Key="AccentWolf" Color="#4834D4"/>
|
||||
<SolidColorBrush x:Key="AccentWolfHover" Color="#686DE0"/>
|
||||
<SolidColorBrush x:Key="BadgeSrpgBg" Color="#0984E3"/>
|
||||
<SolidColorBrush x:Key="AccentSrpg" Color="#0984E3"/>
|
||||
<SolidColorBrush x:Key="AccentSrpgHover" Color="#74B9FF"/>
|
||||
|
||||
<!-- スクロールバースタイル定義 -->
|
||||
<Style TargetType="ScrollBar">
|
||||
@@ -368,6 +374,8 @@
|
||||
<RadioButton x:Name="tabVXAce" Style="{StaticResource NavTabRadioButton}" Content="ツクールVX Ace" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
<RadioButton x:Name="tabVX" Style="{StaticResource NavTabRadioButton}" Content="ツクールVX" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
<RadioButton x:Name="tabTyrano" Style="{StaticResource NavTabRadioButton}" Content="ティラノ" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
<RadioButton x:Name="tabWolf" Style="{StaticResource NavTabRadioButton}" Content="🐺 ウディタ" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
<RadioButton x:Name="tabSrpg" Style="{StaticResource NavTabRadioButton}" Content="🛡️ SRPG Studio" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
<RadioButton x:Name="tabUnity" Style="{StaticResource NavTabRadioButton}" Content="⚡ Unity" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
@@ -386,6 +394,7 @@
|
||||
<CheckBox x:Name="chkFilterModdedOnly" Content="改造中のみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
<CheckBox x:Name="chkFilterAsarOnly" Content="ASAR形式のみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
<CheckBox x:Name="chkFilterRgssOnly" Content="RGSSアーカイブのみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
<CheckBox x:Name="chkFilterSrpgOnly" Content="data.dtsのみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
<CheckBox x:Name="chkFilterSaveOnly" Content="セーブありのみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
@@ -583,6 +592,44 @@
|
||||
<TextBlock Text="ティラノ" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- ウディタバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="{StaticResource BadgeWolfBg}"/>
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsWolf}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="ウディタ" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- SRPG Studioバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="{StaticResource BadgeSrpgBg}"/>
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsSrpgStudio}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="SRPG" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- SRPG アーカイブバッジ -->
|
||||
<Border Background="{Binding SrpgBadgeBackground}" CornerRadius="4" Padding="6,2" Margin="0,0,6,0"
|
||||
Visibility="{Binding SrpgBadgeVisibility}">
|
||||
<TextBlock Text="{Binding SrpgBadgeText}" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- IL2CPPバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||
<Border.Style>
|
||||
@@ -793,6 +840,21 @@
|
||||
<TextBlock Text="ティラノスクリプト" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- ウディタバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0" Background="{StaticResource BadgeWolfBg}">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="WOLF RPGエディター" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- Unityバックエンドバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0" Background="{StaticResource BadgeIl2cppBg}"
|
||||
Visibility="{Binding SelectedItem, ElementName=lstGames, Converter={x:Static helpers:IsUnityToVisibilityConverter.Instance}}">
|
||||
@@ -816,6 +878,12 @@
|
||||
<TextBlock Text="{Binding SelectedItem.RgssBadgeText, ElementName=lstGames}" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- ウディタアーカイブバッジ -->
|
||||
<Border Background="{Binding SelectedItem.WolfArchiveBadgeBackground, ElementName=lstGames}" CornerRadius="4" Padding="6,2" Margin="0,0,6,0"
|
||||
Visibility="{Binding SelectedItem.WolfArchiveBadgeVisibility, ElementName=lstGames}">
|
||||
<TextBlock Text="{Binding SelectedItem.WolfArchiveBadgeText, ElementName=lstGames}" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- 改造中バッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Background="{StaticResource BadgeModdedBg}" Margin="0,0,6,0">
|
||||
<Border.Style>
|
||||
@@ -852,7 +920,17 @@
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0" Style="{StaticResource ModernButton}" Content="📁 フォルダを開く" Click="btnOpenFolder_Click"/>
|
||||
<Button Grid.Column="2" Style="{StaticResource ModernButton}" Content="↩ 改造を解除(復元)" Click="btnRestoreOriginal_Click"/>
|
||||
<Button Grid.Column="2" Content="↩ 改造を解除(復元)" Click="btnRestoreOriginal_Click">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource ModernButton}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<!-- パス・日時情報 -->
|
||||
@@ -946,6 +1024,15 @@
|
||||
|
||||
<!-- スクリプト改造セクション -->
|
||||
<Border Background="#252535" BorderBrush="{StaticResource AccentPrimary}" BorderThickness="1.5" CornerRadius="8" Padding="14" Margin="0,0,0,14">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel>
|
||||
<CheckBox x:Name="chkApplyMod" IsChecked="{Binding SelectedItem.ApplyMod, ElementName=lstGames, Mode=TwoWay}"
|
||||
FontSize="15" FontWeight="Bold" Foreground="#A29BFE">
|
||||
@@ -977,6 +1064,216 @@
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- ================= WOLF RPGエディター専用セクション ================= -->
|
||||
<Border Background="#1E1E2E" BorderBrush="{StaticResource AccentWolf}" BorderThickness="1.5" CornerRadius="8" Padding="14" Margin="0,0,0,14">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel>
|
||||
<!-- 1. セーブエディタ起動ボタン(大・紫) -->
|
||||
<Button x:Name="btnOpenWolfSaveEditor" Style="{StaticResource EditorBigButton}" Height="42" Margin="0,0,0,14" Click="btnOpenWolfSaveEditor_Click">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<TextBlock Text="🛠" FontSize="16" Margin="0,0,8,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="ウディタ セーブデータを編集する (SaveXX.sav)" FontSize="13" FontWeight="Bold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<!-- 2. デバッグモード(テストプレイモード)強制有効化 -->
|
||||
<Border Background="#181824" BorderBrush="#35354A" BorderThickness="1" CornerRadius="6" Padding="10,8" Margin="0,0,0,10">
|
||||
<StackPanel>
|
||||
<CheckBox x:Name="chkWolfDebugMode" IsChecked="{Binding SelectedItem.WolfDebugMode, ElementName=lstGames, Mode=TwoWay}"
|
||||
FontSize="13" FontWeight="Bold" Foreground="#81ECEC">
|
||||
<TextBlock Text="⚡ テストプレイ(デバッグ)モードで起動" Margin="4,0,0,0"/>
|
||||
</CheckBox>
|
||||
<TextBlock Text="ウディタ開発用テストプレイ引数を付与して起動します。[F3] デバッグウィンドウ、[F9] 変数エディタ、[F7/F8]、[Ctrl] 壁すり抜けが即座に動作します。"
|
||||
FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="22,3,0,6"/>
|
||||
<CheckBox x:Name="chkWolfDebugWindow" IsChecked="{Binding SelectedItem.WolfDebugWindow, ElementName=lstGames, Mode=TwoWay}"
|
||||
FontSize="11" Foreground="{StaticResource TextPrimary}" Margin="22,0,0,0" Content="起動時にデバッグウィンドウ(F3)を即時表示する"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 3. プロキシDLL(メモリフック / スピードハック)機能拡張 -->
|
||||
<Border Background="#181824" BorderBrush="#35354A" BorderThickness="1" CornerRadius="6" Padding="10,8" Margin="0,0,0,10">
|
||||
<StackPanel>
|
||||
<CheckBox x:Name="chkWolfProxyDll" IsChecked="{Binding SelectedItem.WolfProxyDll, ElementName=lstGames, Mode=TwoWay}"
|
||||
FontSize="13" FontWeight="Bold" Foreground="#FDCB6E" Checked="chkWolfProxyDll_Checked" Unchecked="chkWolfProxyDll_Unchecked">
|
||||
<TextBlock Text="🚀 プロキシDLL(倍速・早送り機能)を適用" Margin="4,0,0,0"/>
|
||||
</CheckBox>
|
||||
<TextBlock Text="ゲームフォルダに version.dll を配置し、ゲーム内タイマーをフックして倍速化します。"
|
||||
FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="22,3,0,6"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="22,0,0,6">
|
||||
<TextBlock Text="・[F6] キー: 3倍速 トグル(通常 ↔ 3倍速)" FontSize="10" Foreground="#FFEAA7" Margin="0,0,12,0"/>
|
||||
<TextBlock Text="・[Ctrl] キー: 5倍速 早送り" FontSize="10" Foreground="#FFEAA7"/>
|
||||
</StackPanel>
|
||||
<Grid Margin="22,0,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="8"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0" Style="{StaticResource ModernButton}" Content="⚡ プロキシDLLを配置" Click="btnApplyWolfProxyDll_Click" Padding="6,4" FontSize="11"/>
|
||||
<Button Grid.Column="2" Style="{StaticResource ModernButton}" Content="↩ プロキシDLLを解除" Click="btnRemoveWolfProxyDll_Click" Padding="6,4" FontSize="11"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 4. Data.wolf アーカイブ管理(解凍・抽出・復元) -->
|
||||
<Border Background="#181824" BorderBrush="#35354A" BorderThickness="1" CornerRadius="6" Padding="10,8" Margin="0,0,0,10">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,4">
|
||||
<TextBlock Text="📦 Data.wolf アーカイブ管理" FontSize="12" FontWeight="Bold" Foreground="#A29BFE"/>
|
||||
<Border Background="{Binding SelectedItem.WolfArchiveBadgeBackground, ElementName=lstGames}" CornerRadius="4" Padding="6,2" Margin="10,0,0,0"
|
||||
Visibility="{Binding SelectedItem.WolfArchiveBadgeVisibility, ElementName=lstGames}">
|
||||
<TextBlock Text="{Binding SelectedItem.WolfArchiveBadgeText, ElementName=lstGames}" FontSize="9" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding SelectedItem.WolfArchiveDetailStatusText, ElementName=lstGames}"
|
||||
FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="0,0,0,8"/>
|
||||
<Grid Margin="0,0,0,4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="8"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="btnExtractWolf" Grid.Column="0" Style="{StaticResource ModernButton}"
|
||||
Content="📦 Data.wolf を解凍" Click="btnExtractWolf_Click" Padding="8,5" FontSize="11"/>
|
||||
<Button x:Name="btnRestoreWolfArchive" Grid.Column="2" Style="{StaticResource ModernButton}"
|
||||
Content="↩ アーカイブに戻す" Click="btnRestoreWolfArchive_Click" Padding="8,5" FontSize="11"/>
|
||||
</Grid>
|
||||
<ProgressBar x:Name="pbWolfProgress" Height="5" Margin="0,6,0,3" Visibility="Collapsed"
|
||||
Foreground="{StaticResource AccentGreen}" Background="#252535" BorderThickness="0"/>
|
||||
<TextBlock x:Name="lblWolfProgressStatus" Text="" FontSize="10" Foreground="#81ECEC" Visibility="Collapsed" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 5. 全改造の解除(完全復元) -->
|
||||
<Button Style="{StaticResource ModernButton}" Content="↩ すべてのウディタ改造を解除(完全復元)"
|
||||
Click="btnRestoreWolfAll_Click" Padding="10,6" FontSize="11" Margin="0,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- ================= SRPG Studio専用セクション ================= -->
|
||||
<Border Background="#1E1E2E" BorderBrush="{StaticResource AccentSrpg}" BorderThickness="1.5" CornerRadius="8" Padding="14" Margin="0,0,0,14">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedItem.IsSrpgStudio, ElementName=lstGames}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel>
|
||||
<TextBlock Text="🛡️ SRPG Studio ゲーム機能拡張" FontSize="14" FontWeight="Bold" Foreground="#74B9FF" Margin="0,0,0,12"/>
|
||||
|
||||
<!-- 1. プラグイン改造(チート機能) -->
|
||||
<Border Background="#181824" BorderBrush="#35354A" BorderThickness="1" CornerRadius="6" Padding="10,8" Margin="0,0,0,10">
|
||||
<StackPanel>
|
||||
<TextBlock Text="🛠 改造プラグイン設定 (Plugin/99_AntigravityMod.js)" FontSize="12" FontWeight="Bold" Foreground="#00CEC9" Margin="0,0,0,6"/>
|
||||
<TextBlock Text="SRPG Studioのスクリプト実行エンジンにチート処理を注入し、data.dts へ反映します。"
|
||||
FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="0,0,0,8"/>
|
||||
|
||||
<!-- オプション一覧(ItemsControl) -->
|
||||
<ItemsControl ItemsSource="{Binding SelectedItem.PluginOptions, ElementName=lstGames}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Background="#20202C" CornerRadius="4" Padding="8,6" Margin="0,0,0,4">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="{Binding Definition.Name}" FontSize="12" FontWeight="SemiBold" Foreground="{StaticResource TextPrimary}"/>
|
||||
<TextBlock Text="{Binding Definition.Description}" FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
<CheckBox Grid.Column="1" IsChecked="{Binding IsEnabled, Mode=TwoWay}" VerticalAlignment="Center" Margin="8,0,0,0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<Grid Margin="0,6,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="8"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="btnApplySrpgMod" Grid.Column="0" Style="{StaticResource ModernButton}" Content="⚡ 改造プラグインを適用&再構築" Click="btnApplySrpgMod_Click" Padding="6,6" FontSize="11"/>
|
||||
<Button x:Name="btnRemoveSrpgMod" Grid.Column="2" Style="{StaticResource ModernButton}" Content="↩ 改造プラグインを解除" Click="btnRemoveSrpgMod_Click" Padding="6,6" FontSize="11"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 2. プロキシDLL(倍速・早送り機能) -->
|
||||
<Border Background="#181824" BorderBrush="#35354A" BorderThickness="1" CornerRadius="6" Padding="10,8" Margin="0,0,0,10">
|
||||
<StackPanel>
|
||||
<CheckBox x:Name="chkSrpgProxyDll" IsChecked="{Binding SelectedItem.SrpgProxyDll, ElementName=lstGames, Mode=TwoWay}"
|
||||
FontSize="13" FontWeight="Bold" Foreground="#FDCB6E" Checked="chkSrpgProxyDll_Checked" Unchecked="chkSrpgProxyDll_Unchecked">
|
||||
<TextBlock Text="🚀 プロキシDLL(倍速・早送り機能)を適用" Margin="4,0,0,0"/>
|
||||
</CheckBox>
|
||||
<TextBlock Text="ゲームフォルダに version.dll を配置し、DirectX/タイマーをフックして倍速化します。"
|
||||
FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="22,3,0,6"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="22,0,0,6">
|
||||
<TextBlock Text="・[F6] キー: 3倍速 トグル(通常 ↔ 3倍速)" FontSize="10" Foreground="#FFEAA7" Margin="0,0,12,0"/>
|
||||
<TextBlock Text="・[Ctrl] キー: 5倍速 早送り" FontSize="10" Foreground="#FFEAA7"/>
|
||||
</StackPanel>
|
||||
<Grid Margin="22,0,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="8"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0" Style="{StaticResource ModernButton}" Content="⚡ プロキシDLLを配置" Click="btnApplySrpgProxyDll_Click" Padding="6,4" FontSize="11"/>
|
||||
<Button Grid.Column="2" Style="{StaticResource ModernButton}" Content="↩ プロキシDLLを解除" Click="btnRemoveSrpgProxyDll_Click" Padding="6,4" FontSize="11"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 3. data.dts アーカイブ管理(解凍・抽出・再パック) -->
|
||||
<Border Background="#181824" BorderBrush="#35354A" BorderThickness="1" CornerRadius="6" Padding="10,8" Margin="0,0,0,10">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,4">
|
||||
<TextBlock Text="📦 data.dts アーカイブ管理" FontSize="12" FontWeight="Bold" Foreground="#A29BFE"/>
|
||||
<Border Background="{Binding SelectedItem.SrpgBadgeBackground, ElementName=lstGames}" CornerRadius="4" Padding="6,2" Margin="10,0,0,0"
|
||||
Visibility="{Binding SelectedItem.SrpgBadgeVisibility, ElementName=lstGames}">
|
||||
<TextBlock Text="{Binding SelectedItem.SrpgBadgeText, ElementName=lstGames}" FontSize="9" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding SelectedItem.SrpgDetailStatusText, ElementName=lstGames}"
|
||||
FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="0,0,0,8"/>
|
||||
<Grid Margin="0,0,0,4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="8"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="btnUnpackSrpg" Grid.Column="0" Style="{StaticResource ModernButton}"
|
||||
Content="📦 data.dts を解凍・抽出" Click="btnUnpackSrpg_Click" Padding="8,5" FontSize="11"/>
|
||||
<Button x:Name="btnRepackSrpg" Grid.Column="2" Style="{StaticResource ModernButton}"
|
||||
Content="🔨 data.dts を再構築" Click="btnRepackSrpg_Click" Padding="8,5" FontSize="11"/>
|
||||
</Grid>
|
||||
<ProgressBar x:Name="pbSrpgProgress" Height="5" Margin="0,6,0,3" Visibility="Collapsed"
|
||||
Foreground="{StaticResource AccentGreen}" Background="#252535" BorderThickness="0"/>
|
||||
<TextBlock x:Name="lblSrpgProgressStatus" Text="" FontSize="10" Foreground="#81ECEC" Visibility="Collapsed" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 4. 全改造の解除(完全復元) -->
|
||||
<Button Style="{StaticResource ModernButton}" Content="↩ すべてのSRPG Studio改造を解除(完全復元)"
|
||||
Click="btnRestoreSrpgAll_Click" Padding="10,6" FontSize="11" Margin="0,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ================= B. Unity 選択時の個別UI ================= -->
|
||||
|
||||
+516
-6
@@ -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<GameItemBase> _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<string>(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<string>(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<string>(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<string>(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<string>(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<string>(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)
|
||||
|
||||
@@ -146,6 +146,12 @@ namespace GameLauncher.Models
|
||||
/// <summary>ティラノスクリプトか</summary>
|
||||
public virtual bool IsTyrano => false;
|
||||
|
||||
/// <summary>WOLF RPGエディター(ウディタ)か</summary>
|
||||
public virtual bool IsWolf => false;
|
||||
|
||||
/// <summary>SRPG Studioか</summary>
|
||||
public virtual bool IsSrpgStudio => false;
|
||||
|
||||
/// <summary>RGSSアーカイブ(rgss3a/rgss2a等)を持つか</summary>
|
||||
public virtual bool HasRgssArchive
|
||||
{
|
||||
@@ -160,6 +166,34 @@ namespace GameLauncher.Models
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>Wolfアーカイブ(Data.wolf等)を持つか</summary>
|
||||
public virtual bool HasWolfArchive
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>Wolfアーカイブが解凍済み(Dataフォルダが存在)か</summary>
|
||||
public virtual bool IsWolfExtracted
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>SRPG Studioアーカイブ(data.dts)を持つか</summary>
|
||||
public virtual bool HasSrpgArchive
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>SRPG Studioアーカイブが解凍済み(data_extracted等が存在)か</summary>
|
||||
public virtual bool IsSrpgExtracted
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>RGSSバッジのテキスト</summary>
|
||||
public virtual string RgssBadgeText => string.Empty;
|
||||
|
||||
@@ -172,6 +206,18 @@ namespace GameLauncher.Models
|
||||
/// <summary>RGSS詳細状態テキスト</summary>
|
||||
public virtual string RgssDetailStatusText => string.Empty;
|
||||
|
||||
/// <summary>SRPG Studioバッジのテキスト</summary>
|
||||
public virtual string SrpgBadgeText => string.Empty;
|
||||
|
||||
/// <summary>SRPG Studioバッジの背景色</summary>
|
||||
public virtual Brush SrpgBadgeBackground => Brushes.Transparent;
|
||||
|
||||
/// <summary>SRPG Studioバッジの可視性</summary>
|
||||
public virtual Visibility SrpgBadgeVisibility => Visibility.Collapsed;
|
||||
|
||||
/// <summary>SRPG Studio詳細状態テキスト</summary>
|
||||
public virtual string SrpgDetailStatusText => string.Empty;
|
||||
|
||||
/// <summary>Unity IL2CPPか</summary>
|
||||
public virtual bool IsIL2CPP => false;
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace GameLauncher.Models
|
||||
/// <summary>RGSS Extractor の実行ファイルパス(ツクールVX/VX Ace暗号化アーカイブ展開用)</summary>
|
||||
public string RgssExtractorPath { get; set; } = @"C:\Soft\RGSS-Extractor-v1.0\RGSS Extractor.exe";
|
||||
|
||||
/// <summary>Wolf RPG アーカイブ解凍ツールの実行ファイルパス(UberWolfCli.exe / WolfDec.exe など)</summary>
|
||||
public string WolfExtractorPath { get; set; } = string.Empty;
|
||||
|
||||
// フィルター状態の保存(再起動時復元用)
|
||||
public string TkoolEngineFilter { get; set; } = "All";
|
||||
public bool TkoolFilterModdedOnly { get; set; }
|
||||
|
||||
+189
-3
@@ -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;
|
||||
|
||||
/// <summary>テストプレイ(デバッグ)モードで起動するか</summary>
|
||||
public bool WolfDebugMode
|
||||
{
|
||||
get => _wolfDebugMode;
|
||||
set { if (_wolfDebugMode != value) { _wolfDebugMode = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>デバッグウィンドウ(F3)を起動時に表示するか</summary>
|
||||
public bool WolfDebugWindow
|
||||
{
|
||||
get => _wolfDebugWindow;
|
||||
set { if (_wolfDebugWindow != value) { _wolfDebugWindow = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>プロキシDLL(version.dll 倍速/メモリフック)を適用するか</summary>
|
||||
public bool WolfProxyDll
|
||||
{
|
||||
get => _wolfProxyDll;
|
||||
set { if (_wolfProxyDll != value) { _wolfProxyDll = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>プロキシDLLのスピード倍率</summary>
|
||||
public double WolfSpeedMultiplier
|
||||
{
|
||||
get => _wolfSpeedMultiplier;
|
||||
set { if (_wolfSpeedMultiplier != value) { _wolfSpeedMultiplier = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>Data.wolf アーカイブが存在するか</summary>
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Data.wolf が解凍済み(Dataフォルダが存在)か</summary>
|
||||
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;
|
||||
|
||||
/// <summary>SRPG Studio プロキシDLL(version.dll 倍速機能)を適用するか</summary>
|
||||
public bool SrpgProxyDll
|
||||
{
|
||||
get => _srpgProxyDll;
|
||||
set { if (_srpgProxyDll != value) { _srpgProxyDll = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>SRPG Studio プロキシDLLのスピード倍率</summary>
|
||||
public double SrpgSpeedMultiplier
|
||||
{
|
||||
get => _srpgSpeedMultiplier;
|
||||
set { if (_srpgSpeedMultiplier != value) { _srpgSpeedMultiplier = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>SRPG Studio プラグイン改造オプション(PluginOptionsのエイリアス)</summary>
|
||||
public ObservableCollection<ModPluginOptionItem> SrpgModOptions => PluginOptions;
|
||||
|
||||
public override bool IsModded
|
||||
{
|
||||
get => _isModded;
|
||||
@@ -384,9 +548,25 @@ namespace GameLauncher.Models
|
||||
new() { Id = "RgssCommandMemory", Name = "🧠 コマンド位置記憶 (ツクールMV風)", Description = "メニュー画面や戦闘中のアクターコマンドのカーソル選択位置を記憶して次回遷移時に復元します。" }
|
||||
];
|
||||
|
||||
/// <summary>SRPG Studio用スクリプト改造定義一覧</summary>
|
||||
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<ModPluginDefinition> availablePlugins, Dictionary<string, bool>? defaultSettings = null)
|
||||
{
|
||||
_pluginOptions.Clear();
|
||||
if (EngineType == TkoolEngineType.Wolf)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IEnumerable<ModPluginDefinition> 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",
|
||||
_ => "ツクール/ティラノ"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,11 +7,13 @@ namespace GameLauncher.Models
|
||||
{
|
||||
Tkool,
|
||||
Tyrano,
|
||||
Unity
|
||||
Unity,
|
||||
Wolf,
|
||||
SrpgStudio
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ツクールのエンジンの種類
|
||||
/// エンジンの種類
|
||||
/// </summary>
|
||||
public enum TkoolEngineType
|
||||
{
|
||||
@@ -20,6 +22,8 @@ namespace GameLauncher.Models
|
||||
Tyrano,
|
||||
VX,
|
||||
VXAce,
|
||||
Wolf,
|
||||
SrpgStudio,
|
||||
Unknown
|
||||
}
|
||||
|
||||
|
||||
+739
-17
@@ -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<string, bool>(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エディター(ウディタ)検出ロジック
|
||||
|
||||
/// <summary>
|
||||
/// 指定されたディレクトリがウディタのゲームであるかを判定し、TkoolGameItemを生成します。
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 指定されたディレクトリまたはその直下にウディタのファイルが存在するかチェックします。
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 単一のディレクトリ内にウディタの特徴(*.wolf、ウディタ用Game.ini、Game.dat等)が存在するか判定します。
|
||||
/// </summary>
|
||||
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 検出ロジック
|
||||
|
||||
/// <summary>
|
||||
/// 指定されたディレクトリがSRPG Studioのゲームであるかを判定し、TkoolGameItemを生成します。
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 指定されたディレクトリまたはその直下にSRPG Studioのファイルが存在するかチェックします。
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 単一のディレクトリ内にSRPG Studioの特徴(data.dts、runtime.rts、固有設定のgame.ini等)が存在するか判定します。
|
||||
/// </summary>
|
||||
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読み込み & タイトル修復
|
||||
|
||||
/// <summary>
|
||||
/// BOMの有無やShift_JIS (CP932) を自動判定して安全にINIファイルを行単位で読み込みます。
|
||||
/// </summary>
|
||||
public static string[] ReadIniLinesSafe(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(filePath)) return Array.Empty<string>();
|
||||
|
||||
byte[] bytes = File.ReadAllBytes(filePath);
|
||||
if (bytes.Length == 0) return Array.Empty<string>();
|
||||
|
||||
// 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<string>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// キャッシュ内に文字化けして保存されたRGSSタイトルの修復を行います。
|
||||
/// </summary>
|
||||
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<string>();
|
||||
var rgss2aFiles = Directory.Exists(searchDir) ? Directory.GetFiles(searchDir, "*.rgss2a", SearchOption.TopDirectoryOnly) : Array.Empty<string>();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
+12
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user