feat: ツクールVX/VX Ace改造対応、Backupsフォルダ統一、全エンジンの種類別一覧表示タブの実装
This commit is contained in:
1 parent
7ac4dbc825
commit
bc5ba43ce7
14 files changed
+2157
-130
No files matched your search
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using Microsoft.Win32;
|
||||
using GameLauncher.Helpers;
|
||||
using GameLauncher.Models;
|
||||
|
||||
namespace GameLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// 設定ダイアログのロジック
|
||||
/// </summary>
|
||||
public partial class ConfigDialog : Window
|
||||
{
|
||||
private readonly LauncherConfig _config;
|
||||
|
||||
public bool IsSaved { get; private set; }
|
||||
|
||||
public ConfigDialog(LauncherConfig config)
|
||||
{
|
||||
InitializeComponent();
|
||||
_config = config;
|
||||
|
||||
txtRgssExtractorPath.Text = _config.RgssExtractorPath ?? @"C:\Soft\RGSS-Extractor-v1.0\RGSS Extractor.exe";
|
||||
txtBackupsPath.Text = AppPathHelper.GetBackupsDirectory();
|
||||
chkDefaultApplyMod.IsChecked = _config.DefaultApplyMod;
|
||||
}
|
||||
|
||||
private void btnBrowseExtractor_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var ofd = new OpenFileDialog
|
||||
{
|
||||
Title = "RGSS Extractor の実行ファイルを選択してください",
|
||||
Filter = "実行ファイル (*.exe)|*.exe|すべてのファイル (*.*)|*.*",
|
||||
FileName = "RGSS Extractor.exe"
|
||||
};
|
||||
|
||||
var currentDir = Path.GetDirectoryName(txtRgssExtractorPath.Text);
|
||||
if (!string.IsNullOrEmpty(currentDir) && Directory.Exists(currentDir))
|
||||
{
|
||||
ofd.InitialDirectory = currentDir;
|
||||
}
|
||||
|
||||
if (ofd.ShowDialog() == true)
|
||||
{
|
||||
txtRgssExtractorPath.Text = ofd.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOpenBackupsDir_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dir = AppPathHelper.GetBackupsDirectory();
|
||||
if (!Directory.Exists(dir))
|
||||
{
|
||||
Directory.CreateDirectory(dir);
|
||||
}
|
||||
Process.Start(new ProcessStartInfo { FileName = dir, UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"バックアップフォルダを開けませんでした:\n{ex.Message}", "エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnSave_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_config.RgssExtractorPath = txtRgssExtractorPath.Text.Trim();
|
||||
_config.DefaultApplyMod = chkDefaultApplyMod.IsChecked == true;
|
||||
IsSaved = true;
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DialogResult = false;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user