Files
GameLauncher/WolfSaveEditorDialog.xaml

323 lines
20 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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>