スタイル: コーディング規約に準拠したコードフォーマットの適用(this.の明示、空白スタイルの統一)

- 自インスタンスメンバーアクセスへの this. 付与(28ファイル)
- .editorconfig に準拠したインデント・波括弧・空白スタイルの適用
- UTF-8 (BOMあり)、CRLF改行コード、行末空白除去の整合性検証
This commit is contained in:
armonica committed 2026-10-20 10:14:26 +09:00
1 parent 2fa40c950f
commit ae86b53147
28 files changed
+1362 -1380

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ namespace GameLauncher.Engines.Evb
private const string EnigmaSecondarySection = ".enigma2";
/// <summary>EVB virtual filesystem header magic ("EVB\0").</summary>
private static readonly byte[] EvbMagic = { 0x45, 0x56, 0x42, 0x00 };
private static readonly byte[] EvbMagic = [0x45, 0x56, 0x42, 0x00];
/// <summary>Returns true when the given executable is packed with EVB and can be unpacked.</summary>
/// <remarks>
+1 -1
View File
@@ -34,7 +34,7 @@ namespace GameLauncher.Engines.Evb
/// <inheritdoc />
public string ResolveToolPath(string toolFileName)
=> AppPathHelperBridge.Resolve(EngineName, toolFileName);
=> AppPathHelperBridge.Resolve(this.EngineName, toolFileName);
}
/// <summary>
+2 -2
View File
@@ -79,7 +79,7 @@ namespace GameLauncher.Engines.Evb
try
{
// Preferred names commonly used by NW.js / RPG Maker / Tyrano bundles.
string[] preferred = { "Game.exe", "game.exe", "nw.exe", "Game_boxed.exe" };
string[] preferred = ["Game.exe", "game.exe", "nw.exe", "Game_boxed.exe"];
foreach (var name in preferred)
{
var direct = Path.Combine(outputDirectory, name);
@@ -302,7 +302,7 @@ namespace GameLauncher.Engines.Evb
{
foreach (var backup in Directory.GetFiles(gameRootDir, "*" + ExeBackupSuffix))
{
var original = backup.Substring(0, backup.Length - ExeBackupSuffix.Length);
var original = backup[..^ExeBackupSuffix.Length];
if (!File.Exists(original))
{
File.Move(backup, original);
+15 -17
View File
@@ -170,7 +170,7 @@ namespace GameLauncher.Engines.Nwjs
long packageJsonOffset = -1;
long packageJsonSize = -1;
TraverseFiles(filesRoot, "", dataOffset, fs.Length, result, includeFileList,
this.TraverseFiles(filesRoot, "", dataOffset, fs.Length, result, includeFileList,
ref systemJsonRelative, ref systemJsonOffset, ref systemJsonSize,
ref packageJsonRelative, ref packageJsonOffset, ref packageJsonSize);
@@ -274,7 +274,7 @@ namespace GameLauncher.Engines.Nwjs
if (val.TryGetProperty("files", out var subFiles))
{
TraverseFiles(subFiles, path, dataOffset, fileLength, result, includeFileList,
this.TraverseFiles(subFiles, path, dataOffset, fileLength, result, includeFileList,
ref systemJsonRelative, ref systemJsonOffset, ref systemJsonSize,
ref packageJsonRelative, ref packageJsonOffset, ref packageJsonSize);
}
@@ -395,7 +395,7 @@ namespace GameLauncher.Engines.Nwjs
// UNC パス (例: \\server\share\...) の場合
if (normalized.StartsWith(@"\\", StringComparison.Ordinal))
{
return @"\\?\UNC\" + normalized.Substring(2);
return @"\\?\UNC\" + normalized[2..];
}
// 相対パスの場合は安全に絶対パスを取得してからプレフィックスを付与
@@ -408,7 +408,7 @@ namespace GameLauncher.Engines.Nwjs
}
if (full.StartsWith(@"\\", StringComparison.Ordinal))
{
return @"\\?\UNC\" + full.Substring(2);
return @"\\?\UNC\" + full[2..];
}
return @"\\?\" + full;
}
@@ -447,7 +447,7 @@ namespace GameLauncher.Engines.Nwjs
}
// ヘッダ詳細解析
var inspect = InspectAsar(targetAsar, includeFileList: true);
var inspect = this.InspectAsar(targetAsar, includeFileList: true);
if (!inspect.IsValid || inspect.FileEntries.Count == 0)
{
return (false, "asar ファイルのヘッダ解析に失敗したか、ファイルが含まれていません。");
@@ -503,20 +503,18 @@ namespace GameLauncher.Engines.Nwjs
fs.Seek(dataOffset + entry.Offset, SeekOrigin.Begin);
long remaining = entry.Size;
using (var outFs = new FileStream(destFilePath, FileMode.Create, FileAccess.Write, FileShare.None))
using var outFs = new FileStream(destFilePath, FileMode.Create, FileAccess.Write, FileShare.None);
while (remaining > 0)
{
while (remaining > 0)
{
int toRead = (int)Math.Min(remaining, buffer.Length);
int read = fs.Read(buffer, 0, toRead);
if (read == 0) break;
int toRead = (int)Math.Min(remaining, buffer.Length);
int read = fs.Read(buffer, 0, toRead);
if (read == 0) break;
outFs.Write(buffer, 0, read);
remaining -= read;
extractedBytes += read;
outFs.Write(buffer, 0, read);
remaining -= read;
extractedBytes += read;
progress?.Report((extractedBytes, totalBytes, i + 1, totalFiles, Path.GetFileName(entry.RelativePath)));
}
progress?.Report((extractedBytes, totalBytes, i + 1, totalFiles, Path.GetFileName(entry.RelativePath)));
}
}
catch (Exception fileEx)
@@ -573,7 +571,7 @@ namespace GameLauncher.Engines.Nwjs
: asarPath + AsarBackupSuffix;
var originalAsar = asarPath.EndsWith(AsarBackupSuffix, StringComparison.OrdinalIgnoreCase)
? asarPath.Substring(0, asarPath.Length - AsarBackupSuffix.Length)
? asarPath[..^AsarBackupSuffix.Length]
: asarPath;
string extExtractedDir = ToExtendedPath(extractedDir);
@@ -52,7 +52,7 @@ namespace GameLauncher.Engines.Rgss.Games.IiniTitleRepair
var trim = line.Trim();
if (trim.StartsWith("Title=", StringComparison.OrdinalIgnoreCase))
{
var val = trim.Substring(6).Trim();
var val = trim[6..].Trim();
if (!string.IsNullOrWhiteSpace(val) && !val.Contains('\uFFFD'))
{
tg.Title = val;
@@ -73,23 +73,23 @@ namespace GameLauncher.Engines.Rgss.Games.IiniTitleRepair
{
try
{
if (!File.Exists(filePath)) return Array.Empty<string>();
if (!File.Exists(filePath)) return [];
byte[] bytes = File.ReadAllBytes(filePath);
if (bytes.Length == 0) return Array.Empty<string>();
if (bytes.Length == 0) return [];
// 1. UTF-8 BOM (EF BB BF)
if (bytes.Length >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF)
{
var text = System.Text.Encoding.UTF8.GetString(bytes, 3, bytes.Length - 3);
return text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
return text.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);
}
// 2. UTF-16 LE BOM (FF FE)
if (bytes.Length >= 2 && bytes[0] == 0xFF && bytes[1] == 0xFE)
{
var text = System.Text.Encoding.Unicode.GetString(bytes, 2, bytes.Length - 2);
return text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
return text.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);
}
// 3. Shift_JIS (CP932)
@@ -104,11 +104,11 @@ namespace GameLauncher.Engines.Rgss.Games.IiniTitleRepair
}
var decoded = encoding.GetString(bytes);
return decoded.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
return decoded.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);
}
catch
{
return Array.Empty<string>();
return [];
}
}
}
+7 -12
View File
@@ -415,11 +415,11 @@ namespace GameLauncher.Engines.Rgss
{
if (game.ApplyMod)
{
return await ApplyModAsync(game, pluginSettings, rgssExtractorPath);
return await this.ApplyModAsync(game, pluginSettings, rgssExtractorPath);
}
else
{
return RestoreOriginal(game);
return this.RestoreOriginal(game);
}
}
@@ -439,7 +439,7 @@ namespace GameLauncher.Engines.Rgss
// 1. スクリプトファイルが存在しない場合(RGSS暗号化アーカイブ内の場合)、自動抽出
if (string.IsNullOrEmpty(scriptsPath) || !File.Exists(scriptsPath))
{
var (extractSuccess, extractMsg) = await ExtractScriptsAsync(game, rgssExtractorPath);
var (extractSuccess, extractMsg) = await this.ExtractScriptsAsync(game, rgssExtractorPath);
if (!extractSuccess)
{
return (false, $"スクリプトの抽出に失敗したため改造を適用できませんでした: {extractMsg}");
@@ -819,14 +819,13 @@ namespace GameLauncher.Engines.Rgss
if (parserType != null)
{
var parser = Activator.CreateInstance(parserType);
var parseFileMethod = parserType.GetMethod("parse_file", new[] { typeof(string) });
var parseFileMethod = parserType.GetMethod("parse_file", [typeof(string)]);
var getFileDataMethod = parserType.GetMethod("get_filedata");
var closeFileMethod = parserType.GetMethod("close_file");
if (parseFileMethod != null && getFileDataMethod != null && parser != null)
{
var entries = parseFileMethod.Invoke(parser, new object[] { archivePath }) as System.Collections.IEnumerable;
if (entries != null)
if (parseFileMethod.Invoke(parser, [archivePath]) is System.Collections.IEnumerable entries)
{
foreach (var entry in entries)
{
@@ -839,8 +838,7 @@ namespace GameLauncher.Engines.Rgss
(entryName.EndsWith(targetFileName, StringComparison.OrdinalIgnoreCase) ||
Path.GetFileName(entryName).Equals(targetFileName, StringComparison.OrdinalIgnoreCase)))
{
var fileBytes = getFileDataMethod.Invoke(parser, new object[] { entry }) as byte[];
if (fileBytes != null && fileBytes.Length > 0)
if (getFileDataMethod.Invoke(parser, [entry]) is byte[] fileBytes && fileBytes.Length > 0)
{
closeFileMethod?.Invoke(parser, null);
@@ -873,10 +871,7 @@ namespace GameLauncher.Engines.Rgss
};
using var proc = Process.Start(psi);
if (proc != null)
{
proc.WaitForExit(30000); // 最大30秒待機
}
proc?.WaitForExit(30000); // 最大30秒待機
// RGSS Extractor はツール自身のフォルダ配下に Data\Scripts.rvdata2 等を出力
var possibleOutput = Path.Combine(toolDir, "Data", targetFileName);
+12 -12
View File
@@ -513,7 +513,7 @@ namespace GameLauncher.Engines.Rgss
int endIdx = content.IndexOf(ModEndTag, StringComparison.Ordinal);
if (endIdx > startIdx)
{
content = content.Substring(0, startIdx).TrimEnd() + "\n\n" + modCode + "\n";
content = content[..startIdx].TrimEnd() + "\n\n" + modCode + "\n";
File.WriteAllText(scriptPath, content, Encoding.UTF8);
return;
}
@@ -562,7 +562,7 @@ namespace GameLauncher.Engines.Rgss
if (!SrpgArchiveService.IsExtracted(gameDir))
{
progress?.Report("アーカイブ(data.dts)を初回展開中...");
var unpackRes = await _archiveService.UnpackDataDtsAsync(gameDir, progress);
var unpackRes = await this._archiveService.UnpackDataDtsAsync(gameDir, progress);
if (!unpackRes.Success)
{
return unpackRes;
@@ -571,7 +571,7 @@ namespace GameLauncher.Engines.Rgss
var extractedDir = SrpgArchiveService.GetExtractedDirectory(gameDir);
progress?.Report("Modスクリプトを生成中...");
var modBody = GenerateModScript(item);
var modBody = this.GenerateModScript(item);
var jsContent = $"{ModStartTag}\n{modBody}\n{ModEndTag}";
// 2. 既存のスクリプトへ注入
@@ -604,7 +604,7 @@ namespace GameLauncher.Engines.Rgss
// 3. data.dts を再パック
progress?.Report("Modを適用した data.dts を再構築中...");
var repackRes = await _archiveService.RepackDataDtsAsync(gameDir, progress);
var repackRes = await this._archiveService.RepackDataDtsAsync(gameDir, progress);
if (repackRes.Success)
{
item.IsModded = true;
@@ -658,8 +658,8 @@ namespace GameLauncher.Engines.Rgss
// 2. バックアップが存在すればバックアップ復元を試行
progress?.Report("オリジナルバックアップから data.dts を復元中...");
var revertRes = await _archiveService.RevertBackupAsync(gameDir);
if (revertRes.Success)
var (Success, Message) = await this._archiveService.RevertBackupAsync(gameDir);
if (Success)
{
item.IsModded = false;
return (true, "改造プラグインを解除し、元のアーカイブへ復元しました。");
@@ -667,7 +667,7 @@ namespace GameLauncher.Engines.Rgss
// バックアップが無い場合は Mod解除状態で再パック
progress?.Report("Mod解除状態でアーカイブを再構築中...");
var repackRes = await _archiveService.RepackDataDtsAsync(gameDir, progress);
var repackRes = await this._archiveService.RepackDataDtsAsync(gameDir, progress);
if (repackRes.Success)
{
item.IsModded = false;
@@ -689,7 +689,7 @@ namespace GameLauncher.Engines.Rgss
// 1. プロキシDLL解除
if (IsProxyDllEnabled(gameDir))
{
DisableProxyDll(gameDir);
this.DisableProxyDll(gameDir);
logs.Add("・プロキシDLL (version.dll) を解除しました");
}
@@ -726,10 +726,10 @@ namespace GameLauncher.Engines.Rgss
// 3. バックアップからの data.dts 復元
progress?.Report("バックアップから元の data.dts を復元中...");
var revertRes = await _archiveService.RevertBackupAsync(gameDir);
if (revertRes.Success)
var (Success, Message) = await this._archiveService.RevertBackupAsync(gameDir);
if (Success)
{
logs.Add($"・{revertRes.Message}");
logs.Add($"・{Message}");
}
else
{
@@ -737,7 +737,7 @@ namespace GameLauncher.Engines.Rgss
}
// 4. 解凍フォルダの退避
var restoreExtractedRes = _archiveService.RestoreExtractedState(gameDir);
var restoreExtractedRes = this._archiveService.RestoreExtractedState(gameDir);
if (restoreExtractedRes.Success && !restoreExtractedRes.Message.Contains("存在しません"))
{
logs.Add($"・{restoreExtractedRes.Message}");
+251 -251
View File
@@ -28,62 +28,62 @@ namespace GameLauncher.Engines.Tkool
public bool SpeedUp
{
get => _speedUp;
set { if (_speedUp != value) { _speedUp = value; OnPropertyChanged(); } }
get => this._speedUp;
set { if (this._speedUp != value) { this._speedUp = value; this.OnPropertyChanged(); } }
}
public bool AntigravityGameTweaks
{
get => _antigravityGameTweaks;
set { if (_antigravityGameTweaks != value) { _antigravityGameTweaks = value; OnPropertyChanged(); } }
get => this._antigravityGameTweaks;
set { if (this._antigravityGameTweaks != value) { this._antigravityGameTweaks = value; this.OnPropertyChanged(); } }
}
public bool DropItem99
{
get => _dropItem99;
set { if (_dropItem99 != value) { _dropItem99 = value; OnPropertyChanged(); } }
get => this._dropItem99;
set { if (this._dropItem99 != value) { this._dropItem99 = value; this.OnPropertyChanged(); } }
}
public bool TurnStartFullRecover
{
get => _turnStartFullRecover;
set { if (_turnStartFullRecover != value) { _turnStartFullRecover = value; OnPropertyChanged(); } }
get => this._turnStartFullRecover;
set { if (this._turnStartFullRecover != value) { this._turnStartFullRecover = value; this.OnPropertyChanged(); } }
}
public bool TurnStartFullRecoverHp
{
get => _turnStartFullRecoverHp;
set { if (_turnStartFullRecoverHp != value) { _turnStartFullRecoverHp = value; OnPropertyChanged(); } }
get => this._turnStartFullRecoverHp;
set { if (this._turnStartFullRecoverHp != value) { this._turnStartFullRecoverHp = value; this.OnPropertyChanged(); } }
}
public bool TurnStartFullRecoverMp
{
get => _turnStartFullRecoverMp;
set { if (_turnStartFullRecoverMp != value) { _turnStartFullRecoverMp = value; OnPropertyChanged(); } }
get => this._turnStartFullRecoverMp;
set { if (this._turnStartFullRecoverMp != value) { this._turnStartFullRecoverMp = value; this.OnPropertyChanged(); } }
}
public bool TurnStartFullRecoverTp
{
get => _turnStartFullRecoverTp;
set { if (_turnStartFullRecoverTp != value) { _turnStartFullRecoverTp = value; OnPropertyChanged(); } }
get => this._turnStartFullRecoverTp;
set { if (this._turnStartFullRecoverTp != value) { this._turnStartFullRecoverTp = value; this.OnPropertyChanged(); } }
}
public bool MaxGainGold
{
get => _maxGainGold;
set { if (_maxGainGold != value) { _maxGainGold = value; OnPropertyChanged(); } }
get => this._maxGainGold;
set { if (this._maxGainGold != value) { this._maxGainGold = value; this.OnPropertyChanged(); } }
}
public bool MaxGainExp
{
get => _maxGainExp;
set { if (_maxGainExp != value) { _maxGainExp = value; OnPropertyChanged(); } }
get => this._maxGainExp;
set { if (this._maxGainExp != value) { this._maxGainExp = value; this.OnPropertyChanged(); } }
}
public bool InstantMessage
{
get => _instantMessage;
set { if (_instantMessage != value) { _instantMessage = value; OnPropertyChanged(); } }
get => this._instantMessage;
set { if (this._instantMessage != value) { this._instantMessage = value; this.OnPropertyChanged(); } }
}
public event System.ComponentModel.PropertyChangedEventHandler? PropertyChanged;
@@ -133,22 +133,22 @@ namespace GameLauncher.Engines.Tkool
/// <summary>Enigma Virtual Box でパックされた exe を持つゲームかどうか</summary>
public override bool IsEvbPacked
{
get => _isEvbPacked;
get => this._isEvbPacked;
set
{
if (_isEvbPacked != value)
if (this._isEvbPacked != value)
{
_isEvbPacked = value;
OnPropertyChanged();
OnPropertyChanged(nameof(IsEvb));
OnPropertyChanged(nameof(EvbBadgeVisibility));
OnPropertyChanged(nameof(EvbBadgeText));
OnPropertyChanged(nameof(EvbNeedsUnpackVisibility));
OnPropertyChanged(nameof(EvbNeedsUnpackBadgeText));
OnPropertyChanged(nameof(EvbExtractedVisibility));
OnPropertyChanged(nameof(EvbExtractedBadgeText));
OnPropertyChanged(nameof(EvbDetailStatusText));
OnPropertyChanged(nameof(IsEvbToolMissing));
this._isEvbPacked = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.IsEvb));
this.OnPropertyChanged(nameof(this.EvbBadgeVisibility));
this.OnPropertyChanged(nameof(this.EvbBadgeText));
this.OnPropertyChanged(nameof(this.EvbNeedsUnpackVisibility));
this.OnPropertyChanged(nameof(this.EvbNeedsUnpackBadgeText));
this.OnPropertyChanged(nameof(this.EvbExtractedVisibility));
this.OnPropertyChanged(nameof(this.EvbExtractedBadgeText));
this.OnPropertyChanged(nameof(this.EvbDetailStatusText));
this.OnPropertyChanged(nameof(this.IsEvbToolMissing));
}
}
}
@@ -156,20 +156,20 @@ namespace GameLauncher.Engines.Tkool
/// <summary>EVB 解凍済み(_evb_extracted に出力済み)かどうか</summary>
public override bool IsEvbExtracted
{
get => _isEvbExtracted;
get => this._isEvbExtracted;
set
{
if (_isEvbExtracted != value)
if (this._isEvbExtracted != value)
{
_isEvbExtracted = value;
OnPropertyChanged();
OnPropertyChanged(nameof(EvbBadgeVisibility));
OnPropertyChanged(nameof(EvbBadgeText));
OnPropertyChanged(nameof(EvbNeedsUnpackVisibility));
OnPropertyChanged(nameof(EvbNeedsUnpackBadgeText));
OnPropertyChanged(nameof(EvbExtractedVisibility));
OnPropertyChanged(nameof(EvbExtractedBadgeText));
OnPropertyChanged(nameof(EvbDetailStatusText));
this._isEvbExtracted = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.EvbBadgeVisibility));
this.OnPropertyChanged(nameof(this.EvbBadgeText));
this.OnPropertyChanged(nameof(this.EvbNeedsUnpackVisibility));
this.OnPropertyChanged(nameof(this.EvbNeedsUnpackBadgeText));
this.OnPropertyChanged(nameof(this.EvbExtractedVisibility));
this.OnPropertyChanged(nameof(this.EvbExtractedBadgeText));
this.OnPropertyChanged(nameof(this.EvbDetailStatusText));
}
}
}
@@ -177,76 +177,76 @@ namespace GameLauncher.Engines.Tkool
/// <summary>EVB 解凍先ディレクトリ(ゲームフォルダ内 _evb_extracted)</summary>
public string? EvbExtractedDirPath
{
get => _evbExtractedDirPath;
set { if (_evbExtractedDirPath != value) { _evbExtractedDirPath = value; OnPropertyChanged(); } }
get => this._evbExtractedDirPath;
set { if (this._evbExtractedDirPath != value) { this._evbExtractedDirPath = value; this.OnPropertyChanged(); } }
}
/// <summary>EVB 解凍時に作成した元 exe のバックアップパス(*.glbak)</summary>
public string? EvbBackupPath
{
get => _evbBackupPath;
set { if (_evbBackupPath != value) { _evbBackupPath = value; OnPropertyChanged(); } }
get => this._evbBackupPath;
set { if (this._evbBackupPath != value) { this._evbBackupPath = value; this.OnPropertyChanged(); } }
}
/// <summary>EVB 解凍後に再判定された本来のエンジン名</summary>
public string EvbUnderlyingEngine
{
get => _evbUnderlyingEngine;
set { if (_evbUnderlyingEngine != value) { _evbUnderlyingEngine = value; OnPropertyChanged(); OnPropertyChanged(nameof(EvbDetailStatusText)); } }
get => this._evbUnderlyingEngine;
set { if (this._evbUnderlyingEngine != value) { this._evbUnderlyingEngine = value; this.OnPropertyChanged(); this.OnPropertyChanged(nameof(this.EvbDetailStatusText)); } }
}
/// <summary>EVB として扱うか(UI バッジ判定用)</summary>
public override bool IsEvb => IsEvbPacked;
public override bool IsEvb => this.IsEvbPacked;
/// <summary>EVB バッジの可視性(実際にEVBで圧縮され解凍・管理対象のもののみ Visible)</summary>
public override Visibility EvbBadgeVisibility => IsEvbPacked ? Visibility.Visible : Visibility.Collapsed;
public override Visibility EvbBadgeVisibility => this.IsEvbPacked ? Visibility.Visible : Visibility.Collapsed;
/// <summary>
/// EVB バッジのテキスト。実際に Enigma Virtual Box でパックされているゲームのみ "EVB" を返し、
/// それ以外は空文字を返してバッジを非表示にする。
/// </summary>
public override string EvbBadgeText => IsEvbPacked ? "EVB" : string.Empty;
public override string EvbBadgeText => this.IsEvbPacked ? "EVB" : string.Empty;
/// <summary>
/// EVB「要解凍」バッジのテキスト。未解凍のときだけ "要解凍" を返し、それ以外は空文字を返す。
/// バッジはテキスト駆動(StringNotEmptyToVisibilityConverter)で表示制御されるため、
/// 無関係なゲームで空のバッジが描画されることはない。
/// </summary>
public override string EvbNeedsUnpackBadgeText => (IsEvbPacked && !IsEvbExtracted) ? "要解凍" : string.Empty;
public override string EvbNeedsUnpackBadgeText => (this.IsEvbPacked && !this.IsEvbExtracted) ? "要解凍" : string.Empty;
/// <summary>EVB 未解凍のときだけ「要解凍」を強調表示するための可視性(一目で分かる導線)</summary>
public override Visibility EvbNeedsUnpackVisibility => (IsEvbPacked && !IsEvbExtracted) ? Visibility.Visible : Visibility.Collapsed;
public override Visibility EvbNeedsUnpackVisibility => (this.IsEvbPacked && !this.IsEvbExtracted) ? Visibility.Visible : Visibility.Collapsed;
/// <summary>EVB 解凍済みのときだけ「解凍済み」ラベルを表示するための可視性(一目で分かる導線)</summary>
public override Visibility EvbExtractedVisibility => (IsEvbPacked && IsEvbExtracted) ? Visibility.Visible : Visibility.Collapsed;
public override Visibility EvbExtractedVisibility => (this.IsEvbPacked && this.IsEvbExtracted) ? Visibility.Visible : Visibility.Collapsed;
/// <summary>
/// EVB「解凍済み」ラベルのテキスト。EVB パック済みかつ解凍済みのときだけ "解凍済み" を返し、
/// それ以外は空文字を返して非表示にする。
/// </summary>
public override string EvbExtractedBadgeText => (IsEvbPacked && IsEvbExtracted) ? "解凍済み" : string.Empty;
public override string EvbExtractedBadgeText => (this.IsEvbPacked && this.IsEvbExtracted) ? "解凍済み" : string.Empty;
/// <summary>
/// Evb 解凍ツール(evbunpack.exe)が未配置かどうか。
/// 選択時のガイドで「README.md を参照してください」と案内するために使用します。
/// </summary>
public bool IsEvbToolMissing => IsEvbPacked && !Engines.Evb.EvbUnpackerToolProvider.IsAvailable();
public bool IsEvbToolMissing => this.IsEvbPacked && !Engines.Evb.EvbUnpackerToolProvider.IsAvailable();
/// <summary>EVB 詳細状態テキスト</summary>
public override string EvbDetailStatusText
{
get
{
if (!IsEvbPacked)
if (!this.IsEvbPacked)
{
return string.Empty;
}
var engine = string.IsNullOrWhiteSpace(EvbUnderlyingEngine) ? "未判定" : EvbUnderlyingEngine;
if (IsEvbToolMissing)
var engine = string.IsNullOrWhiteSpace(this.EvbUnderlyingEngine) ? "未判定" : this.EvbUnderlyingEngine;
if (this.IsEvbToolMissing)
{
return "evbunpack.exe が未配置です。Engines/Evb/Tools/evbunpack/README.md を参照してください。";
}
return IsEvbExtracted
return this.IsEvbExtracted
? $"Enigma Virtual Box パック済み(解凍済み / 本来: {engine})"
: $"Enigma Virtual Box パック済み(未解凍 / 本来: {engine})";
}
@@ -259,15 +259,15 @@ namespace GameLauncher.Engines.Tkool
/// </summary>
public string ResolveLaunchExecutable()
{
if (!IsEvbPacked || !IsEvbExtracted)
if (!this.IsEvbPacked || !this.IsEvbExtracted)
{
return ExecutablePath;
return this.ExecutablePath;
}
// 解凍先フォルダを決定する(保存済みパスが無ければゲームフォルダ配下から解決)。
var outputDir = !string.IsNullOrEmpty(EvbExtractedDirPath)
? EvbExtractedDirPath!
: GameLauncher.Engines.Evb.EvbUnpackService.GetExtractedDir(RootDirectory);
var outputDir = !string.IsNullOrEmpty(this.EvbExtractedDirPath)
? this.EvbExtractedDirPath!
: GameLauncher.Engines.Evb.EvbUnpackService.GetExtractedDir(this.RootDirectory);
// ExecutablePath が空の場合でも、解凍完了マーカーを確認したうえで
// 解凍後の exe を起動対象として復元する(再スキャン直後の起動失敗対策)。
@@ -277,27 +277,27 @@ namespace GameLauncher.Engines.Tkool
return exe!;
}
return ExecutablePath;
return this.ExecutablePath;
}
/// <summary>FOSSIL形態(FOSSILindex.html + 単体Game.exe、data/System.json はディスク上)かどうか</summary>
public bool IsFossilSingleExe
{
get => _isFossilSingleExe;
set { if (_isFossilSingleExe != value) { _isFossilSingleExe = value; OnPropertyChanged(); } }
get => this._isFossilSingleExe;
set { if (this._isFossilSingleExe != value) { this._isFossilSingleExe = value; this.OnPropertyChanged(); } }
}
/// <summary>boxed形態(ゲーム本体をexeへ内包、例: Game_boxed.exe)かどうか</summary>
public bool IsBoxedExe
{
get => _isBoxedExe;
set { if (_isBoxedExe != value) { _isBoxedExe = value; OnPropertyChanged(); } }
get => this._isBoxedExe;
set { if (this._isBoxedExe != value) { this._isBoxedExe = value; this.OnPropertyChanged(); } }
}
/// <summary>いずれかの単体exe梱包形態(FOSSIL / boxed)かどうか</summary>
public bool IsStandaloneExePackage => IsFossilSingleExe || IsBoxedExe;
public bool IsStandaloneExePackage => this.IsFossilSingleExe || this.IsBoxedExe;
public override GameEngineKind EngineKind => EngineType switch
public override GameEngineKind EngineKind => this.EngineType switch
{
TkoolEngineType.Tyrano => GameEngineKind.Tyrano,
TkoolEngineType.Wolf => GameEngineKind.Wolf,
@@ -309,31 +309,31 @@ namespace GameLauncher.Engines.Tkool
public string PluginsJsPath
{
get => _pluginsJsPath;
set { if (_pluginsJsPath != value) { _pluginsJsPath = value; OnPropertyChanged(); } }
get => this._pluginsJsPath;
set { if (this._pluginsJsPath != value) { this._pluginsJsPath = value; this.OnPropertyChanged(); } }
}
public string PluginsDirPath
{
get => _pluginsDirPath;
set { if (_pluginsDirPath != value) { _pluginsDirPath = value; OnPropertyChanged(); } }
get => this._pluginsDirPath;
set { if (this._pluginsDirPath != value) { this._pluginsDirPath = value; this.OnPropertyChanged(); } }
}
public override bool IsMV => EngineType == TkoolEngineType.MV;
public override bool IsMZ => EngineType == TkoolEngineType.MZ;
public override bool IsTyrano => EngineType == TkoolEngineType.Tyrano;
public override bool IsVX => EngineType == TkoolEngineType.VX;
public override bool IsVXAce => EngineType == TkoolEngineType.VXAce;
public override bool IsWolf => EngineType == TkoolEngineType.Wolf;
public override bool IsSrpgStudio => EngineType == TkoolEngineType.SrpgStudio;
public override bool IsRgss => EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce;
public override bool IsNwjs => EngineType == TkoolEngineType.Nwjs;
public override bool IsOther => EngineType == TkoolEngineType.Other;
public override bool IsMV => this.EngineType == TkoolEngineType.MV;
public override bool IsMZ => this.EngineType == TkoolEngineType.MZ;
public override bool IsTyrano => this.EngineType == TkoolEngineType.Tyrano;
public override bool IsVX => this.EngineType == TkoolEngineType.VX;
public override bool IsVXAce => this.EngineType == TkoolEngineType.VXAce;
public override bool IsWolf => this.EngineType == TkoolEngineType.Wolf;
public override bool IsSrpgStudio => this.EngineType == TkoolEngineType.SrpgStudio;
public override bool IsRgss => this.EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce;
public override bool IsNwjs => this.EngineType == TkoolEngineType.Nwjs;
public override bool IsOther => this.EngineType == TkoolEngineType.Other;
/// <summary>
/// エンジン種別ラベルの表示文字列。該当エンジンが無い場合は空文字を返し、ラベル自体を非表示にします。
/// </summary>
public override string EngineLabelText => EngineType switch
public override string EngineLabelText => this.EngineType switch
{
TkoolEngineType.MV => "MV",
TkoolEngineType.MZ => "MZ",
@@ -346,7 +346,7 @@ namespace GameLauncher.Engines.Tkool
};
/// <summary>エンジン種別ラベルの背景色</summary>
public override Brush EngineLabelBackground => EngineType switch
public override Brush EngineLabelBackground => this.EngineType switch
{
TkoolEngineType.MV => new SolidColorBrush(Color.FromRgb(0x8B, 0x1E, 0x3F)),
TkoolEngineType.MZ => new SolidColorBrush(Color.FromRgb(0x1E, 0x5F, 0x8B)),
@@ -360,15 +360,15 @@ namespace GameLauncher.Engines.Tkool
/// <summary>NW.jsバッジのテキスト</summary>
public override string NwjsBadgeText =>
EngineType == TkoolEngineType.Nwjs ? "NW.js" : string.Empty;
this.EngineType == TkoolEngineType.Nwjs ? "NW.js" : string.Empty;
/// <summary>NW.jsバッジの可視性</summary>
public override Visibility NwjsBadgeVisibility =>
EngineType == TkoolEngineType.Nwjs ? Visibility.Visible : Visibility.Collapsed;
this.EngineType == TkoolEngineType.Nwjs ? Visibility.Visible : Visibility.Collapsed;
/// <summary>その他バッジの可視性</summary>
public override Visibility OtherBadgeVisibility =>
EngineType == TkoolEngineType.Other ? Visibility.Visible : Visibility.Collapsed;
this.EngineType == TkoolEngineType.Other ? Visibility.Visible : Visibility.Collapsed;
/// <summary>
/// 「プリンセスシナジー」(ツクールMZ製・専用改造対象ゲーム)かどうか。
@@ -376,7 +376,7 @@ namespace GameLauncher.Engines.Tkool
/// これにより当該機能が他ゲームに表示・適用されるのを防ぎます。
/// </summary>
public override bool IsPrincessSynergy =>
!string.IsNullOrEmpty(Title) && Title.Contains("プリンセスシナジー");
!string.IsNullOrEmpty(this.Title) && this.Title.Contains("プリンセスシナジー");
// SRPG Studio アーカイブ関連プロパティ
private bool _hasSrpgArchive;
@@ -385,56 +385,56 @@ namespace GameLauncher.Engines.Tkool
public override bool HasSrpgArchive
{
get => _hasSrpgArchive;
get => this._hasSrpgArchive;
set
{
if (_hasSrpgArchive != value)
if (this._hasSrpgArchive != value)
{
_hasSrpgArchive = value;
OnPropertyChanged();
OnPropertyChanged(nameof(SrpgBadgeVisibility));
OnPropertyChanged(nameof(SrpgBadgeText));
OnPropertyChanged(nameof(SrpgBadgeBackground));
OnPropertyChanged(nameof(SrpgDetailStatusText));
this._hasSrpgArchive = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.SrpgBadgeVisibility));
this.OnPropertyChanged(nameof(this.SrpgBadgeText));
this.OnPropertyChanged(nameof(this.SrpgBadgeBackground));
this.OnPropertyChanged(nameof(this.SrpgDetailStatusText));
}
}
}
public override bool IsSrpgExtracted
{
get => _isSrpgExtracted;
get => this._isSrpgExtracted;
set
{
if (_isSrpgExtracted != value)
if (this._isSrpgExtracted != value)
{
_isSrpgExtracted = value;
OnPropertyChanged();
OnPropertyChanged(nameof(SrpgBadgeText));
OnPropertyChanged(nameof(SrpgBadgeBackground));
OnPropertyChanged(nameof(SrpgDetailStatusText));
this._isSrpgExtracted = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.SrpgBadgeText));
this.OnPropertyChanged(nameof(this.SrpgBadgeBackground));
this.OnPropertyChanged(nameof(this.SrpgDetailStatusText));
}
}
}
public string? SrpgArchivePath
{
get => _srpgArchivePath;
set { if (_srpgArchivePath != value) { _srpgArchivePath = value; OnPropertyChanged(); } }
get => this._srpgArchivePath;
set { if (this._srpgArchivePath != value) { this._srpgArchivePath = value; this.OnPropertyChanged(); } }
}
public override Visibility SrpgBadgeVisibility => (IsSrpgStudio && HasSrpgArchive) ? Visibility.Visible : Visibility.Collapsed;
public override Visibility SrpgBadgeVisibility => (this.IsSrpgStudio && this.HasSrpgArchive) ? Visibility.Visible : Visibility.Collapsed;
public override string SrpgBadgeText => !(IsSrpgStudio && HasSrpgArchive) ? string.Empty : (IsSrpgExtracted ? "SRPG (抽出済)" : "SRPG (暗号化)");
public override string SrpgBadgeText => !(this.IsSrpgStudio && this.HasSrpgArchive) ? string.Empty : (this.IsSrpgExtracted ? "SRPG (抽出済)" : "SRPG (暗号化)");
public override Brush SrpgBadgeBackground => !(IsSrpgStudio && HasSrpgArchive)
public override Brush SrpgBadgeBackground => !(this.IsSrpgStudio && this.HasSrpgArchive)
? Brushes.Transparent
: (IsSrpgExtracted
: (this.IsSrpgExtracted
? new SolidColorBrush(Color.FromRgb(0x00, 0x89, 0x7B))
: new SolidColorBrush(Color.FromRgb(0x09, 0x84, 0xE3)));
public override string SrpgDetailStatusText => !(IsSrpgStudio && HasSrpgArchive)
public override string SrpgDetailStatusText => !(this.IsSrpgStudio && this.HasSrpgArchive)
? string.Empty
: (IsSrpgExtracted ? "📦 SRPGアーカイブ(スクリプト/リソース抽出済み・改造可能)" : "🔒 SRPG暗号化アーカイブ(ボタンで抽出・改造・再構築可能)");
: (this.IsSrpgExtracted ? "📦 SRPGアーカイブ(スクリプト/リソース抽出済み・改造可能)" : "🔒 SRPG暗号化アーカイブ(ボタンで抽出・改造・再構築可能)");
// RGSS (VX / VX Ace) アーカイブ関連プロパティ
private bool _hasRgssArchive;
@@ -443,95 +443,95 @@ namespace GameLauncher.Engines.Tkool
public override bool HasRgssArchive
{
get => _hasRgssArchive;
get => this._hasRgssArchive;
set
{
if (_hasRgssArchive != value)
if (this._hasRgssArchive != value)
{
_hasRgssArchive = value;
OnPropertyChanged();
OnPropertyChanged(nameof(RgssBadgeVisibility));
OnPropertyChanged(nameof(RgssBadgeText));
OnPropertyChanged(nameof(RgssBadgeBackground));
OnPropertyChanged(nameof(RgssDetailStatusText));
this._hasRgssArchive = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.RgssBadgeVisibility));
this.OnPropertyChanged(nameof(this.RgssBadgeText));
this.OnPropertyChanged(nameof(this.RgssBadgeBackground));
this.OnPropertyChanged(nameof(this.RgssDetailStatusText));
}
}
}
public override bool IsRgssExtracted
{
get => _isRgssExtracted;
get => this._isRgssExtracted;
set
{
if (_isRgssExtracted != value)
if (this._isRgssExtracted != value)
{
_isRgssExtracted = value;
OnPropertyChanged();
OnPropertyChanged(nameof(RgssBadgeText));
OnPropertyChanged(nameof(RgssBadgeBackground));
OnPropertyChanged(nameof(RgssDetailStatusText));
this._isRgssExtracted = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.RgssBadgeText));
this.OnPropertyChanged(nameof(this.RgssBadgeBackground));
this.OnPropertyChanged(nameof(this.RgssDetailStatusText));
}
}
}
public string? RgssArchivePath
{
get => _rgssArchivePath;
set { if (_rgssArchivePath != value) { _rgssArchivePath = value; OnPropertyChanged(); } }
get => this._rgssArchivePath;
set { if (this._rgssArchivePath != value) { this._rgssArchivePath = value; this.OnPropertyChanged(); } }
}
public override Visibility RgssBadgeVisibility => (IsRgss && HasRgssArchive) ? Visibility.Visible : Visibility.Collapsed;
public override Visibility RgssBadgeVisibility => (this.IsRgss && this.HasRgssArchive) ? Visibility.Visible : Visibility.Collapsed;
public override string RgssBadgeText => !(IsRgss && HasRgssArchive) ? string.Empty : (IsRgssExtracted ? "RGSS (抽出済)" : "RGSS (暗号化)");
public override string RgssBadgeText => !(this.IsRgss && this.HasRgssArchive) ? string.Empty : (this.IsRgssExtracted ? "RGSS (抽出済)" : "RGSS (暗号化)");
public override Brush RgssBadgeBackground => !(IsRgss && HasRgssArchive)
public override Brush RgssBadgeBackground => !(this.IsRgss && this.HasRgssArchive)
? Brushes.Transparent
: (IsRgssExtracted
: (this.IsRgssExtracted
? new SolidColorBrush(Color.FromRgb(0x00, 0x89, 0x7B))
: new SolidColorBrush(Color.FromRgb(0xD3, 0x54, 0x00)));
public override string RgssDetailStatusText => !(IsRgss && HasRgssArchive)
public override string RgssDetailStatusText => !(this.IsRgss && this.HasRgssArchive)
? string.Empty
: (IsRgssExtracted ? "📦 RGSSアーカイブ(スクリプト抽出済み・改造可能)" : "🔒 RGSS暗号化アーカイブ(起動時またはボタンでスクリプト抽出可能)");
: (this.IsRgssExtracted ? "📦 RGSSアーカイブ(スクリプト抽出済み・改造可能)" : "🔒 RGSS暗号化アーカイブ(起動時またはボタンでスクリプト抽出可能)");
public TkoolEngineType EngineType
{
get => _engineType;
get => this._engineType;
set
{
if (_engineType != value)
if (this._engineType != value)
{
_engineType = value;
OnPropertyChanged();
OnPropertyChanged(nameof(EngineKind));
OnPropertyChanged(nameof(EngineDisplayName));
OnPropertyChanged(nameof(EngineLabelText));
OnPropertyChanged(nameof(EngineLabelBackground));
OnPropertyChanged(nameof(IsMV));
OnPropertyChanged(nameof(IsMZ));
OnPropertyChanged(nameof(IsTyrano));
OnPropertyChanged(nameof(IsVX));
OnPropertyChanged(nameof(IsVXAce));
OnPropertyChanged(nameof(IsWolf));
OnPropertyChanged(nameof(IsSrpgStudio));
OnPropertyChanged(nameof(IsRgss));
OnPropertyChanged(nameof(IsNwjs));
OnPropertyChanged(nameof(IsOther));
OnPropertyChanged(nameof(NwjsBadgeText));
OnPropertyChanged(nameof(NwjsBadgeVisibility));
OnPropertyChanged(nameof(OtherBadgeVisibility));
OnPropertyChanged(nameof(WolfArchiveBadgeVisibility));
OnPropertyChanged(nameof(WolfArchiveBadgeText));
OnPropertyChanged(nameof(WolfArchiveBadgeBackground));
OnPropertyChanged(nameof(WolfArchiveDetailStatusText));
OnPropertyChanged(nameof(SrpgBadgeVisibility));
OnPropertyChanged(nameof(SrpgBadgeText));
OnPropertyChanged(nameof(SrpgBadgeBackground));
OnPropertyChanged(nameof(SrpgDetailStatusText));
OnPropertyChanged(nameof(RgssBadgeVisibility));
OnPropertyChanged(nameof(RgssBadgeText));
OnPropertyChanged(nameof(RgssBadgeBackground));
OnPropertyChanged(nameof(RgssDetailStatusText));
this._engineType = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.EngineKind));
this.OnPropertyChanged(nameof(this.EngineDisplayName));
this.OnPropertyChanged(nameof(this.EngineLabelText));
this.OnPropertyChanged(nameof(this.EngineLabelBackground));
this.OnPropertyChanged(nameof(this.IsMV));
this.OnPropertyChanged(nameof(this.IsMZ));
this.OnPropertyChanged(nameof(this.IsTyrano));
this.OnPropertyChanged(nameof(this.IsVX));
this.OnPropertyChanged(nameof(this.IsVXAce));
this.OnPropertyChanged(nameof(this.IsWolf));
this.OnPropertyChanged(nameof(this.IsSrpgStudio));
this.OnPropertyChanged(nameof(this.IsRgss));
this.OnPropertyChanged(nameof(this.IsNwjs));
this.OnPropertyChanged(nameof(this.IsOther));
this.OnPropertyChanged(nameof(this.NwjsBadgeText));
this.OnPropertyChanged(nameof(this.NwjsBadgeVisibility));
this.OnPropertyChanged(nameof(this.OtherBadgeVisibility));
this.OnPropertyChanged(nameof(this.WolfArchiveBadgeVisibility));
this.OnPropertyChanged(nameof(this.WolfArchiveBadgeText));
this.OnPropertyChanged(nameof(this.WolfArchiveBadgeBackground));
this.OnPropertyChanged(nameof(this.WolfArchiveDetailStatusText));
this.OnPropertyChanged(nameof(this.SrpgBadgeVisibility));
this.OnPropertyChanged(nameof(this.SrpgBadgeText));
this.OnPropertyChanged(nameof(this.SrpgBadgeBackground));
this.OnPropertyChanged(nameof(this.SrpgDetailStatusText));
this.OnPropertyChanged(nameof(this.RgssBadgeVisibility));
this.OnPropertyChanged(nameof(this.RgssBadgeText));
this.OnPropertyChanged(nameof(this.RgssBadgeBackground));
this.OnPropertyChanged(nameof(this.RgssDetailStatusText));
}
}
}
@@ -545,31 +545,31 @@ namespace GameLauncher.Engines.Tkool
/// <summary>プロキシDLL(version.dll 倍速/メモリフック)を適用するか</summary>
public override bool WolfProxyDll
{
get => _wolfProxyDll;
set { if (_wolfProxyDll != value) { _wolfProxyDll = value; OnPropertyChanged(); } }
get => this._wolfProxyDll;
set { if (this._wolfProxyDll != value) { this._wolfProxyDll = value; this.OnPropertyChanged(); } }
}
/// <summary>プロキシDLLのスピード倍率</summary>
public double WolfSpeedMultiplier
{
get => _wolfSpeedMultiplier;
set { if (_wolfSpeedMultiplier != value) { _wolfSpeedMultiplier = value; OnPropertyChanged(); } }
get => this._wolfSpeedMultiplier;
set { if (this._wolfSpeedMultiplier != value) { this._wolfSpeedMultiplier = value; this.OnPropertyChanged(); } }
}
/// <summary>Data.wolf アーカイブが存在するか</summary>
public override bool HasWolfArchive
{
get => _hasWolfArchive;
get => this._hasWolfArchive;
set
{
if (_hasWolfArchive != value)
if (this._hasWolfArchive != value)
{
_hasWolfArchive = value;
OnPropertyChanged();
OnPropertyChanged(nameof(WolfArchiveBadgeVisibility));
OnPropertyChanged(nameof(WolfArchiveBadgeText));
OnPropertyChanged(nameof(WolfArchiveBadgeBackground));
OnPropertyChanged(nameof(WolfArchiveDetailStatusText));
this._hasWolfArchive = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.WolfArchiveBadgeVisibility));
this.OnPropertyChanged(nameof(this.WolfArchiveBadgeText));
this.OnPropertyChanged(nameof(this.WolfArchiveBadgeBackground));
this.OnPropertyChanged(nameof(this.WolfArchiveDetailStatusText));
}
}
}
@@ -577,31 +577,31 @@ namespace GameLauncher.Engines.Tkool
/// <summary>Data.wolf が解凍済み(Dataフォルダが存在)か</summary>
public override bool IsWolfExtracted
{
get => _isWolfExtracted;
get => this._isWolfExtracted;
set
{
if (_isWolfExtracted != value)
if (this._isWolfExtracted != value)
{
_isWolfExtracted = value;
OnPropertyChanged();
OnPropertyChanged(nameof(WolfArchiveBadgeVisibility));
OnPropertyChanged(nameof(WolfArchiveBadgeText));
OnPropertyChanged(nameof(WolfArchiveBadgeBackground));
OnPropertyChanged(nameof(WolfArchiveDetailStatusText));
this._isWolfExtracted = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.WolfArchiveBadgeVisibility));
this.OnPropertyChanged(nameof(this.WolfArchiveBadgeText));
this.OnPropertyChanged(nameof(this.WolfArchiveBadgeBackground));
this.OnPropertyChanged(nameof(this.WolfArchiveDetailStatusText));
}
}
}
public override Visibility WolfArchiveBadgeVisibility => (IsWolf && HasWolfArchive) ? Visibility.Visible : Visibility.Collapsed;
public override string WolfArchiveBadgeText => !(IsWolf && HasWolfArchive) ? string.Empty : (IsWolfExtracted ? "Data解凍済" : "Data.wolf保護");
public override Brush WolfArchiveBadgeBackground => !(IsWolf && HasWolfArchive)
public override Visibility WolfArchiveBadgeVisibility => (this.IsWolf && this.HasWolfArchive) ? Visibility.Visible : Visibility.Collapsed;
public override string WolfArchiveBadgeText => !(this.IsWolf && this.HasWolfArchive) ? string.Empty : (this.IsWolfExtracted ? "Data解凍済" : "Data.wolf保護");
public override Brush WolfArchiveBadgeBackground => !(this.IsWolf && this.HasWolfArchive)
? Brushes.Transparent
: (IsWolfExtracted
: (this.IsWolfExtracted
? new SolidColorBrush(Color.FromRgb(0x00, 0xB8, 0x94))
: new SolidColorBrush(Color.FromRgb(0x63, 0x6E, 0x72)));
public override string WolfArchiveDetailStatusText => !(IsWolf && HasWolfArchive)
public override string WolfArchiveDetailStatusText => !(this.IsWolf && this.HasWolfArchive)
? string.Empty
: (IsWolfExtracted
: (this.IsWolfExtracted
? "Data フォルダに解凍・抽出済みです。ウディタは Data フォルダのマップ・イベント・データベース等を優先して読み込みます。直接ファイルを改造できます。"
: "Data.wolf アーカイブで暗号化・保護されています。下の「Data.wolf を解凍」を実行すると、全データを展開して直接編集・改造可能になります。");
@@ -612,124 +612,124 @@ namespace GameLauncher.Engines.Tkool
/// <summary>SRPG Studio プロキシDLL(version.dll 倍速機能)を適用するか</summary>
public override bool SrpgProxyDll
{
get => _srpgProxyDll;
set { if (_srpgProxyDll != value) { _srpgProxyDll = value; OnPropertyChanged(); } }
get => this._srpgProxyDll;
set { if (this._srpgProxyDll != value) { this._srpgProxyDll = value; this.OnPropertyChanged(); } }
}
/// <summary>SRPG Studio プロキシDLLのスピード倍率</summary>
public double SrpgSpeedMultiplier
{
get => _srpgSpeedMultiplier;
set { if (_srpgSpeedMultiplier != value) { _srpgSpeedMultiplier = value; OnPropertyChanged(); } }
get => this._srpgSpeedMultiplier;
set { if (this._srpgSpeedMultiplier != value) { this._srpgSpeedMultiplier = value; this.OnPropertyChanged(); } }
}
/// <summary>SRPG Studio プラグイン改造オプション(PluginOptionsのエイリアス)</summary>
public ObservableCollection<ModPluginOptionItem> SrpgModOptions => PluginOptions;
public ObservableCollection<ModPluginOptionItem> SrpgModOptions => this.PluginOptions;
public override bool IsModded
{
get => _isModded;
set { if (_isModded != value) { _isModded = value; OnPropertyChanged(); } }
get => this._isModded;
set { if (this._isModded != value) { this._isModded = value; this.OnPropertyChanged(); } }
}
public bool HasCustomApplyMod
{
get => _hasCustomApplyMod;
set { if (_hasCustomApplyMod != value) { _hasCustomApplyMod = value; OnPropertyChanged(); } }
get => this._hasCustomApplyMod;
set { if (this._hasCustomApplyMod != value) { this._hasCustomApplyMod = value; this.OnPropertyChanged(); } }
}
public override bool ApplyMod
{
get => _applyMod;
get => this._applyMod;
set
{
if (_applyMod != value)
if (this._applyMod != value)
{
_applyMod = value;
if (!_isInitializingApplyMod)
this._applyMod = value;
if (!this._isInitializingApplyMod)
{
HasCustomApplyMod = true;
this.HasCustomApplyMod = true;
}
OnPropertyChanged();
this.OnPropertyChanged();
}
}
}
public void SetDefaultApplyMod(bool defaultVal)
{
if (!_hasCustomApplyMod)
if (!this._hasCustomApplyMod)
{
_isInitializingApplyMod = true;
_applyMod = defaultVal;
_isInitializingApplyMod = false;
OnPropertyChanged(nameof(ApplyMod));
this._isInitializingApplyMod = true;
this._applyMod = defaultVal;
this._isInitializingApplyMod = false;
this.OnPropertyChanged(nameof(this.ApplyMod));
}
}
public override bool IsAsar
{
get => _isAsar;
get => this._isAsar;
set
{
if (_isAsar != value)
if (this._isAsar != value)
{
_isAsar = value;
OnPropertyChanged();
OnPropertyChanged(nameof(AsarBadgeVisibility));
OnPropertyChanged(nameof(AsarBadgeText));
OnPropertyChanged(nameof(AsarBadgeBackground));
OnPropertyChanged(nameof(AsarDetailStatusText));
this._isAsar = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.AsarBadgeVisibility));
this.OnPropertyChanged(nameof(this.AsarBadgeText));
this.OnPropertyChanged(nameof(this.AsarBadgeBackground));
this.OnPropertyChanged(nameof(this.AsarDetailStatusText));
}
}
}
public override bool IsAsarExtracted
{
get => _isAsarExtracted;
get => this._isAsarExtracted;
set
{
if (_isAsarExtracted != value)
if (this._isAsarExtracted != value)
{
_isAsarExtracted = value;
OnPropertyChanged();
OnPropertyChanged(nameof(AsarBadgeText));
OnPropertyChanged(nameof(AsarBadgeBackground));
OnPropertyChanged(nameof(AsarDetailStatusText));
this._isAsarExtracted = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.AsarBadgeText));
this.OnPropertyChanged(nameof(this.AsarBadgeBackground));
this.OnPropertyChanged(nameof(this.AsarDetailStatusText));
}
}
}
public string? AsarPath
{
get => _asarPath;
set { if (_asarPath != value) { _asarPath = value; OnPropertyChanged(); } }
get => this._asarPath;
set { if (this._asarPath != value) { this._asarPath = value; this.OnPropertyChanged(); } }
}
public string? AsarExtractedDirPath
{
get => _asarExtractedDirPath;
set { if (_asarExtractedDirPath != value) { _asarExtractedDirPath = value; OnPropertyChanged(); } }
get => this._asarExtractedDirPath;
set { if (this._asarExtractedDirPath != value) { this._asarExtractedDirPath = value; this.OnPropertyChanged(); } }
}
public string? RelativePluginsJsInAsar
{
get => _relativePluginsJsInAsar;
set { if (_relativePluginsJsInAsar != value) { _relativePluginsJsInAsar = value; OnPropertyChanged(); } }
get => this._relativePluginsJsInAsar;
set { if (this._relativePluginsJsInAsar != value) { this._relativePluginsJsInAsar = value; this.OnPropertyChanged(); } }
}
public override Visibility AsarBadgeVisibility => IsAsar ? Visibility.Visible : Visibility.Collapsed;
public override Visibility AsarBadgeVisibility => this.IsAsar ? Visibility.Visible : Visibility.Collapsed;
public override string AsarBadgeText => !IsAsar ? string.Empty : (IsAsarExtracted ? "ASAR (解凍済)" : "ASAR (圧縮)");
public override string AsarBadgeText => !this.IsAsar ? string.Empty : (this.IsAsarExtracted ? "ASAR (解凍済)" : "ASAR (圧縮)");
public override Brush AsarBadgeBackground => !IsAsar
public override Brush AsarBadgeBackground => !this.IsAsar
? Brushes.Transparent
: (IsAsarExtracted
: (this.IsAsarExtracted
? new SolidColorBrush(Color.FromRgb(0x00, 0x89, 0x7B))
: new SolidColorBrush(Color.FromRgb(0x5E, 0x35, 0xB1)));
public override string AsarDetailStatusText => !IsAsar
public override string AsarDetailStatusText => !this.IsAsar
? string.Empty
: (IsAsarExtracted ? "📦 app.asar 形式(解凍済み・改造可能)" : "📦 app.asar 形式(圧縮中・起動時またはボタンで解凍可能)");
: (this.IsAsarExtracted ? "📦 app.asar 形式(解凍済み・改造可能)" : "📦 app.asar 形式(圧縮中・起動時またはボタンで解凍可能)");
private Dictionary<string, bool> _pluginSettings = new(StringComparer.OrdinalIgnoreCase);
private ObservableCollection<ModPluginOptionItem> _pluginOptions = [];
@@ -810,14 +810,14 @@ namespace GameLauncher.Engines.Tkool
public bool IsPluginEnabled(string pluginId, Dictionary<string, bool>? defaultSettings = null, bool fallbackVal = true)
{
if (_pluginSettings.TryGetValue(pluginId, out var val))
if (this._pluginSettings.TryGetValue(pluginId, out var val))
{
return val;
}
if (pluginId is "BattleTurnRecoverHp" or "BattleTurnRecoverMp" or "BattleTurnRecoverTp")
{
if (_pluginSettings.TryGetValue("BattleTurnRecover", out var legacyVal))
if (this._pluginSettings.TryGetValue("BattleTurnRecover", out var legacyVal))
{
return legacyVal;
}
@@ -969,11 +969,11 @@ namespace GameLauncher.Engines.Tkool
public ModPluginOptions ModOptions
{
get => _modOptions;
set { if (_modOptions != value) { _modOptions = value; OnPropertyChanged(); } }
get => this._modOptions;
set { if (this._modOptions != value) { this._modOptions = value; this.OnPropertyChanged(); } }
}
public string EngineDisplayName => EngineType switch
public string EngineDisplayName => this.EngineType switch
{
TkoolEngineType.MV => "RPGツクールMV",
TkoolEngineType.MZ => "RPGツクールMZ",
+3 -3
View File
@@ -159,9 +159,9 @@ namespace GameLauncher.Engines.Tkool
var entry = $"{BeginMarker}{{\"name\":\"{ModPluginId}\",\"status\":true,\"description\":\"GameLauncher mod\",\"parameters\":{{}}}}{EndMarker}";
var prefix = content.Substring(0, arrayStart + 1);
var prefix = content[..(arrayStart + 1)];
var inner = content.Substring(arrayStart + 1, arrayEnd - arrayStart - 1);
var suffix = content.Substring(arrayEnd);
var suffix = content[arrayEnd..];
var trimmedInner = inner.Trim();
var newInner = string.IsNullOrEmpty(trimmedInner)
@@ -198,7 +198,7 @@ namespace GameLauncher.Engines.Tkool
while (scan >= 0 && char.IsWhiteSpace(content[scan])) scan--;
if (scan >= 0 && content[scan] == ',') cutStart = scan;
content = content.Substring(0, cutStart) + content.Substring(end);
content = content[..cutStart] + content[end..];
}
while (content != prev);
+16 -18
View File
@@ -41,11 +41,11 @@ namespace GameLauncher.Engines.Tkool
private List<ModPluginDefinition> _availablePlugins = [];
/// <summary>現在認識されている利用可能なプラグイン一覧</summary>
public IReadOnlyList<ModPluginDefinition> AvailablePlugins => _availablePlugins;
public IReadOnlyList<ModPluginDefinition> AvailablePlugins => this._availablePlugins;
public TkoolModService()
{
LoadAvailablePlugins();
this.LoadAvailablePlugins();
}
/// <summary>
@@ -105,7 +105,7 @@ namespace GameLauncher.Engines.Tkool
}
}
_availablePlugins = list;
this._availablePlugins = list;
return list;
}
@@ -159,11 +159,11 @@ namespace GameLauncher.Engines.Tkool
{
if (game.ApplyMod)
{
return ApplyMod(game, defaultSettings);
return this.ApplyMod(game, defaultSettings);
}
else
{
return RestoreOriginal(game);
return this.RestoreOriginal(game);
}
}
catch (Exception ex)
@@ -216,18 +216,16 @@ namespace GameLauncher.Engines.Tkool
string baseContent = File.ReadAllText(backupPath, Encoding.UTF8);
// 最新の動的プラグイン一覧を取得
if (_availablePlugins.Count == 0)
if (this._availablePlugins.Count == 0)
{
LoadAvailablePlugins();
this.LoadAvailablePlugins();
}
// 有効化対象のプラグインを取得
// ※ResourceLoaderFix はリソース読み込み不具合の必須救済プラグインのため、常に有効化・先頭配置
var fixPlugin = _availablePlugins.FirstOrDefault(p => string.Equals(p.Id, "ResourceLoaderFix", StringComparison.OrdinalIgnoreCase));
var pluginsToEnable = _availablePlugins
.Where(p => string.Equals(p.Id, "ResourceLoaderFix", StringComparison.OrdinalIgnoreCase)
? true
: game.IsPluginEnabled(p.Id, defaultSettings, fallbackVal: true))
var fixPlugin = this._availablePlugins.FirstOrDefault(p => string.Equals(p.Id, "ResourceLoaderFix", StringComparison.OrdinalIgnoreCase));
var pluginsToEnable = this._availablePlugins
.Where(p => string.Equals(p.Id, "ResourceLoaderFix", StringComparison.OrdinalIgnoreCase) || game.IsPluginEnabled(p.Id, defaultSettings, fallbackVal: true))
.ToList();
// ResourceLoaderFix を最優先(先頭)に配置して、他プラグイン実行前のリソース要求も確実に救済
@@ -238,7 +236,7 @@ namespace GameLauncher.Engines.Tkool
}
// 3. ゲーム側の plugins ディレクトリから不要な旧プラグインや無効プラグインを安全に掃除
var allManaged = GetAllManagedPluginNames(_availablePlugins);
var allManaged = GetAllManagedPluginNames(this._availablePlugins);
var enabledIds = new HashSet<string>(pluginsToEnable.Select(p => p.Id), StringComparer.OrdinalIgnoreCase);
foreach (var pluginId in allManaged)
@@ -257,7 +255,7 @@ namespace GameLauncher.Engines.Tkool
// 4. 有効対象のプラグインファイルをゲーム側へ配置
foreach (var plugin in pluginsToEnable)
{
CopyPluginToGame(plugin, pluginsDir);
this.CopyPluginToGame(plugin, pluginsDir);
}
// 5. plugins.js をパース・再構築して有効プラグインを追加
@@ -309,7 +307,7 @@ namespace GameLauncher.Engines.Tkool
// 2. ゲーム側の plugins フォルダから新旧すべてのプラグインファイルを安全に削除(ゴミを残さない)
if (!string.IsNullOrEmpty(pluginsDir) && Directory.Exists(pluginsDir))
{
var allManaged = GetAllManagedPluginNames(_availablePlugins);
var allManaged = GetAllManagedPluginNames(this._availablePlugins);
foreach (var pluginName in allManaged)
{
var targetFile = Path.Combine(pluginsDir, $"{pluginName}.js");
@@ -356,9 +354,9 @@ namespace GameLauncher.Engines.Tkool
return content;
}
string prefix = content.Substring(0, arrayStart + 1);
string prefix = content[..(arrayStart + 1)];
string inner = content.Substring(arrayStart + 1, arrayEnd - arrayStart - 1);
string suffix = content.Substring(arrayEnd);
string suffix = content[arrayEnd..];
// 新旧すべてのプラグイン名を除去対象とする
var managedSet = GetAllManagedPluginNames();
@@ -412,7 +410,7 @@ namespace GameLauncher.Engines.Tkool
if (depth == 0)
{
string objText = inner.Substring(objStart, i - objStart).Trim();
string objText = inner[objStart..i].Trim();
// このオブジェクトが新旧管理対象プラグインかどうか判定
var match = Regex.Match(objText, @"""name""\s*:\s*""([^""]+)""");
if (match.Success && managedSet.Contains(match.Groups[1].Value))
+2 -2
View File
@@ -297,7 +297,7 @@ namespace GameLauncher.Engines.Tkool
// 拡張子がある場合とない場合(.png を補完)を検討
var extensionsToCheck = string.IsNullOrEmpty(reqExt)
? new[] { ".png", ".ogg", ".m4a" }
: new[] { reqExt };
: [reqExt];
foreach (var ext in extensionsToCheck)
{
@@ -513,7 +513,7 @@ namespace GameLauncher.Engines.Tkool
bytes.Add(Convert.ToByte(hexPart.Substring(i + 1, 2), 16));
}
}
return Encoding.UTF8.GetString(bytes.ToArray());
return Encoding.UTF8.GetString([.. bytes]);
}
catch
{
+32 -32
View File
@@ -21,22 +21,22 @@ namespace GameLauncher.Engines.Unity
/// <summary>[Game]_Data ディレクトリ絶対パス</summary>
public string DataDirectoryPath
{
get => _dataDirectoryPath;
set { if (_dataDirectoryPath != value) { _dataDirectoryPath = value; OnPropertyChanged(); } }
get => this._dataDirectoryPath;
set { if (this._dataDirectoryPath != value) { this._dataDirectoryPath = value; this.OnPropertyChanged(); } }
}
/// <summary>app.info 由来の会社名/開発者名</summary>
public string CompanyName
{
get => _companyName;
get => this._companyName;
set
{
if (_companyName != value)
if (this._companyName != value)
{
_companyName = value;
OnPropertyChanged();
OnPropertyChanged(nameof(RegistryPath));
OnPropertyChanged(nameof(LocalLowPath));
this._companyName = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.RegistryPath));
this.OnPropertyChanged(nameof(this.LocalLowPath));
}
}
}
@@ -44,35 +44,35 @@ namespace GameLauncher.Engines.Unity
/// <summary>app.info 由来の製品名</summary>
public string ProductName
{
get => _productName;
get => this._productName;
set
{
if (_productName != value)
if (this._productName != value)
{
_productName = value;
OnPropertyChanged();
OnPropertyChanged(nameof(RegistryPath));
OnPropertyChanged(nameof(LocalLowPath));
this._productName = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.RegistryPath));
this.OnPropertyChanged(nameof(this.LocalLowPath));
}
}
}
public override bool IsIL2CPP => BackendType == UnityBackendType.IL2CPP;
public override bool IsMono => BackendType == UnityBackendType.Mono;
public override bool IsIL2CPP => this.BackendType == UnityBackendType.IL2CPP;
public override bool IsMono => this.BackendType == UnityBackendType.Mono;
/// <summary>バックエンド形式 (IL2CPP / Mono)</summary>
public UnityBackendType BackendType
{
get => _backendType;
get => this._backendType;
set
{
if (_backendType != value)
if (this._backendType != value)
{
_backendType = value;
OnPropertyChanged();
OnPropertyChanged(nameof(BackendBadgeText));
OnPropertyChanged(nameof(IsIL2CPP));
OnPropertyChanged(nameof(IsMono));
this._backendType = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.BackendBadgeText));
this.OnPropertyChanged(nameof(this.IsIL2CPP));
this.OnPropertyChanged(nameof(this.IsMono));
}
}
}
@@ -80,15 +80,15 @@ namespace GameLauncher.Engines.Unity
/// <summary>Unityバージョン文字列</summary>
public override string UnityVersion
{
get => _unityVersion;
set { if (_unityVersion != value) { _unityVersion = value; OnPropertyChanged(); } }
get => this._unityVersion;
set { if (this._unityVersion != value) { this._unityVersion = value; this.OnPropertyChanged(); } }
}
/// <summary>セーブデータ(レジストリまたはファイル)が検出されたかどうか</summary>
public override bool HasSaveData
{
get => _hasSaveData;
set { if (_hasSaveData != value) { _hasSaveData = value; OnPropertyChanged(); } }
get => this._hasSaveData;
set { if (this._hasSaveData != value) { this._hasSaveData = value; this.OnPropertyChanged(); } }
}
/// <summary>
@@ -99,9 +99,9 @@ namespace GameLauncher.Engines.Unity
{
get
{
if (string.IsNullOrEmpty(CompanyName) || string.IsNullOrEmpty(ProductName))
if (string.IsNullOrEmpty(this.CompanyName) || string.IsNullOrEmpty(this.ProductName))
return string.Empty;
return $@"Software\{CompanyName}\{ProductName}";
return $@"Software\{this.CompanyName}\{this.ProductName}";
}
}
@@ -113,18 +113,18 @@ namespace GameLauncher.Engines.Unity
{
get
{
if (string.IsNullOrEmpty(CompanyName) || string.IsNullOrEmpty(ProductName))
if (string.IsNullOrEmpty(this.CompanyName) || string.IsNullOrEmpty(this.ProductName))
return string.Empty;
var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
var appData = Path.GetDirectoryName(localAppData);
if (string.IsNullOrEmpty(appData)) return string.Empty;
return Path.Combine(appData, "LocalLow", CompanyName, ProductName);
return Path.Combine(appData, "LocalLow", this.CompanyName, this.ProductName);
}
}
public override string BackendBadgeText => BackendType switch
public override string BackendBadgeText => this.BackendType switch
{
UnityBackendType.IL2CPP => "IL2CPP",
UnityBackendType.Mono => "Mono",
+37 -37
View File
@@ -28,35 +28,35 @@ namespace GameLauncher.Engines.Unity
/// <summary>レジストリの生キー名(例: ClearedLevel_h1378399435)</summary>
public string RawKey
{
get => _rawKey;
set { if (_rawKey != value) { _rawKey = value; OnPropertyChanged(); } }
get => this._rawKey;
set { if (this._rawKey != value) { this._rawKey = value; this.OnPropertyChanged(); } }
}
/// <summary>Unityのハッシュを除去した整形式キー名(例: ClearedLevel)</summary>
public string CleanKey
{
get => _cleanKey;
set { if (_cleanKey != value) { _cleanKey = value; OnPropertyChanged(); } }
get => this._cleanKey;
set { if (this._cleanKey != value) { this._cleanKey = value; this.OnPropertyChanged(); } }
}
/// <summary>値のデータ型</summary>
public PlayerPrefsType Type
{
get => _type;
set { if (_type != value) { _type = value; OnPropertyChanged(); OnPropertyChanged(nameof(TypeDisplay)); } }
get => this._type;
set { if (this._type != value) { this._type = value; this.OnPropertyChanged(); this.OnPropertyChanged(nameof(this.TypeDisplay)); } }
}
/// <summary>実際の値(int, float, string, byte[])</summary>
public object? Value
{
get => _value;
get => this._value;
set
{
if (!Equals(_value, value))
if (!Equals(this._value, value))
{
_value = value;
OnPropertyChanged();
UpdateEditValue();
this._value = value;
this.OnPropertyChanged();
this.UpdateEditValue();
}
}
}
@@ -64,15 +64,15 @@ namespace GameLauncher.Engines.Unity
/// <summary>UI表示・編集用の文字列値</summary>
public string EditValue
{
get => _editValue;
get => this._editValue;
set
{
if (_editValue != value)
if (this._editValue != value)
{
_editValue = value;
_isModified = true;
OnPropertyChanged();
OnPropertyChanged(nameof(IsModified));
this._editValue = value;
this._isModified = true;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.IsModified));
}
}
}
@@ -80,11 +80,11 @@ namespace GameLauncher.Engines.Unity
/// <summary>値が変更されたかどうか</summary>
public bool IsModified
{
get => _isModified;
set { if (_isModified != value) { _isModified = value; OnPropertyChanged(); } }
get => this._isModified;
set { if (this._isModified != value) { this._isModified = value; this.OnPropertyChanged(); } }
}
public string TypeDisplay => Type switch
public string TypeDisplay => this.Type switch
{
PlayerPrefsType.Int => "Int (数値)",
PlayerPrefsType.Float => "Float (小数)",
@@ -95,19 +95,19 @@ namespace GameLauncher.Engines.Unity
private void UpdateEditValue()
{
if (_value == null)
if (this._value == null)
{
_editValue = string.Empty;
this._editValue = string.Empty;
}
else if (_value is byte[] bytes)
else if (this._value is byte[] bytes)
{
try
{
var text = System.Text.Encoding.UTF8.GetString(bytes).TrimEnd('\0');
if (text.All(c => !char.IsControl(c) || c == '\r' || c == '\n' || c == '\t'))
{
_editValue = text;
_type = PlayerPrefsType.String;
this._editValue = text;
this._type = PlayerPrefsType.String;
return;
}
}
@@ -118,21 +118,21 @@ namespace GameLauncher.Engines.Unity
float f = BitConverter.ToSingle(bytes, 0);
if (!float.IsNaN(f) && !float.IsInfinity(f))
{
_editValue = f.ToString("G");
_type = PlayerPrefsType.Float;
this._editValue = f.ToString("G");
this._type = PlayerPrefsType.Float;
return;
}
}
_editValue = BitConverter.ToString(bytes).Replace("-", " ");
this._editValue = BitConverter.ToString(bytes).Replace("-", " ");
}
else
{
_editValue = _value.ToString() ?? string.Empty;
this._editValue = this._value.ToString() ?? string.Empty;
}
_isModified = false;
OnPropertyChanged(nameof(EditValue));
OnPropertyChanged(nameof(IsModified));
this._isModified = false;
this.OnPropertyChanged(nameof(this.EditValue));
this.OnPropertyChanged(nameof(this.IsModified));
}
}
@@ -152,13 +152,13 @@ namespace GameLauncher.Engines.Unity
{
get
{
if (FileSize < 1024) return $"{FileSize} B";
if (FileSize < 1024 * 1024) return $"{FileSize / 1024.0:F1} KB";
return $"{FileSize / (1024.0 * 1024.0):F2} MB";
if (this.FileSize < 1024) return $"{this.FileSize} B";
if (this.FileSize < 1024 * 1024) return $"{this.FileSize / 1024.0:F1} KB";
return $"{this.FileSize / (1024.0 * 1024.0):F2} MB";
}
}
public string LastModifiedDisplay => LastModified.ToString("yyyy/MM/dd HH:mm:ss");
public string LastModifiedDisplay => this.LastModified.ToString("yyyy/MM/dd HH:mm:ss");
}
/// <summary>
@@ -172,6 +172,6 @@ namespace GameLauncher.Engines.Unity
public string BackupType { get; set; } = string.Empty; // "Registry (.reg)" または "ファイル"
public string Note { get; set; } = string.Empty;
public string TimestampDisplay => Timestamp.ToString("yyyy/MM/dd HH:mm:ss");
public string TimestampDisplay => this.Timestamp.ToString("yyyy/MM/dd HH:mm:ss");
}
}
+9 -9
View File
@@ -81,7 +81,7 @@ namespace GameLauncher.Engines.Unity
catch { }
// キー名昇順でソート
return list.OrderBy(e => e.CleanKey, StringComparer.OrdinalIgnoreCase).ToList();
return [.. list.OrderBy(e => e.CleanKey, StringComparer.OrdinalIgnoreCase)];
}
/// <summary>
@@ -319,7 +319,7 @@ namespace GameLauncher.Engines.Unity
proc?.WaitForExit(3000);
// JSONバックアップも併せて出力
var entries = GetPlayerPrefs(registryPath);
var entries = this.GetPlayerPrefs(registryPath);
var jsonBackupFile = Path.Combine(backupDir, $"PlayerPrefs_{timestamp}.json");
var serializableList = entries.Select(e => new
{
@@ -416,7 +416,7 @@ namespace GameLauncher.Engines.Unity
FileSize = fi.Length,
LastModified = fi.LastWriteTime,
LocationType = "LocalLow",
IsTextOrJson = CheckIsTextOrJson(f)
IsTextOrJson = this.CheckIsTextOrJson(f)
});
}
}
@@ -429,7 +429,7 @@ namespace GameLauncher.Engines.Unity
try
{
// ルート直下
CollectCandidateFiles(game.RootDirectory, "ゲームフォルダ", list);
this.CollectCandidateFiles(game.RootDirectory, "ゲームフォルダ", list);
// Save / SaveData / saves / savedata サブフォルダ
var subNames = new[] { "Save", "SaveData", "saves", "savedata", "Save_Data" };
@@ -438,21 +438,21 @@ namespace GameLauncher.Engines.Unity
var subPath = Path.Combine(game.RootDirectory, sub);
if (Directory.Exists(subPath))
{
CollectCandidateFiles(subPath, "ゲームフォルダ/" + sub, list, isStrict: false);
this.CollectCandidateFiles(subPath, "ゲームフォルダ/" + sub, list, isStrict: false);
}
}
// Dataフォルダ直下のセーブファイル候補
if (!string.IsNullOrEmpty(game.DataDirectoryPath) && Directory.Exists(game.DataDirectoryPath))
{
CollectCandidateFiles(game.DataDirectoryPath, "Dataフォルダ", list);
this.CollectCandidateFiles(game.DataDirectoryPath, "Dataフォルダ", list);
}
}
catch { }
}
// 更新日時降順でソート
return list.OrderByDescending(f => f.LastModified).ToList();
return [.. list.OrderByDescending(f => f.LastModified)];
}
private void CollectCandidateFiles(string dir, string locationLabel, List<SaveFileEntry> list, bool isStrict = true)
@@ -494,7 +494,7 @@ namespace GameLauncher.Engines.Unity
FileSize = fi.Length,
LastModified = fi.LastWriteTime,
LocationType = locationLabel,
IsTextOrJson = CheckIsTextOrJson(f)
IsTextOrJson = this.CheckIsTextOrJson(f)
});
}
}
@@ -649,7 +649,7 @@ namespace GameLauncher.Engines.Unity
}
catch { }
return list.OrderByDescending(b => b.Timestamp).ToList();
return [.. list.OrderByDescending(b => b.Timestamp)];
}
/// <summary>
+1 -1
View File
@@ -85,7 +85,7 @@ namespace GameLauncher.Engines.Wolf
return (false, "ゲームのルートディレクトリが見つかりません。");
}
var extractorPath = ResolveExtractorPath(customExtractorPath);
var extractorPath = this.ResolveExtractorPath(customExtractorPath);
if (string.IsNullOrEmpty(extractorPath) || !File.Exists(extractorPath))
{
return (false, "Wolf RPG アーカイブ解凍ツール(UberWolfCli.exe / WolfDec.exe)が見つかりません。設定ダイアログからツールのパスを指定してください。");
+3 -3
View File
@@ -51,7 +51,7 @@ namespace GameLauncher.Engines.Wolf
try
{
// 1. プロキシDLL本体の探索 (Tools\speedhack-i686\version.dll)
var sourceDllPath = ResolveProxyDllPath();
var sourceDllPath = this.ResolveProxyDllPath();
if (string.IsNullOrEmpty(sourceDllPath) || !File.Exists(sourceDllPath))
{
return (false, "プロキシDLL(Engines\\Wolf\\Tools\\speedhack-i686\\version.dll)が見つかりません。");
@@ -73,7 +73,7 @@ namespace GameLauncher.Engines.Wolf
File.Copy(sourceDllPath, targetDllPath, overwrite: true);
// 4. speedhack_config.json の生成・書き込み
var configContent = GenerateSpeedhackConfig(baseSpeed, toggleSpeed, holdSpeed);
var configContent = this.GenerateSpeedhackConfig(baseSpeed, toggleSpeed, holdSpeed);
File.WriteAllText(targetConfigPath, configContent, new UTF8Encoding(false));
game.WolfProxyDll = true;
@@ -138,7 +138,7 @@ namespace GameLauncher.Engines.Wolf
var sb = new StringBuilder();
// 1. プロキシDLLの解除
var (dllSuccess, dllMsg) = RemoveProxyDll(game);
var (dllSuccess, dllMsg) = this.RemoveProxyDll(game);
sb.AppendLine(dllMsg);
// 2. Game.exe バックアップからの復元(存在する場合)
+6 -6
View File
@@ -108,7 +108,7 @@ namespace GameLauncher.Engines.Wolf
catch { }
}
return result.Distinct(StringComparer.OrdinalIgnoreCase).ToList();
return [.. result.Distinct(StringComparer.OrdinalIgnoreCase)];
}
/// <summary>
@@ -186,7 +186,7 @@ namespace GameLauncher.Engines.Wolf
throw new FileNotFoundException($"セーブデータファイルが見つかりません: {filePath}");
byte[] rawBytes = File.ReadAllBytes(filePath);
byte[] decrypted = Decrypt(rawBytes);
byte[] decrypted = this.Decrypt(rawBytes);
var result = new WolfSaveData
{
@@ -217,10 +217,10 @@ namespace GameLauncher.Engines.Wolf
}
// セーブデータ内の全文字列スキャン
ScanStrings(result, decrypted, enc);
this.ScanStrings(result, decrypted, enc);
// セーブデータ内の通常変数スキャン
ScanVariables(result, decrypted);
this.ScanVariables(result, decrypted);
return result;
}
@@ -293,7 +293,7 @@ namespace GameLauncher.Engines.Wolf
throw new InvalidOperationException("保存対象のデータが空です。");
// 1. バックアップ作成 (Backups フォルダへ)
string? backupPath = BackupSaveFile(model.FilePath, folderName, rootDirectory);
string? backupPath = this.BackupSaveFile(model.FilePath, folderName, rootDirectory);
// 2. 変数・項目の変更を RawDecryptedBytes に書き戻し
foreach (var item in model.Variables)
@@ -306,7 +306,7 @@ namespace GameLauncher.Engines.Wolf
}
// 3. 暗号化 & チェックサム再計算
byte[] encrypted = Encrypt(model.RawDecryptedBytes);
byte[] encrypted = this.Encrypt(model.RawDecryptedBytes);
// 4. アトミック書き込み
string tempFile = model.FilePath + ".tmp_" + Guid.NewGuid().ToString("N");