feat: ツクールVX/VX Ace改造対応、Backupsフォルダ統一、全エンジンの種類別一覧表示タブの実装
This commit is contained in:
1 parent
7ac4dbc825
commit
bc5ba43ce7
14 files changed
+2157
-130
No files matched your search
@@ -8,3 +8,9 @@
|
||||
*.suo
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# Runtime data
|
||||
Backups/
|
||||
Profiles/
|
||||
config.json
|
||||
games_cache.json
|
||||
@@ -0,0 +1,136 @@
|
||||
<Window x:Class="GameLauncher.ConfigDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="アプリケーション設定"
|
||||
Height="420" Width="640"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="#181824"
|
||||
Foreground="#E0E0E6"
|
||||
ResizeMode="NoResize"
|
||||
FontFamily="Segoe UI, Meiryo UI, Yu Gothic UI">
|
||||
|
||||
<Window.Resources>
|
||||
<SolidColorBrush x:Key="AccentPrimary" Color="#6C5CE7"/>
|
||||
<SolidColorBrush x:Key="AccentHover" Color="#7D6DF8"/>
|
||||
<SolidColorBrush x:Key="BorderColor" Color="#38384C"/>
|
||||
<SolidColorBrush x:Key="TextSecondary" Color="#9E9EB4"/>
|
||||
|
||||
<Style x:Key="ModernButton" TargetType="Button">
|
||||
<Setter Property="Background" Value="#2E2E3E"/>
|
||||
<Setter Property="Foreground" Value="#E0E0E6"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="#44445A"/>
|
||||
<Setter Property="Padding" Value="14,7"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="6"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#3D3D52"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource AccentPrimary}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PrimaryButton" TargetType="Button" BasedOn="{StaticResource ModernButton}">
|
||||
<Setter Property="Background" Value="{StaticResource AccentPrimary}"/>
|
||||
<Setter Property="Foreground" Value="#FFFFFF"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource AccentHover}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="24">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ヘッダー -->
|
||||
<StackPanel Grid.Row="0" Margin="0,0,0,18">
|
||||
<TextBlock Text="⚙ 設定 (Configuration)" FontSize="18" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
<TextBlock Text="ツクールVX改造用外部ツール設定およびバックアップ設定を管理します。" FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="0,3,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 設定項目エリア -->
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel>
|
||||
<!-- 1. RGSS Extractor パス設定 -->
|
||||
<Border Background="#20202E" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="8" Padding="14" Margin="0,0,0,14">
|
||||
<StackPanel>
|
||||
<TextBlock Text="📦 RGSS Extractor のパス (ツクールVX / VX Ace用)" FontSize="13" FontWeight="Bold" Foreground="#A29BFE"/>
|
||||
<TextBlock Text="ツクールVXおよびVX Aceの暗号化アーカイブ (*.rgss3a / *.rgss2a) の解凍・抽出に使用する外部ツールのパスを設定します。"
|
||||
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="txtRgssExtractorPath" 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="btnBrowseExtractor_Click"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 2. バックアップ保存先フォルダ -->
|
||||
<Border Background="#20202E" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="8" Padding="14" Margin="0,0,0,14">
|
||||
<StackPanel>
|
||||
<TextBlock Text="📦 バックアップ統一保存先" FontSize="13" FontWeight="Bold" Foreground="#00B894"/>
|
||||
<TextBlock Text="ツクールMV/MZ・ティラノ・ツクールVX/VX Ace・Unityのすべてのバックアップは、exe直下のBackupsフォルダ(Z:\自作ソフト\GameLauncher\Backups)に集約されます。"
|
||||
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="txtBackupsPath" Grid.Column="0" Background="#14141C" Foreground="#81ECEC"
|
||||
BorderBrush="{StaticResource BorderColor}" BorderThickness="1" Padding="8,6" FontSize="12" IsReadOnly="True"/>
|
||||
<Button Grid.Column="2" Style="{StaticResource ModernButton}" Content="📂 フォルダを開く" Click="btnOpenBackupsDir_Click"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 3. デフォルト起動時改造適用 -->
|
||||
<Border Background="#20202E" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="8" Padding="14">
|
||||
<StackPanel>
|
||||
<CheckBox x:Name="chkDefaultApplyMod" Content="一度も変更していないゲームにおける「起動時に改造を適用する」の初期値をONにする"
|
||||
FontSize="12" FontWeight="SemiBold" Foreground="#FFFFFF"/>
|
||||
<TextBlock Text="新規検出されたゲームにおいて、初期状態でスクリプト改造を有効にするかどうかを設定します。"
|
||||
FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="24,4,0,0"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- ボタンバー -->
|
||||
<Border Grid.Row="2" Margin="0,18,0,0" Padding="0,12,0,0" BorderBrush="{StaticResource BorderColor}" BorderThickness="0,1,0,0">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Style="{StaticResource PrimaryButton}" Content="✔ 保存して閉じる" Width="140" Margin="0,0,10,0" Click="btnSave_Click"/>
|
||||
<Button Style="{StaticResource ModernButton}" Content="キャンセル" Width="90" Click="btnCancel_Click"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using Microsoft.Win32;
|
||||
using GameLauncher.Helpers;
|
||||
using GameLauncher.Models;
|
||||
|
||||
namespace GameLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// 設定ダイアログのロジック
|
||||
/// </summary>
|
||||
public partial class ConfigDialog : Window
|
||||
{
|
||||
private readonly LauncherConfig _config;
|
||||
|
||||
public bool IsSaved { get; private set; }
|
||||
|
||||
public ConfigDialog(LauncherConfig config)
|
||||
{
|
||||
InitializeComponent();
|
||||
_config = config;
|
||||
|
||||
txtRgssExtractorPath.Text = _config.RgssExtractorPath ?? @"C:\Soft\RGSS-Extractor-v1.0\RGSS Extractor.exe";
|
||||
txtBackupsPath.Text = AppPathHelper.GetBackupsDirectory();
|
||||
chkDefaultApplyMod.IsChecked = _config.DefaultApplyMod;
|
||||
}
|
||||
|
||||
private void btnBrowseExtractor_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var ofd = new OpenFileDialog
|
||||
{
|
||||
Title = "RGSS Extractor の実行ファイルを選択してください",
|
||||
Filter = "実行ファイル (*.exe)|*.exe|すべてのファイル (*.*)|*.*",
|
||||
FileName = "RGSS Extractor.exe"
|
||||
};
|
||||
|
||||
var currentDir = Path.GetDirectoryName(txtRgssExtractorPath.Text);
|
||||
if (!string.IsNullOrEmpty(currentDir) && Directory.Exists(currentDir))
|
||||
{
|
||||
ofd.InitialDirectory = currentDir;
|
||||
}
|
||||
|
||||
if (ofd.ShowDialog() == true)
|
||||
{
|
||||
txtRgssExtractorPath.Text = ofd.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOpenBackupsDir_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dir = AppPathHelper.GetBackupsDirectory();
|
||||
if (!Directory.Exists(dir))
|
||||
{
|
||||
Directory.CreateDirectory(dir);
|
||||
}
|
||||
Process.Start(new ProcessStartInfo { FileName = dir, UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"バックアップフォルダを開けませんでした:\n{ex.Message}", "エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnSave_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_config.RgssExtractorPath = txtRgssExtractorPath.Text.Trim();
|
||||
_config.DefaultApplyMod = chkDefaultApplyMod.IsChecked == true;
|
||||
IsSaved = true;
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DialogResult = false;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
+134
-32
@@ -32,6 +32,8 @@
|
||||
<SolidColorBrush x:Key="BadgeMvBg" Color="#8B1E3F"/>
|
||||
<SolidColorBrush x:Key="BadgeMzBg" Color="#1E5F8B"/>
|
||||
<SolidColorBrush x:Key="BadgeTyranoBg" Color="#D35400"/>
|
||||
<SolidColorBrush x:Key="BadgeVxBg" Color="#C0392B"/>
|
||||
<SolidColorBrush x:Key="BadgeVxAceBg" Color="#D35400"/>
|
||||
<SolidColorBrush x:Key="BadgeModdedBg" Color="#8B571E"/>
|
||||
<SolidColorBrush x:Key="BadgeIl2cppBg" Color="#5A368B"/>
|
||||
<SolidColorBrush x:Key="BadgeMonoBg" Color="#1E5F8B"/>
|
||||
@@ -341,58 +343,50 @@
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 再スキャンボタン -->
|
||||
<!-- 設定ボタン & 再スキャンボタン -->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<Button x:Name="btnOpenConfig" Style="{StaticResource ModernButton}" Content="⚙ 設定" Margin="0,0,8,0" Click="btnOpenConfig_Click"/>
|
||||
<Button x:Name="btnRescan" Style="{StaticResource ModernButton}" Content="🔄 再スキャン" Click="btnRescan_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ================= ナビゲーションタブ & フィルターバー ================= -->
|
||||
<Border Grid.Row="1" Background="#181824" BorderBrush="{StaticResource BorderBrushColor}" BorderThickness="0,0,0,1" Padding="16,8">
|
||||
<Border Grid.Row="1" Background="#181824" BorderBrush="{StaticResource BorderBrushColor}" BorderThickness="0,0,0,1" Padding="14,8">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- メインタブセレクター(ピル型) -->
|
||||
<Border Grid.Column="0" Background="#12121A" CornerRadius="8" Padding="3" Margin="0,0,20,0" BorderBrush="#303040" BorderThickness="1">
|
||||
<!-- エンジンの種類セレクター(全エンジン常時表示ピル型タブ) -->
|
||||
<Border Grid.Column="0" Background="#12121A" CornerRadius="8" Padding="3" Margin="0,0,14,0" BorderBrush="#303040" BorderThickness="1">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton x:Name="tabAll" Style="{StaticResource NavTabRadioButton}" Content="🎮⚡ すべて" IsChecked="True" Checked="MainTab_Checked"/>
|
||||
<RadioButton x:Name="tabTkool" Style="{StaticResource NavTabRadioButton}" Content="🎮 ツクール・ティラノ" Checked="MainTab_Checked"/>
|
||||
<RadioButton x:Name="tabUnity" Style="{StaticResource NavTabRadioButton}" Content="⚡ Unity" Checked="MainTab_Checked"/>
|
||||
<RadioButton x:Name="tabAll" Style="{StaticResource NavTabRadioButton}" Content="🎮⚡ すべて" IsChecked="True" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
<RadioButton x:Name="tabMV" Style="{StaticResource NavTabRadioButton}" Content="ツクールMV" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
<RadioButton x:Name="tabMZ" Style="{StaticResource NavTabRadioButton}" Content="ツクールMZ" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
<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="tabUnity" Style="{StaticResource NavTabRadioButton}" Content="⚡ Unity" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 連動サブフィルター群 -->
|
||||
<!-- サブフィルター群(状態・形式の追加絞り込み) -->
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<!-- 1. ツクール/ティラノ用サブフィルター -->
|
||||
<StackPanel x:Name="pnlTkoolFilters" Orientation="Horizontal" VerticalAlignment="Center" Visibility="Collapsed">
|
||||
<TextBlock Text="エンジン:" FontSize="12" Foreground="{StaticResource TextSecondary}" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
||||
<RadioButton x:Name="rbTkoolAll" Content="すべて" IsChecked="True" GroupName="TkoolEngineFilter" Margin="0,0,8,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
<RadioButton x:Name="rbTkoolMV" Content="MV" GroupName="TkoolEngineFilter" Margin="0,0,8,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
<RadioButton x:Name="rbTkoolMZ" Content="MZ" GroupName="TkoolEngineFilter" Margin="0,0,8,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
<RadioButton x:Name="rbTkoolTyrano" Content="ティラノ" GroupName="TkoolEngineFilter" Margin="0,0,14,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
<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"/>
|
||||
<!-- Unityバックエンド切り替え(Unityタブ選択時のみ表示) -->
|
||||
<StackPanel x:Name="pnlUnityBackendFilter" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,12,0" Visibility="Collapsed">
|
||||
<TextBlock Text="形式:" FontSize="11" Foreground="{StaticResource TextSecondary}" VerticalAlignment="Center" Margin="0,0,4,0"/>
|
||||
<RadioButton x:Name="rbUnityAll" Content="すべて" IsChecked="True" GroupName="UnityBackendFilter" Margin="0,0,6,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
<RadioButton x:Name="rbUnityIL2CPP" Content="IL2CPP" GroupName="UnityBackendFilter" Margin="0,0,6,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
<RadioButton x:Name="rbUnityMono" Content="Mono" GroupName="UnityBackendFilter" Margin="0,0,6,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 2. Unity用サブフィルター -->
|
||||
<StackPanel x:Name="pnlUnityFilters" Orientation="Horizontal" VerticalAlignment="Center" Visibility="Collapsed">
|
||||
<TextBlock Text="バックエンド:" FontSize="12" Foreground="{StaticResource TextSecondary}" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
||||
<RadioButton x:Name="rbUnityAll" Content="すべて" IsChecked="True" GroupName="UnityBackendFilter" Margin="0,0,8,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
<RadioButton x:Name="rbUnityIL2CPP" Content="IL2CPP" GroupName="UnityBackendFilter" Margin="0,0,8,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
<RadioButton x:Name="rbUnityMono" Content="Mono" GroupName="UnityBackendFilter" Margin="0,0,14,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
||||
<CheckBox x:Name="chkFilterSaveOnly" Content="セーブありのみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 3. 「すべて」選択時の共通フィルター -->
|
||||
<StackPanel x:Name="pnlAllFilters" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<CheckBox x:Name="chkFilterAllModded" Content="改造中のみ" Margin="0,0,12,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
<CheckBox x:Name="chkFilterAllAsar" Content="ASAR形式のみ" Margin="0,0,12,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
<CheckBox x:Name="chkFilterAllSave" Content="セーブありのみ" Margin="0,0,12,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
</StackPanel>
|
||||
<!-- 全体共通詳細チェックボックス -->
|
||||
<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="chkFilterSaveOnly" Content="セーブありのみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
@@ -426,6 +420,8 @@
|
||||
<MenuItem x:Name="menuTkoolRestoreOriginal" Header="↩ 改造を解除してオリジナルに復元" Click="MenuRestoreOriginal_Click"/>
|
||||
<MenuItem x:Name="menuTkoolExtractAsar" Header="📦 ASARを解凍する" Click="MenuExtractAsar_Click"/>
|
||||
<MenuItem x:Name="menuTkoolRestoreAsar" Header="↩ ASAR状態に戻す(復元)" Click="MenuRestoreAsar_Click"/>
|
||||
<MenuItem x:Name="menuTkoolExtractRgss" Header="📦 RGSSスクリプトを抽出する" Click="MenuExtractRgss_Click"/>
|
||||
<MenuItem x:Name="menuTkoolRestoreRgss" Header="↩ RGSSアーカイブ状態に戻す(復元)" Click="MenuRestoreRgss_Click"/>
|
||||
|
||||
<!-- Unity専用メニュー項目 -->
|
||||
<MenuItem x:Name="menuUnitySaveEditor" Header="🛠 セーブエディタを開く" Click="MenuOpenSaveEditor_Click"/>
|
||||
@@ -539,6 +535,38 @@
|
||||
<TextBlock Text="MZ" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- VX Aceバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="{StaticResource BadgeVxAceBg}"/>
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsVXAce}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="VX Ace" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- VXバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="{StaticResource BadgeVxBg}"/>
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsVX}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="VX" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- ティラノバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||
<Border.Style>
|
||||
@@ -593,6 +621,12 @@
|
||||
<TextBlock Text="{Binding AsarBadgeText}" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- RGSSアーカイブバッジ(ツクールVX専用) -->
|
||||
<Border Background="{Binding RgssBadgeBackground}" CornerRadius="4" Padding="6,2" Margin="0,0,6,0"
|
||||
Visibility="{Binding RgssBadgeVisibility}">
|
||||
<TextBlock Text="{Binding RgssBadgeText}" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- 改造適用中インジケータ(ツクール専用) -->
|
||||
<Border Background="{StaticResource BadgeModdedBg}" CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||
<Border.Style>
|
||||
@@ -714,6 +748,36 @@
|
||||
<TextBlock Text="RPGツクールMZ" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- ツクールVXバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0" Background="{StaticResource BadgeVxBg}">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedItem.IsVX, ElementName=lstGames}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="RPGツクールVX" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- ツクールVX Aceバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0" Background="{StaticResource BadgeVxAceBg}">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedItem.IsVXAce, ElementName=lstGames}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="RPGツクールVX Ace" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- ティラノバッジ -->
|
||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0" Background="{StaticResource BadgeTyranoBg}">
|
||||
<Border.Style>
|
||||
@@ -746,6 +810,12 @@
|
||||
<TextBlock Text="{Binding SelectedItem.AsarBadgeText, ElementName=lstGames}" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
|
||||
<!-- RGSSバッジ -->
|
||||
<Border Background="{Binding SelectedItem.RgssBadgeBackground, ElementName=lstGames}" CornerRadius="4" Padding="6,2" Margin="0,0,6,0"
|
||||
Visibility="{Binding SelectedItem.RgssBadgeVisibility, ElementName=lstGames}">
|
||||
<TextBlock Text="{Binding SelectedItem.RgssBadgeText, 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>
|
||||
@@ -842,6 +912,38 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- RGSSアーカイブ管理セクション(HasRgssArchive時のみ表示) -->
|
||||
<Border Background="#1E1E2E" BorderBrush="#00CEC9" BorderThickness="1.5" CornerRadius="8" Padding="14" Margin="0,0,0,14"
|
||||
Visibility="{Binding SelectedItem.RgssBadgeVisibility, ElementName=lstGames}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,6">
|
||||
<TextBlock Text="📦 RGSS アーカイブ管理" FontSize="13" FontWeight="Bold" Foreground="#81ECEC"/>
|
||||
<Border Background="{Binding SelectedItem.RgssBadgeBackground, ElementName=lstGames}" CornerRadius="4" Padding="6,2" Margin="10,0,0,0">
|
||||
<TextBlock Text="{Binding SelectedItem.RgssBadgeText, ElementName=lstGames}" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{Binding SelectedItem.RgssDetailStatusText, ElementName=lstGames}"
|
||||
FontSize="11" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="0,0,0,10"/>
|
||||
|
||||
<Grid Margin="0,0,0,4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="8"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="btnExtractRgss" Grid.Column="0" Style="{StaticResource ModernButton}"
|
||||
Content="📦 スクリプトを抽出" Click="btnExtractRgss_Click"/>
|
||||
<Button x:Name="btnRestoreRgss" Grid.Column="2" Style="{StaticResource ModernButton}"
|
||||
Content="↩ スクリプトを元に戻す" Click="btnRestoreRgss_Click"/>
|
||||
</Grid>
|
||||
|
||||
<ProgressBar x:Name="pbRgssProgress" Height="6" Margin="0,8,0,4" Visibility="Collapsed"
|
||||
Foreground="{StaticResource AccentGreen}" Background="#252535" BorderThickness="0"/>
|
||||
<TextBlock x:Name="lblRgssProgressStatus" Text="" FontSize="11" Foreground="#81ECEC" Visibility="Collapsed" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- スクリプト改造セクション -->
|
||||
<Border Background="#252535" BorderBrush="{StaticResource AccentPrimary}" BorderThickness="1.5" CornerRadius="8" Padding="14" Margin="0,0,0,14">
|
||||
<StackPanel>
|
||||
|
||||
+241
-79
@@ -30,6 +30,7 @@ namespace GameLauncher
|
||||
private readonly TyranoModService _tyranoModService = new();
|
||||
private readonly AsarArchiveService _asarService = new();
|
||||
private readonly UnitySaveManagerService _unitySaveService = new();
|
||||
private readonly RgssModService _rgssModService = new();
|
||||
|
||||
private readonly ObservableCollection<GameItemBase> _games = [];
|
||||
private ListCollectionView _gamesView = null!;
|
||||
@@ -68,6 +69,20 @@ namespace GameLauncher
|
||||
|
||||
#region 設定のロード & セーブ
|
||||
|
||||
private void btnOpenConfig_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dialog = new ConfigDialog(_config)
|
||||
{
|
||||
Owner = this
|
||||
};
|
||||
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
SaveConfig();
|
||||
AppendLog($"[設定変更] 設定を保存しました。(RGSS Extractor: {_config.RgssExtractorPath})");
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadConfig()
|
||||
{
|
||||
try
|
||||
@@ -82,12 +97,7 @@ namespace GameLauncher
|
||||
_gameComparer.SortOrder = _config.SortOrder;
|
||||
ApplySortOrderToComboBox(_config.SortOrder);
|
||||
|
||||
// タブ復元
|
||||
if (_config.SelectedTab == 1) tabTkool.IsChecked = true;
|
||||
else if (_config.SelectedTab == 2) tabUnity.IsChecked = true;
|
||||
else tabAll.IsChecked = true;
|
||||
|
||||
// フィルター復元
|
||||
// フィルター設定の復元
|
||||
RestoreFilterSettings();
|
||||
}
|
||||
}
|
||||
@@ -99,20 +109,30 @@ namespace GameLauncher
|
||||
|
||||
private void RestoreFilterSettings()
|
||||
{
|
||||
// ツクールフィルター
|
||||
if (_config.TkoolEngineFilter == "MV") rbTkoolMV.IsChecked = true;
|
||||
else if (_config.TkoolEngineFilter == "MZ") rbTkoolMZ.IsChecked = true;
|
||||
else if (_config.TkoolEngineFilter == "Tyrano") rbTkoolTyrano.IsChecked = true;
|
||||
else rbTkoolAll.IsChecked = true;
|
||||
switch (_config.SelectedTab)
|
||||
{
|
||||
case 1: tabMV.IsChecked = true; break;
|
||||
case 2: tabMZ.IsChecked = true; break;
|
||||
case 3: tabVXAce.IsChecked = true; break;
|
||||
case 4: tabVX.IsChecked = true; break;
|
||||
case 5: tabTyrano.IsChecked = true; break;
|
||||
case 6: tabUnity.IsChecked = true; break;
|
||||
default: tabAll.IsChecked = true; break;
|
||||
}
|
||||
|
||||
chkFilterModdedOnly.IsChecked = _config.TkoolFilterModdedOnly;
|
||||
chkFilterAsarOnly.IsChecked = _config.TkoolFilterAsarOnly;
|
||||
if (pnlUnityBackendFilter != null)
|
||||
{
|
||||
pnlUnityBackendFilter.Visibility = tabUnity.IsChecked == true ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
// Unityフィルター
|
||||
if (_config.UnityBackendFilter == "IL2CPP") rbUnityIL2CPP.IsChecked = true;
|
||||
else if (_config.UnityBackendFilter == "Mono") rbUnityMono.IsChecked = true;
|
||||
else rbUnityAll.IsChecked = true;
|
||||
|
||||
chkFilterModdedOnly.IsChecked = _config.TkoolFilterModdedOnly;
|
||||
chkFilterAsarOnly.IsChecked = _config.TkoolFilterAsarOnly;
|
||||
chkFilterRgssOnly.IsChecked = _config.TkoolFilterRgssOnly;
|
||||
chkFilterSaveOnly.IsChecked = _config.UnityFilterSaveOnly;
|
||||
}
|
||||
|
||||
@@ -123,13 +143,21 @@ namespace GameLauncher
|
||||
try
|
||||
{
|
||||
_config.SortOrder = _gameComparer.SortOrder;
|
||||
_config.SelectedTab = tabTkool.IsChecked == true ? 1 : (tabUnity.IsChecked == true ? 2 : 0);
|
||||
|
||||
_config.TkoolEngineFilter = rbTkoolMV.IsChecked == true ? "MV" : (rbTkoolMZ.IsChecked == true ? "MZ" : (rbTkoolTyrano.IsChecked == true ? "Tyrano" : "All"));
|
||||
int tabIndex = 0;
|
||||
if (tabMV.IsChecked == true) tabIndex = 1;
|
||||
else if (tabMZ.IsChecked == true) tabIndex = 2;
|
||||
else if (tabVXAce.IsChecked == true) tabIndex = 3;
|
||||
else if (tabVX.IsChecked == true) tabIndex = 4;
|
||||
else if (tabTyrano.IsChecked == true) tabIndex = 5;
|
||||
else if (tabUnity.IsChecked == true) tabIndex = 6;
|
||||
|
||||
_config.SelectedTab = tabIndex;
|
||||
_config.UnityBackendFilter = rbUnityIL2CPP.IsChecked == true ? "IL2CPP" : (rbUnityMono.IsChecked == true ? "Mono" : "All");
|
||||
|
||||
_config.TkoolFilterModdedOnly = chkFilterModdedOnly.IsChecked == true;
|
||||
_config.TkoolFilterAsarOnly = chkFilterAsarOnly.IsChecked == true;
|
||||
|
||||
_config.UnityBackendFilter = rbUnityIL2CPP.IsChecked == true ? "IL2CPP" : (rbUnityMono.IsChecked == true ? "Mono" : "All");
|
||||
_config.TkoolFilterRgssOnly = chkFilterRgssOnly.IsChecked == true;
|
||||
_config.UnityFilterSaveOnly = chkFilterSaveOnly.IsChecked == true;
|
||||
|
||||
var options = new JsonSerializerOptions
|
||||
@@ -171,6 +199,15 @@ namespace GameLauncher
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var rgssPlugin in TkoolGameItem.DefaultRgssPlugins)
|
||||
{
|
||||
if (!_config.DefaultPluginSettings.ContainsKey(rgssPlugin.Id))
|
||||
{
|
||||
_config.DefaultPluginSettings[rgssPlugin.Id] = true;
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (modified || !File.Exists(_configFilePath))
|
||||
{
|
||||
SaveConfig();
|
||||
@@ -376,70 +413,50 @@ namespace GameLauncher
|
||||
}
|
||||
}
|
||||
|
||||
// 2. メインタブフィルター
|
||||
if (tabTkool.IsChecked == true)
|
||||
// 2. エンジンの種類フィルター
|
||||
if (tabMV.IsChecked == true)
|
||||
{
|
||||
if (game is not TkoolGameItem tg) return false;
|
||||
|
||||
// ツクールサブフィルター
|
||||
if (rbTkoolMV.IsChecked == true && tg.EngineType != TkoolEngineType.MV) return false;
|
||||
if (rbTkoolMZ.IsChecked == true && tg.EngineType != TkoolEngineType.MZ) return false;
|
||||
if (rbTkoolTyrano.IsChecked == true && tg.EngineType != TkoolEngineType.Tyrano) return false;
|
||||
|
||||
if (chkFilterModdedOnly.IsChecked == true && !tg.IsModded) return false;
|
||||
if (chkFilterAsarOnly.IsChecked == true && !tg.IsAsar) return false;
|
||||
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.MV) return false;
|
||||
}
|
||||
else if (tabMZ.IsChecked == true)
|
||||
{
|
||||
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.MZ) return false;
|
||||
}
|
||||
else if (tabVXAce.IsChecked == true)
|
||||
{
|
||||
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.VXAce) return false;
|
||||
}
|
||||
else if (tabVX.IsChecked == true)
|
||||
{
|
||||
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.VX) return false;
|
||||
}
|
||||
else if (tabTyrano.IsChecked == true)
|
||||
{
|
||||
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.Tyrano) return false;
|
||||
}
|
||||
else if (tabUnity.IsChecked == true)
|
||||
{
|
||||
if (game is not UnityGameItem ug) return false;
|
||||
|
||||
// Unityサブフィルター
|
||||
if (rbUnityIL2CPP.IsChecked == true && ug.BackendType != UnityBackendType.IL2CPP) return false;
|
||||
if (rbUnityMono.IsChecked == true && ug.BackendType != UnityBackendType.Mono) return false;
|
||||
if (chkFilterSaveOnly.IsChecked == true && !ug.HasSaveData) return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 「すべて」タブ
|
||||
if (chkFilterAllModded.IsChecked == true)
|
||||
{
|
||||
if (game is not TkoolGameItem tg || !tg.IsModded) return false;
|
||||
}
|
||||
if (chkFilterAllAsar.IsChecked == true)
|
||||
{
|
||||
if (game is not TkoolGameItem tg || !tg.IsAsar) return false;
|
||||
}
|
||||
if (chkFilterAllSave.IsChecked == true)
|
||||
{
|
||||
if (game is not UnityGameItem ug || !ug.HasSaveData) return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 追加属性フィルター(全タブ共通)
|
||||
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 (chkFilterSaveOnly.IsChecked == true && (game is not UnityGameItem ugSave || !ugSave.HasSaveData)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void MainTab_Checked(object sender, RoutedEventArgs e)
|
||||
private void EngineTab_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isInitialized) return;
|
||||
if (pnlTkoolFilters == null || pnlUnityFilters == null || pnlAllFilters == null) return;
|
||||
|
||||
if (tabTkool.IsChecked == true)
|
||||
if (pnlUnityBackendFilter != null)
|
||||
{
|
||||
pnlTkoolFilters.Visibility = Visibility.Visible;
|
||||
pnlUnityFilters.Visibility = Visibility.Collapsed;
|
||||
pnlAllFilters.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else if (tabUnity.IsChecked == true)
|
||||
{
|
||||
pnlTkoolFilters.Visibility = Visibility.Collapsed;
|
||||
pnlUnityFilters.Visibility = Visibility.Visible;
|
||||
pnlAllFilters.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
pnlTkoolFilters.Visibility = Visibility.Collapsed;
|
||||
pnlUnityFilters.Visibility = Visibility.Collapsed;
|
||||
pnlAllFilters.Visibility = Visibility.Visible;
|
||||
pnlUnityBackendFilter.Visibility = tabUnity.IsChecked == true ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
_gamesView?.Refresh();
|
||||
@@ -486,12 +503,13 @@ namespace GameLauncher
|
||||
|
||||
int total = _games.Count;
|
||||
int visible = _gamesView?.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);
|
||||
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 unityCount = _games.Count(g => g is UnityGameItem);
|
||||
|
||||
lblStatusSummary.Text = $"総ゲーム数: {total} 件 | 表示: {visible} 件";
|
||||
lblStatusBreakdown.Text = $"(ツクール: {tkoolCount}, ティラノ: {tyranoCount}, Unity: {unityCount})";
|
||||
lblStatusBreakdown.Text = $"(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, Unity: {unityCount})";
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -613,8 +631,23 @@ namespace GameLauncher
|
||||
}
|
||||
}
|
||||
|
||||
// スクリプト改造の適用または復元
|
||||
if (tg.EngineType == TkoolEngineType.Tyrano)
|
||||
// RGSSゲーム(ツクールVX / VX Ace)の場合
|
||||
if (tg.IsRgss)
|
||||
{
|
||||
var (success, msg) = await _rgssModService.ApplyOrRestoreModAsync(tg, tg.PluginSettings, _config.RgssExtractorPath);
|
||||
AppendLog($"[RGSS改造処理] {tg.Title}: {msg}");
|
||||
if (!success && tg.ApplyMod)
|
||||
{
|
||||
var res = MessageBox.Show(
|
||||
$"スクリプト改造の適用中に警告/エラーが発生しました:\n{msg}\n\nこのまま通常(未改造)でゲームを起動しますか?",
|
||||
"RGSS改造警告",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Warning);
|
||||
if (res != MessageBoxResult.Yes) return;
|
||||
}
|
||||
}
|
||||
// スクリプト改造の適用または復元(ティラノ)
|
||||
else if (tg.EngineType == TkoolEngineType.Tyrano)
|
||||
{
|
||||
if (tg.ApplyMod)
|
||||
{
|
||||
@@ -627,6 +660,7 @@ namespace GameLauncher
|
||||
AppendLog($"[ティラノ復元] {tg.Title}: {msg}");
|
||||
}
|
||||
}
|
||||
// スクリプト改造の適用または復元(ツクールMV/MZ)
|
||||
else
|
||||
{
|
||||
var (success, msg) = _modService.ApplyOrRestoreMod(tg, _config.DefaultPluginSettings);
|
||||
@@ -655,7 +689,8 @@ namespace GameLauncher
|
||||
|
||||
// ツクール/ティラノ等のWebランタイム(NW.js / Chromium)ゲームの場合、
|
||||
// GameLauncher.exe のあるフォルダ配下の Profiles フォルダに隔離した専用プロファイルディレクトリを指定して起動
|
||||
if (game is TkoolGameItem tg)
|
||||
// ※RGSS(DirectX/Ruby)やUnity等のネイティブアプリには引数を付与しない
|
||||
if (game is TkoolGameItem tg && !tg.IsRgss)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -699,19 +734,48 @@ namespace GameLauncher
|
||||
|
||||
// ツクール専用メニュー
|
||||
menuTkoolOpenFolder.Visibility = isTkool ? Visibility.Visible : Visibility.Collapsed;
|
||||
menuTkoolOpenProfile.Visibility = isTkool ? Visibility.Visible : Visibility.Collapsed;
|
||||
menuTkoolOpenPluginsJs.Visibility = isTkool ? Visibility.Visible : Visibility.Collapsed;
|
||||
menuTkoolRestoreOriginal.Visibility = isTkool ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
if (selected is TkoolGameItem tg && tg.IsAsar)
|
||||
if (selected is TkoolGameItem tg)
|
||||
{
|
||||
menuTkoolExtractAsar.Visibility = !tg.IsAsarExtracted ? Visibility.Visible : Visibility.Collapsed;
|
||||
menuTkoolRestoreAsar.Visibility = tg.IsAsarExtracted ? Visibility.Visible : Visibility.Collapsed;
|
||||
// ASAR メニュー
|
||||
if (tg.IsAsar)
|
||||
{
|
||||
menuTkoolExtractAsar.Visibility = !tg.IsAsarExtracted ? Visibility.Visible : Visibility.Collapsed;
|
||||
menuTkoolRestoreAsar.Visibility = tg.IsAsarExtracted ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
menuTkoolExtractAsar.Visibility = Visibility.Collapsed;
|
||||
menuTkoolRestoreAsar.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
// RGSS メニュー
|
||||
if (tg.IsRgss && tg.HasRgssArchive)
|
||||
{
|
||||
menuTkoolExtractRgss.Visibility = !tg.IsRgssExtracted ? Visibility.Visible : Visibility.Collapsed;
|
||||
menuTkoolRestoreRgss.Visibility = tg.IsRgssExtracted ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
menuTkoolExtractRgss.Visibility = Visibility.Collapsed;
|
||||
menuTkoolRestoreRgss.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
// plugins.js は MV/MZ のみ
|
||||
menuTkoolOpenPluginsJs.Visibility = (tg.IsMV || tg.IsMZ) && File.Exists(tg.PluginsJsPath) ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
// 専用プロファイルフォルダは Chromium/NW.js 系(MV/MZ/Tyrano)のみ
|
||||
menuTkoolOpenProfile.Visibility = !tg.IsRgss ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
menuTkoolExtractAsar.Visibility = Visibility.Collapsed;
|
||||
menuTkoolRestoreAsar.Visibility = Visibility.Collapsed;
|
||||
menuTkoolExtractRgss.Visibility = Visibility.Collapsed;
|
||||
menuTkoolRestoreRgss.Visibility = Visibility.Collapsed;
|
||||
menuTkoolOpenPluginsJs.Visibility = Visibility.Collapsed;
|
||||
menuTkoolOpenProfile.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
// Unity専用メニュー
|
||||
@@ -724,7 +788,7 @@ namespace GameLauncher
|
||||
|
||||
#endregion
|
||||
|
||||
#region ツクール専用機能 (ASAR解凍・復元・MOD解除・Profile)
|
||||
#region ツクール専用機能 (ASAR解凍・復元・RGSS抽出・復元・MOD解除・Profile)
|
||||
|
||||
private async void btnExtractAsar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -849,6 +913,102 @@ namespace GameLauncher
|
||||
}
|
||||
}
|
||||
|
||||
#region RGSS スクリプト抽出・復元
|
||||
|
||||
private async void btnExtractRgss_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (lstGames.SelectedItem is TkoolGameItem tg)
|
||||
{
|
||||
await ExtractRgssForGame(tg);
|
||||
}
|
||||
}
|
||||
|
||||
private async void MenuExtractRgss_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (lstGames.SelectedItem is TkoolGameItem tg)
|
||||
{
|
||||
await ExtractRgssForGame(tg);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ExtractRgssForGame(TkoolGameItem tg)
|
||||
{
|
||||
if (!tg.IsRgss) return;
|
||||
|
||||
btnExtractRgss.IsEnabled = false;
|
||||
pbRgssProgress.Visibility = Visibility.Visible;
|
||||
pbRgssProgress.IsIndeterminate = true;
|
||||
lblRgssProgressStatus.Visibility = Visibility.Visible;
|
||||
lblRgssProgressStatus.Text = "RGSSスクリプトを抽出中...";
|
||||
|
||||
AppendLog($"[RGSS抽出開始] {tg.Title} (アーカイブ: {tg.RgssArchivePath})");
|
||||
|
||||
var (success, message) = await _rgssModService.ExtractScriptsAsync(tg, _config.RgssExtractorPath);
|
||||
|
||||
pbRgssProgress.Visibility = Visibility.Collapsed;
|
||||
lblRgssProgressStatus.Visibility = Visibility.Collapsed;
|
||||
btnExtractRgss.IsEnabled = true;
|
||||
|
||||
if (success)
|
||||
{
|
||||
_scannerService.SaveCache(_games);
|
||||
AppendLog($"[RGSS抽出成功] {message}");
|
||||
MessageBox.Show(message, "RGSS スクリプト抽出完了", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendLog($"[RGSS抽出失敗] {message}");
|
||||
MessageBox.Show(message, "RGSS スクリプト抽出エラー", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnRestoreRgss_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (lstGames.SelectedItem is TkoolGameItem tg)
|
||||
{
|
||||
RestoreRgssForGame(tg);
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuRestoreRgss_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (lstGames.SelectedItem is TkoolGameItem tg)
|
||||
{
|
||||
RestoreRgssForGame(tg);
|
||||
}
|
||||
}
|
||||
|
||||
private void RestoreRgssForGame(TkoolGameItem tg)
|
||||
{
|
||||
if (!tg.IsRgss) return;
|
||||
|
||||
var confirm = MessageBox.Show(
|
||||
"抽出したスクリプト(Data\\Scripts)や改造を元に戻し、元のアーカイブ暗号化状態に戻しますか?",
|
||||
"RGSSスクリプト復元の確認",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Question);
|
||||
|
||||
if (confirm != MessageBoxResult.Yes) return;
|
||||
|
||||
AppendLog($"[RGSS復元開始] {tg.Title}");
|
||||
var (success, message) = _rgssModService.RestoreOriginal(tg);
|
||||
|
||||
if (success)
|
||||
{
|
||||
tg.IsModded = false;
|
||||
_scannerService.SaveCache(_games);
|
||||
AppendLog($"[RGSS復元成功] {message}");
|
||||
MessageBox.Show(message, "RGSS 復元完了", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendLog($"[RGSS復元失敗] {message}");
|
||||
MessageBox.Show(message, "RGSS 復元エラー", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void btnRestoreOriginal_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (lstGames.SelectedItem is TkoolGameItem tg)
|
||||
@@ -867,9 +1027,11 @@ namespace GameLauncher
|
||||
|
||||
private void RestoreOriginalMod(TkoolGameItem tg)
|
||||
{
|
||||
var result = tg.EngineType == TkoolEngineType.Tyrano
|
||||
? _tyranoModService.RestoreOriginal(tg)
|
||||
: _modService.RestoreOriginal(tg);
|
||||
var result = tg.IsRgss
|
||||
? _rgssModService.RestoreOriginal(tg)
|
||||
: (tg.EngineType == TkoolEngineType.Tyrano
|
||||
? _tyranoModService.RestoreOriginal(tg)
|
||||
: _modService.RestoreOriginal(tg));
|
||||
|
||||
tg.IsModded = false;
|
||||
AppendLog($"[改造解除] {tg.Title}: {result.Message}");
|
||||
|
||||
@@ -134,9 +134,44 @@ namespace GameLauncher.Models
|
||||
/// <summary>ツクールMZか</summary>
|
||||
public virtual bool IsMZ => false;
|
||||
|
||||
/// <summary>ツクールVXか</summary>
|
||||
public virtual bool IsVX => false;
|
||||
|
||||
/// <summary>ツクールVX Aceか</summary>
|
||||
public virtual bool IsVXAce => false;
|
||||
|
||||
/// <summary>RGSS系(VX / VX Ace)か</summary>
|
||||
public virtual bool IsRgss => false;
|
||||
|
||||
/// <summary>ティラノスクリプトか</summary>
|
||||
public virtual bool IsTyrano => false;
|
||||
|
||||
/// <summary>RGSSアーカイブ(rgss3a/rgss2a等)を持つか</summary>
|
||||
public virtual bool HasRgssArchive
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>RGSSアーカイブが抽出済み(Scripts.rvdata/rvdata2が存在)か</summary>
|
||||
public virtual bool IsRgssExtracted
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>RGSSバッジのテキスト</summary>
|
||||
public virtual string RgssBadgeText => string.Empty;
|
||||
|
||||
/// <summary>RGSSバッジの背景色</summary>
|
||||
public virtual Brush RgssBadgeBackground => Brushes.Transparent;
|
||||
|
||||
/// <summary>RGSSバッジの可視性</summary>
|
||||
public virtual Visibility RgssBadgeVisibility => Visibility.Collapsed;
|
||||
|
||||
/// <summary>RGSS詳細状態テキスト</summary>
|
||||
public virtual string RgssDetailStatusText => string.Empty;
|
||||
|
||||
/// <summary>Unity IL2CPPか</summary>
|
||||
public virtual bool IsIL2CPP => false;
|
||||
|
||||
|
||||
@@ -23,10 +23,15 @@ namespace GameLauncher.Models
|
||||
/// <summary>追加のスキャン対象ルートディレクトリ一覧</summary>
|
||||
public List<string> TargetDirectories { get; set; } = [];
|
||||
|
||||
/// <summary>RGSS Extractor の実行ファイルパス(ツクールVX/VX Ace暗号化アーカイブ展開用)</summary>
|
||||
public string RgssExtractorPath { get; set; } = @"C:\Soft\RGSS-Extractor-v1.0\RGSS Extractor.exe";
|
||||
|
||||
// フィルター状態の保存(再起動時復元用)
|
||||
public string TkoolEngineFilter { get; set; } = "All";
|
||||
public bool TkoolFilterModdedOnly { get; set; }
|
||||
public bool TkoolFilterAsarOnly { get; set; }
|
||||
public bool TkoolFilterRgssOnly { get; set; }
|
||||
public bool TkoolFilterAllRgss { get; set; }
|
||||
public string UnityBackendFilter { get; set; } = "All";
|
||||
public bool UnityFilterSaveOnly { get; set; }
|
||||
}
|
||||
|
||||
+92
-1
@@ -131,6 +131,65 @@ namespace GameLauncher.Models
|
||||
public override bool IsMV => EngineType == TkoolEngineType.MV;
|
||||
public override bool IsMZ => EngineType == TkoolEngineType.MZ;
|
||||
public override bool IsTyrano => EngineType == TkoolEngineType.Tyrano;
|
||||
public override bool IsVX => EngineType == TkoolEngineType.VX;
|
||||
public override bool IsVXAce => EngineType == TkoolEngineType.VXAce;
|
||||
public override bool IsRgss => EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce;
|
||||
|
||||
// RGSS (VX / VX Ace) アーカイブ関連プロパティ
|
||||
private bool _hasRgssArchive;
|
||||
private bool _isRgssExtracted;
|
||||
private string? _rgssArchivePath;
|
||||
|
||||
public override bool HasRgssArchive
|
||||
{
|
||||
get => _hasRgssArchive;
|
||||
set
|
||||
{
|
||||
if (_hasRgssArchive != value)
|
||||
{
|
||||
_hasRgssArchive = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(RgssBadgeVisibility));
|
||||
OnPropertyChanged(nameof(RgssBadgeText));
|
||||
OnPropertyChanged(nameof(RgssBadgeBackground));
|
||||
OnPropertyChanged(nameof(RgssDetailStatusText));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsRgssExtracted
|
||||
{
|
||||
get => _isRgssExtracted;
|
||||
set
|
||||
{
|
||||
if (_isRgssExtracted != value)
|
||||
{
|
||||
_isRgssExtracted = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(RgssBadgeText));
|
||||
OnPropertyChanged(nameof(RgssBadgeBackground));
|
||||
OnPropertyChanged(nameof(RgssDetailStatusText));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string? RgssArchivePath
|
||||
{
|
||||
get => _rgssArchivePath;
|
||||
set { if (_rgssArchivePath != value) { _rgssArchivePath = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
public override Visibility RgssBadgeVisibility => HasRgssArchive ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
public override string RgssBadgeText => !HasRgssArchive ? string.Empty : (IsRgssExtracted ? "RGSS (抽出済)" : "RGSS (暗号化)");
|
||||
|
||||
public override Brush RgssBadgeBackground => IsRgssExtracted
|
||||
? new SolidColorBrush(Color.FromRgb(0x00, 0x89, 0x7B))
|
||||
: new SolidColorBrush(Color.FromRgb(0xD3, 0x54, 0x00));
|
||||
|
||||
public override string RgssDetailStatusText => !HasRgssArchive
|
||||
? string.Empty
|
||||
: (IsRgssExtracted ? "📦 RGSSアーカイブ(スクリプト抽出済み・改造可能)" : "🔒 RGSS暗号化アーカイブ(起動時またはボタンでスクリプト抽出可能)");
|
||||
|
||||
public TkoolEngineType EngineType
|
||||
{
|
||||
@@ -146,6 +205,9 @@ namespace GameLauncher.Models
|
||||
OnPropertyChanged(nameof(IsMV));
|
||||
OnPropertyChanged(nameof(IsMZ));
|
||||
OnPropertyChanged(nameof(IsTyrano));
|
||||
OnPropertyChanged(nameof(IsVX));
|
||||
OnPropertyChanged(nameof(IsVXAce));
|
||||
OnPropertyChanged(nameof(IsRgss));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,10 +369,37 @@ namespace GameLauncher.Models
|
||||
new() { Id = "TyranoCheatMenu", Name = "🎛 画面上変数(f)チートエディタ表示", Description = "画面右上にボタンを配置し、ゲーム内変数・フラグの閲覧と直接書き換えができるメニューを表示します。" }
|
||||
];
|
||||
|
||||
/// <summary>ツクールVX / VX Ace用スクリプト改造定義一覧</summary>
|
||||
public static readonly ModPluginDefinition[] DefaultRgssPlugins =
|
||||
[
|
||||
new() { Id = "RgssDashSpeedUp", Name = "⚡ 移動速度高速化&常時オートダッシュ", Description = "キャラクターの移動速度を高速化し、Shiftキーを押さなくても常時ダッシュ状態にします。" },
|
||||
new() { Id = "RgssItemGainMax", Name = "🎁 アイテム入手時 99個固定化", Description = "宝箱・イベント・戦闘等で通常アイテムを入手した際、入手個数を99個にします。" },
|
||||
new() { Id = "RgssItemNoConsume", Name = "♾️ アイテム消費なし", Description = "アイテムを使用しても所持個数を減少しないようにします。" },
|
||||
new() { Id = "RgssGoldGainMax", Name = "💰 獲得ゴールド最大化 (999,999G)", Description = "戦闘勝利時の獲得ゴールドを999,999Gにします。" },
|
||||
new() { Id = "RgssExpGainMax", Name = "📈 獲得経験値最大化 (999,999Exp)", Description = "戦闘勝利時の獲得経験値を999,999Expにします。" },
|
||||
new() { Id = "RgssBattleTurnRecoverHp", Name = "💖 ターン開始時 全回復 (HP)", Description = "戦闘中の毎ターン開始時にパーティ全員のHPを全回復します。" },
|
||||
new() { Id = "RgssBattleTurnRecoverMp", Name = "🔷 ターン開始時 全回復 (MP)", Description = "戦闘中の毎ターン開始時にパーティ全員のMPを全回復します。" },
|
||||
new() { Id = "RgssBattleTurnRecoverTp", Name = "⚡ ターン開始時 全回復 (TP)", Description = "戦闘中の毎ターン開始時にパーティ全員のTPを最大(100)にします。(VX Ace)" },
|
||||
new() { Id = "RgssMessageInstant", Name = "⏩ メッセージ瞬間表示・高速スキップ", Description = "会話ウィンドウの文字送りウェイトをカットし、瞬間表示します。" },
|
||||
new() { Id = "RgssCommandMemory", Name = "🧠 コマンド位置記憶 (ツクールMV風)", Description = "メニュー画面や戦闘中のアクターコマンドのカーソル選択位置を記憶して次回遷移時に復元します。" }
|
||||
];
|
||||
|
||||
public void SyncPluginOptions(IEnumerable<ModPluginDefinition> availablePlugins, Dictionary<string, bool>? defaultSettings = null)
|
||||
{
|
||||
_pluginOptions.Clear();
|
||||
var targetDefs = EngineType == TkoolEngineType.Tyrano ? DefaultTyranoPlugins : availablePlugins;
|
||||
IEnumerable<ModPluginDefinition> targetDefs;
|
||||
if (EngineType == TkoolEngineType.Tyrano)
|
||||
{
|
||||
targetDefs = DefaultTyranoPlugins;
|
||||
}
|
||||
else if (IsRgss)
|
||||
{
|
||||
targetDefs = DefaultRgssPlugins;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetDefs = availablePlugins;
|
||||
}
|
||||
|
||||
foreach (var def in targetDefs)
|
||||
{
|
||||
@@ -342,6 +431,8 @@ namespace GameLauncher.Models
|
||||
TkoolEngineType.MV => "RPGツクールMV",
|
||||
TkoolEngineType.MZ => "RPGツクールMZ",
|
||||
TkoolEngineType.Tyrano => "ティラノスクリプト",
|
||||
TkoolEngineType.VX => "RPGツクールVX",
|
||||
TkoolEngineType.VXAce => "RPGツクールVX Ace",
|
||||
_ => "ツクール/ティラノ"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace GameLauncher.Models
|
||||
MV,
|
||||
MZ,
|
||||
Tyrano,
|
||||
VX,
|
||||
VXAce,
|
||||
Unknown
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,9 @@ namespace GameLauncher.Services
|
||||
public string? AsarPath { get; set; }
|
||||
public string? AsarExtractedDirPath { get; set; }
|
||||
public string? RelativePluginsJsInAsar { get; set; }
|
||||
public bool HasRgssArchive { get; set; }
|
||||
public bool IsRgssExtracted { get; set; }
|
||||
public string? RgssArchivePath { get; set; }
|
||||
|
||||
// Unity専用
|
||||
public string DataDirectoryPath { get; set; } = string.Empty;
|
||||
@@ -133,7 +136,10 @@ namespace GameLauncher.Services
|
||||
IsAsarExtracted = entry.IsAsarExtracted,
|
||||
AsarPath = entry.AsarPath,
|
||||
AsarExtractedDirPath = entry.AsarExtractedDirPath,
|
||||
RelativePluginsJsInAsar = entry.RelativePluginsJsInAsar
|
||||
RelativePluginsJsInAsar = entry.RelativePluginsJsInAsar,
|
||||
HasRgssArchive = entry.HasRgssArchive,
|
||||
IsRgssExtracted = entry.IsRgssExtracted,
|
||||
RgssArchivePath = entry.RgssArchivePath
|
||||
};
|
||||
if (entry.PluginSettings != null)
|
||||
{
|
||||
@@ -333,7 +339,10 @@ namespace GameLauncher.Services
|
||||
IsAsarExtracted = tg.IsAsarExtracted,
|
||||
AsarPath = tg.AsarPath,
|
||||
AsarExtractedDirPath = tg.AsarExtractedDirPath,
|
||||
RelativePluginsJsInAsar = tg.RelativePluginsJsInAsar
|
||||
RelativePluginsJsInAsar = tg.RelativePluginsJsInAsar,
|
||||
HasRgssArchive = tg.HasRgssArchive,
|
||||
IsRgssExtracted = tg.IsRgssExtracted,
|
||||
RgssArchivePath = tg.RgssArchivePath
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -448,6 +457,25 @@ namespace GameLauncher.Services
|
||||
onGameUpdated(tg);
|
||||
}
|
||||
}
|
||||
else if (tg.IsRgss)
|
||||
{
|
||||
var archiveExists = !string.IsNullOrEmpty(tg.RgssArchivePath) && File.Exists(tg.RgssArchivePath);
|
||||
var scriptExists = !string.IsNullOrEmpty(tg.PluginsJsPath) && File.Exists(tg.PluginsJsPath);
|
||||
|
||||
if (!archiveExists && !scriptExists)
|
||||
{
|
||||
onGameRemoved(tg);
|
||||
cacheNeedsSave = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tg.IsRgssExtracted != scriptExists)
|
||||
{
|
||||
tg.IsRgssExtracted = scriptExists;
|
||||
cacheNeedsSave = true;
|
||||
onGameUpdated(tg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!File.Exists(tg.PluginsJsPath))
|
||||
@@ -475,6 +503,10 @@ namespace GameLauncher.Services
|
||||
{
|
||||
tg.IsModded = false;
|
||||
}
|
||||
else if (tg.IsRgss)
|
||||
{
|
||||
tg.IsModded = !string.IsNullOrEmpty(tg.PluginsJsPath) && File.Exists(tg.PluginsJsPath) && RgssModService.CheckIsModded(tg.PluginsJsPath);
|
||||
}
|
||||
else if (File.Exists(tg.PluginsJsPath))
|
||||
{
|
||||
if (tg.EngineType == TkoolEngineType.Tyrano)
|
||||
@@ -721,6 +753,199 @@ namespace GameLauncher.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 4. ツクールVX / VX Ace (RGSS2 / RGSS3) ゲームの検出
|
||||
var rgssGame = DetectRgssGameInDirectory(dirPath, folderName, folderModified);
|
||||
if (rgssGame != null)
|
||||
{
|
||||
return rgssGame;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private TkoolGameItem? DetectRgssGameInDirectory(string dirPath, string folderName, DateTime? folderModified)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 1. Game.ini または RGSS アーカイブ / スクリプトファイルの存在チェック
|
||||
string? gameIniPath = null;
|
||||
string searchDir = dirPath;
|
||||
|
||||
var directIni = Path.Combine(dirPath, "Game.ini");
|
||||
if (File.Exists(directIni))
|
||||
{
|
||||
gameIniPath = directIni;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var sub in Directory.GetDirectories(dirPath))
|
||||
{
|
||||
var subIni = Path.Combine(sub, "Game.ini");
|
||||
if (File.Exists(subIni))
|
||||
{
|
||||
gameIniPath = subIni;
|
||||
searchDir = sub;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
// 2. アーカイブおよびスクリプト実ファイルの探索
|
||||
string? archivePath = null;
|
||||
string? scriptsPath = null;
|
||||
TkoolEngineType engineType = TkoolEngineType.Unknown;
|
||||
string? title = null;
|
||||
|
||||
if (gameIniPath != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var lines = File.ReadAllLines(gameIniPath);
|
||||
foreach (var line in lines)
|
||||
{
|
||||
var trim = line.Trim();
|
||||
if (trim.StartsWith("Title=", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var val = trim.Substring(6).Trim();
|
||||
if (!string.IsNullOrEmpty(val)) title = val;
|
||||
}
|
||||
else if (trim.StartsWith("RTP=", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var val = trim.Substring(4).Trim();
|
||||
if (val.Contains("RPGVXAce", StringComparison.OrdinalIgnoreCase))
|
||||
engineType = TkoolEngineType.VXAce;
|
||||
else if (val.Contains("RPGVX", StringComparison.OrdinalIgnoreCase))
|
||||
engineType = TkoolEngineType.VX;
|
||||
}
|
||||
else if (trim.StartsWith("Library=", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var val = trim.Substring(8).Trim();
|
||||
if (val.Contains("RGSS3", StringComparison.OrdinalIgnoreCase) && engineType == TkoolEngineType.Unknown)
|
||||
engineType = TkoolEngineType.VXAce;
|
||||
else if (val.Contains("RGSS2", StringComparison.OrdinalIgnoreCase) && engineType == TkoolEngineType.Unknown)
|
||||
engineType = TkoolEngineType.VX;
|
||||
}
|
||||
else if (trim.StartsWith("Scripts=", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var val = trim.Substring(8).Trim();
|
||||
if (val.EndsWith(".rvdata2", StringComparison.OrdinalIgnoreCase) && engineType == TkoolEngineType.Unknown)
|
||||
engineType = TkoolEngineType.VXAce;
|
||||
else if (val.EndsWith(".rvdata", StringComparison.OrdinalIgnoreCase) && engineType == TkoolEngineType.Unknown)
|
||||
engineType = TkoolEngineType.VX;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
// アーカイブファイルの探索
|
||||
var rgss3aFiles = Directory.GetFiles(searchDir, "*.rgss3a", SearchOption.TopDirectoryOnly);
|
||||
var rgss2aFiles = Directory.GetFiles(searchDir, "*.rgss2a", SearchOption.TopDirectoryOnly);
|
||||
|
||||
if (rgss3aFiles.Length > 0)
|
||||
{
|
||||
archivePath = rgss3aFiles[0];
|
||||
if (engineType == TkoolEngineType.Unknown) engineType = TkoolEngineType.VXAce;
|
||||
}
|
||||
else if (rgss2aFiles.Length > 0)
|
||||
{
|
||||
archivePath = rgss2aFiles[0];
|
||||
if (engineType == TkoolEngineType.Unknown) engineType = TkoolEngineType.VX;
|
||||
}
|
||||
|
||||
// スクリプト実ファイルの探索 (Data\Scripts.rvdata2 または rvdata)
|
||||
var rvdata2Path = Path.Combine(searchDir, "Data", "Scripts.rvdata2");
|
||||
var rvdataPath = Path.Combine(searchDir, "Data", "Scripts.rvdata");
|
||||
|
||||
if (File.Exists(rvdata2Path))
|
||||
{
|
||||
scriptsPath = rvdata2Path;
|
||||
if (engineType == TkoolEngineType.Unknown) engineType = TkoolEngineType.VXAce;
|
||||
}
|
||||
else if (File.Exists(rvdataPath))
|
||||
{
|
||||
scriptsPath = rvdataPath;
|
||||
if (engineType == TkoolEngineType.Unknown) engineType = TkoolEngineType.VX;
|
||||
}
|
||||
|
||||
// RGSS系でない場合はスキップ
|
||||
if (engineType == TkoolEngineType.Unknown && archivePath == null && scriptsPath == null && gameIniPath == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (engineType == TkoolEngineType.Unknown)
|
||||
{
|
||||
engineType = TkoolEngineType.VXAce;
|
||||
}
|
||||
|
||||
// 実行ファイルの探索 (Game.exe、または searchDir 内の exe)
|
||||
var exePath = FindRgssExecutable(searchDir, dirPath);
|
||||
if (exePath == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var icon = LoadIcon(exePath, dirPath);
|
||||
bool hasArchive = archivePath != null;
|
||||
bool isExtracted = scriptsPath != null;
|
||||
bool isModded = isExtracted && RgssModService.CheckIsModded(scriptsPath!);
|
||||
|
||||
var plannedScriptName = engineType == TkoolEngineType.VXAce ? "Scripts.rvdata2" : "Scripts.rvdata";
|
||||
var plannedScriptPath = Path.Combine(searchDir, "Data", plannedScriptName);
|
||||
var plannedDataDir = Path.Combine(searchDir, "Data");
|
||||
|
||||
return new TkoolGameItem
|
||||
{
|
||||
Title = !string.IsNullOrWhiteSpace(title) ? title : folderName,
|
||||
FolderName = folderName,
|
||||
RootDirectory = dirPath,
|
||||
ExecutablePath = exePath,
|
||||
PluginsJsPath = isExtracted ? scriptsPath! : plannedScriptPath,
|
||||
PluginsDirPath = plannedDataDir,
|
||||
EngineType = engineType,
|
||||
IsModded = isModded,
|
||||
ApplyMod = true,
|
||||
IconImage = icon,
|
||||
FolderLastModified = folderModified,
|
||||
HasRgssArchive = hasArchive,
|
||||
IsRgssExtracted = isExtracted,
|
||||
RgssArchivePath = archivePath
|
||||
};
|
||||
}
|
||||
catch { }
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string? FindRgssExecutable(string searchDir, string rootDir)
|
||||
{
|
||||
try
|
||||
{
|
||||
var gameExe = Path.Combine(searchDir, "Game.exe");
|
||||
if (File.Exists(gameExe)) return gameExe;
|
||||
|
||||
var rootGameExe = Path.Combine(rootDir, "Game.exe");
|
||||
if (File.Exists(rootGameExe)) return rootGameExe;
|
||||
|
||||
var exes = Directory.GetFiles(searchDir, "*.exe", SearchOption.TopDirectoryOnly);
|
||||
foreach (var exe in exes)
|
||||
{
|
||||
var name = Path.GetFileName(exe);
|
||||
if (!name.Contains("unins", StringComparison.OrdinalIgnoreCase) &&
|
||||
!name.Contains("extractor", StringComparison.OrdinalIgnoreCase) &&
|
||||
!name.Contains("patch", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return exe;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -178,15 +178,25 @@ namespace GameLauncher.Services
|
||||
Directory.CreateDirectory(pluginsDir);
|
||||
}
|
||||
|
||||
var backupPath = pluginsJsPath + BackupSuffix;
|
||||
var gameBackupDir = AppPathHelper.GetGameBackupDirectory(game.FolderName, game.RootDirectory);
|
||||
var backupPath = Path.Combine(gameBackupDir, "plugins.js" + BackupSuffix);
|
||||
var legacyBackupPath = pluginsJsPath + BackupSuffix;
|
||||
|
||||
// 1. バックアップが存在しない場合、バックアップを作成する
|
||||
// 1. バックアップが存在しない場合、バックアップを作成する (Backups フォルダに保存)
|
||||
if (!File.Exists(backupPath))
|
||||
{
|
||||
string currentContent = File.ReadAllText(pluginsJsPath, Encoding.UTF8);
|
||||
// 既に改造プラグイン(新旧問わず)が埋め込まれている場合はクリーンアップしたものをバックアップとして保持
|
||||
string cleanContent = CleanManagedPluginsFromContent(currentContent);
|
||||
File.WriteAllText(backupPath, cleanContent, new UTF8Encoding(false));
|
||||
if (File.Exists(legacyBackupPath))
|
||||
{
|
||||
// 既存のゲーム内バックアップがあれば Backups フォルダへコピー
|
||||
File.Copy(legacyBackupPath, backupPath, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
string currentContent = File.ReadAllText(pluginsJsPath, Encoding.UTF8);
|
||||
// 既に改造プラグイン(新旧問わず)が埋め込まれている場合はクリーンアップしたものをバックアップとして保持
|
||||
string cleanContent = CleanManagedPluginsFromContent(currentContent);
|
||||
File.WriteAllText(backupPath, cleanContent, new UTF8Encoding(false));
|
||||
}
|
||||
}
|
||||
|
||||
// 2. バックアップ(クリーン状態)を元に編集を開始
|
||||
@@ -245,7 +255,9 @@ namespace GameLauncher.Services
|
||||
{
|
||||
var pluginsJsPath = game.PluginsJsPath;
|
||||
var pluginsDir = game.PluginsDirPath;
|
||||
var backupPath = pluginsJsPath + BackupSuffix;
|
||||
var gameBackupDir = AppPathHelper.GetGameBackupDirectory(game.FolderName, game.RootDirectory);
|
||||
var backupPath = Path.Combine(gameBackupDir, "plugins.js" + BackupSuffix);
|
||||
var legacyBackupPath = pluginsJsPath + BackupSuffix;
|
||||
|
||||
// 1. バックアップが存在する場合はバックアップから復元(再構築を通すことで壊れたバックアップも修復)
|
||||
if (File.Exists(backupPath))
|
||||
@@ -254,6 +266,14 @@ namespace GameLauncher.Services
|
||||
string cleanContent = RebuildPluginsJs(backupContent, null);
|
||||
File.WriteAllText(pluginsJsPath, cleanContent, new UTF8Encoding(false));
|
||||
}
|
||||
else if (File.Exists(legacyBackupPath))
|
||||
{
|
||||
string backupContent = File.ReadAllText(legacyBackupPath, Encoding.UTF8);
|
||||
string cleanContent = RebuildPluginsJs(backupContent, null);
|
||||
File.WriteAllText(pluginsJsPath, cleanContent, new UTF8Encoding(false));
|
||||
// Backups フォルダへもコピー
|
||||
try { File.Copy(legacyBackupPath, backupPath, true); } catch { }
|
||||
}
|
||||
else
|
||||
{
|
||||
// バックアップがなくても、現在の plugins.js から新旧すべての管理プラグインを綺麗に除去
|
||||
@@ -276,6 +296,12 @@ namespace GameLauncher.Services
|
||||
}
|
||||
}
|
||||
|
||||
// 3. ゲームフォルダ内の旧バックアップファイルがあれば削除してBackupsフォルダに一本化
|
||||
if (File.Exists(legacyBackupPath))
|
||||
{
|
||||
try { File.Delete(legacyBackupPath); } catch { }
|
||||
}
|
||||
|
||||
game.IsModded = false;
|
||||
return (true, "ゲームを改造前のオリジナル状態に正常に復元しました。(旧プラグインも完全削除済み)");
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using GameLauncher.Helpers;
|
||||
using GameLauncher.Models;
|
||||
|
||||
namespace GameLauncher.Services
|
||||
@@ -69,15 +70,24 @@ namespace GameLauncher.Services
|
||||
try
|
||||
{
|
||||
var dir = Path.GetDirectoryName(indexPath)!;
|
||||
var backupPath = indexPath + IndexBackupSuffix;
|
||||
var gameBackupDir = AppPathHelper.GetGameBackupDirectory(game.FolderName, game.RootDirectory);
|
||||
var backupPath = Path.Combine(gameBackupDir, "index.html" + IndexBackupSuffix);
|
||||
var legacyBackupPath = indexPath + IndexBackupSuffix;
|
||||
|
||||
// 1. バックアップの作成(存在しない場合)
|
||||
// 1. バックアップの作成(存在しない場合、Backups フォルダに保存)
|
||||
if (!File.Exists(backupPath))
|
||||
{
|
||||
string originalContent = File.ReadAllText(indexPath, Encoding.UTF8);
|
||||
// 既にタグが含まれていた場合は除去したものをバックアップとする
|
||||
string cleanContent = RemoveScriptTag(originalContent);
|
||||
File.WriteAllText(backupPath, cleanContent, new UTF8Encoding(false));
|
||||
if (File.Exists(legacyBackupPath))
|
||||
{
|
||||
File.Copy(legacyBackupPath, backupPath, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
string originalContent = File.ReadAllText(indexPath, Encoding.UTF8);
|
||||
// 既にタグが含まれていた場合は除去したものをバックアップとする
|
||||
string cleanContent = RemoveScriptTag(originalContent);
|
||||
File.WriteAllText(backupPath, cleanContent, new UTF8Encoding(false));
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 有効化する機能の判定
|
||||
@@ -121,14 +131,21 @@ namespace GameLauncher.Services
|
||||
try
|
||||
{
|
||||
var dir = Path.GetDirectoryName(indexPath)!;
|
||||
var backupPath = indexPath + IndexBackupSuffix;
|
||||
var gameBackupDir = AppPathHelper.GetGameBackupDirectory(game.FolderName, game.RootDirectory);
|
||||
var backupPath = Path.Combine(gameBackupDir, "index.html" + IndexBackupSuffix);
|
||||
var legacyBackupPath = indexPath + IndexBackupSuffix;
|
||||
var modJsPath = Path.Combine(dir, ModScriptFileName);
|
||||
|
||||
// 1. index.html の復元
|
||||
// 1. index.html の復元 (Backups フォルダを優先)
|
||||
if (File.Exists(backupPath))
|
||||
{
|
||||
File.Copy(backupPath, indexPath, true);
|
||||
}
|
||||
else if (File.Exists(legacyBackupPath))
|
||||
{
|
||||
File.Copy(legacyBackupPath, indexPath, true);
|
||||
try { File.Copy(legacyBackupPath, backupPath, true); } catch { }
|
||||
}
|
||||
else if (File.Exists(indexPath))
|
||||
{
|
||||
string content = File.ReadAllText(indexPath, Encoding.UTF8);
|
||||
@@ -136,6 +153,12 @@ namespace GameLauncher.Services
|
||||
File.WriteAllText(indexPath, clean, new UTF8Encoding(false));
|
||||
}
|
||||
|
||||
// ゲームフォルダ内の旧バックアップがあれば削除
|
||||
if (File.Exists(legacyBackupPath))
|
||||
{
|
||||
try { File.Delete(legacyBackupPath); } catch { }
|
||||
}
|
||||
|
||||
// 2. tyrano_launcher_mod.js の削除
|
||||
if (File.Exists(modJsPath))
|
||||
{
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ if (!(Test-Path $publishDir)) {
|
||||
|
||||
Write-Host 'プロジェクトのビルドおよび単一ファイル発行中...' -ForegroundColor Yellow
|
||||
|
||||
dotnet publish "$projectDir\GameLauncher.csproj" -c Release -r win-x64 --self-contained false -o $publishDir
|
||||
dotnet publish "$projectDir\GameLauncher.csproj" -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -p:PublishDir="$publishDir\"
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
# プラグインおよび設定ファイルの配置
|
||||
|
||||
Reference in new issue
Block a user