Compare commits
7
Commits
7ac4dbc825
...
0d11039ee9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d11039ee9 | ||
|
|
0eb06318ac | ||
|
|
6cea9fa91b | ||
|
|
01ee04b4cc | ||
|
|
a1430bbdbc | ||
|
|
0befb0a972 | ||
|
|
bc5ba43ce7 |
No files matched your search
+11
@@ -8,3 +8,14 @@
|
|||||||
*.suo
|
*.suo
|
||||||
*.userosscache
|
*.userosscache
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
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);
|
base.OnStartup(e);
|
||||||
|
|
||||||
|
// Shift_JIS等のコードページを有効化
|
||||||
|
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
|
||||||
|
|
||||||
// 作業ディレクトリを exe のあるフォルダに確実に設定
|
// 作業ディレクトリを exe のあるフォルダに確実に設定
|
||||||
AppPathHelper.SetCurrentDirectoryToExeDirectory();
|
AppPathHelper.SetCurrentDirectoryToExeDirectory();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,156 @@
|
|||||||
|
<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>
|
||||||
|
|
||||||
|
<!-- 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>
|
||||||
|
<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,106 @@
|
|||||||
|
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";
|
||||||
|
txtWolfExtractorPath.Text = _config.WolfExtractorPath ?? string.Empty;
|
||||||
|
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 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
|
||||||
|
{
|
||||||
|
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.WolfExtractorPath = txtWolfExtractorPath.Text.Trim();
|
||||||
|
_config.DefaultApplyMod = chkDefaultApplyMod.IsChecked == true;
|
||||||
|
IsSaved = true;
|
||||||
|
DialogResult = true;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult = false;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,10 @@
|
|||||||
<DebugType>embedded</DebugType>
|
<DebugType>embedded</DebugType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="plugins\AlwaysMaxHpMp.js" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Update="plugins\**">
|
<None Update="plugins\**">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
|||||||
@@ -164,6 +164,24 @@ namespace GameLauncher.Helpers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetBackupsDirectory()
|
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");
|
var exeBackups = Path.Combine(GetExeDirectory(), "Backups");
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
+445
-33
@@ -32,10 +32,18 @@
|
|||||||
<SolidColorBrush x:Key="BadgeMvBg" Color="#8B1E3F"/>
|
<SolidColorBrush x:Key="BadgeMvBg" Color="#8B1E3F"/>
|
||||||
<SolidColorBrush x:Key="BadgeMzBg" Color="#1E5F8B"/>
|
<SolidColorBrush x:Key="BadgeMzBg" Color="#1E5F8B"/>
|
||||||
<SolidColorBrush x:Key="BadgeTyranoBg" Color="#D35400"/>
|
<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="BadgeModdedBg" Color="#8B571E"/>
|
||||||
<SolidColorBrush x:Key="BadgeIl2cppBg" Color="#5A368B"/>
|
<SolidColorBrush x:Key="BadgeIl2cppBg" Color="#5A368B"/>
|
||||||
<SolidColorBrush x:Key="BadgeMonoBg" Color="#1E5F8B"/>
|
<SolidColorBrush x:Key="BadgeMonoBg" Color="#1E5F8B"/>
|
||||||
<SolidColorBrush x:Key="BadgeSaveBg" Color="#0D735E"/>
|
<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">
|
<Style TargetType="ScrollBar">
|
||||||
@@ -341,58 +349,53 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- 再スキャンボタン -->
|
<!-- 設定ボタン & 再スキャンボタン -->
|
||||||
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
|
<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"/>
|
<Button x:Name="btnRescan" Style="{StaticResource ModernButton}" Content="🔄 再スキャン" Click="btnRescan_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</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>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</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">
|
<StackPanel Orientation="Horizontal">
|
||||||
<RadioButton x:Name="tabAll" Style="{StaticResource NavTabRadioButton}" Content="🎮⚡ すべて" IsChecked="True" Checked="MainTab_Checked"/>
|
<RadioButton x:Name="tabAll" Style="{StaticResource NavTabRadioButton}" Content="🎮⚡ すべて" IsChecked="True" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||||
<RadioButton x:Name="tabTkool" Style="{StaticResource NavTabRadioButton}" Content="🎮 ツクール・ティラノ" Checked="MainTab_Checked"/>
|
<RadioButton x:Name="tabMV" Style="{StaticResource NavTabRadioButton}" Content="ツクールMV" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="11,6"/>
|
||||||
<RadioButton x:Name="tabUnity" Style="{StaticResource NavTabRadioButton}" Content="⚡ Unity" Checked="MainTab_Checked"/>
|
<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="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>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- 連動サブフィルター群 -->
|
<!-- サブフィルター群(状態・形式の追加絞り込み) -->
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
<!-- 1. ツクール/ティラノ用サブフィルター -->
|
<!-- Unityバックエンド切り替え(Unityタブ選択時のみ表示) -->
|
||||||
<StackPanel x:Name="pnlTkoolFilters" Orientation="Horizontal" VerticalAlignment="Center" Visibility="Collapsed">
|
<StackPanel x:Name="pnlUnityBackendFilter" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,12,0" Visibility="Collapsed">
|
||||||
<TextBlock Text="エンジン:" FontSize="12" Foreground="{StaticResource TextSecondary}" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
<TextBlock Text="形式:" FontSize="11" Foreground="{StaticResource TextSecondary}" VerticalAlignment="Center" Margin="0,0,4,0"/>
|
||||||
<RadioButton x:Name="rbTkoolAll" Content="すべて" IsChecked="True" GroupName="TkoolEngineFilter" Margin="0,0,8,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
<RadioButton x:Name="rbUnityAll" Content="すべて" IsChecked="True" GroupName="UnityBackendFilter" Margin="0,0,6,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="rbUnityIL2CPP" Content="IL2CPP" GroupName="UnityBackendFilter" Margin="0,0,6,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="rbUnityMono" Content="Mono" GroupName="UnityBackendFilter" Margin="0,0,6,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"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- 2. Unity用サブフィルター -->
|
<!-- 全体共通詳細チェックボックス -->
|
||||||
<StackPanel x:Name="pnlUnityFilters" Orientation="Horizontal" VerticalAlignment="Center" Visibility="Collapsed">
|
<CheckBox x:Name="chkFilterModdedOnly" Content="改造中のみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||||
<TextBlock Text="バックエンド:" FontSize="12" Foreground="{StaticResource TextSecondary}" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
<CheckBox x:Name="chkFilterAsarOnly" Content="ASAR形式のみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||||
<RadioButton x:Name="rbUnityAll" Content="すべて" IsChecked="True" GroupName="UnityBackendFilter" Margin="0,0,8,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
<CheckBox x:Name="chkFilterRgssOnly" Content="RGSSアーカイブのみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="FilterChanged"/>
|
||||||
<RadioButton x:Name="rbUnityIL2CPP" Content="IL2CPP" GroupName="UnityBackendFilter" Margin="0,0,8,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged"/>
|
<CheckBox x:Name="chkFilterSrpgOnly" Content="data.dtsのみ" Margin="0,0,10,0" Foreground="{StaticResource TextSecondary}" Checked="FilterChanged" Unchecked="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"/>
|
||||||
<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>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
@@ -426,6 +429,8 @@
|
|||||||
<MenuItem x:Name="menuTkoolRestoreOriginal" Header="↩ 改造を解除してオリジナルに復元" Click="MenuRestoreOriginal_Click"/>
|
<MenuItem x:Name="menuTkoolRestoreOriginal" Header="↩ 改造を解除してオリジナルに復元" Click="MenuRestoreOriginal_Click"/>
|
||||||
<MenuItem x:Name="menuTkoolExtractAsar" Header="📦 ASARを解凍する" Click="MenuExtractAsar_Click"/>
|
<MenuItem x:Name="menuTkoolExtractAsar" Header="📦 ASARを解凍する" Click="MenuExtractAsar_Click"/>
|
||||||
<MenuItem x:Name="menuTkoolRestoreAsar" Header="↩ ASAR状態に戻す(復元)" Click="MenuRestoreAsar_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専用メニュー項目 -->
|
<!-- Unity専用メニュー項目 -->
|
||||||
<MenuItem x:Name="menuUnitySaveEditor" Header="🛠 セーブエディタを開く" Click="MenuOpenSaveEditor_Click"/>
|
<MenuItem x:Name="menuUnitySaveEditor" Header="🛠 セーブエディタを開く" Click="MenuOpenSaveEditor_Click"/>
|
||||||
@@ -539,6 +544,38 @@
|
|||||||
<TextBlock Text="MZ" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
<TextBlock Text="MZ" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||||
</Border>
|
</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 CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
@@ -555,6 +592,44 @@
|
|||||||
<TextBlock Text="ティラノ" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
<TextBlock Text="ティラノ" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||||
</Border>
|
</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バッジ -->
|
<!-- IL2CPPバッジ -->
|
||||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
@@ -593,6 +668,12 @@
|
|||||||
<TextBlock Text="{Binding AsarBadgeText}" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
<TextBlock Text="{Binding AsarBadgeText}" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||||
</Border>
|
</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 Background="{StaticResource BadgeModdedBg}" CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
@@ -714,6 +795,36 @@
|
|||||||
<TextBlock Text="RPGツクールMZ" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
<TextBlock Text="RPGツクールMZ" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||||
</Border>
|
</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 CornerRadius="4" Padding="6,2" Margin="0,0,6,0" Background="{StaticResource BadgeTyranoBg}">
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
@@ -729,6 +840,21 @@
|
|||||||
<TextBlock Text="ティラノスクリプト" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
<TextBlock Text="ティラノスクリプト" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||||
</Border>
|
</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バックエンドバッジ -->
|
<!-- Unityバックエンドバッジ -->
|
||||||
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0" Background="{StaticResource BadgeIl2cppBg}"
|
<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}}">
|
Visibility="{Binding SelectedItem, ElementName=lstGames, Converter={x:Static helpers:IsUnityToVisibilityConverter.Instance}}">
|
||||||
@@ -746,6 +872,18 @@
|
|||||||
<TextBlock Text="{Binding SelectedItem.AsarBadgeText, ElementName=lstGames}" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
<TextBlock Text="{Binding SelectedItem.AsarBadgeText, ElementName=lstGames}" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||||
</Border>
|
</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 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 CornerRadius="4" Padding="6,2" Background="{StaticResource BadgeModdedBg}" Margin="0,0,6,0">
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
@@ -782,7 +920,17 @@
|
|||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Button Grid.Column="0" Style="{StaticResource ModernButton}" Content="📁 フォルダを開く" Click="btnOpenFolder_Click"/>
|
<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>
|
</Grid>
|
||||||
|
|
||||||
<!-- パス・日時情報 -->
|
<!-- パス・日時情報 -->
|
||||||
@@ -842,8 +990,49 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</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">
|
<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>
|
<StackPanel>
|
||||||
<CheckBox x:Name="chkApplyMod" IsChecked="{Binding SelectedItem.ApplyMod, ElementName=lstGames, Mode=TwoWay}"
|
<CheckBox x:Name="chkApplyMod" IsChecked="{Binding SelectedItem.ApplyMod, ElementName=lstGames, Mode=TwoWay}"
|
||||||
FontSize="15" FontWeight="Bold" Foreground="#A29BFE">
|
FontSize="15" FontWeight="Bold" Foreground="#A29BFE">
|
||||||
@@ -875,6 +1064,229 @@
|
|||||||
</Expander>
|
</Expander>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
<!-- ====== プリンセスシナジー専用: HP/MP 常時MAX ====== -->
|
||||||
|
<Border Background="#1E1E2E" BorderBrush="#E84393" 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.IsPrincessSynergy, ElementName=lstGames}" Value="True">
|
||||||
|
<Setter Property="Visibility" Value="Visible"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Border.Style>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="💖 プリンセスシナジー専用 カジュアル設定" FontSize="13" FontWeight="Bold" Foreground="#FD79A8" Margin="0,0,0,10"/>
|
||||||
|
<CheckBox x:Name="chkPrincessAlwaysMaxHp" IsChecked="{Binding SelectedItem.PrincessAlwaysMaxHp, ElementName=lstGames, Mode=TwoWay}"
|
||||||
|
FontSize="13" FontWeight="Bold" Foreground="#FFEAA7">
|
||||||
|
<TextBlock Text="❤️ HPを常時MAXにする" Margin="4,0,0,0"/>
|
||||||
|
</CheckBox>
|
||||||
|
<TextBlock Text="プレイヤーキャラのHPを常に最大値に固定します。" FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="22,2,0,8"/>
|
||||||
|
<CheckBox x:Name="chkPrincessAlwaysMaxMp" IsChecked="{Binding SelectedItem.PrincessAlwaysMaxMp, ElementName=lstGames, Mode=TwoWay}"
|
||||||
|
FontSize="13" FontWeight="Bold" Foreground="#74B9FF">
|
||||||
|
<TextBlock Text="💙 MPを常時MAXにする" Margin="4,0,0,0"/>
|
||||||
|
</CheckBox>
|
||||||
|
<TextBlock Text="プレイヤーキャラのMPを常に最大値に固定します。" FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="22,2,0,0"/>
|
||||||
|
</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. プロキシ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>
|
||||||
|
|
||||||
|
<!-- 3. 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>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- ================= B. Unity 選択時の個別UI ================= -->
|
<!-- ================= B. Unity 選択時の個別UI ================= -->
|
||||||
|
|||||||
+745
-81
@@ -30,6 +30,12 @@ namespace GameLauncher
|
|||||||
private readonly TyranoModService _tyranoModService = new();
|
private readonly TyranoModService _tyranoModService = new();
|
||||||
private readonly AsarArchiveService _asarService = new();
|
private readonly AsarArchiveService _asarService = new();
|
||||||
private readonly UnitySaveManagerService _unitySaveService = 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 readonly ObservableCollection<GameItemBase> _games = [];
|
||||||
private ListCollectionView _gamesView = null!;
|
private ListCollectionView _gamesView = null!;
|
||||||
@@ -68,6 +74,20 @@ namespace GameLauncher
|
|||||||
|
|
||||||
#region 設定のロード & セーブ
|
#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()
|
private void LoadConfig()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -82,12 +102,7 @@ namespace GameLauncher
|
|||||||
_gameComparer.SortOrder = _config.SortOrder;
|
_gameComparer.SortOrder = _config.SortOrder;
|
||||||
ApplySortOrderToComboBox(_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();
|
RestoreFilterSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,20 +114,32 @@ namespace GameLauncher
|
|||||||
|
|
||||||
private void RestoreFilterSettings()
|
private void RestoreFilterSettings()
|
||||||
{
|
{
|
||||||
// ツクールフィルター
|
switch (_config.SelectedTab)
|
||||||
if (_config.TkoolEngineFilter == "MV") rbTkoolMV.IsChecked = true;
|
{
|
||||||
else if (_config.TkoolEngineFilter == "MZ") rbTkoolMZ.IsChecked = true;
|
case 1: tabMV.IsChecked = true; break;
|
||||||
else if (_config.TkoolEngineFilter == "Tyrano") rbTkoolTyrano.IsChecked = true;
|
case 2: tabMZ.IsChecked = true; break;
|
||||||
else rbTkoolAll.IsChecked = true;
|
case 3: tabVXAce.IsChecked = true; break;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
chkFilterModdedOnly.IsChecked = _config.TkoolFilterModdedOnly;
|
if (pnlUnityBackendFilter != null)
|
||||||
chkFilterAsarOnly.IsChecked = _config.TkoolFilterAsarOnly;
|
{
|
||||||
|
pnlUnityBackendFilter.Visibility = tabUnity.IsChecked == true ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
// Unityフィルター
|
// Unityフィルター
|
||||||
if (_config.UnityBackendFilter == "IL2CPP") rbUnityIL2CPP.IsChecked = true;
|
if (_config.UnityBackendFilter == "IL2CPP") rbUnityIL2CPP.IsChecked = true;
|
||||||
else if (_config.UnityBackendFilter == "Mono") rbUnityMono.IsChecked = true;
|
else if (_config.UnityBackendFilter == "Mono") rbUnityMono.IsChecked = true;
|
||||||
else rbUnityAll.IsChecked = true;
|
else rbUnityAll.IsChecked = true;
|
||||||
|
|
||||||
|
chkFilterModdedOnly.IsChecked = _config.TkoolFilterModdedOnly;
|
||||||
|
chkFilterAsarOnly.IsChecked = _config.TkoolFilterAsarOnly;
|
||||||
|
chkFilterRgssOnly.IsChecked = _config.TkoolFilterRgssOnly;
|
||||||
chkFilterSaveOnly.IsChecked = _config.UnityFilterSaveOnly;
|
chkFilterSaveOnly.IsChecked = _config.UnityFilterSaveOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,13 +150,23 @@ namespace GameLauncher
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
_config.SortOrder = _gameComparer.SortOrder;
|
_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;
|
||||||
|
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");
|
||||||
|
|
||||||
_config.TkoolFilterModdedOnly = chkFilterModdedOnly.IsChecked == true;
|
_config.TkoolFilterModdedOnly = chkFilterModdedOnly.IsChecked == true;
|
||||||
_config.TkoolFilterAsarOnly = chkFilterAsarOnly.IsChecked == true;
|
_config.TkoolFilterAsarOnly = chkFilterAsarOnly.IsChecked == true;
|
||||||
|
_config.TkoolFilterRgssOnly = chkFilterRgssOnly.IsChecked == true;
|
||||||
_config.UnityBackendFilter = rbUnityIL2CPP.IsChecked == true ? "IL2CPP" : (rbUnityMono.IsChecked == true ? "Mono" : "All");
|
|
||||||
_config.UnityFilterSaveOnly = chkFilterSaveOnly.IsChecked == true;
|
_config.UnityFilterSaveOnly = chkFilterSaveOnly.IsChecked == true;
|
||||||
|
|
||||||
var options = new JsonSerializerOptions
|
var options = new JsonSerializerOptions
|
||||||
@@ -171,6 +208,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))
|
if (modified || !File.Exists(_configFilePath))
|
||||||
{
|
{
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
@@ -222,11 +268,13 @@ namespace GameLauncher
|
|||||||
|
|
||||||
if (_games.Count > 0)
|
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 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);
|
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 = "裏で更新・実在検証を実行中...";
|
lblStatusEngine.Text = "裏で更新・実在検証を実行中...";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -376,70 +424,59 @@ namespace GameLauncher
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. メインタブフィルター
|
// 2. エンジンの種類フィルター
|
||||||
if (tabTkool.IsChecked == true)
|
if (tabMV.IsChecked == true)
|
||||||
{
|
{
|
||||||
if (game is not TkoolGameItem tg) return false;
|
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.MV) return false;
|
||||||
|
}
|
||||||
// ツクールサブフィルター
|
else if (tabMZ.IsChecked == true)
|
||||||
if (rbTkoolMV.IsChecked == true && tg.EngineType != TkoolEngineType.MV) return false;
|
{
|
||||||
if (rbTkoolMZ.IsChecked == true && tg.EngineType != TkoolEngineType.MZ) return false;
|
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.MZ) return false;
|
||||||
if (rbTkoolTyrano.IsChecked == true && tg.EngineType != TkoolEngineType.Tyrano) return false;
|
}
|
||||||
|
else if (tabVXAce.IsChecked == true)
|
||||||
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.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 (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)
|
else if (tabUnity.IsChecked == true)
|
||||||
{
|
{
|
||||||
if (game is not UnityGameItem ug) return false;
|
if (game is not UnityGameItem ug) return false;
|
||||||
|
|
||||||
// Unityサブフィルター
|
|
||||||
if (rbUnityIL2CPP.IsChecked == true && ug.BackendType != UnityBackendType.IL2CPP) return false;
|
if (rbUnityIL2CPP.IsChecked == true && ug.BackendType != UnityBackendType.IL2CPP) return false;
|
||||||
if (rbUnityMono.IsChecked == true && ug.BackendType != UnityBackendType.Mono) 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 (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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainTab_Checked(object sender, RoutedEventArgs e)
|
private void EngineTab_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!_isInitialized) return;
|
if (!_isInitialized) return;
|
||||||
if (pnlTkoolFilters == null || pnlUnityFilters == null || pnlAllFilters == null) return;
|
|
||||||
|
|
||||||
if (tabTkool.IsChecked == true)
|
if (pnlUnityBackendFilter != null)
|
||||||
{
|
{
|
||||||
pnlTkoolFilters.Visibility = Visibility.Visible;
|
pnlUnityBackendFilter.Visibility = tabUnity.IsChecked == true ? Visibility.Visible : Visibility.Collapsed;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_gamesView?.Refresh();
|
_gamesView?.Refresh();
|
||||||
@@ -486,12 +523,15 @@ namespace GameLauncher
|
|||||||
|
|
||||||
int total = _games.Count;
|
int total = _games.Count;
|
||||||
int visible = _gamesView?.Count ?? 0;
|
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 && !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 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);
|
int unityCount = _games.Count(g => g is UnityGameItem);
|
||||||
|
|
||||||
lblStatusSummary.Text = $"総ゲーム数: {total} 件 | 表示: {visible} 件";
|
lblStatusSummary.Text = $"総ゲーム数: {total} 件 | 表示: {visible} 件";
|
||||||
lblStatusBreakdown.Text = $"(ツクール: {tkoolCount}, ティラノ: {tyranoCount}, Unity: {unityCount})";
|
lblStatusBreakdown.Text = $"(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, SRPG Studio: {srpgCount}, Unity: {unityCount})";
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -591,6 +631,46 @@ namespace GameLauncher
|
|||||||
|
|
||||||
private async Task LaunchTkoolGameAsync(TkoolGameItem tg)
|
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の場合、解凍を促す
|
// ASAR形式ゲームで未解凍かつ改造適用ONの場合、解凍を促す
|
||||||
if (tg.IsAsar && !tg.IsAsarExtracted && tg.ApplyMod)
|
if (tg.IsAsar && !tg.IsAsarExtracted && tg.ApplyMod)
|
||||||
{
|
{
|
||||||
@@ -613,8 +693,23 @@ namespace GameLauncher
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// スクリプト改造の適用または復元
|
// RGSSゲーム(ツクールVX / VX Ace)の場合
|
||||||
if (tg.EngineType == TkoolEngineType.Tyrano)
|
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)
|
if (tg.ApplyMod)
|
||||||
{
|
{
|
||||||
@@ -627,6 +722,7 @@ namespace GameLauncher
|
|||||||
AppendLog($"[ティラノ復元] {tg.Title}: {msg}");
|
AppendLog($"[ティラノ復元] {tg.Title}: {msg}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// スクリプト改造の適用または復元(ツクールMV/MZ)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var (success, msg) = _modService.ApplyOrRestoreMod(tg, _config.DefaultPluginSettings);
|
var (success, msg) = _modService.ApplyOrRestoreMod(tg, _config.DefaultPluginSettings);
|
||||||
@@ -655,7 +751,8 @@ namespace GameLauncher
|
|||||||
|
|
||||||
// ツクール/ティラノ等のWebランタイム(NW.js / Chromium)ゲームの場合、
|
// ツクール/ティラノ等のWebランタイム(NW.js / Chromium)ゲームの場合、
|
||||||
// GameLauncher.exe のあるフォルダ配下の Profiles フォルダに隔離した専用プロファイルディレクトリを指定して起動
|
// GameLauncher.exe のあるフォルダ配下の Profiles フォルダに隔離した専用プロファイルディレクトリを指定して起動
|
||||||
if (game is TkoolGameItem tg)
|
// ※RGSS(DirectX/Ruby)やウディタ、Unity等のネイティブアプリには引数を付与しない
|
||||||
|
if (game is TkoolGameItem tg && !tg.IsRgss && !tg.IsWolf)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -699,19 +796,48 @@ namespace GameLauncher
|
|||||||
|
|
||||||
// ツクール専用メニュー
|
// ツクール専用メニュー
|
||||||
menuTkoolOpenFolder.Visibility = isTkool ? Visibility.Visible : Visibility.Collapsed;
|
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;
|
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;
|
// ASAR メニュー
|
||||||
menuTkoolRestoreAsar.Visibility = tg.IsAsarExtracted ? Visibility.Visible : Visibility.Collapsed;
|
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
|
else
|
||||||
{
|
{
|
||||||
menuTkoolExtractAsar.Visibility = Visibility.Collapsed;
|
menuTkoolExtractAsar.Visibility = Visibility.Collapsed;
|
||||||
menuTkoolRestoreAsar.Visibility = Visibility.Collapsed;
|
menuTkoolRestoreAsar.Visibility = Visibility.Collapsed;
|
||||||
|
menuTkoolExtractRgss.Visibility = Visibility.Collapsed;
|
||||||
|
menuTkoolRestoreRgss.Visibility = Visibility.Collapsed;
|
||||||
|
menuTkoolOpenPluginsJs.Visibility = Visibility.Collapsed;
|
||||||
|
menuTkoolOpenProfile.Visibility = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unity専用メニュー
|
// Unity専用メニュー
|
||||||
@@ -724,7 +850,7 @@ namespace GameLauncher
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ツクール専用機能 (ASAR解凍・復元・MOD解除・Profile)
|
#region ツクール専用機能 (ASAR解凍・復元・RGSS抽出・復元・MOD解除・Profile)
|
||||||
|
|
||||||
private async void btnExtractAsar_Click(object sender, RoutedEventArgs e)
|
private async void btnExtractAsar_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -849,6 +975,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)
|
private void btnRestoreOriginal_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (lstGames.SelectedItem is TkoolGameItem tg)
|
if (lstGames.SelectedItem is TkoolGameItem tg)
|
||||||
@@ -867,9 +1089,11 @@ namespace GameLauncher
|
|||||||
|
|
||||||
private void RestoreOriginalMod(TkoolGameItem tg)
|
private void RestoreOriginalMod(TkoolGameItem tg)
|
||||||
{
|
{
|
||||||
var result = tg.EngineType == TkoolEngineType.Tyrano
|
var result = tg.IsRgss
|
||||||
? _tyranoModService.RestoreOriginal(tg)
|
? _rgssModService.RestoreOriginal(tg)
|
||||||
: _modService.RestoreOriginal(tg);
|
: (tg.EngineType == TkoolEngineType.Tyrano
|
||||||
|
? _tyranoModService.RestoreOriginal(tg)
|
||||||
|
: _modService.RestoreOriginal(tg));
|
||||||
|
|
||||||
tg.IsModded = false;
|
tg.IsModded = false;
|
||||||
AppendLog($"[改造解除] {tg.Title}: {result.Message}");
|
AppendLog($"[改造解除] {tg.Title}: {result.Message}");
|
||||||
@@ -1080,6 +1304,446 @@ namespace GameLauncher
|
|||||||
|
|
||||||
#endregion
|
#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 共通アクション (フォルダを開く・ログ操作)
|
#region 共通アクション (フォルダを開く・ログ操作)
|
||||||
|
|
||||||
private void btnOpenFolder_Click(object sender, RoutedEventArgs e)
|
private void btnOpenFolder_Click(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
@@ -134,9 +134,93 @@ namespace GameLauncher.Models
|
|||||||
/// <summary>ツクールMZか</summary>
|
/// <summary>ツクールMZか</summary>
|
||||||
public virtual bool IsMZ => false;
|
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>
|
/// <summary>ティラノスクリプトか</summary>
|
||||||
public virtual bool IsTyrano => false;
|
public virtual bool IsTyrano => false;
|
||||||
|
|
||||||
|
/// <summary>WOLF RPGエディター(ウディタ)か</summary>
|
||||||
|
public virtual bool IsWolf => false;
|
||||||
|
|
||||||
|
/// <summary>SRPG Studioか</summary>
|
||||||
|
public virtual bool IsSrpgStudio => false;
|
||||||
|
|
||||||
|
/// <summary>プリンセスシナジー(専用改造対象のMZゲーム)か</summary>
|
||||||
|
public virtual bool IsPrincessSynergy => 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>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;
|
||||||
|
|
||||||
|
/// <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>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>
|
/// <summary>Unity IL2CPPか</summary>
|
||||||
public virtual bool IsIL2CPP => false;
|
public virtual bool IsIL2CPP => false;
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,18 @@ namespace GameLauncher.Models
|
|||||||
/// <summary>追加のスキャン対象ルートディレクトリ一覧</summary>
|
/// <summary>追加のスキャン対象ルートディレクトリ一覧</summary>
|
||||||
public List<string> TargetDirectories { get; set; } = [];
|
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";
|
||||||
|
|
||||||
|
/// <summary>Wolf RPG アーカイブ解凍ツールの実行ファイルパス(UberWolfCli.exe / WolfDec.exe など)</summary>
|
||||||
|
public string WolfExtractorPath { get; set; } = string.Empty;
|
||||||
|
|
||||||
// フィルター状態の保存(再起動時復元用)
|
// フィルター状態の保存(再起動時復元用)
|
||||||
public string TkoolEngineFilter { get; set; } = "All";
|
public string TkoolEngineFilter { get; set; } = "All";
|
||||||
public bool TkoolFilterModdedOnly { get; set; }
|
public bool TkoolFilterModdedOnly { get; set; }
|
||||||
public bool TkoolFilterAsarOnly { get; set; }
|
public bool TkoolFilterAsarOnly { get; set; }
|
||||||
|
public bool TkoolFilterRgssOnly { get; set; }
|
||||||
|
public bool TkoolFilterAllRgss { get; set; }
|
||||||
public string UnityBackendFilter { get; set; } = "All";
|
public string UnityBackendFilter { get; set; } = "All";
|
||||||
public bool UnityFilterSaveOnly { get; set; }
|
public bool UnityFilterSaveOnly { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
+308
-4
@@ -112,9 +112,13 @@ namespace GameLauncher.Models
|
|||||||
private string? _asarExtractedDirPath;
|
private string? _asarExtractedDirPath;
|
||||||
private string? _relativePluginsJsInAsar;
|
private string? _relativePluginsJsInAsar;
|
||||||
|
|
||||||
public override GameEngineKind EngineKind => EngineType == TkoolEngineType.Tyrano
|
public override GameEngineKind EngineKind => EngineType switch
|
||||||
? GameEngineKind.Tyrano
|
{
|
||||||
: GameEngineKind.Tkool;
|
TkoolEngineType.Tyrano => GameEngineKind.Tyrano,
|
||||||
|
TkoolEngineType.Wolf => GameEngineKind.Wolf,
|
||||||
|
TkoolEngineType.SrpgStudio => GameEngineKind.SrpgStudio,
|
||||||
|
_ => GameEngineKind.Tkool
|
||||||
|
};
|
||||||
|
|
||||||
public string PluginsJsPath
|
public string PluginsJsPath
|
||||||
{
|
{
|
||||||
@@ -131,6 +135,131 @@ namespace GameLauncher.Models
|
|||||||
public override bool IsMV => EngineType == TkoolEngineType.MV;
|
public override bool IsMV => EngineType == TkoolEngineType.MV;
|
||||||
public override bool IsMZ => EngineType == TkoolEngineType.MZ;
|
public override bool IsMZ => EngineType == TkoolEngineType.MZ;
|
||||||
public override bool IsTyrano => EngineType == TkoolEngineType.Tyrano;
|
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;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 「プリンセスシナジー」(ツクールMZ製・専用改造対象ゲーム)かどうか。
|
||||||
|
/// タイトルまたはフォルダ名に "プリンセスシナジー" を含み、エンジンがMZの場合のみ true。
|
||||||
|
/// これにより当該機能が他ゲームに表示・適用されるのを防ぎます。
|
||||||
|
/// </summary>
|
||||||
|
public override bool IsPrincessSynergy =>
|
||||||
|
!string.IsNullOrEmpty(Title) && Title.Contains("プリンセスシナジー");
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
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
|
public TkoolEngineType EngineType
|
||||||
{
|
{
|
||||||
@@ -146,10 +275,99 @@ namespace GameLauncher.Models
|
|||||||
OnPropertyChanged(nameof(IsMV));
|
OnPropertyChanged(nameof(IsMV));
|
||||||
OnPropertyChanged(nameof(IsMZ));
|
OnPropertyChanged(nameof(IsMZ));
|
||||||
OnPropertyChanged(nameof(IsTyrano));
|
OnPropertyChanged(nameof(IsTyrano));
|
||||||
|
OnPropertyChanged(nameof(IsVX));
|
||||||
|
OnPropertyChanged(nameof(IsVXAce));
|
||||||
|
OnPropertyChanged(nameof(IsWolf));
|
||||||
|
OnPropertyChanged(nameof(IsSrpgStudio));
|
||||||
|
OnPropertyChanged(nameof(IsRgss));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ================= WOLF RPGエディター関連プロパティ =================
|
||||||
|
private bool _wolfProxyDll = false;
|
||||||
|
private double _wolfSpeedMultiplier = 3.0;
|
||||||
|
private bool _hasWolfArchive = false;
|
||||||
|
private bool _isWolfExtracted = false;
|
||||||
|
|
||||||
|
/// <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
|
public override bool IsModded
|
||||||
{
|
{
|
||||||
get => _isModded;
|
get => _isModded;
|
||||||
@@ -268,6 +486,41 @@ namespace GameLauncher.Models
|
|||||||
set { if (_pluginOptions != value) { _pluginOptions = value; OnPropertyChanged(); } }
|
set { if (_pluginOptions != value) { _pluginOptions = value; OnPropertyChanged(); } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プリンセスシナジー専用: HP常時MAX(プラグイン "AlwaysMaxHp")の有効状態。
|
||||||
|
/// PluginSettings に直接マッピングされ、既存の改造適用パイプラインで反映されます。
|
||||||
|
/// </summary>
|
||||||
|
public bool PrincessAlwaysMaxHp
|
||||||
|
{
|
||||||
|
get => IsPluginEnabled("AlwaysMaxHp", fallbackVal: false);
|
||||||
|
set => SetPrincessPluginSetting("AlwaysMaxHp", value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プリンセスシナジー専用: MP常時MAX(プラグイン "AlwaysMaxMp")の有効状態。
|
||||||
|
/// </summary>
|
||||||
|
public bool PrincessAlwaysMaxMp
|
||||||
|
{
|
||||||
|
get => IsPluginEnabled("AlwaysMaxMp", fallbackVal: false);
|
||||||
|
set => SetPrincessPluginSetting("AlwaysMaxMp", value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プラグイン設定を更新し、関連プロパティの変更通知を発行します。
|
||||||
|
/// </summary>
|
||||||
|
private void SetPrincessPluginSetting(string pluginId, bool value)
|
||||||
|
{
|
||||||
|
if (_pluginSettings.TryGetValue(pluginId, out var cur) && cur == value)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_pluginSettings[pluginId] = value;
|
||||||
|
OnPropertyChanged(pluginId == "AlwaysMaxHp" ? nameof(PrincessAlwaysMaxHp) : nameof(PrincessAlwaysMaxMp));
|
||||||
|
// 連動して独自の改造設定であることを示す
|
||||||
|
HasCustomApplyMod = true;
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsPluginEnabled(string pluginId, Dictionary<string, bool>? defaultSettings = null, bool fallbackVal = true)
|
public bool IsPluginEnabled(string pluginId, Dictionary<string, bool>? defaultSettings = null, bool fallbackVal = true)
|
||||||
{
|
{
|
||||||
if (_pluginSettings.TryGetValue(pluginId, out var val))
|
if (_pluginSettings.TryGetValue(pluginId, out var val))
|
||||||
@@ -307,10 +560,57 @@ namespace GameLauncher.Models
|
|||||||
new() { Id = "TyranoCheatMenu", Name = "🎛 画面上変数(f)チートエディタ表示", Description = "画面右上にボタンを配置し、ゲーム内変数・フラグの閲覧と直接書き換えができるメニューを表示します。" }
|
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 = "メニュー画面や戦闘中のアクターコマンドのカーソル選択位置を記憶して次回遷移時に復元します。" }
|
||||||
|
];
|
||||||
|
|
||||||
|
/// <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)
|
public void SyncPluginOptions(IEnumerable<ModPluginDefinition> availablePlugins, Dictionary<string, bool>? defaultSettings = null)
|
||||||
{
|
{
|
||||||
_pluginOptions.Clear();
|
_pluginOptions.Clear();
|
||||||
var targetDefs = EngineType == TkoolEngineType.Tyrano ? DefaultTyranoPlugins : availablePlugins;
|
if (EngineType == TkoolEngineType.Wolf)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerable<ModPluginDefinition> targetDefs;
|
||||||
|
if (EngineType == TkoolEngineType.Tyrano)
|
||||||
|
{
|
||||||
|
targetDefs = DefaultTyranoPlugins;
|
||||||
|
}
|
||||||
|
else if (IsRgss)
|
||||||
|
{
|
||||||
|
targetDefs = DefaultRgssPlugins;
|
||||||
|
}
|
||||||
|
else if (IsSrpgStudio)
|
||||||
|
{
|
||||||
|
targetDefs = DefaultSrpgPlugins;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetDefs = availablePlugins;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var def in targetDefs)
|
foreach (var def in targetDefs)
|
||||||
{
|
{
|
||||||
@@ -342,6 +642,10 @@ namespace GameLauncher.Models
|
|||||||
TkoolEngineType.MV => "RPGツクールMV",
|
TkoolEngineType.MV => "RPGツクールMV",
|
||||||
TkoolEngineType.MZ => "RPGツクールMZ",
|
TkoolEngineType.MZ => "RPGツクールMZ",
|
||||||
TkoolEngineType.Tyrano => "ティラノスクリプト",
|
TkoolEngineType.Tyrano => "ティラノスクリプト",
|
||||||
|
TkoolEngineType.VX => "RPGツクールVX",
|
||||||
|
TkoolEngineType.VXAce => "RPGツクールVX Ace",
|
||||||
|
TkoolEngineType.Wolf => "WOLF RPGエディター",
|
||||||
|
TkoolEngineType.SrpgStudio => "SRPG Studio",
|
||||||
_ => "ツクール/ティラノ"
|
_ => "ツクール/ティラノ"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,17 +7,23 @@ namespace GameLauncher.Models
|
|||||||
{
|
{
|
||||||
Tkool,
|
Tkool,
|
||||||
Tyrano,
|
Tyrano,
|
||||||
Unity
|
Unity,
|
||||||
|
Wolf,
|
||||||
|
SrpgStudio
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ツクールのエンジンの種類
|
/// エンジンの種類
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum TkoolEngineType
|
public enum TkoolEngineType
|
||||||
{
|
{
|
||||||
MV,
|
MV,
|
||||||
MZ,
|
MZ,
|
||||||
Tyrano,
|
Tyrano,
|
||||||
|
VX,
|
||||||
|
VXAce,
|
||||||
|
Wolf,
|
||||||
|
SrpgStudio,
|
||||||
Unknown
|
Unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,329 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using GameLauncher.Helpers;
|
||||||
|
|
||||||
|
namespace GameLauncher.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// SRPG Studio の data.dts アーカイブ解凍・抽出および再構築(再パック)サービス
|
||||||
|
/// 外部ツール Tools/SRPG_Unpacker.exe を利用して安全に展開・再構築を行います。
|
||||||
|
/// バックアップはすべて Z:\自作ソフト\GameLauncher\Backups に保存されます。
|
||||||
|
/// </summary>
|
||||||
|
public class SrpgArchiveService
|
||||||
|
{
|
||||||
|
public const string ExtractedDirName = "data_extracted";
|
||||||
|
public const string ArchiveFileName = "data.dts";
|
||||||
|
public const string ToolExeName = "SRPG_Unpacker.exe";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SRPG_Unpacker.exe のフルパスを取得します。
|
||||||
|
/// </summary>
|
||||||
|
public static string? GetToolPath()
|
||||||
|
{
|
||||||
|
var exeDir = AppPathHelper.GetExeDirectory();
|
||||||
|
var path = Path.Combine(exeDir, "Tools", ToolExeName);
|
||||||
|
if (File.Exists(path)) return path;
|
||||||
|
|
||||||
|
// プロジェクトルート等フォールバック
|
||||||
|
var fallback = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Tools", ToolExeName);
|
||||||
|
if (File.Exists(fallback)) return fallback;
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// data.dts アーカイブが存在するか判定します。
|
||||||
|
/// </summary>
|
||||||
|
public static bool HasDataDts(string gameDir)
|
||||||
|
{
|
||||||
|
return File.Exists(Path.Combine(gameDir, ArchiveFileName));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 解凍済みフォルダ (data_extracted または Script & Plugin) が存在するか判定します。
|
||||||
|
/// </summary>
|
||||||
|
public static bool IsExtracted(string gameDir)
|
||||||
|
{
|
||||||
|
var extractedDir = Path.Combine(gameDir, ExtractedDirName);
|
||||||
|
if (Directory.Exists(extractedDir)) return true;
|
||||||
|
|
||||||
|
var scriptDir = Path.Combine(gameDir, "Script");
|
||||||
|
var pluginDir = Path.Combine(gameDir, "Plugin");
|
||||||
|
return Directory.Exists(scriptDir) && Directory.Exists(pluginDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 解凍先フォルダパスを取得します。
|
||||||
|
/// </summary>
|
||||||
|
public static string GetExtractedDirectory(string gameDir)
|
||||||
|
{
|
||||||
|
var extractedDir = Path.Combine(gameDir, ExtractedDirName);
|
||||||
|
if (Directory.Exists(extractedDir)) return extractedDir;
|
||||||
|
|
||||||
|
var scriptDir = Path.Combine(gameDir, "Script");
|
||||||
|
if (Directory.Exists(scriptDir)) return gameDir;
|
||||||
|
|
||||||
|
return extractedDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// data.dts を解凍・抽出します。
|
||||||
|
/// 実行前に data.dts を Backups フォルダにバックアップします。
|
||||||
|
/// </summary>
|
||||||
|
public async Task<(bool Success, string Message)> UnpackDataDtsAsync(string gameDir, IProgress<string>? progress = null)
|
||||||
|
{
|
||||||
|
return await Task.Run(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var dtsPath = Path.Combine(gameDir, ArchiveFileName);
|
||||||
|
if (!File.Exists(dtsPath))
|
||||||
|
{
|
||||||
|
return (false, "data.dts が見つかりません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
var tool = GetToolPath();
|
||||||
|
if (tool == null)
|
||||||
|
{
|
||||||
|
return (false, $"解凍ツール ({ToolExeName}) が Tools フォルダに見つかりません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
progress?.Report("data.dts のバックアップを作成中...");
|
||||||
|
var backupDir = AppPathHelper.GetBackupsDirectory();
|
||||||
|
var gameFolderName = Path.GetFileName(gameDir.TrimEnd('\\', '/'));
|
||||||
|
var timeStamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
|
||||||
|
var targetBackupDir = Path.Combine(backupDir, "SRPGStudio", $"{gameFolderName}_{timeStamp}");
|
||||||
|
Directory.CreateDirectory(targetBackupDir);
|
||||||
|
|
||||||
|
var backupFile = Path.Combine(targetBackupDir, ArchiveFileName);
|
||||||
|
File.Copy(dtsPath, backupFile, overwrite: true);
|
||||||
|
|
||||||
|
var outDir = Path.Combine(gameDir, ExtractedDirName);
|
||||||
|
if (!Directory.Exists(outDir))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(outDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
progress?.Report("SRPG_Unpacker でアーカイブを解凍中...");
|
||||||
|
var psi = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = tool,
|
||||||
|
Arguments = $"\"{dtsPath}\" -o \"{outDir}\"",
|
||||||
|
WorkingDirectory = gameDir,
|
||||||
|
CreateNoWindow = true,
|
||||||
|
UseShellExecute = false,
|
||||||
|
RedirectStandardOutput = true,
|
||||||
|
RedirectStandardError = true
|
||||||
|
};
|
||||||
|
|
||||||
|
using var proc = Process.Start(psi);
|
||||||
|
if (proc == null)
|
||||||
|
{
|
||||||
|
return (false, "解凍プロセスの起動に失敗しました。");
|
||||||
|
}
|
||||||
|
|
||||||
|
string stdout = proc.StandardOutput.ReadToEnd();
|
||||||
|
string stderr = proc.StandardError.ReadToEnd();
|
||||||
|
proc.WaitForExit();
|
||||||
|
|
||||||
|
if (proc.ExitCode == 0)
|
||||||
|
{
|
||||||
|
progress?.Report("解凍が正常に完了しました。");
|
||||||
|
return (true, $"data.dts を正常に {ExtractedDirName} フォルダへ展開しました。\n(バックアップ: {backupFile})");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (false, $"解凍処理でエラーが発生しました。(Code: {proc.ExitCode})\n{stderr}\n{stdout}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (false, $"解凍処理中に例外が発生しました: {ex.Message}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 解凍されたフォルダから data.dts を再構築(再パック)します。
|
||||||
|
/// </summary>
|
||||||
|
public async Task<(bool Success, string Message)> RepackDataDtsAsync(string gameDir, IProgress<string>? progress = null)
|
||||||
|
{
|
||||||
|
return await Task.Run(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var extractedDir = GetExtractedDirectory(gameDir);
|
||||||
|
if (!Directory.Exists(extractedDir))
|
||||||
|
{
|
||||||
|
return (false, "展開済みフォルダが見つかりません。先に解凍を行ってください。");
|
||||||
|
}
|
||||||
|
|
||||||
|
var tool = GetToolPath();
|
||||||
|
if (tool == null)
|
||||||
|
{
|
||||||
|
return (false, $"ツール ({ToolExeName}) が見つかりません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
var dtsPath = Path.Combine(gameDir, ArchiveFileName);
|
||||||
|
var tempOutputDts = Path.Combine(gameDir, "data_temp_repack.dts");
|
||||||
|
|
||||||
|
progress?.Report("アーカイブを再構築(再パック)中...");
|
||||||
|
var psi = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = tool,
|
||||||
|
Arguments = $"\"{extractedDir}\" -o \"{tempOutputDts}\"",
|
||||||
|
WorkingDirectory = gameDir,
|
||||||
|
CreateNoWindow = true,
|
||||||
|
UseShellExecute = false,
|
||||||
|
RedirectStandardOutput = true,
|
||||||
|
RedirectStandardError = true
|
||||||
|
};
|
||||||
|
|
||||||
|
using var proc = Process.Start(psi);
|
||||||
|
if (proc == null)
|
||||||
|
{
|
||||||
|
return (false, "再パックプロセスの起動に失敗しました。");
|
||||||
|
}
|
||||||
|
|
||||||
|
string stdout = proc.StandardOutput.ReadToEnd();
|
||||||
|
string stderr = proc.StandardError.ReadToEnd();
|
||||||
|
proc.WaitForExit();
|
||||||
|
|
||||||
|
if (proc.ExitCode == 0 && File.Exists(tempOutputDts))
|
||||||
|
{
|
||||||
|
// 既存の data.dts をバックアップした上で置き換え
|
||||||
|
if (File.Exists(dtsPath))
|
||||||
|
{
|
||||||
|
var backupDir = AppPathHelper.GetBackupsDirectory();
|
||||||
|
var gameFolderName = Path.GetFileName(gameDir.TrimEnd('\\', '/'));
|
||||||
|
var timeStamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
|
||||||
|
var targetBackupDir = Path.Combine(backupDir, "SRPGStudio", $"{gameFolderName}_{timeStamp}_repack_prev");
|
||||||
|
Directory.CreateDirectory(targetBackupDir);
|
||||||
|
File.Copy(dtsPath, Path.Combine(targetBackupDir, ArchiveFileName), overwrite: true);
|
||||||
|
|
||||||
|
File.Delete(dtsPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
File.Move(tempOutputDts, dtsPath);
|
||||||
|
progress?.Report("再パック完了。data.dts を更新しました。");
|
||||||
|
return (true, "data.dts の再構築(再パック)が正常に完了しました。");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (File.Exists(tempOutputDts)) File.Delete(tempOutputDts);
|
||||||
|
return (false, $"再パック処理でエラーが発生しました。(Code: {proc.ExitCode})\n{stderr}\n{stdout}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (false, $"再パック処理中に例外が発生しました: {ex.Message}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最新のバックアップから data.dts を復元します。
|
||||||
|
/// </summary>
|
||||||
|
public async Task<(bool Success, string Message)> RevertBackupAsync(string gameDir)
|
||||||
|
{
|
||||||
|
return await Task.Run(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var backupDir = AppPathHelper.GetBackupsDirectory();
|
||||||
|
var gameFolderName = Path.GetFileName(gameDir.TrimEnd('\\', '/'));
|
||||||
|
var targetBase = Path.Combine(backupDir, "SRPGStudio");
|
||||||
|
if (!Directory.Exists(targetBase))
|
||||||
|
{
|
||||||
|
return (false, "バックアップフォルダが見つかりません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// gameFolderName で始まるフォルダのうち最も新しいものを検索
|
||||||
|
var dirs = Directory.GetDirectories(targetBase, $"{gameFolderName}_*")
|
||||||
|
.OrderByDescending(d => d)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (dirs.Count == 0)
|
||||||
|
{
|
||||||
|
return (false, "該当するバックアップが見つかりません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var d in dirs)
|
||||||
|
{
|
||||||
|
var bakFile = Path.Combine(d, ArchiveFileName);
|
||||||
|
if (File.Exists(bakFile))
|
||||||
|
{
|
||||||
|
var dstFile = Path.Combine(gameDir, ArchiveFileName);
|
||||||
|
File.Copy(bakFile, dstFile, overwrite: true);
|
||||||
|
return (true, $"バックアップ ({Path.GetFileName(d)}) から data.dts を正常に復元しました。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (false, "バックアップファイルが見つかりませんでした。");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (false, $"復元処理中に例外が発生しました: {ex.Message}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 解凍されたフォルダ (data_extracted) を Backups フォルダへ安全に退避し、
|
||||||
|
/// ゲームディレクトリ内を元の data.dts のみの状態に復元します。
|
||||||
|
/// </summary>
|
||||||
|
public (bool Success, string Message) RestoreExtractedState(string gameDir)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var extractedDir = Path.Combine(gameDir, ExtractedDirName);
|
||||||
|
if (!Directory.Exists(extractedDir))
|
||||||
|
{
|
||||||
|
return (true, "解凍フォルダは存在しません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
var backupDir = AppPathHelper.GetBackupsDirectory();
|
||||||
|
var gameFolderName = Path.GetFileName(gameDir.TrimEnd('\\', '/'));
|
||||||
|
var timeStamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
|
||||||
|
var targetBackupDir = Path.Combine(backupDir, "SRPGStudio", $"{gameFolderName}_{timeStamp}_extracted_evacuated");
|
||||||
|
|
||||||
|
Directory.CreateDirectory(targetBackupDir);
|
||||||
|
var dst = Path.Combine(targetBackupDir, ExtractedDirName);
|
||||||
|
|
||||||
|
// ディレクトリ移動(別ドライブ考慮でフォールバック)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Directory.Move(extractedDir, dst);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// コピー後に削除
|
||||||
|
CopyDirectory(extractedDir, dst);
|
||||||
|
Directory.Delete(extractedDir, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (true, $"解凍フォルダ ({ExtractedDirName}) を Backups フォルダへ退避しました。");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (false, $"解凍フォルダ退避中にエラーが発生しました: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CopyDirectory(string sourceDir, string targetDir)
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(targetDir);
|
||||||
|
foreach (var file in Directory.GetFiles(sourceDir))
|
||||||
|
{
|
||||||
|
File.Copy(file, Path.Combine(targetDir, Path.GetFileName(file)), true);
|
||||||
|
}
|
||||||
|
foreach (var subDir in Directory.GetDirectories(sourceDir))
|
||||||
|
{
|
||||||
|
CopyDirectory(subDir, Path.Combine(targetDir, Path.GetFileName(subDir)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,757 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using GameLauncher.Helpers;
|
||||||
|
using GameLauncher.Models;
|
||||||
|
|
||||||
|
namespace GameLauncher.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// SRPG Studio ゲームの機能拡張(プロキシDLL・倍速機能、Modスクリプト注入・再構築)サービス
|
||||||
|
/// </summary>
|
||||||
|
public class SrpgModService
|
||||||
|
{
|
||||||
|
public const string ProxyDllName = "version.dll";
|
||||||
|
public const string ConfigFileName = "speedhack_config.json";
|
||||||
|
public const string ModScriptFileName = "99_AntigravityMod.js";
|
||||||
|
|
||||||
|
private readonly SrpgArchiveService _archiveService = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プロキシDLL(version.dll)および設定ファイルをゲームディレクトリに配置し、倍速機能を有効化します。
|
||||||
|
/// </summary>
|
||||||
|
public bool EnableProxyDll(string gameDir, double speedMultiplier = 3.0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var srcDll = Path.Combine(AppPathHelper.GetExeDirectory(), "Tools", "speedhack-i686", ProxyDllName);
|
||||||
|
if (!File.Exists(srcDll))
|
||||||
|
{
|
||||||
|
srcDll = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Tools", "speedhack-i686", ProxyDllName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!File.Exists(srcDll))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dstDll = Path.Combine(gameDir, ProxyDllName);
|
||||||
|
File.Copy(srcDll, dstDll, overwrite: true);
|
||||||
|
|
||||||
|
var config = new
|
||||||
|
{
|
||||||
|
speed = Math.Max(1.0, speedMultiplier),
|
||||||
|
toggle_key = "F6",
|
||||||
|
fast_key = "Control",
|
||||||
|
fast_multiplier = 5.0
|
||||||
|
};
|
||||||
|
var json = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
||||||
|
File.WriteAllText(Path.Combine(gameDir, ConfigFileName), json, Encoding.UTF8);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プロキシDLLおよび設定ファイルを削除し、通常動作に戻します。
|
||||||
|
/// </summary>
|
||||||
|
public bool DisableProxyDll(string gameDir)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var dstDll = Path.Combine(gameDir, ProxyDllName);
|
||||||
|
if (File.Exists(dstDll))
|
||||||
|
{
|
||||||
|
File.Delete(dstDll);
|
||||||
|
}
|
||||||
|
|
||||||
|
var configFile = Path.Combine(gameDir, ConfigFileName);
|
||||||
|
if (File.Exists(configFile))
|
||||||
|
{
|
||||||
|
File.Delete(configFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プロキシDLLが適用されているか確認します。
|
||||||
|
/// </summary>
|
||||||
|
public static bool IsProxyDllEnabled(string gameDir)
|
||||||
|
{
|
||||||
|
return File.Exists(Path.Combine(gameDir, ProxyDllName));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プラグイン改造が適用されているか確認します。
|
||||||
|
/// </summary>
|
||||||
|
public static bool IsModScriptApplied(string gameDir)
|
||||||
|
{
|
||||||
|
var extractedDir = SrpgArchiveService.GetExtractedDirectory(gameDir);
|
||||||
|
var modJs = Path.Combine(extractedDir, "Plugin", ModScriptFileName);
|
||||||
|
return File.Exists(modJs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 選択されたModオプションから JavaScript スクリプトコードを生成します。
|
||||||
|
/// </summary>
|
||||||
|
public string GenerateModScript(TkoolGameItem item)
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
sb.AppendLine("/* ========================================================================= */");
|
||||||
|
sb.AppendLine("/* Antigravity GameLauncher - SRPG Studio 統合拡張プラグイン */");
|
||||||
|
sb.AppendLine("/* ========================================================================= */");
|
||||||
|
sb.AppendLine("(function() {");
|
||||||
|
sb.AppendLine(" 'use strict';");
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
// 1. 武器・アイテム耐久度無限
|
||||||
|
if (item.IsPluginEnabled("SrpgInfDurability"))
|
||||||
|
{
|
||||||
|
sb.AppendLine(" // [チート] 武器・アイテム耐久度無限");
|
||||||
|
sb.AppendLine(" if (typeof ItemControl !== 'undefined') {");
|
||||||
|
sb.AppendLine(" if (ItemControl.decreaseLimit) {");
|
||||||
|
sb.AppendLine(" var _orig_decreaseLimit = ItemControl.decreaseLimit;");
|
||||||
|
sb.AppendLine(" ItemControl.decreaseLimit = function(unit, item) {");
|
||||||
|
sb.AppendLine(" if (unit && unit.getUnitType && unit.getUnitType() === UnitType.PLAYER) {");
|
||||||
|
sb.AppendLine(" return; // 味方ユニットの耐久度は消費しない");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" return _orig_decreaseLimit.call(this, unit, item);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (ItemControl.isItemBroken) {");
|
||||||
|
sb.AppendLine(" ItemControl.isItemBroken = function(item) {");
|
||||||
|
sb.AppendLine(" return false; // 武器破損を防止");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (typeof DataConfig !== 'undefined' && DataConfig.isWeaponInfinity) {");
|
||||||
|
sb.AppendLine(" DataConfig.isWeaponInfinity = function() { return true; };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 獲得経験値最大化(即レベルアップ / 100Exp固定)
|
||||||
|
if (item.IsPluginEnabled("SrpgExpBoost"))
|
||||||
|
{
|
||||||
|
sb.AppendLine(" // [チート] 獲得経験値最大化 (戦闘・アイテム使用時即レベルアップ)");
|
||||||
|
sb.AppendLine(" if (typeof ExperienceCalculator !== 'undefined') {");
|
||||||
|
sb.AppendLine(" if (ExperienceCalculator.calculateExperience) {");
|
||||||
|
sb.AppendLine(" ExperienceCalculator.calculateExperience = function(data) {");
|
||||||
|
sb.AppendLine(" return 100;");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (ExperienceCalculator.getBestExperience) {");
|
||||||
|
sb.AppendLine(" ExperienceCalculator.getBestExperience = function(unit, exp) {");
|
||||||
|
sb.AppendLine(" return 100;");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 共通ユーティリティ: 味方ユニット判定関数
|
||||||
|
sb.AppendLine(" // [共通] 味方ユニット判定 (敵以外はすべて味方・自軍として扱う)");
|
||||||
|
sb.AppendLine(" function __antigravity_isPlayerSide(unit) {");
|
||||||
|
sb.AppendLine(" if (!unit) return false;");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" var ut = (typeof unit.getUnitType === 'function') ? unit.getUnitType() : -1;");
|
||||||
|
sb.AppendLine(" // 敵 (1 = UnitType.ENEMY) 以外は味方/自軍とみなす");
|
||||||
|
sb.AppendLine(" if (ut === 1) return false;");
|
||||||
|
sb.AppendLine(" return true;");
|
||||||
|
sb.AppendLine(" } catch (e) { return true; }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" // [共通] 移動力ブースト対象判定 (敵以外 = 自軍・同盟軍。敵は除外)");
|
||||||
|
sb.AppendLine(" function __antigravity_isMovTarget(unit) {");
|
||||||
|
sb.AppendLine(" if (!unit) return false;");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" return (typeof unit.getUnitType === 'function') && unit.getUnitType() !== 1;");
|
||||||
|
sb.AppendLine(" } catch (e) { return false; }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
// 3. 所持金最大化 & ターン開始時全回復
|
||||||
|
bool hasMaxGold = item.IsPluginEnabled("SrpgMaxGold");
|
||||||
|
bool hasRecoverHp = item.IsPluginEnabled("SrpgTurnRecoverHp");
|
||||||
|
|
||||||
|
if (hasMaxGold || hasRecoverHp)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" // [チート] 味方全回復関数 & 所持金最大化関数");
|
||||||
|
if (hasRecoverHp)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" function __antigravity_healAllUnits() {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" var processedUnits = [];");
|
||||||
|
sb.AppendLine(" var unitList = [];");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" // 1. 各種リストから自軍ユニットを収集");
|
||||||
|
sb.AppendLine(" if (typeof PlayerList !== 'undefined') {");
|
||||||
|
sb.AppendLine(" if (typeof PlayerList.getSortieList === 'function') {");
|
||||||
|
sb.AppendLine(" var sList = PlayerList.getSortieList();");
|
||||||
|
sb.AppendLine(" if (sList && sList.getCount) { for (var i = 0; i < sList.getCount(); i++) unitList.push(sList.getData(i)); }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (typeof PlayerList.getAliveList === 'function') {");
|
||||||
|
sb.AppendLine(" var aList = PlayerList.getAliveList();");
|
||||||
|
sb.AppendLine(" if (aList && aList.getCount) { for (var i = 0; i < aList.getCount(); i++) unitList.push(aList.getData(i)); }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (typeof TurnControl !== 'undefined' && typeof TurnControl.getActorList === 'function') {");
|
||||||
|
sb.AppendLine(" var tList = TurnControl.getActorList();");
|
||||||
|
sb.AppendLine(" if (tList && tList.getCount) { for (var i = 0; i < tList.getCount(); i++) unitList.push(tList.getData(i)); }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" // 2. マップ上の全座標を走査 (ゲスト・NPC・未登録ユニットも100%捕捉)");
|
||||||
|
sb.AppendLine(" if (typeof CurrentMap !== 'undefined' && typeof PosChecker !== 'undefined') {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" var mapW = CurrentMap.getWidth();");
|
||||||
|
sb.AppendLine(" var mapH = CurrentMap.getHeight();");
|
||||||
|
sb.AppendLine(" for (var mx = 0; mx < mapW; mx++) {");
|
||||||
|
sb.AppendLine(" for (var my = 0; my < mapH; my++) {");
|
||||||
|
sb.AppendLine(" var mu = PosChecker.getUnitFromPos(mx, my);");
|
||||||
|
sb.AppendLine(" if (mu) unitList.push(mu);");
|
||||||
|
sb.AppendLine(" } ");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" } catch (eScan) {}");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" // 3. 敵以外の全ユニットのHPを最大化");
|
||||||
|
sb.AppendLine(" for (var j = 0; j < unitList.length; j++) {");
|
||||||
|
sb.AppendLine(" var u = unitList[j];");
|
||||||
|
sb.AppendLine(" if (!u || typeof u.setHp !== 'function' || typeof u.getId !== 'function') continue;");
|
||||||
|
sb.AppendLine(" var uid = u.getId();");
|
||||||
|
sb.AppendLine(" if (processedUnits.indexOf(uid) !== -1) continue;");
|
||||||
|
sb.AppendLine(" processedUnits.push(uid);");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" if (!__antigravity_isPlayerSide(u)) continue;");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" var maxHp = 0;");
|
||||||
|
sb.AppendLine(" if (typeof ParamBonus !== 'undefined' && typeof ParamBonus.getMhp === 'function') {");
|
||||||
|
sb.AppendLine(" maxHp = ParamBonus.getMhp(u);");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (maxHp <= 0 && typeof RealBonus !== 'undefined' && typeof RealBonus.getMhp === 'function') {");
|
||||||
|
sb.AppendLine(" maxHp = RealBonus.getMhp(u);");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (maxHp <= 0) maxHp = 99;");
|
||||||
|
sb.AppendLine(" u.setHp(maxHp);");
|
||||||
|
sb.AppendLine(" } catch (e2) {}");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasMaxGold)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" function __antigravity_maxGold() {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" if (typeof root !== 'undefined' && root.getMetaSession) {");
|
||||||
|
sb.AppendLine(" var meta = root.getMetaSession();");
|
||||||
|
sb.AppendLine(" if (meta && meta.setGold) { meta.setGold(999999); }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasRecoverHp)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" // ターン開始時自動回復フローへの介入 (公式のターン開始回復で確実に最大HP全快)");
|
||||||
|
sb.AppendLine(" if (typeof RecoveryAllFlowEntry !== 'undefined') {");
|
||||||
|
sb.AppendLine(" if (RecoveryAllFlowEntry._getRecoveryValue) {");
|
||||||
|
sb.AppendLine(" var _orig_RecoveryAllFlowEntry_getRecoveryValue = RecoveryAllFlowEntry._getRecoveryValue;");
|
||||||
|
sb.AppendLine(" RecoveryAllFlowEntry._getRecoveryValue = function(unit) {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" if (__antigravity_isPlayerSide(unit)) {");
|
||||||
|
sb.AppendLine(" var mhp = (typeof ParamBonus !== 'undefined' && ParamBonus.getMhp) ? ParamBonus.getMhp(unit) : 99;");
|
||||||
|
sb.AppendLine(" return Math.max(mhp, 999);");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_RecoveryAllFlowEntry_getRecoveryValue.call(this, unit);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (RecoveryAllFlowEntry._completeMemberData) {");
|
||||||
|
sb.AppendLine(" var _orig_RecoveryAllFlowEntry_completeMemberData = RecoveryAllFlowEntry._completeMemberData;");
|
||||||
|
sb.AppendLine(" RecoveryAllFlowEntry._completeMemberData = function(turnChange) {");
|
||||||
|
sb.AppendLine(" try { __antigravity_healAllUnits(); } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_RecoveryAllFlowEntry_completeMemberData.call(this, turnChange);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.AppendLine(" // A. プレイヤーターン開始時に実行 (PlayerTurn.openTurnCycle)");
|
||||||
|
sb.AppendLine(" if (typeof PlayerTurn !== 'undefined' && PlayerTurn.openTurnCycle) {");
|
||||||
|
sb.AppendLine(" var _orig_PlayerTurn_openTurnCycle = PlayerTurn.openTurnCycle;");
|
||||||
|
sb.AppendLine(" PlayerTurn.openTurnCycle = function() {");
|
||||||
|
sb.AppendLine(" var result = _orig_PlayerTurn_openTurnCycle.call(this);");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
if (hasRecoverHp) sb.AppendLine(" __antigravity_healAllUnits();");
|
||||||
|
if (hasMaxGold) sb.AppendLine(" __antigravity_maxGold();");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return result;");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" // A2. プレイヤー行動中サイクル (PlayerTurn.moveTurnCycle - セーブロード直後にも即座に反映)");
|
||||||
|
sb.AppendLine(" if (typeof PlayerTurn !== 'undefined' && PlayerTurn.moveTurnCycle) {");
|
||||||
|
sb.AppendLine(" var _orig_PlayerTurn_moveTurnCycle = PlayerTurn.moveTurnCycle;");
|
||||||
|
sb.AppendLine(" PlayerTurn.moveTurnCycle = function() {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
if (hasRecoverHp) sb.AppendLine(" __antigravity_healAllUnits();");
|
||||||
|
if (hasMaxGold) sb.AppendLine(" __antigravity_maxGold();");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_PlayerTurn_moveTurnCycle.call(this);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" // B. ターン切替処理時 (TurnChangeEnd.doLastAction & TurnChangeStart.doLastAction)");
|
||||||
|
sb.AppendLine(" if (typeof TurnChangeEnd !== 'undefined' && TurnChangeEnd.doLastAction) {");
|
||||||
|
sb.AppendLine(" var _orig_TurnChangeEnd_doLastAction = TurnChangeEnd.doLastAction;");
|
||||||
|
sb.AppendLine(" TurnChangeEnd.doLastAction = function() {");
|
||||||
|
sb.AppendLine(" _orig_TurnChangeEnd_doLastAction.call(this);");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
if (hasRecoverHp) sb.AppendLine(" __antigravity_healAllUnits();");
|
||||||
|
if (hasMaxGold) sb.AppendLine(" __antigravity_maxGold();");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (typeof TurnChangeStart !== 'undefined' && TurnChangeStart.doLastAction) {");
|
||||||
|
sb.AppendLine(" var _orig_TurnChangeStart_doLastAction = TurnChangeStart.doLastAction;");
|
||||||
|
sb.AppendLine(" TurnChangeStart.doLastAction = function() {");
|
||||||
|
sb.AppendLine(" _orig_TurnChangeStart_doLastAction.call(this);");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
if (hasRecoverHp) sb.AppendLine(" __antigravity_healAllUnits();");
|
||||||
|
if (hasMaxGold) sb.AppendLine(" __antigravity_maxGold();");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" // B2. ターンロゴ表示時 (BaseTurnLogoFlowEntry.doMainAction)");
|
||||||
|
sb.AppendLine(" if (typeof BaseTurnLogoFlowEntry !== 'undefined' && BaseTurnLogoFlowEntry.doMainAction) {");
|
||||||
|
sb.AppendLine(" var _orig_BaseTurnLogoFlowEntry_doMainAction = BaseTurnLogoFlowEntry.doMainAction;");
|
||||||
|
sb.AppendLine(" BaseTurnLogoFlowEntry.doMainAction = function(isMusic) {");
|
||||||
|
sb.AppendLine(" var res = _orig_BaseTurnLogoFlowEntry_doMainAction.call(this, isMusic);");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
if (hasRecoverHp) sb.AppendLine(" __antigravity_healAllUnits();");
|
||||||
|
if (hasMaxGold) sb.AppendLine(" __antigravity_maxGold();");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return res;");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" // C. マップ開始時 (CurrentMap.prepareMap)");
|
||||||
|
sb.AppendLine(" if (typeof CurrentMap !== 'undefined' && CurrentMap.prepareMap) {");
|
||||||
|
sb.AppendLine(" var _orig_CurrentMap_prepareMap = CurrentMap.prepareMap;");
|
||||||
|
sb.AppendLine(" CurrentMap.prepareMap = function() {");
|
||||||
|
sb.AppendLine(" _orig_CurrentMap_prepareMap.call(this);");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
if (hasRecoverHp) sb.AppendLine(" __antigravity_healAllUnits();");
|
||||||
|
if (hasMaxGold) sb.AppendLine(" __antigravity_maxGold();");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(" // D. ユニット移動選択画面開始時 (MapSequenceArea.openSequence)");
|
||||||
|
sb.AppendLine(" if (typeof MapSequenceArea !== 'undefined' && MapSequenceArea.openSequence) {");
|
||||||
|
sb.AppendLine(" var _orig_MapSequenceArea_openSequence = MapSequenceArea.openSequence;");
|
||||||
|
sb.AppendLine(" MapSequenceArea.openSequence = function(parentTurnObject) {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
if (hasRecoverHp) sb.AppendLine(" __antigravity_healAllUnits();");
|
||||||
|
if (hasMaxGold) sb.AppendLine(" __antigravity_maxGold();");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_MapSequenceArea_openSequence.call(this, parentTurnObject);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 味方移動力最大化 (マップ全域移動可能: 99固定)
|
||||||
|
if (item.IsPluginEnabled("SrpgMoveBoost"))
|
||||||
|
{
|
||||||
|
sb.AppendLine(" // [チート] 自軍ユニットの移動可能範囲最大化 (移動力99)");
|
||||||
|
sb.AppendLine(" if (typeof ParamBonus !== 'undefined' && ParamBonus.getMov) {");
|
||||||
|
sb.AppendLine(" var _orig_ParamBonus_getMov = ParamBonus.getMov;");
|
||||||
|
sb.AppendLine(" ParamBonus.getMov = function(unit) {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" if (__antigravity_isMovTarget(unit)) return 99;");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_ParamBonus_getMov.call(this, unit);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (typeof RealBonus !== 'undefined' && RealBonus.getMov) {");
|
||||||
|
sb.AppendLine(" var _orig_RealBonus_getMov = RealBonus.getMov;");
|
||||||
|
sb.AppendLine(" RealBonus.getMov = function(unit) {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" if (__antigravity_isMovTarget(unit)) return 99;");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_RealBonus_getMov.call(this, unit);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (typeof UnitParameter !== 'undefined' && UnitParameter.MOV && UnitParameter.MOV.getUnitValue) {");
|
||||||
|
sb.AppendLine(" var _orig_UnitParameter_MOV_getUnitValue = UnitParameter.MOV.getUnitValue;");
|
||||||
|
sb.AppendLine(" UnitParameter.MOV.getUnitValue = function(unit) {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" if (__antigravity_isMovTarget(unit)) return 99;");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_UnitParameter_MOV_getUnitValue.call(this, unit);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (typeof UnitRangePanel !== 'undefined') {");
|
||||||
|
sb.AppendLine(" if (UnitRangePanel._getRangeMov) {");
|
||||||
|
sb.AppendLine(" var _orig_UnitRangePanel_getRangeMov = UnitRangePanel._getRangeMov;");
|
||||||
|
sb.AppendLine(" UnitRangePanel._getRangeMov = function(unit) {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" if (__antigravity_isMovTarget(unit)) return 99;");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_UnitRangePanel_getRangeMov.call(this, unit);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (UnitRangePanel.getUnitAttackRange) {");
|
||||||
|
sb.AppendLine(" var _orig_UnitRangePanel_getUnitAttackRange = UnitRangePanel.getUnitAttackRange;");
|
||||||
|
sb.AppendLine(" UnitRangePanel.getUnitAttackRange = function(unit) {");
|
||||||
|
sb.AppendLine(" var obj = _orig_UnitRangePanel_getUnitAttackRange.call(this, unit);");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" if (obj && __antigravity_isMovTarget(unit)) {");
|
||||||
|
sb.AppendLine(" obj.mov = 99;");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return obj;");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (UnitRangePanel._setRangeData) {");
|
||||||
|
sb.AppendLine(" var _orig_UnitRangePanel_setRangeData = UnitRangePanel._setRangeData;");
|
||||||
|
sb.AppendLine(" UnitRangePanel._setRangeData = function() {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" if (this._unit && __antigravity_isMovTarget(this._unit)) {");
|
||||||
|
sb.AppendLine(" var attackRange = this.getUnitAttackRange(this._unit);");
|
||||||
|
sb.AppendLine(" var isWeapon = attackRange.endRange !== 0;");
|
||||||
|
sb.AppendLine(" if (isWeapon) {");
|
||||||
|
sb.AppendLine(" this._simulator.startSimulationWeapon(this._unit, 99, attackRange.startRange, attackRange.endRange);");
|
||||||
|
sb.AppendLine(" } else {");
|
||||||
|
sb.AppendLine(" this._simulator.startSimulation(this._unit, 99);");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" this._setLight(isWeapon);");
|
||||||
|
sb.AppendLine(" return;");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_UnitRangePanel_setRangeData.call(this);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (UnitRangePanel._setRepeatRangeData) {");
|
||||||
|
sb.AppendLine(" var _orig_UnitRangePanel_setRepeatRangeData = UnitRangePanel._setRepeatRangeData;");
|
||||||
|
sb.AppendLine(" UnitRangePanel._setRepeatRangeData = function() {");
|
||||||
|
sb.AppendLine(" try {");
|
||||||
|
sb.AppendLine(" if (this._unit && __antigravity_isMovTarget(this._unit)) {");
|
||||||
|
sb.AppendLine(" var attackRange = this.getUnitAttackRange(this._unit);");
|
||||||
|
sb.AppendLine(" var isWeapon = attackRange.endRange !== 0;");
|
||||||
|
sb.AppendLine(" if (isWeapon) {");
|
||||||
|
sb.AppendLine(" this._simulator.startSimulationWeapon(this._unit, 99, attackRange.startRange, attackRange.endRange);");
|
||||||
|
sb.AppendLine(" } else {");
|
||||||
|
sb.AppendLine(" this._simulator.startSimulation(this._unit, 99);");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" this._setLight(isWeapon);");
|
||||||
|
sb.AppendLine(" return;");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" } catch (e) {}");
|
||||||
|
sb.AppendLine(" return _orig_UnitRangePanel_setRepeatRangeData.call(this);");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 敵撃破時アイテム100%ドロップ
|
||||||
|
if (item.IsPluginEnabled("SrpgItemAllDrop"))
|
||||||
|
{
|
||||||
|
sb.AppendLine(" // [チート] 敵撃破時アイテム100%ドロップ");
|
||||||
|
sb.AppendLine(" if (typeof ItemDropControl !== 'undefined' && ItemDropControl.isDropAllowed) {");
|
||||||
|
sb.AppendLine(" ItemDropControl.isDropAllowed = function(unit) {");
|
||||||
|
sb.AppendLine(" return true;");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine(" if (typeof DropTrophyControl !== 'undefined' && DropTrophyControl.isDropAllowed) {");
|
||||||
|
sb.AppendLine(" DropTrophyControl.isDropAllowed = function(unit) {");
|
||||||
|
sb.AppendLine(" return true;");
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
sb.AppendLine(" }");
|
||||||
|
sb.AppendLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.AppendLine("})();");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public const string ModStartTag = "// >>> ANTIGRAVITY_MOD_START >>>";
|
||||||
|
public const string ModEndTag = "// <<< ANTIGRAVITY_MOD_END <<<";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 既存スクリプトファイルへModコードを注入(または更新)します。
|
||||||
|
/// </summary>
|
||||||
|
private static void InjectModToExistingScript(string scriptPath, string modCode)
|
||||||
|
{
|
||||||
|
if (!File.Exists(scriptPath)) return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string content = File.ReadAllText(scriptPath, Encoding.UTF8);
|
||||||
|
int startIdx = content.IndexOf(ModStartTag, StringComparison.Ordinal);
|
||||||
|
if (startIdx >= 0)
|
||||||
|
{
|
||||||
|
int endIdx = content.IndexOf(ModEndTag, StringComparison.Ordinal);
|
||||||
|
if (endIdx > startIdx)
|
||||||
|
{
|
||||||
|
content = content.Substring(0, startIdx).TrimEnd() + "\n\n" + modCode + "\n";
|
||||||
|
File.WriteAllText(scriptPath, content, Encoding.UTF8);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
content = content.TrimEnd() + "\n\n" + modCode + "\n";
|
||||||
|
File.WriteAllText(scriptPath, content, Encoding.UTF8);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 既存スクリプトファイルから注入されたModコードを削除します。
|
||||||
|
/// </summary>
|
||||||
|
private static void RemoveModFromExistingScript(string scriptPath)
|
||||||
|
{
|
||||||
|
if (!File.Exists(scriptPath)) return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string content = File.ReadAllText(scriptPath, Encoding.UTF8);
|
||||||
|
int startIdx = content.IndexOf(ModStartTag, StringComparison.Ordinal);
|
||||||
|
if (startIdx >= 0)
|
||||||
|
{
|
||||||
|
int endIdx = content.IndexOf(ModEndTag, StringComparison.Ordinal);
|
||||||
|
if (endIdx > startIdx)
|
||||||
|
{
|
||||||
|
endIdx += ModEndTag.Length;
|
||||||
|
content = content.Remove(startIdx, endIdx - startIdx).TrimEnd() + "\n";
|
||||||
|
File.WriteAllText(scriptPath, content, Encoding.UTF8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Modスクリプトを展開フォルダ内の既存スクリプト群に注入し、data.dts を再構築します。
|
||||||
|
/// (SRPG_Unpackerの仕様上、新規ファイル名は無視されるため、既存ファイルへの確実な注入を行います)
|
||||||
|
/// </summary>
|
||||||
|
public async Task<(bool Success, string Message)> ApplyModAndRepackAsync(TkoolGameItem item, IProgress<string>? progress = null)
|
||||||
|
{
|
||||||
|
var gameDir = item.RootDirectory;
|
||||||
|
|
||||||
|
// 1. まだ解凍されていない場合は解凍を実行
|
||||||
|
if (!SrpgArchiveService.IsExtracted(gameDir))
|
||||||
|
{
|
||||||
|
progress?.Report("アーカイブ(data.dts)を初回展開中...");
|
||||||
|
var unpackRes = await _archiveService.UnpackDataDtsAsync(gameDir, progress);
|
||||||
|
if (!unpackRes.Success)
|
||||||
|
{
|
||||||
|
return unpackRes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var extractedDir = SrpgArchiveService.GetExtractedDirectory(gameDir);
|
||||||
|
progress?.Report("Modスクリプトを生成中...");
|
||||||
|
var modBody = GenerateModScript(item);
|
||||||
|
var jsContent = $"{ModStartTag}\n{modBody}\n{ModEndTag}";
|
||||||
|
|
||||||
|
// 2. 既存のスクリプトへ注入
|
||||||
|
// (Pluginフォルダ内の既存スクリプトは全標準スクリプト読み込み完了後に実行されるため最優先で注入)
|
||||||
|
var mainScript = Path.Combine(extractedDir, "Script", "map", "map-playerturn.js");
|
||||||
|
var turnChangeScript = Path.Combine(extractedDir, "Script", "map", "map-turnchange.js");
|
||||||
|
var pluginDir = Path.Combine(extractedDir, "Plugin");
|
||||||
|
|
||||||
|
progress?.Report("スクリプトへModコードを注入中...");
|
||||||
|
InjectModToExistingScript(mainScript, jsContent);
|
||||||
|
InjectModToExistingScript(turnChangeScript, jsContent);
|
||||||
|
|
||||||
|
if (Directory.Exists(pluginDir))
|
||||||
|
{
|
||||||
|
var existingPlugin = Directory.GetFiles(pluginDir, "*.js")
|
||||||
|
.FirstOrDefault(f => !Path.GetFileName(f).StartsWith("99_AntigravityMod", StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (existingPlugin != null)
|
||||||
|
{
|
||||||
|
InjectModToExistingScript(existingPlugin, jsContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var directPluginDir = Path.Combine(gameDir, "Plugin");
|
||||||
|
if (!Directory.Exists(directPluginDir)) Directory.CreateDirectory(directPluginDir);
|
||||||
|
File.WriteAllText(Path.Combine(directPluginDir, ModScriptFileName), jsContent, Encoding.UTF8);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
// 3. data.dts を再パック
|
||||||
|
progress?.Report("Modを適用した data.dts を再構築中...");
|
||||||
|
var repackRes = await _archiveService.RepackDataDtsAsync(gameDir, progress);
|
||||||
|
if (repackRes.Success)
|
||||||
|
{
|
||||||
|
item.IsModded = true;
|
||||||
|
item.IsSrpgExtracted = true;
|
||||||
|
return (true, "SRPG Studio 改造プラグインの注入とアーカイブ再構築が完了しました!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return repackRes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Modスクリプトの注入を解除し、data.dts を再構築(またはバックアップから復元)します。
|
||||||
|
/// </summary>
|
||||||
|
public async Task<(bool Success, string Message)> RemoveModAndRepackAsync(TkoolGameItem item, IProgress<string>? progress = null)
|
||||||
|
{
|
||||||
|
var gameDir = item.RootDirectory;
|
||||||
|
var extractedDir = SrpgArchiveService.GetExtractedDirectory(gameDir);
|
||||||
|
|
||||||
|
// 1. 注入したスクリプトからModコードを削除
|
||||||
|
var targets = new List<string>
|
||||||
|
{
|
||||||
|
Path.Combine(extractedDir, "Script", "map", "map-playerturn.js"),
|
||||||
|
Path.Combine(extractedDir, "Script", "map", "map-turnchange.js"),
|
||||||
|
Path.Combine(extractedDir, "Script", "singleton", "singleton-system.js")
|
||||||
|
};
|
||||||
|
var pluginDir = Path.Combine(extractedDir, "Plugin");
|
||||||
|
if (Directory.Exists(pluginDir))
|
||||||
|
{
|
||||||
|
foreach (var f in Directory.GetFiles(pluginDir, "*.js"))
|
||||||
|
{
|
||||||
|
targets.Add(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var target in targets)
|
||||||
|
{
|
||||||
|
RemoveModFromExistingScript(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
var modJsPath = Path.Combine(pluginDir, ModScriptFileName);
|
||||||
|
if (File.Exists(modJsPath)) File.Delete(modJsPath);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var directModJs = Path.Combine(gameDir, "Plugin", ModScriptFileName);
|
||||||
|
if (File.Exists(directModJs)) File.Delete(directModJs);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
// 2. バックアップが存在すればバックアップ復元を試行
|
||||||
|
progress?.Report("オリジナルバックアップから data.dts を復元中...");
|
||||||
|
var revertRes = await _archiveService.RevertBackupAsync(gameDir);
|
||||||
|
if (revertRes.Success)
|
||||||
|
{
|
||||||
|
item.IsModded = false;
|
||||||
|
return (true, "改造プラグインを解除し、元のアーカイブへ復元しました。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// バックアップが無い場合は Mod解除状態で再パック
|
||||||
|
progress?.Report("Mod解除状態でアーカイブを再構築中...");
|
||||||
|
var repackRes = await _archiveService.RepackDataDtsAsync(gameDir, progress);
|
||||||
|
if (repackRes.Success)
|
||||||
|
{
|
||||||
|
item.IsModded = false;
|
||||||
|
return (true, "改造プラグインを解除し、アーカイブを再構築しました。");
|
||||||
|
}
|
||||||
|
|
||||||
|
return repackRes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SRPG Studio ゲームに対するすべての改造(プロキシDLL・プラグイン改造・解凍データ等)を完全に解除し、
|
||||||
|
/// 元の安全な状態に復元します。
|
||||||
|
/// </summary>
|
||||||
|
public async Task<(bool Success, string Message)> RestoreAllModsAsync(TkoolGameItem item, IProgress<string>? progress = null)
|
||||||
|
{
|
||||||
|
var logs = new List<string>();
|
||||||
|
var gameDir = item.RootDirectory;
|
||||||
|
|
||||||
|
// 1. プロキシDLL解除
|
||||||
|
if (IsProxyDllEnabled(gameDir))
|
||||||
|
{
|
||||||
|
DisableProxyDll(gameDir);
|
||||||
|
logs.Add("・プロキシDLL (version.dll) を解除しました");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 注入コードおよびModプラグインの削除
|
||||||
|
var extractedDir = SrpgArchiveService.GetExtractedDirectory(gameDir);
|
||||||
|
var targets = new List<string>
|
||||||
|
{
|
||||||
|
Path.Combine(extractedDir, "Script", "map", "map-playerturn.js"),
|
||||||
|
Path.Combine(extractedDir, "Script", "singleton", "singleton-system.js")
|
||||||
|
};
|
||||||
|
var pluginDir = Path.Combine(extractedDir, "Plugin");
|
||||||
|
if (Directory.Exists(pluginDir))
|
||||||
|
{
|
||||||
|
foreach (var f in Directory.GetFiles(pluginDir, "*.js")) targets.Add(f);
|
||||||
|
}
|
||||||
|
foreach (var t in targets) RemoveModFromExistingScript(t);
|
||||||
|
|
||||||
|
var modJsPath = Path.Combine(pluginDir, ModScriptFileName);
|
||||||
|
if (File.Exists(modJsPath))
|
||||||
|
{
|
||||||
|
File.Delete(modJsPath);
|
||||||
|
logs.Add($"・Modプラグインスクリプト ({ModScriptFileName}) を削除しました");
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var directModJs = Path.Combine(gameDir, "Plugin", ModScriptFileName);
|
||||||
|
if (File.Exists(directModJs))
|
||||||
|
{
|
||||||
|
File.Delete(directModJs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
// 3. バックアップからの data.dts 復元
|
||||||
|
progress?.Report("バックアップから元の data.dts を復元中...");
|
||||||
|
var revertRes = await _archiveService.RevertBackupAsync(gameDir);
|
||||||
|
if (revertRes.Success)
|
||||||
|
{
|
||||||
|
logs.Add($"・{revertRes.Message}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logs.Add("・元の data.dts バックアップは適用不要または存在しませんでした");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 解凍フォルダの退避
|
||||||
|
var restoreExtractedRes = _archiveService.RestoreExtractedState(gameDir);
|
||||||
|
if (restoreExtractedRes.Success && !restoreExtractedRes.Message.Contains("存在しません"))
|
||||||
|
{
|
||||||
|
logs.Add($"・{restoreExtractedRes.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. フラグ更新
|
||||||
|
item.SrpgProxyDll = false;
|
||||||
|
item.IsModded = false;
|
||||||
|
item.IsSrpgExtracted = false;
|
||||||
|
|
||||||
|
string summary = logs.Count > 0 ? string.Join("\n", logs) : "解除対象の改造はありませんでした。";
|
||||||
|
return (true, summary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -178,15 +178,25 @@ namespace GameLauncher.Services
|
|||||||
Directory.CreateDirectory(pluginsDir);
|
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))
|
if (!File.Exists(backupPath))
|
||||||
{
|
{
|
||||||
string currentContent = File.ReadAllText(pluginsJsPath, Encoding.UTF8);
|
if (File.Exists(legacyBackupPath))
|
||||||
// 既に改造プラグイン(新旧問わず)が埋め込まれている場合はクリーンアップしたものをバックアップとして保持
|
{
|
||||||
string cleanContent = CleanManagedPluginsFromContent(currentContent);
|
// 既存のゲーム内バックアップがあれば Backups フォルダへコピー
|
||||||
File.WriteAllText(backupPath, cleanContent, new UTF8Encoding(false));
|
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. バックアップ(クリーン状態)を元に編集を開始
|
// 2. バックアップ(クリーン状態)を元に編集を開始
|
||||||
@@ -245,7 +255,9 @@ namespace GameLauncher.Services
|
|||||||
{
|
{
|
||||||
var pluginsJsPath = game.PluginsJsPath;
|
var pluginsJsPath = game.PluginsJsPath;
|
||||||
var pluginsDir = game.PluginsDirPath;
|
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. バックアップが存在する場合はバックアップから復元(再構築を通すことで壊れたバックアップも修復)
|
// 1. バックアップが存在する場合はバックアップから復元(再構築を通すことで壊れたバックアップも修復)
|
||||||
if (File.Exists(backupPath))
|
if (File.Exists(backupPath))
|
||||||
@@ -254,6 +266,14 @@ namespace GameLauncher.Services
|
|||||||
string cleanContent = RebuildPluginsJs(backupContent, null);
|
string cleanContent = RebuildPluginsJs(backupContent, null);
|
||||||
File.WriteAllText(pluginsJsPath, cleanContent, new UTF8Encoding(false));
|
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
|
else
|
||||||
{
|
{
|
||||||
// バックアップがなくても、現在の plugins.js から新旧すべての管理プラグインを綺麗に除去
|
// バックアップがなくても、現在の plugins.js から新旧すべての管理プラグインを綺麗に除去
|
||||||
@@ -276,6 +296,12 @@ namespace GameLauncher.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 3. ゲームフォルダ内の旧バックアップファイルがあれば削除してBackupsフォルダに一本化
|
||||||
|
if (File.Exists(legacyBackupPath))
|
||||||
|
{
|
||||||
|
try { File.Delete(legacyBackupPath); } catch { }
|
||||||
|
}
|
||||||
|
|
||||||
game.IsModded = false;
|
game.IsModded = false;
|
||||||
return (true, "ゲームを改造前のオリジナル状態に正常に復元しました。(旧プラグインも完全削除済み)");
|
return (true, "ゲームを改造前のオリジナル状態に正常に復元しました。(旧プラグインも完全削除済み)");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using GameLauncher.Helpers;
|
||||||
using GameLauncher.Models;
|
using GameLauncher.Models;
|
||||||
|
|
||||||
namespace GameLauncher.Services
|
namespace GameLauncher.Services
|
||||||
@@ -69,15 +70,24 @@ namespace GameLauncher.Services
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var dir = Path.GetDirectoryName(indexPath)!;
|
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))
|
if (!File.Exists(backupPath))
|
||||||
{
|
{
|
||||||
string originalContent = File.ReadAllText(indexPath, Encoding.UTF8);
|
if (File.Exists(legacyBackupPath))
|
||||||
// 既にタグが含まれていた場合は除去したものをバックアップとする
|
{
|
||||||
string cleanContent = RemoveScriptTag(originalContent);
|
File.Copy(legacyBackupPath, backupPath, true);
|
||||||
File.WriteAllText(backupPath, cleanContent, new UTF8Encoding(false));
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string originalContent = File.ReadAllText(indexPath, Encoding.UTF8);
|
||||||
|
// 既にタグが含まれていた場合は除去したものをバックアップとする
|
||||||
|
string cleanContent = RemoveScriptTag(originalContent);
|
||||||
|
File.WriteAllText(backupPath, cleanContent, new UTF8Encoding(false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 有効化する機能の判定
|
// 2. 有効化する機能の判定
|
||||||
@@ -121,14 +131,21 @@ namespace GameLauncher.Services
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var dir = Path.GetDirectoryName(indexPath)!;
|
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);
|
var modJsPath = Path.Combine(dir, ModScriptFileName);
|
||||||
|
|
||||||
// 1. index.html の復元
|
// 1. index.html の復元 (Backups フォルダを優先)
|
||||||
if (File.Exists(backupPath))
|
if (File.Exists(backupPath))
|
||||||
{
|
{
|
||||||
File.Copy(backupPath, indexPath, true);
|
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))
|
else if (File.Exists(indexPath))
|
||||||
{
|
{
|
||||||
string content = File.ReadAllText(indexPath, Encoding.UTF8);
|
string content = File.ReadAllText(indexPath, Encoding.UTF8);
|
||||||
@@ -136,6 +153,12 @@ namespace GameLauncher.Services
|
|||||||
File.WriteAllText(indexPath, clean, new UTF8Encoding(false));
|
File.WriteAllText(indexPath, clean, new UTF8Encoding(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ゲームフォルダ内の旧バックアップがあれば削除
|
||||||
|
if (File.Exists(legacyBackupPath))
|
||||||
|
{
|
||||||
|
try { File.Delete(legacyBackupPath); } catch { }
|
||||||
|
}
|
||||||
|
|
||||||
// 2. tyrano_launcher_mod.js の削除
|
// 2. tyrano_launcher_mod.js の削除
|
||||||
if (File.Exists(modJsPath))
|
if (File.Exists(modJsPath))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,217 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using GameLauncher.Helpers;
|
||||||
|
using GameLauncher.Models;
|
||||||
|
|
||||||
|
namespace GameLauncher.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ウディタ(WOLF RPGエディター)の Data.wolf アーカイブの解凍・抽出・状態管理サービス
|
||||||
|
/// </summary>
|
||||||
|
public class WolfArchiveService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 指定されたゲームフォルダ内に Data.wolf または .wolf アーカイブが存在するか判定します。
|
||||||
|
/// </summary>
|
||||||
|
public bool HasWolfArchive(string gameDirectory)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(gameDirectory) || !Directory.Exists(gameDirectory))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var dataWolf = Path.Combine(gameDirectory, "Data.wolf");
|
||||||
|
if (File.Exists(dataWolf)) return true;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Directory.EnumerateFiles(gameDirectory, "*.wolf", SearchOption.TopDirectoryOnly).Any();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 指定されたゲームフォルダ内に Data.wolf の解凍先フォルダ(Data フォルダ)が存在するか判定します。
|
||||||
|
/// </summary>
|
||||||
|
public bool IsExtracted(string gameDirectory)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(gameDirectory) || !Directory.Exists(gameDirectory))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var dataDir = Path.Combine(gameDirectory, "Data");
|
||||||
|
return Directory.Exists(dataDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 有効な Wolf 解凍ツールの実行ファイルパスを取得します。
|
||||||
|
/// </summary>
|
||||||
|
public string? ResolveExtractorPath(string? customPath)
|
||||||
|
{
|
||||||
|
// 1. ユーザー指定パス
|
||||||
|
if (!string.IsNullOrWhiteSpace(customPath) && File.Exists(customPath))
|
||||||
|
{
|
||||||
|
return customPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. ランチャー直下の Tools\UberWolfCli.exe
|
||||||
|
var exeDir = AppPathHelper.GetExeDirectory();
|
||||||
|
var candidates = new[]
|
||||||
|
{
|
||||||
|
Path.Combine(exeDir, "Tools", "UberWolfCli.exe"),
|
||||||
|
Path.Combine(exeDir, "Tools", "UberWolf.exe"),
|
||||||
|
Path.Combine(exeDir, "Tools", "WolfDec.exe"),
|
||||||
|
@"C:\VS2026\GameLauncher\Tools\UberWolfCli.exe",
|
||||||
|
@"Z:\自作ソフト\GameLauncher\Tools\UberWolfCli.exe"
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var candidate in candidates)
|
||||||
|
{
|
||||||
|
if (File.Exists(candidate))
|
||||||
|
{
|
||||||
|
return candidate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data.wolf を解凍・抽出します。
|
||||||
|
/// </summary>
|
||||||
|
public async Task<(bool success, string message)> ExtractArchiveAsync(
|
||||||
|
TkoolGameItem game,
|
||||||
|
string? customExtractorPath,
|
||||||
|
IProgress<string>? progress = null)
|
||||||
|
{
|
||||||
|
var gameDir = game.RootDirectory;
|
||||||
|
if (!Directory.Exists(gameDir))
|
||||||
|
{
|
||||||
|
return (false, "ゲームのルートディレクトリが見つかりません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
var extractorPath = ResolveExtractorPath(customExtractorPath);
|
||||||
|
if (string.IsNullOrEmpty(extractorPath) || !File.Exists(extractorPath))
|
||||||
|
{
|
||||||
|
return (false, "Wolf RPG アーカイブ解凍ツール(UberWolfCli.exe / WolfDec.exe)が見つかりません。設定ダイアログからツールのパスを指定してください。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解凍対象の探索 (Data.wolf または Game.exe)
|
||||||
|
var targetFile = Path.Combine(gameDir, "Data.wolf");
|
||||||
|
if (!File.Exists(targetFile))
|
||||||
|
{
|
||||||
|
var wolfFiles = Directory.GetFiles(gameDir, "*.wolf");
|
||||||
|
if (wolfFiles.Length > 0)
|
||||||
|
{
|
||||||
|
targetFile = wolfFiles[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetFile = Path.Combine(gameDir, "Game.exe");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!File.Exists(targetFile))
|
||||||
|
{
|
||||||
|
return (false, "解凍対象の Data.wolf または Game.exe が見つかりません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
progress?.Report($"[解凍開始] ツール: {Path.GetFileName(extractorPath)} 対象: {Path.GetFileName(targetFile)}");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// UberWolfCli.exe の場合は -o (上書き) -u (プロテクト解除) を渡す
|
||||||
|
var isUberWolf = Path.GetFileName(extractorPath).Contains("UberWolf", StringComparison.OrdinalIgnoreCase);
|
||||||
|
var arguments = isUberWolf
|
||||||
|
? $"-o -u \"{targetFile}\""
|
||||||
|
: $"\"{targetFile}\"";
|
||||||
|
|
||||||
|
var psi = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = extractorPath,
|
||||||
|
Arguments = arguments,
|
||||||
|
WorkingDirectory = gameDir,
|
||||||
|
CreateNoWindow = true,
|
||||||
|
UseShellExecute = false,
|
||||||
|
RedirectStandardOutput = true,
|
||||||
|
RedirectStandardError = true
|
||||||
|
};
|
||||||
|
|
||||||
|
using var process = new Process { StartInfo = psi };
|
||||||
|
var outputLog = new System.Text.StringBuilder();
|
||||||
|
|
||||||
|
process.OutputDataReceived += (_, e) =>
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(e.Data))
|
||||||
|
{
|
||||||
|
outputLog.AppendLine(e.Data);
|
||||||
|
progress?.Report(e.Data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
process.ErrorDataReceived += (_, e) =>
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(e.Data))
|
||||||
|
{
|
||||||
|
outputLog.AppendLine(e.Data);
|
||||||
|
progress?.Report($"[情報] {e.Data}");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
process.Start();
|
||||||
|
process.BeginOutputReadLine();
|
||||||
|
process.BeginErrorReadLine();
|
||||||
|
|
||||||
|
await process.WaitForExitAsync();
|
||||||
|
|
||||||
|
var dataDir = Path.Combine(gameDir, "Data");
|
||||||
|
if (Directory.Exists(dataDir) && Directory.EnumerateFileSystemEntries(dataDir).Any())
|
||||||
|
{
|
||||||
|
progress?.Report($"[解凍完了] Data フォルダへの抽出に成功しました: {dataDir}");
|
||||||
|
return (true, "Data.wolf の解凍・抽出が完了しました。Data フォルダのファイルを直接編集・改造できます。");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (false, $"解凍処理は終了しましたが、Data フォルダが確認できませんでした。\nログ: {outputLog}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (false, $"解凍処理中に例外が発生しました: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 解凍された Data フォルダを Backups フォルダに退避し、元の Data.wolf 優先読み込み状態に復元します。
|
||||||
|
/// </summary>
|
||||||
|
public (bool success, string message) RestoreArchiveState(TkoolGameItem game)
|
||||||
|
{
|
||||||
|
var gameDir = game.RootDirectory;
|
||||||
|
var dataDir = Path.Combine(gameDir, "Data");
|
||||||
|
|
||||||
|
if (!Directory.Exists(dataDir))
|
||||||
|
{
|
||||||
|
return (true, "Data フォルダは存在しないため、既に元のアーカイブ読み込み状態です。");
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// バックアップ保存先(Backups フォルダ)
|
||||||
|
var backupDir = AppPathHelper.GetGameBackupDirectory(game.FolderName, game.RootDirectory);
|
||||||
|
var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
|
||||||
|
var backupDataDir = Path.Combine(backupDir, $"Data_Extracted_{timestamp}");
|
||||||
|
|
||||||
|
// Data フォルダを Backups へ移動(元に戻す)
|
||||||
|
Directory.Move(dataDir, backupDataDir);
|
||||||
|
|
||||||
|
return (true, $"解凍されていた Data フォルダを Backups フォルダへ退避しました。\n(退避先: {backupDataDir})\n元の Data.wolf アーカイブ優先読み込みに復元されました。");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (false, $"復元処理中にエラーが発生しました: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,215 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
|
using GameLauncher.Helpers;
|
||||||
|
using GameLauncher.Models;
|
||||||
|
|
||||||
|
namespace GameLauncher.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ウディタ(WOLF RPGエディター)向けのプロキシDLL(メモリフック/スピードハック)
|
||||||
|
/// およびデバッグモード(テストプレイモード)管理サービス
|
||||||
|
/// </summary>
|
||||||
|
public class WolfModService
|
||||||
|
{
|
||||||
|
public const string ProxyDllName = "version.dll";
|
||||||
|
public const string ConfigFileName = "speedhack_config.json";
|
||||||
|
public const string GameExeBackupSuffix = ".original_launcher_backup";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プロキシDLL(version.dll)がゲームフォルダ内に配置されているか判定します。
|
||||||
|
/// </summary>
|
||||||
|
public bool IsProxyDllInstalled(TkoolGameItem game)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(game.RootDirectory) || !Directory.Exists(game.RootDirectory))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var dllPath = Path.Combine(game.RootDirectory, ProxyDllName);
|
||||||
|
return File.Exists(dllPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プロキシDLL(メモリフック/スピードハック)をゲームフォルダに適用します。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="game">対象のウディタゲーム</param>
|
||||||
|
/// <param name="baseSpeed">基本スピード倍率(1.0〜10.0)</param>
|
||||||
|
/// <param name="toggleSpeed">F6キー押下時のトグルスピード倍率(3.0など)</param>
|
||||||
|
/// <param name="holdSpeed">Ctrlキー押下時の早送り倍率(5.0など)</param>
|
||||||
|
public (bool success, string message) ApplyProxyDll(
|
||||||
|
TkoolGameItem game,
|
||||||
|
double baseSpeed = 1.0,
|
||||||
|
double toggleSpeed = 3.0,
|
||||||
|
double holdSpeed = 5.0)
|
||||||
|
{
|
||||||
|
var gameDir = game.RootDirectory;
|
||||||
|
if (!Directory.Exists(gameDir))
|
||||||
|
return (false, "ゲームディレクトリが見つかりません。");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 1. プロキシDLL本体の探索 (Tools\speedhack-i686\version.dll)
|
||||||
|
var sourceDllPath = ResolveProxyDllPath();
|
||||||
|
if (string.IsNullOrEmpty(sourceDllPath) || !File.Exists(sourceDllPath))
|
||||||
|
{
|
||||||
|
return (false, "プロキシDLL(Tools\\speedhack-i686\\version.dll)が見つかりません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
var targetDllPath = Path.Combine(gameDir, ProxyDllName);
|
||||||
|
var targetConfigPath = Path.Combine(gameDir, ConfigFileName);
|
||||||
|
|
||||||
|
// 2. 元々同名DLLが存在していた場合は Backups フォルダに退避
|
||||||
|
var backupDir = AppPathHelper.GetGameBackupDirectory(game.FolderName, game.RootDirectory);
|
||||||
|
var backupDllPath = Path.Combine(backupDir, ProxyDllName + GameExeBackupSuffix);
|
||||||
|
|
||||||
|
if (File.Exists(targetDllPath) && !File.Exists(backupDllPath))
|
||||||
|
{
|
||||||
|
File.Copy(targetDllPath, backupDllPath, overwrite: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. プロキシDLLをコピー配置
|
||||||
|
File.Copy(sourceDllPath, targetDllPath, overwrite: true);
|
||||||
|
|
||||||
|
// 4. speedhack_config.json の生成・書き込み
|
||||||
|
var configContent = GenerateSpeedhackConfig(baseSpeed, toggleSpeed, holdSpeed);
|
||||||
|
File.WriteAllText(targetConfigPath, configContent, new UTF8Encoding(false));
|
||||||
|
|
||||||
|
game.WolfProxyDll = true;
|
||||||
|
game.IsModded = true;
|
||||||
|
return (true, $"プロキシDLL(version.dll)を配置しました。\n・[F6] キー: {toggleSpeed:0.#}倍速 トグル\n・[Ctrl] キー: {holdSpeed:0.#}倍速 早送り\n・通常速度: {baseSpeed:0.#}倍");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (false, $"プロキシDLLの適用に失敗しました: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// プロキシDLLをゲームフォルダから削除し、初期状態に完全復元します。
|
||||||
|
/// </summary>
|
||||||
|
public (bool success, string message) RemoveProxyDll(TkoolGameItem game)
|
||||||
|
{
|
||||||
|
var gameDir = game.RootDirectory;
|
||||||
|
if (!Directory.Exists(gameDir))
|
||||||
|
return (false, "ゲームディレクトリが見つかりません。");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var targetDllPath = Path.Combine(gameDir, ProxyDllName);
|
||||||
|
var targetConfigPath = Path.Combine(gameDir, ConfigFileName);
|
||||||
|
|
||||||
|
var backupDir = AppPathHelper.GetGameBackupDirectory(game.FolderName, game.RootDirectory);
|
||||||
|
var backupDllPath = Path.Combine(backupDir, ProxyDllName + GameExeBackupSuffix);
|
||||||
|
|
||||||
|
// 1. プロキシDLLの削除またはオリジナル復元
|
||||||
|
if (File.Exists(backupDllPath))
|
||||||
|
{
|
||||||
|
File.Copy(backupDllPath, targetDllPath, overwrite: true);
|
||||||
|
try { File.Delete(backupDllPath); } catch { }
|
||||||
|
}
|
||||||
|
else if (File.Exists(targetDllPath))
|
||||||
|
{
|
||||||
|
File.Delete(targetDllPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 設定ファイルの削除
|
||||||
|
if (File.Exists(targetConfigPath))
|
||||||
|
{
|
||||||
|
try { File.Delete(targetConfigPath); } catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
game.WolfProxyDll = false;
|
||||||
|
game.IsModded = false;
|
||||||
|
return (true, "プロキシDLL(version.dll)を解除し、ゲームを元の状態に復元しました。");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (false, $"プロキシDLLの解除に失敗しました: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 全ての改造(プロキシDLL、パッチ等)を解除し、ゲームを完全に元に戻します。
|
||||||
|
/// </summary>
|
||||||
|
public (bool success, string message) RestoreAllMods(TkoolGameItem game)
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
|
||||||
|
// 1. プロキシDLLの解除
|
||||||
|
var (dllSuccess, dllMsg) = RemoveProxyDll(game);
|
||||||
|
sb.AppendLine(dllMsg);
|
||||||
|
|
||||||
|
// 2. Game.exe バックアップからの復元(存在する場合)
|
||||||
|
var backupDir = AppPathHelper.GetGameBackupDirectory(game.FolderName, game.RootDirectory);
|
||||||
|
var backupExePath = Path.Combine(backupDir, "Game.exe" + GameExeBackupSuffix);
|
||||||
|
var gameExePath = Path.Combine(game.RootDirectory, "Game.exe");
|
||||||
|
|
||||||
|
if (File.Exists(backupExePath))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.Copy(backupExePath, gameExePath, overwrite: true);
|
||||||
|
sb.AppendLine("・Game.exe をオリジナルバックアップから復元しました。");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
sb.AppendLine($"・Game.exe の復元中にエラーが発生しました: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (true, sb.ToString().Trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// speedhack-rs の version.dll の配置パスを探索・解決します。
|
||||||
|
/// </summary>
|
||||||
|
private string? ResolveProxyDllPath()
|
||||||
|
{
|
||||||
|
var exeDir = AppPathHelper.GetExeDirectory();
|
||||||
|
var candidates = new[]
|
||||||
|
{
|
||||||
|
Path.Combine(exeDir, "Tools", "speedhack-i686", ProxyDllName),
|
||||||
|
Path.Combine(exeDir, "Tools", ProxyDllName),
|
||||||
|
@"C:\VS2026\GameLauncher\Tools\speedhack-i686\version.dll",
|
||||||
|
@"Z:\自作ソフト\GameLauncher\Tools\speedhack-i686\version.dll"
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var path in candidates)
|
||||||
|
{
|
||||||
|
if (File.Exists(path)) return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// speedhack_config.json の JSON 文字列を生成します。
|
||||||
|
/// </summary>
|
||||||
|
private string GenerateSpeedhackConfig(double baseSpeed, double toggleSpeed, double holdSpeed)
|
||||||
|
{
|
||||||
|
var obj = new
|
||||||
|
{
|
||||||
|
console = false,
|
||||||
|
base_speed = baseSpeed,
|
||||||
|
speed_states = new object[]
|
||||||
|
{
|
||||||
|
new
|
||||||
|
{
|
||||||
|
keys = new[] { "F6" },
|
||||||
|
speed = toggleSpeed,
|
||||||
|
is_toggle = true
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
keys = new[] { "Control" },
|
||||||
|
speed = holdSpeed,
|
||||||
|
is_toggle = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return JsonSerializer.Serialize(obj, new JsonSerializerOptions { WriteIndented = true });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,401 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
|
using GameLauncher.Helpers;
|
||||||
|
|
||||||
|
namespace GameLauncher.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ウディタ(WOLF RPGエディター)セーブデータ内の1つの変数項目
|
||||||
|
/// </summary>
|
||||||
|
public class WolfVariableItem
|
||||||
|
{
|
||||||
|
public string Category { get; set; } = "通常変数";
|
||||||
|
public int Index { get; set; }
|
||||||
|
public string DisplayName { get; set; } = string.Empty;
|
||||||
|
public int Value { get; set; }
|
||||||
|
public int Offset { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ウディタセーブデータ内の可変データベース項目
|
||||||
|
/// </summary>
|
||||||
|
public class WolfDbItem
|
||||||
|
{
|
||||||
|
public string TypeName { get; set; } = string.Empty;
|
||||||
|
public int TypeId { get; set; }
|
||||||
|
public int DataId { get; set; }
|
||||||
|
public string DataName { get; set; } = string.Empty;
|
||||||
|
public int FieldId { get; set; }
|
||||||
|
public string FieldName { get; set; } = string.Empty;
|
||||||
|
public bool IsString { get; set; }
|
||||||
|
public int NumberValue { get; set; }
|
||||||
|
public string StringValue { get; set; } = string.Empty;
|
||||||
|
public int Offset { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ウディタセーブデータ内の文字列項目
|
||||||
|
/// </summary>
|
||||||
|
public class WolfStringItem
|
||||||
|
{
|
||||||
|
public int Offset { get; set; }
|
||||||
|
public int Length { get; set; }
|
||||||
|
public string Value { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// パース済みウディタセーブデータ
|
||||||
|
/// </summary>
|
||||||
|
public class WolfSaveData
|
||||||
|
{
|
||||||
|
public string FilePath { get; set; } = string.Empty;
|
||||||
|
public string FileName { get; set; } = string.Empty;
|
||||||
|
public string GameTitle { get; set; } = string.Empty;
|
||||||
|
public ushort FileVersion { get; set; }
|
||||||
|
public bool IsUtf8 { get; set; }
|
||||||
|
public byte[] RawDecryptedBytes { get; set; } = [];
|
||||||
|
public List<WolfVariableItem> Variables { get; set; } = [];
|
||||||
|
public List<WolfDbItem> DatabaseItems { get; set; } = [];
|
||||||
|
public List<WolfStringItem> Strings { get; set; } = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// WOLF RPGエディターのセーブデータ(SaveXX.sav)の復号・暗号化・解析・編集サービス
|
||||||
|
/// </summary>
|
||||||
|
public class WolfSaveService
|
||||||
|
{
|
||||||
|
private const int START_OFFSET = 0x14;
|
||||||
|
private static readonly uint[] INC_STEPS = [1, 2, 5];
|
||||||
|
private static readonly uint[] ENC_INC_STEPS = [5, 2, 1];
|
||||||
|
|
||||||
|
static WolfSaveService()
|
||||||
|
{
|
||||||
|
// Shift-JIS (932) のサポート登録
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 指定されたゲームディレクトリからセーブデータファイル一覧を取得します。
|
||||||
|
/// </summary>
|
||||||
|
public List<string> GetSaveFiles(string gameDirectory)
|
||||||
|
{
|
||||||
|
var result = new List<string>();
|
||||||
|
if (string.IsNullOrEmpty(gameDirectory) || !Directory.Exists(gameDirectory))
|
||||||
|
return result;
|
||||||
|
|
||||||
|
var searchDirs = new List<string> { gameDirectory };
|
||||||
|
var saveSubDir = Path.Combine(gameDirectory, "Save");
|
||||||
|
if (Directory.Exists(saveSubDir)) searchDirs.Add(saveSubDir);
|
||||||
|
var saveSubDir2 = Path.Combine(gameDirectory, "save");
|
||||||
|
if (Directory.Exists(saveSubDir2) && !searchDirs.Contains(saveSubDir2)) searchDirs.Add(saveSubDir2);
|
||||||
|
|
||||||
|
foreach (var dir in searchDirs)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var files = Directory.GetFiles(dir, "*.sav")
|
||||||
|
.OrderBy(f => Path.GetFileName(f), StringComparer.OrdinalIgnoreCase);
|
||||||
|
result.AddRange(files);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.Distinct(StringComparer.OrdinalIgnoreCase).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 暗号化されたウディタセーブデータを復号します。
|
||||||
|
/// </summary>
|
||||||
|
public byte[] Decrypt(byte[] encryptedData)
|
||||||
|
{
|
||||||
|
if (encryptedData == null || encryptedData.Length < START_OFFSET)
|
||||||
|
return encryptedData ?? [];
|
||||||
|
|
||||||
|
byte[] copy = (byte[])encryptedData.Clone();
|
||||||
|
byte[] seeds = [copy[0], copy[3], copy[9]];
|
||||||
|
|
||||||
|
for (int i = 0; i < seeds.Length; i++)
|
||||||
|
{
|
||||||
|
uint state = seeds[i];
|
||||||
|
int inc = (int)INC_STEPS[i];
|
||||||
|
|
||||||
|
for (int j = START_OFFSET; j < copy.Length; j += inc)
|
||||||
|
{
|
||||||
|
state = state * 214013 + 2531011;
|
||||||
|
int r = (int)((state >> 16) & 0x7FFF);
|
||||||
|
byte xor = (byte)((r >> 12) & 0xFF);
|
||||||
|
copy[j] ^= xor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 復号状態のウディタセーブデータを暗号化します(チェックサム自動更新付き)。
|
||||||
|
/// </summary>
|
||||||
|
public byte[] Encrypt(byte[] plainData)
|
||||||
|
{
|
||||||
|
if (plainData == null || plainData.Length < START_OFFSET)
|
||||||
|
return plainData ?? [];
|
||||||
|
|
||||||
|
byte[] copy = (byte[])plainData.Clone();
|
||||||
|
|
||||||
|
// 1. チェックサムの再計算 (オフセット 0x14 からの総和を 0x02 に格納)
|
||||||
|
byte checksum = 0;
|
||||||
|
for (int i = START_OFFSET; i < copy.Length; i++)
|
||||||
|
{
|
||||||
|
checksum += copy[i];
|
||||||
|
}
|
||||||
|
copy[0x02] = checksum;
|
||||||
|
|
||||||
|
// 2. 暗号化 (seeds は copy[9], copy[3], copy[0] の逆順、インクリメントも 5, 2, 1)
|
||||||
|
byte[] seeds = [copy[9], copy[3], copy[0]];
|
||||||
|
|
||||||
|
for (int i = 0; i < seeds.Length; i++)
|
||||||
|
{
|
||||||
|
uint state = seeds[i];
|
||||||
|
int inc = (int)ENC_INC_STEPS[i];
|
||||||
|
|
||||||
|
for (int j = START_OFFSET; j < copy.Length; j += inc)
|
||||||
|
{
|
||||||
|
state = state * 214013 + 2531011;
|
||||||
|
int r = (int)((state >> 16) & 0x7FFF);
|
||||||
|
byte xor = (byte)((r >> 12) & 0xFF);
|
||||||
|
copy[j] ^= xor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// セーブファイルを読み込み、復号してパースします。
|
||||||
|
/// </summary>
|
||||||
|
public WolfSaveData LoadSave(string filePath)
|
||||||
|
{
|
||||||
|
if (!File.Exists(filePath))
|
||||||
|
throw new FileNotFoundException($"セーブデータファイルが見つかりません: {filePath}");
|
||||||
|
|
||||||
|
byte[] rawBytes = File.ReadAllBytes(filePath);
|
||||||
|
byte[] decrypted = Decrypt(rawBytes);
|
||||||
|
|
||||||
|
var result = new WolfSaveData
|
||||||
|
{
|
||||||
|
FilePath = filePath,
|
||||||
|
FileName = Path.GetFileName(filePath),
|
||||||
|
RawDecryptedBytes = decrypted
|
||||||
|
};
|
||||||
|
|
||||||
|
if (decrypted.Length < 0x20) return result;
|
||||||
|
|
||||||
|
// 文字エンコーディング判定 (オフセット6が 0x55 なら UTF-8, それ以外は Shift-JIS)
|
||||||
|
result.IsUtf8 = (decrypted[6] == 0x55);
|
||||||
|
Encoding enc = result.IsUtf8 ? Encoding.UTF8 : Encoding.GetEncoding(932);
|
||||||
|
|
||||||
|
// ゲームタイトルの取得 (オフセット 0x15 からの文字列)
|
||||||
|
if (decrypted[0x14] == 0x19 && decrypted.Length > 0x17)
|
||||||
|
{
|
||||||
|
ushort titleLen = BitConverter.ToUInt16(decrypted, 0x15);
|
||||||
|
if (titleLen > 1 && 0x17 + titleLen <= decrypted.Length)
|
||||||
|
{
|
||||||
|
result.GameTitle = enc.GetString(decrypted, 0x17, titleLen - 1).Trim('\0');
|
||||||
|
int nextOffset = 0x17 + titleLen;
|
||||||
|
if (nextOffset + 2 <= decrypted.Length)
|
||||||
|
{
|
||||||
|
result.FileVersion = BitConverter.ToUInt16(decrypted, nextOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// セーブデータ内の全文字列スキャン
|
||||||
|
ScanStrings(result, decrypted, enc);
|
||||||
|
|
||||||
|
// セーブデータ内の通常変数スキャン
|
||||||
|
ScanVariables(result, decrypted);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文字列の検出スキャン
|
||||||
|
/// </summary>
|
||||||
|
private void ScanStrings(WolfSaveData model, byte[] data, Encoding enc)
|
||||||
|
{
|
||||||
|
for (int i = START_OFFSET; i < data.Length - 4; i++)
|
||||||
|
{
|
||||||
|
uint strLen = BitConverter.ToUInt32(data, i);
|
||||||
|
if (strLen >= 2 && strLen <= 128 && i + 4 + strLen <= data.Length)
|
||||||
|
{
|
||||||
|
// 末尾がNULL終端かチェック
|
||||||
|
if (data[i + 4 + strLen - 1] == 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string s = enc.GetString(data, i + 4, (int)strLen - 1);
|
||||||
|
// 意味のあるテキストか判定(2文字以上の文字、制御文字を含まない)
|
||||||
|
if (s.Length >= 2 && !s.Any(c => char.IsControl(c) && c != '\r' && c != '\n' && c != '\t'))
|
||||||
|
{
|
||||||
|
model.Strings.Add(new WolfStringItem
|
||||||
|
{
|
||||||
|
Offset = i + 4,
|
||||||
|
Length = (int)strLen - 1,
|
||||||
|
Value = s
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 変数テーブルのスキャン(32bit整数群)
|
||||||
|
/// </summary>
|
||||||
|
private void ScanVariables(WolfSaveData model, byte[] data)
|
||||||
|
{
|
||||||
|
// 4バイト境界に沿って整数値を抽出(特に100以上の意味ありそうな数値やステータス)
|
||||||
|
int varIdx = 0;
|
||||||
|
for (int i = 0x50; i < data.Length - 4; i += 4)
|
||||||
|
{
|
||||||
|
int val = BitConverter.ToInt32(data, i);
|
||||||
|
// 範囲制限(極端に大きなゴミデータや負の値のノイズを適度にフィルタ)
|
||||||
|
if (val >= 0 && val <= 999999999)
|
||||||
|
{
|
||||||
|
model.Variables.Add(new WolfVariableItem
|
||||||
|
{
|
||||||
|
Category = "通常・内部変数",
|
||||||
|
Index = varIdx++,
|
||||||
|
DisplayName = $"変数 [0x{i:X5}]",
|
||||||
|
Value = val,
|
||||||
|
Offset = i
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// セーブファイルをバックアップしてから上書き保存します。
|
||||||
|
/// バックアップは必ず Z:\自作ソフト\GameLauncher\Backups に保存されます。
|
||||||
|
/// </summary>
|
||||||
|
public string SaveToFile(WolfSaveData model, string folderName, string rootDirectory)
|
||||||
|
{
|
||||||
|
if (model == null || model.RawDecryptedBytes == null || model.RawDecryptedBytes.Length == 0)
|
||||||
|
throw new InvalidOperationException("保存対象のデータが空です。");
|
||||||
|
|
||||||
|
// 1. バックアップ作成 (Backups フォルダへ)
|
||||||
|
string? backupPath = BackupSaveFile(model.FilePath, folderName, rootDirectory);
|
||||||
|
|
||||||
|
// 2. 変数・項目の変更を RawDecryptedBytes に書き戻し
|
||||||
|
foreach (var item in model.Variables)
|
||||||
|
{
|
||||||
|
if (item.Offset >= START_OFFSET && item.Offset + 4 <= model.RawDecryptedBytes.Length)
|
||||||
|
{
|
||||||
|
byte[] valBytes = BitConverter.GetBytes(item.Value);
|
||||||
|
Buffer.BlockCopy(valBytes, 0, model.RawDecryptedBytes, item.Offset, 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 暗号化 & チェックサム再計算
|
||||||
|
byte[] encrypted = Encrypt(model.RawDecryptedBytes);
|
||||||
|
|
||||||
|
// 4. アトミック書き込み
|
||||||
|
string tempFile = model.FilePath + ".tmp_" + Guid.NewGuid().ToString("N");
|
||||||
|
File.WriteAllBytes(tempFile, encrypted);
|
||||||
|
File.Move(tempFile, model.FilePath, overwrite: true);
|
||||||
|
|
||||||
|
return backupPath ?? string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// セーブデータのバックアップを作成します。
|
||||||
|
/// </summary>
|
||||||
|
public string? BackupSaveFile(string saveFilePath, string folderName, string rootDirectory)
|
||||||
|
{
|
||||||
|
if (!File.Exists(saveFilePath)) return null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var backupDir = AppPathHelper.GetGameBackupDirectory(folderName, rootDirectory);
|
||||||
|
if (!Directory.Exists(backupDir))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(backupDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileName = Path.GetFileNameWithoutExtension(saveFilePath);
|
||||||
|
var ext = Path.GetExtension(saveFilePath);
|
||||||
|
var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
|
||||||
|
var destName = $"{fileName}_{timestamp}{ext}";
|
||||||
|
var destPath = Path.Combine(backupDir, destName);
|
||||||
|
|
||||||
|
File.Copy(saveFilePath, destPath, overwrite: true);
|
||||||
|
return destPath;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
System.Diagnostics.Debug.WriteLine($"[WolfSaveService] Backup error: {ex.Message}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// セーブデータを JSON 形式でエクスポートします。
|
||||||
|
/// </summary>
|
||||||
|
public void ExportToJson(WolfSaveData model, string jsonFilePath)
|
||||||
|
{
|
||||||
|
var dto = new
|
||||||
|
{
|
||||||
|
model.FileName,
|
||||||
|
model.GameTitle,
|
||||||
|
model.FileVersion,
|
||||||
|
model.IsUtf8,
|
||||||
|
Variables = model.Variables.Select(v => new { v.Offset, v.DisplayName, v.Value }),
|
||||||
|
Strings = model.Strings.Select(s => new { s.Offset, s.Length, s.Value })
|
||||||
|
};
|
||||||
|
|
||||||
|
var options = new JsonSerializerOptions { WriteIndented = true };
|
||||||
|
string json = JsonSerializer.Serialize(dto, options);
|
||||||
|
File.WriteAllText(jsonFilePath, json, Encoding.UTF8);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// JSON 形式の編集内容をセーブデータモデルへインポート・反映します。
|
||||||
|
/// </summary>
|
||||||
|
public void ImportFromJson(WolfSaveData model, string jsonFilePath)
|
||||||
|
{
|
||||||
|
if (!File.Exists(jsonFilePath))
|
||||||
|
throw new FileNotFoundException($"JSONファイルが見つかりません: {jsonFilePath}");
|
||||||
|
|
||||||
|
string json = File.ReadAllText(jsonFilePath, Encoding.UTF8);
|
||||||
|
using var doc = JsonDocument.Parse(json);
|
||||||
|
var root = doc.RootElement;
|
||||||
|
|
||||||
|
if (root.TryGetProperty("Variables", out var varsElement) && varsElement.ValueKind == JsonValueKind.Array)
|
||||||
|
{
|
||||||
|
var varDict = model.Variables.ToDictionary(v => v.Offset, v => v);
|
||||||
|
foreach (var item in varsElement.EnumerateArray())
|
||||||
|
{
|
||||||
|
if (item.TryGetProperty("Offset", out var offsetProp) &&
|
||||||
|
item.TryGetProperty("Value", out var valProp))
|
||||||
|
{
|
||||||
|
int offset = offsetProp.GetInt32();
|
||||||
|
int val = valProp.GetInt32();
|
||||||
|
if (varDict.TryGetValue(offset, out var entry))
|
||||||
|
{
|
||||||
|
entry.Value = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,322 @@
|
|||||||
|
<Window x:Class="GameLauncher.WolfSaveEditorDialog"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:GameLauncher"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="WOLF RPGエディター セーブデータエディタ" Height="750" Width="1100"
|
||||||
|
MinHeight="550" MinWidth="850"
|
||||||
|
WindowStartupLocation="CenterOwner"
|
||||||
|
Background="#181820" Foreground="#E0E0E6"
|
||||||
|
FontFamily="Segoe UI, Meiryo UI, Yu Gothic UI">
|
||||||
|
|
||||||
|
<Window.Resources>
|
||||||
|
<!-- カラーパレット -->
|
||||||
|
<SolidColorBrush x:Key="BgDark" Color="#181820"/>
|
||||||
|
<SolidColorBrush x:Key="CardBg" Color="#22222C"/>
|
||||||
|
<SolidColorBrush x:Key="CardHoverBg" Color="#2C2C3A"/>
|
||||||
|
<SolidColorBrush x:Key="SidePanelBg" Color="#1F1F2A"/>
|
||||||
|
<SolidColorBrush x:Key="BorderBrushColor" Color="#38384C"/>
|
||||||
|
<SolidColorBrush x:Key="TextPrimary" Color="#F2F2F7"/>
|
||||||
|
<SolidColorBrush x:Key="TextSecondary" Color="#9E9EB4"/>
|
||||||
|
<SolidColorBrush x:Key="AccentWolf" Color="#4834D4"/>
|
||||||
|
<SolidColorBrush x:Key="AccentWolfHover" Color="#686DE0"/>
|
||||||
|
<SolidColorBrush x:Key="AccentGreen" Color="#00B894"/>
|
||||||
|
<SolidColorBrush x:Key="AccentGreenHover" Color="#10D3AC"/>
|
||||||
|
<SolidColorBrush x:Key="AccentRed" Color="#D63031"/>
|
||||||
|
|
||||||
|
<!-- ボタン標準スタイル -->
|
||||||
|
<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="12,6"/>
|
||||||
|
<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 AccentWolfHover}"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Opacity" Value="0.4"/>
|
||||||
|
<Setter Property="Cursor" Value="Arrow"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- プライマリ(保存)ボタンスタイル -->
|
||||||
|
<Style x:Key="PrimaryButton" TargetType="Button" BasedOn="{StaticResource ModernButton}">
|
||||||
|
<Setter Property="Background" Value="{StaticResource AccentGreen}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource AccentGreen}"/>
|
||||||
|
<Setter Property="Foreground" Value="#FFFFFF"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="{StaticResource AccentGreenHover}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource AccentGreenHover}"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- タブコントロールスタイル -->
|
||||||
|
<Style x:Key="ModernTabItem" TargetType="TabItem">
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource TextSecondary}"/>
|
||||||
|
<Setter Property="FontSize" Value="13"/>
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
|
<Setter Property="Padding" Value="16,8"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="TabItem">
|
||||||
|
<Border x:Name="TabBorder" Background="Transparent" BorderThickness="0,0,0,2" BorderBrush="Transparent" Padding="{TemplateBinding Padding}" Margin="0,0,8,0" Cursor="Hand">
|
||||||
|
<ContentPresenter ContentSource="Header"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsSelected" Value="True">
|
||||||
|
<Setter TargetName="TabBorder" Property="BorderBrush" Value="{StaticResource AccentWolfHover}"/>
|
||||||
|
<Setter Property="Foreground" Value="#FFFFFF"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FFFFFF"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</Window.Resources>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<!-- ヘッダーエリア -->
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<!-- 操作ツールバー -->
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<!-- メインコンテンツ -->
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<!-- ステータスバー -->
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- 1. ヘッダー -->
|
||||||
|
<Border Grid.Row="0" Background="{StaticResource SidePanelBg}" BorderBrush="{StaticResource BorderBrushColor}" BorderThickness="0,0,0,1" Padding="20,14">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<StackPanel Grid.Column="0">
|
||||||
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
|
<Border Background="{StaticResource AccentWolf}" CornerRadius="4" Padding="6,2" Margin="0,0,10,0">
|
||||||
|
<TextBlock Text="🐺 ウディタ" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
|
||||||
|
</Border>
|
||||||
|
<TextBlock Text="セーブデータエディタ" FontSize="18" FontWeight="Bold" Foreground="{StaticResource TextPrimary}" VerticalAlignment="Center"/>
|
||||||
|
<TextBlock x:Name="lblGameTitle" Text="" FontSize="14" Foreground="{StaticResource TextSecondary}" Margin="12,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock x:Name="lblGamePath" Text="" FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="0,4,0,0" TextTrimming="CharacterEllipsis"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- セーブスロット選択 -->
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="対象セーブ:" VerticalAlignment="Center" Margin="0,0,8,0" Foreground="{StaticResource TextSecondary}" FontSize="12"/>
|
||||||
|
<ComboBox x:Name="cboSaveFiles" Width="180" Height="28" VerticalContentAlignment="Center"
|
||||||
|
SelectionChanged="cboSaveFiles_SelectionChanged" Margin="0,0,8,0"/>
|
||||||
|
<Button Content="🔄 再読み込み" Style="{StaticResource ModernButton}" Click="btnReload_Click" Margin="0,0,8,0"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- 2. 操作ツールバー -->
|
||||||
|
<Border Grid.Row="1" Background="{StaticResource CardBg}" BorderBrush="{StaticResource BorderBrushColor}" BorderThickness="0,0,0,1" Padding="20,10">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- 数値ピンポイント検索(所持金・ステータス特定) -->
|
||||||
|
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,16,0">
|
||||||
|
<TextBlock Text="🎯 数値検索 (所持金等):" VerticalAlignment="Center" Foreground="{StaticResource TextSecondary}" FontSize="12" Margin="0,0,6,0"/>
|
||||||
|
<TextBox x:Name="txtTargetValue" Width="110" Height="26" VerticalContentAlignment="Center" Padding="4,0"
|
||||||
|
Background="#14141C" Foreground="#FFFFFF" BorderBrush="{StaticResource BorderBrushColor}" Text=""/>
|
||||||
|
<Button Content="検索" Style="{StaticResource ModernButton}" Click="btnSearchValue_Click" Margin="6,0,4,0"/>
|
||||||
|
<Button Content="MAX(9999999)化" Style="{StaticResource ModernButton}" Click="btnSetMaxTarget_Click" Margin="0,0,4,0" ToolTip="検索された数値を 9,999,999 に書き換えます"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- リアルタイムフィルター -->
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,16,0">
|
||||||
|
<TextBlock Text="🔍 絞り込み:" VerticalAlignment="Center" Foreground="{StaticResource TextSecondary}" FontSize="12" Margin="0,0,6,0"/>
|
||||||
|
<TextBox x:Name="txtFilter" Width="150" Height="26" VerticalContentAlignment="Center" Padding="4,0"
|
||||||
|
Background="#14141C" Foreground="#FFFFFF" BorderBrush="{StaticResource BorderBrushColor}"
|
||||||
|
TextChanged="txtFilter_TextChanged"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- アクションボタン群 -->
|
||||||
|
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
|
<Button Content="📤 JSONエクスポート" Style="{StaticResource ModernButton}" Click="btnExportJson_Click" Margin="0,0,8,0"/>
|
||||||
|
<Button Content="📥 JSONインポート" Style="{StaticResource ModernButton}" Click="btnImportJson_Click" Margin="0,0,8,0"/>
|
||||||
|
<Button Content="📁 バックアップを開く" Style="{StaticResource ModernButton}" Click="btnOpenBackups_Click" Margin="0,0,12,0"/>
|
||||||
|
<Button Content="💾 上書き保存 (自動バックアップ)" Style="{StaticResource PrimaryButton}" Click="btnSave_Click" Padding="16,6"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- 3. メインコンテンツ -->
|
||||||
|
<TabControl Grid.Row="2" Background="Transparent" BorderThickness="0" Margin="16,10,16,10">
|
||||||
|
<!-- 変数・数値データタブ -->
|
||||||
|
<TabItem Header="📊 通常変数・ステータス数値" Style="{StaticResource ModernTabItem}">
|
||||||
|
<DataGrid x:Name="dgVariables" AutoGenerateColumns="False" CanUserAddRows="False"
|
||||||
|
Background="{StaticResource CardBg}" BorderBrush="{StaticResource BorderBrushColor}"
|
||||||
|
RowBackground="#22222C" AlternatingRowBackground="#1D1D26"
|
||||||
|
Foreground="#FFFFFF" GridLinesVisibility="Horizontal" HorizontalGridLinesBrush="#333344"
|
||||||
|
HeadersVisibility="Column" SelectionMode="Single"
|
||||||
|
CellEditEnding="dgVariables_CellEditEnding">
|
||||||
|
<DataGrid.Resources>
|
||||||
|
<Style TargetType="DataGridColumnHeader">
|
||||||
|
<Setter Property="Background" Value="#2A2A38"/>
|
||||||
|
<Setter Property="Foreground" Value="#E0E0E6"/>
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
|
<Setter Property="Padding" Value="10,6"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource BorderBrushColor}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0,0,1,1"/>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.Resources>
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="分類" Binding="{Binding Category}" Width="120" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="項目名" Binding="{Binding DisplayName}" Width="180" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="オフセット" Binding="{Binding Offset, StringFormat=0x{0:X5}}" Width="110" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="現在の値 (ダブルクリックで編集)" Binding="{Binding Value, UpdateSourceTrigger=LostFocus}" Width="200">
|
||||||
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="FontWeight" Value="Bold"/>
|
||||||
|
<Setter Property="Foreground" Value="#55EFC4"/>
|
||||||
|
<Setter Property="Padding" Value="8,3"/>
|
||||||
|
</Style>
|
||||||
|
</DataGridTextColumn.ElementStyle>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTemplateColumn Header="クイック操作" Width="140">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Button Content="MAX(9999999)" Style="{StaticResource ModernButton}" Padding="8,2" FontSize="11"
|
||||||
|
Click="btnQuickMax_Click" Tag="{Binding}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<!-- 文字列データタブ -->
|
||||||
|
<TabItem Header="💬 文字列データ" Style="{StaticResource ModernTabItem}">
|
||||||
|
<DataGrid x:Name="dgStrings" AutoGenerateColumns="False" CanUserAddRows="False" IsReadOnly="True"
|
||||||
|
Background="{StaticResource CardBg}" BorderBrush="{StaticResource BorderBrushColor}"
|
||||||
|
RowBackground="#22222C" AlternatingRowBackground="#1D1D26"
|
||||||
|
Foreground="#FFFFFF" GridLinesVisibility="Horizontal" HorizontalGridLinesBrush="#333344"
|
||||||
|
HeadersVisibility="Column" SelectionMode="Single">
|
||||||
|
<DataGrid.Resources>
|
||||||
|
<Style TargetType="DataGridColumnHeader">
|
||||||
|
<Setter Property="Background" Value="#2A2A38"/>
|
||||||
|
<Setter Property="Foreground" Value="#E0E0E6"/>
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
|
<Setter Property="Padding" Value="10,6"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource BorderBrushColor}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0,0,1,1"/>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.Resources>
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="オフセット" Binding="{Binding Offset, StringFormat=0x{0:X5}}" Width="120"/>
|
||||||
|
<DataGridTextColumn Header="バイト長" Binding="{Binding Length}" Width="90"/>
|
||||||
|
<DataGridTextColumn Header="文字列内容" Binding="{Binding Value}" Width="*"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<!-- セーブ詳細情報タブ -->
|
||||||
|
<TabItem Header="ℹ️ セーブ情報" Style="{StaticResource ModernTabItem}">
|
||||||
|
<Border Background="{StaticResource CardBg}" BorderBrush="{StaticResource BorderBrushColor}" BorderThickness="1" CornerRadius="8" Padding="20">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="セーブデータ詳細メタ情報" FontSize="14" FontWeight="Bold" Foreground="#FFFFFF" Margin="0,0,0,12"/>
|
||||||
|
<Grid Margin="0,0,0,8">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="160"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Text="ゲームタイトル:" Foreground="{StaticResource TextSecondary}"/>
|
||||||
|
<TextBlock x:Name="txtInfoTitle" Grid.Column="1" Foreground="#FFFFFF" FontWeight="SemiBold"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid Margin="0,0,0,8">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="160"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Text="セーブバージョン:" Foreground="{StaticResource TextSecondary}"/>
|
||||||
|
<TextBlock x:Name="txtInfoVersion" Grid.Column="1" Foreground="#FFFFFF"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid Margin="0,0,0,8">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="160"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Text="エンコーディング:" Foreground="{StaticResource TextSecondary}"/>
|
||||||
|
<TextBlock x:Name="txtInfoEncoding" Grid.Column="1" Foreground="#FFFFFF"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid Margin="0,0,0,8">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="160"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Text="復号後データサイズ:" Foreground="{StaticResource TextSecondary}"/>
|
||||||
|
<TextBlock x:Name="txtInfoSize" Grid.Column="1" Foreground="#FFFFFF"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid Margin="0,0,0,8">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="160"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Text="暗号化方式:" Foreground="{StaticResource TextSecondary}"/>
|
||||||
|
<TextBlock Text="WOLF RPG LCG XOR暗号化 (チェックサム自動計算対応)" Grid.Column="1" Foreground="#00B894"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid Margin="0,0,0,8">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="160"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Text="バックアップ先:" Foreground="{StaticResource TextSecondary}"/>
|
||||||
|
<TextBlock x:Name="txtInfoBackupDir" Grid.Column="1" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap"/>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
|
||||||
|
<!-- 4. ステータスバー -->
|
||||||
|
<Border Grid.Row="3" Background="#14141C" BorderBrush="{StaticResource BorderBrushColor}" BorderThickness="0,1,0,0" Padding="16,8">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock x:Name="lblStatus" Text="準備完了" Foreground="{StaticResource TextSecondary}" FontSize="12" VerticalAlignment="Center"/>
|
||||||
|
<TextBlock x:Name="lblSaveCount" Grid.Column="1" Text="" Foreground="{StaticResource TextSecondary}" FontSize="12" VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,332 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using GameLauncher.Helpers;
|
||||||
|
using GameLauncher.Models;
|
||||||
|
using GameLauncher.Services;
|
||||||
|
|
||||||
|
namespace GameLauncher
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ウディタ用セーブデータエディタの画面ロジック
|
||||||
|
/// </summary>
|
||||||
|
public partial class WolfSaveEditorDialog : Window
|
||||||
|
{
|
||||||
|
private readonly TkoolGameItem _game;
|
||||||
|
private readonly WolfSaveService _saveService;
|
||||||
|
private WolfSaveData? _currentSaveData;
|
||||||
|
private List<WolfVariableItem> _allVariables = [];
|
||||||
|
private List<WolfStringItem> _allStrings = [];
|
||||||
|
|
||||||
|
public WolfSaveEditorDialog(TkoolGameItem game, WolfSaveService saveService)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_game = game;
|
||||||
|
_saveService = saveService;
|
||||||
|
|
||||||
|
lblGameTitle.Text = _game.Title;
|
||||||
|
lblGamePath.Text = _game.RootDirectory;
|
||||||
|
txtInfoBackupDir.Text = AppPathHelper.GetGameBackupDirectory(_game.FolderName, _game.RootDirectory);
|
||||||
|
|
||||||
|
LoadSaveFileList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// セーブファイル一覧の読み込みとコンボボックス設定
|
||||||
|
/// </summary>
|
||||||
|
private void LoadSaveFileList()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var files = _saveService.GetSaveFiles(_game.RootDirectory);
|
||||||
|
cboSaveFiles.Items.Clear();
|
||||||
|
|
||||||
|
foreach (var f in files)
|
||||||
|
{
|
||||||
|
cboSaveFiles.Items.Add(Path.GetFileName(f));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cboSaveFiles.Items.Count > 0)
|
||||||
|
{
|
||||||
|
cboSaveFiles.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblStatus.Text = "セーブデータ(*.sav)が見つかりませんでした。";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
lblStatus.Text = $"セーブファイル列挙エラー: {ex.Message}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cboSaveFiles_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (cboSaveFiles.SelectedItem == null) return;
|
||||||
|
var fileName = cboSaveFiles.SelectedItem.ToString();
|
||||||
|
if (string.IsNullOrEmpty(fileName)) return;
|
||||||
|
|
||||||
|
LoadSaveFile(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 指定されたセーブファイルの読み込み・解析
|
||||||
|
/// </summary>
|
||||||
|
private void LoadSaveFile(string fileName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var files = _saveService.GetSaveFiles(_game.RootDirectory);
|
||||||
|
var fullPath = files.FirstOrDefault(f => string.Equals(Path.GetFileName(f), fileName, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(fullPath) || !File.Exists(fullPath))
|
||||||
|
{
|
||||||
|
lblStatus.Text = $"ファイルが存在しません: {fileName}";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentSaveData = _saveService.LoadSave(fullPath);
|
||||||
|
_allVariables = [.. _currentSaveData.Variables];
|
||||||
|
_allStrings = [.. _currentSaveData.Strings];
|
||||||
|
|
||||||
|
// メタ情報表示
|
||||||
|
txtInfoTitle.Text = string.IsNullOrEmpty(_currentSaveData.GameTitle) ? "(不明)" : _currentSaveData.GameTitle;
|
||||||
|
txtInfoVersion.Text = $"0x{_currentSaveData.FileVersion:X4}";
|
||||||
|
txtInfoEncoding.Text = _currentSaveData.IsUtf8 ? "UTF-8" : "Shift-JIS (CP932)";
|
||||||
|
txtInfoSize.Text = $"{_currentSaveData.RawDecryptedBytes.Length:N0} バイト";
|
||||||
|
|
||||||
|
ApplyFilter();
|
||||||
|
|
||||||
|
lblStatus.Text = $"'{fileName}' を正常に読み込みました。";
|
||||||
|
lblSaveCount.Text = $"変数項目: {_allVariables.Count}件, 文字列項目: {_allStrings.Count}件";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"セーブデータの読み込みに失敗しました:\n{ex.Message}", "読み込みエラー", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
lblStatus.Text = $"読み込みエラー: {ex.Message}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnReload_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (cboSaveFiles.SelectedItem != null)
|
||||||
|
{
|
||||||
|
LoadSaveFile(cboSaveFiles.SelectedItem.ToString()!);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LoadSaveFileList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// フィルターの適用
|
||||||
|
/// </summary>
|
||||||
|
private void ApplyFilter()
|
||||||
|
{
|
||||||
|
var filter = txtFilter.Text?.Trim() ?? string.Empty;
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(filter))
|
||||||
|
{
|
||||||
|
dgVariables.ItemsSource = _allVariables;
|
||||||
|
dgStrings.ItemsSource = _allStrings;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dgVariables.ItemsSource = _allVariables
|
||||||
|
.Where(v => v.DisplayName.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
v.Category.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
v.Value.ToString().Contains(filter, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
v.Offset.ToString("X").Contains(filter, StringComparison.OrdinalIgnoreCase))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
dgStrings.ItemsSource = _allStrings
|
||||||
|
.Where(s => s.Value.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
s.Offset.ToString("X").Contains(filter, StringComparison.OrdinalIgnoreCase))
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txtFilter_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
ApplyFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数値ピンポイント検索(所持金・ステータス等)
|
||||||
|
/// </summary>
|
||||||
|
private void btnSearchValue_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (!int.TryParse(txtTargetValue.Text.Trim(), out int target))
|
||||||
|
{
|
||||||
|
MessageBox.Show("検索する数値を半角数字で入力してください。(例: 現在の所持金やステータス)", "入力エラー", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var matches = _allVariables.Where(v => v.Value == target).ToList();
|
||||||
|
if (matches.Count == 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"値が {target:N0} と一致する変数が見つかりませんでした。", "検索結果", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dgVariables.ItemsSource = matches;
|
||||||
|
lblStatus.Text = $"値 {target:N0} に一致する候補が {matches.Count} 件見つかりました。";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 検索された数値を一括で 9,999,999 に設定
|
||||||
|
/// </summary>
|
||||||
|
private void btnSetMaxTarget_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (dgVariables.ItemsSource is not IEnumerable<WolfVariableItem> currentList) return;
|
||||||
|
var list = currentList.ToList();
|
||||||
|
if (list.Count == 0) return;
|
||||||
|
|
||||||
|
var result = MessageBox.Show(
|
||||||
|
$"現在一覧に表示されている {list.Count} 件の数値をすべて 9,999,999 に変更しますか?\n(所持金やステータスの一括MAX化に便利です)",
|
||||||
|
"一括変更の確認", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
|
||||||
|
if (result == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
item.Value = 9999999;
|
||||||
|
}
|
||||||
|
dgVariables.Items.Refresh();
|
||||||
|
lblStatus.Text = $"{list.Count} 件の値を 9,999,999 に変更しました。保存ボタンを押すと反映されます。";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 単一行のクイックMAX化
|
||||||
|
/// </summary>
|
||||||
|
private void btnQuickMax_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is Button btn && btn.Tag is WolfVariableItem item)
|
||||||
|
{
|
||||||
|
item.Value = 9999999;
|
||||||
|
dgVariables.Items.Refresh();
|
||||||
|
lblStatus.Text = $"{item.DisplayName} の値を 9,999,999 に設定しました。";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dgVariables_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
|
||||||
|
{
|
||||||
|
lblStatus.Text = "値を編集しました。「上書き保存」を押すとバックアップを作成して保存されます。";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// セーブデータの上書き保存(Backupsへの完全自動退避付き)
|
||||||
|
/// </summary>
|
||||||
|
private void btnSave_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (_currentSaveData == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("保存対象のセーブデータがありません。", "エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 変数リストの最新値をモデルへ反映
|
||||||
|
_currentSaveData.Variables = _allVariables;
|
||||||
|
|
||||||
|
// 保存実行 (自動バックアップ)
|
||||||
|
string backupPath = _saveService.SaveToFile(_currentSaveData, _game.FolderName, _game.RootDirectory);
|
||||||
|
|
||||||
|
var msg = $"セーブデータ '{_currentSaveData.FileName}' を安全に上書き保存しました!\n\n【バックアップ保存先】\n{backupPath}";
|
||||||
|
MessageBox.Show(msg, "保存完了", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
lblStatus.Text = $"保存完了 (バックアップ: {Path.GetFileName(backupPath)})";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"保存中にエラーが発生しました:\n{ex.Message}", "保存エラー", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
lblStatus.Text = $"保存エラー: {ex.Message}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// JSON エクスポート
|
||||||
|
/// </summary>
|
||||||
|
private void btnExportJson_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (_currentSaveData == null) return;
|
||||||
|
|
||||||
|
var sfd = new SaveFileDialog
|
||||||
|
{
|
||||||
|
Title = "セーブデータを JSON としてエクスポート",
|
||||||
|
Filter = "JSON ファイル (*.json)|*.json",
|
||||||
|
FileName = $"{Path.GetFileNameWithoutExtension(_currentSaveData.FileName)}_export.json"
|
||||||
|
};
|
||||||
|
|
||||||
|
if (sfd.ShowDialog() == true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_saveService.ExportToJson(_currentSaveData, sfd.FileName);
|
||||||
|
MessageBox.Show($"JSON ファイルをエクスポートしました:\n{sfd.FileName}", "エクスポート完了", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"エクスポートに失敗しました:\n{ex.Message}", "エラー", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// JSON インポート
|
||||||
|
/// </summary>
|
||||||
|
private void btnImportJson_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (_currentSaveData == null) return;
|
||||||
|
|
||||||
|
var ofd = new OpenFileDialog
|
||||||
|
{
|
||||||
|
Title = "編集済み JSON ファイルを選択してください",
|
||||||
|
Filter = "JSON ファイル (*.json)|*.json"
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ofd.ShowDialog() == true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_saveService.ImportFromJson(_currentSaveData, ofd.FileName);
|
||||||
|
_allVariables = [.. _currentSaveData.Variables];
|
||||||
|
ApplyFilter();
|
||||||
|
MessageBox.Show("JSON データを正常に取り込みました。「上書き保存」を押すとファイルへ反映されます。", "インポート完了", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"インポートに失敗しました:\n{ex.Message}", "エラー", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// バックアップフォルダを開く
|
||||||
|
/// </summary>
|
||||||
|
private void btnOpenBackups_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var dir = AppPathHelper.GetGameBackupDirectory(_game.FolderName, _game.RootDirectory);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
/*:
|
||||||
|
* @target MZ
|
||||||
|
* @plugindesc プリンセスシナジー専用: 主人公のHPを常時最大に固定する
|
||||||
|
* @author GameLauncher
|
||||||
|
*
|
||||||
|
* @help
|
||||||
|
* プリンセスシナジー(RPGツクールMZ/カードバトル)専用プラグインです。
|
||||||
|
*
|
||||||
|
* 【分析結果】
|
||||||
|
* 本作の戦闘は標準の Game_BattlerBase / Game_Actor のHP APIを一切使わず、
|
||||||
|
* 独自のプレイヤー配列 NPlayer[] の _hp を直接書き換える実装になっています
|
||||||
|
* (JsScript100Set.js で NPlayer[0] = $gameActors._data[1] を参照)。
|
||||||
|
* ダメージは JsScript79Set.js:710 で NPlayer[0]._hp -= value と直接減算され、
|
||||||
|
* 描画は JsScript87Set.js で NPlayer[i]._hp を読みます。
|
||||||
|
* 戦闘の毎フレーム処理は Game_Interpreter.prototype.update
|
||||||
|
* (JsScript54Set.js:91)から呼ばれる NUpdate() が担っています。
|
||||||
|
*
|
||||||
|
* 【方式】
|
||||||
|
* 本プラグインは戦闘の毎フレーム入口 Game_Interpreter.prototype.update を
|
||||||
|
* フックし、主人公(NPlayer[0])の _hp を毎フレーム mhp へクランプします。
|
||||||
|
* どの経路で書き換えられても、描画前に必ず最大値へ戻ります。
|
||||||
|
*
|
||||||
|
* 【対象範囲】
|
||||||
|
* NPlayer[0](主人公ロマーシャ)のみ。敵(NEnemy)・他の味方(NPlayer[1]以降)
|
||||||
|
* には一切影響しません。
|
||||||
|
*
|
||||||
|
* 【適用/解除】
|
||||||
|
* ランチャーの改造チェック(PrincessAlwaysMaxHp)でこのプラグインの
|
||||||
|
* 適用/解除を切り替えられます(plugins.js への登録/解除)。
|
||||||
|
*/
|
||||||
|
|
||||||
|
(() => {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// 主人公(NPlayer[0])のHPを最大値へクランプする
|
||||||
|
function clampHeroHp() {
|
||||||
|
if (typeof NPlayer === 'undefined' || !NPlayer || !NPlayer[0]) return;
|
||||||
|
const hero = NPlayer[0];
|
||||||
|
const mhp = hero.mhp;
|
||||||
|
if (typeof mhp === 'number' && mhp > 0 && hero._hp !== mhp) {
|
||||||
|
hero._hp = mhp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 戦闘中、毎フレーム呼ばれる Game_Interpreter.update をフック
|
||||||
|
if (Game_Interpreter.prototype.update) {
|
||||||
|
const _Game_Interpreter_update = Game_Interpreter.prototype.update;
|
||||||
|
Game_Interpreter.prototype.update = function() {
|
||||||
|
const result = _Game_Interpreter_update.apply(this, arguments);
|
||||||
|
clampHeroHp();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// 毎フレームの戦闘更新(ダメージ等の直接書き換えを毎回打ち消す)
|
||||||
|
if (Game_Interpreter.prototype.DmgEffectUpdate) {
|
||||||
|
const _DmgEffectUpdate = Game_Interpreter.prototype.DmgEffectUpdate;
|
||||||
|
Game_Interpreter.prototype.DmgEffectUpdate = function() {
|
||||||
|
const result = _DmgEffectUpdate.apply(this, arguments);
|
||||||
|
clampHeroHp();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// プレイヤーターン開始時の保険
|
||||||
|
if (Game_Interpreter.prototype.BtlPLTurnSetup_Update) {
|
||||||
|
const _BtlPLTurnSetup_Update = Game_Interpreter.prototype.BtlPLTurnSetup_Update;
|
||||||
|
Game_Interpreter.prototype.BtlPLTurnSetup_Update = function() {
|
||||||
|
const result = _BtlPLTurnSetup_Update.apply(this, arguments);
|
||||||
|
clampHeroHp();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
/*:
|
||||||
|
* @target MZ
|
||||||
|
* @plugindesc プリンセスシナジー専用: 主人公のMPを常時最大に固定する
|
||||||
|
* @author GameLauncher
|
||||||
|
*
|
||||||
|
* @help
|
||||||
|
* プリンセスシナジー(RPGツクールMZ/カードバトル)専用プラグインです。
|
||||||
|
*
|
||||||
|
* 【分析結果】
|
||||||
|
* 本作の戦闘は標準の Game_BattlerBase / Game_Actor のMP APIを一切使わず、
|
||||||
|
* 独自のプレイヤー配列 NPlayer[] の _mp を直接書き換える実装になっています
|
||||||
|
* (JsScript100Set.js で NPlayer[0] = $gameActors._data[1] を参照)。
|
||||||
|
* カードコストは JsScript72Set.js:119 で NPlayer[0]._mp -= Cost と直接減算
|
||||||
|
* され、毎ターン減少や回復(上限9クランプ)も直接書き換えです。
|
||||||
|
* 戦闘の毎フレーム処理は Game_Interpreter.prototype.update
|
||||||
|
* (JsScript54Set.js:91)から呼ばれる NUpdate() が担っています。
|
||||||
|
*
|
||||||
|
* 【方式】
|
||||||
|
* 本プラグインは戦闘の毎フレーム入口 Game_Interpreter.prototype.update を
|
||||||
|
* フックし、主人公(NPlayer[0])の _mp を毎フレーム mmp へクランプします。
|
||||||
|
* どの経路で書き換えられても、描画前に必ず最大値へ戻ります。
|
||||||
|
*
|
||||||
|
* 【対象範囲】
|
||||||
|
* NPlayer[0](主人公ロマーシャ)のみ。敵(NEnemy)・他の味方(NPlayer[1]以降)
|
||||||
|
* には一切影響しません。
|
||||||
|
*
|
||||||
|
* 【適用/解除】
|
||||||
|
* ランチャーの改造チェック(PrincessAlwaysMaxMp)でこのプラグインの
|
||||||
|
* 適用/解除を切り替えられます(plugins.js への登録/解除)。
|
||||||
|
*/
|
||||||
|
|
||||||
|
(() => {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// 主人公(NPlayer[0])のMPを最大値へクランプする
|
||||||
|
function clampHeroMp() {
|
||||||
|
if (typeof NPlayer === 'undefined' || !NPlayer || !NPlayer[0]) return;
|
||||||
|
const hero = NPlayer[0];
|
||||||
|
const mmp = hero.mmp;
|
||||||
|
if (typeof mmp === 'number' && mmp > 0 && hero._mp !== mmp) {
|
||||||
|
hero._mp = mmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 戦闘中、毎フレーム呼ばれる Game_Interpreter.update をフック
|
||||||
|
if (Game_Interpreter.prototype.update) {
|
||||||
|
const _Game_Interpreter_update = Game_Interpreter.prototype.update;
|
||||||
|
Game_Interpreter.prototype.update = function() {
|
||||||
|
const result = _Game_Interpreter_update.apply(this, arguments);
|
||||||
|
clampHeroMp();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// 毎フレームの戦闘更新(カードコスト等の直接書き換えを毎回打ち消す)
|
||||||
|
if (Game_Interpreter.prototype.DmgEffectUpdate) {
|
||||||
|
const _DmgEffectUpdate = Game_Interpreter.prototype.DmgEffectUpdate;
|
||||||
|
Game_Interpreter.prototype.DmgEffectUpdate = function() {
|
||||||
|
const result = _DmgEffectUpdate.apply(this, arguments);
|
||||||
|
clampHeroMp();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// プレイヤーターン開始時の保険
|
||||||
|
if (Game_Interpreter.prototype.BtlPLTurnSetup_Update) {
|
||||||
|
const _BtlPLTurnSetup_Update = Game_Interpreter.prototype.BtlPLTurnSetup_Update;
|
||||||
|
Game_Interpreter.prototype.BtlPLTurnSetup_Update = function() {
|
||||||
|
const result = _BtlPLTurnSetup_Update.apply(this, arguments);
|
||||||
|
clampHeroMp();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本作のMP回復は上限9でクランプされるため、回復後にも最大値へ戻す
|
||||||
|
if (Game_Interpreter.prototype.MPKaihuku) {
|
||||||
|
const _MPKaihuku = Game_Interpreter.prototype.MPKaihuku;
|
||||||
|
Game_Interpreter.prototype.MPKaihuku = function() {
|
||||||
|
const result = _MPKaihuku.apply(this, arguments);
|
||||||
|
clampHeroMp();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})();
|
||||||
+12
-5
@@ -1,20 +1,20 @@
|
|||||||
# GameLauncher 単一ファイル発行スクリプト
|
# GameLauncher 単一ファイル発行スクリプト
|
||||||
# 公開先: Z:\自作ソフト\GameLauncher\
|
# 公開先: Z:\自作ソフト\GameLauncher\
|
||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
$projectDir = $PSScriptRoot
|
$projectDir = $PSScriptRoot
|
||||||
$publishDir = 'Z:\自作ソフト\GameLauncher'
|
$publishDir = "Z:\自作ソフト\GameLauncher"
|
||||||
|
|
||||||
Write-Host '=== GameLauncher 発行処理開始 ===' -ForegroundColor Cyan
|
Write-Host "=== GameLauncher 発行処理開始 (発行先: $publishDir) ===" -ForegroundColor Cyan
|
||||||
|
|
||||||
if (!(Test-Path $publishDir)) {
|
if (!(Test-Path $publishDir)) {
|
||||||
New-Item -ItemType Directory -Path $publishDir -Force | Out-Null
|
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 -o $publishDir
|
dotnet publish "$projectDir\GameLauncher.csproj" -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o "$publishDir"
|
||||||
|
|
||||||
if ($LASTEXITCODE -eq 0) {
|
if ($LASTEXITCODE -eq 0) {
|
||||||
# プラグインおよび設定ファイルの配置
|
# プラグインおよび設定ファイルの配置
|
||||||
@@ -27,6 +27,13 @@ if ($LASTEXITCODE -eq 0) {
|
|||||||
if (Test-Path "$projectDir\Config.tjs") {
|
if (Test-Path "$projectDir\Config.tjs") {
|
||||||
Copy-Item -Path "$projectDir\Config.tjs" -Destination "$publishDir\Config.tjs" -Force
|
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
|
Write-Host "発行成功: $publishDir\GameLauncher.exe" -ForegroundColor Green
|
||||||
} else {
|
} else {
|
||||||
Write-Host "発行失敗 (終了コード: $LASTEXITCODE)" -ForegroundColor Red
|
Write-Host "発行失敗 (終了コード: $LASTEXITCODE)" -ForegroundColor Red
|
||||||
|
|||||||
Reference in new issue
Block a user