626 lines
27 KiB
C#
626 lines
27 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Collections.ObjectModel;
|
||
using System.IO;
|
||
using System.Linq;
|
||
using System.Windows;
|
||
using System.Windows.Media;
|
||
|
||
namespace GameLauncher.Models
|
||
{
|
||
/// <summary>
|
||
/// 各プラグイン改造の個別有効/無効オプション(互換用)
|
||
/// </summary>
|
||
public class ModPluginOptions : System.ComponentModel.INotifyPropertyChanged
|
||
{
|
||
private bool _speedUp = true;
|
||
private bool _antigravityGameTweaks = true;
|
||
private bool _dropItem99 = true;
|
||
private bool _turnStartFullRecover = true;
|
||
private bool _turnStartFullRecoverHp = true;
|
||
private bool _turnStartFullRecoverMp = true;
|
||
private bool _turnStartFullRecoverTp = true;
|
||
private bool _maxGainGold = true;
|
||
private bool _maxGainExp = true;
|
||
private bool _instantMessage = true;
|
||
|
||
public bool SpeedUp
|
||
{
|
||
get => _speedUp;
|
||
set { if (_speedUp != value) { _speedUp = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool AntigravityGameTweaks
|
||
{
|
||
get => _antigravityGameTweaks;
|
||
set { if (_antigravityGameTweaks != value) { _antigravityGameTweaks = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool DropItem99
|
||
{
|
||
get => _dropItem99;
|
||
set { if (_dropItem99 != value) { _dropItem99 = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool TurnStartFullRecover
|
||
{
|
||
get => _turnStartFullRecover;
|
||
set { if (_turnStartFullRecover != value) { _turnStartFullRecover = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool TurnStartFullRecoverHp
|
||
{
|
||
get => _turnStartFullRecoverHp;
|
||
set { if (_turnStartFullRecoverHp != value) { _turnStartFullRecoverHp = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool TurnStartFullRecoverMp
|
||
{
|
||
get => _turnStartFullRecoverMp;
|
||
set { if (_turnStartFullRecoverMp != value) { _turnStartFullRecoverMp = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool TurnStartFullRecoverTp
|
||
{
|
||
get => _turnStartFullRecoverTp;
|
||
set { if (_turnStartFullRecoverTp != value) { _turnStartFullRecoverTp = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool MaxGainGold
|
||
{
|
||
get => _maxGainGold;
|
||
set { if (_maxGainGold != value) { _maxGainGold = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool MaxGainExp
|
||
{
|
||
get => _maxGainExp;
|
||
set { if (_maxGainExp != value) { _maxGainExp = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool InstantMessage
|
||
{
|
||
get => _instantMessage;
|
||
set { if (_instantMessage != value) { _instantMessage = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public event System.ComponentModel.PropertyChangedEventHandler? PropertyChanged;
|
||
protected void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string? name = null)
|
||
{
|
||
PropertyChanged?.Invoke(this, new System.ComponentModel.PropertyChangedEventArgs(name));
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// ツクールおよびティラノスクリプトゲームのデータモデル
|
||
/// </summary>
|
||
public class TkoolGameItem : GameItemBase
|
||
{
|
||
private string _pluginsJsPath = string.Empty;
|
||
private string _pluginsDirPath = string.Empty;
|
||
private TkoolEngineType _engineType = TkoolEngineType.Unknown;
|
||
private bool _isModded;
|
||
private bool _applyMod = true;
|
||
private bool _hasCustomApplyMod;
|
||
private bool _isInitializingApplyMod;
|
||
private ModPluginOptions _modOptions = new();
|
||
|
||
// app.asar 関連プロパティ
|
||
private bool _isAsar;
|
||
private bool _isAsarExtracted;
|
||
private string? _asarPath;
|
||
private string? _asarExtractedDirPath;
|
||
private string? _relativePluginsJsInAsar;
|
||
|
||
public override GameEngineKind EngineKind => EngineType switch
|
||
{
|
||
TkoolEngineType.Tyrano => GameEngineKind.Tyrano,
|
||
TkoolEngineType.Wolf => GameEngineKind.Wolf,
|
||
TkoolEngineType.SrpgStudio => GameEngineKind.SrpgStudio,
|
||
_ => GameEngineKind.Tkool
|
||
};
|
||
|
||
public string PluginsJsPath
|
||
{
|
||
get => _pluginsJsPath;
|
||
set { if (_pluginsJsPath != value) { _pluginsJsPath = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public string PluginsDirPath
|
||
{
|
||
get => _pluginsDirPath;
|
||
set { if (_pluginsDirPath != value) { _pluginsDirPath = value; 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;
|
||
|
||
// 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
|
||
{
|
||
get => _engineType;
|
||
set
|
||
{
|
||
if (_engineType != value)
|
||
{
|
||
_engineType = value;
|
||
OnPropertyChanged();
|
||
OnPropertyChanged(nameof(EngineKind));
|
||
OnPropertyChanged(nameof(EngineDisplayName));
|
||
OnPropertyChanged(nameof(IsMV));
|
||
OnPropertyChanged(nameof(IsMZ));
|
||
OnPropertyChanged(nameof(IsTyrano));
|
||
OnPropertyChanged(nameof(IsVX));
|
||
OnPropertyChanged(nameof(IsVXAce));
|
||
OnPropertyChanged(nameof(IsWolf));
|
||
OnPropertyChanged(nameof(IsSrpgStudio));
|
||
OnPropertyChanged(nameof(IsRgss));
|
||
}
|
||
}
|
||
}
|
||
|
||
// ================= WOLF RPGエディター関連プロパティ =================
|
||
private bool _wolfDebugMode = false;
|
||
private bool _wolfDebugWindow = false;
|
||
private bool _wolfProxyDll = false;
|
||
private double _wolfSpeedMultiplier = 3.0;
|
||
private bool _hasWolfArchive = false;
|
||
private bool _isWolfExtracted = false;
|
||
|
||
/// <summary>テストプレイ(デバッグ)モードで起動するか</summary>
|
||
public bool WolfDebugMode
|
||
{
|
||
get => _wolfDebugMode;
|
||
set { if (_wolfDebugMode != value) { _wolfDebugMode = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
/// <summary>デバッグウィンドウ(F3)を起動時に表示するか</summary>
|
||
public bool WolfDebugWindow
|
||
{
|
||
get => _wolfDebugWindow;
|
||
set { if (_wolfDebugWindow != value) { _wolfDebugWindow = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
/// <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
|
||
{
|
||
get => _isModded;
|
||
set { if (_isModded != value) { _isModded = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool HasCustomApplyMod
|
||
{
|
||
get => _hasCustomApplyMod;
|
||
set { if (_hasCustomApplyMod != value) { _hasCustomApplyMod = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public override bool ApplyMod
|
||
{
|
||
get => _applyMod;
|
||
set
|
||
{
|
||
if (_applyMod != value)
|
||
{
|
||
_applyMod = value;
|
||
if (!_isInitializingApplyMod)
|
||
{
|
||
HasCustomApplyMod = true;
|
||
}
|
||
OnPropertyChanged();
|
||
}
|
||
}
|
||
}
|
||
|
||
public void SetDefaultApplyMod(bool defaultVal)
|
||
{
|
||
if (!_hasCustomApplyMod)
|
||
{
|
||
_isInitializingApplyMod = true;
|
||
_applyMod = defaultVal;
|
||
_isInitializingApplyMod = false;
|
||
OnPropertyChanged(nameof(ApplyMod));
|
||
}
|
||
}
|
||
|
||
public override bool IsAsar
|
||
{
|
||
get => _isAsar;
|
||
set
|
||
{
|
||
if (_isAsar != value)
|
||
{
|
||
_isAsar = value;
|
||
OnPropertyChanged();
|
||
OnPropertyChanged(nameof(AsarBadgeVisibility));
|
||
OnPropertyChanged(nameof(AsarBadgeText));
|
||
OnPropertyChanged(nameof(AsarBadgeBackground));
|
||
OnPropertyChanged(nameof(AsarDetailStatusText));
|
||
}
|
||
}
|
||
}
|
||
|
||
public override bool IsAsarExtracted
|
||
{
|
||
get => _isAsarExtracted;
|
||
set
|
||
{
|
||
if (_isAsarExtracted != value)
|
||
{
|
||
_isAsarExtracted = value;
|
||
OnPropertyChanged();
|
||
OnPropertyChanged(nameof(AsarBadgeText));
|
||
OnPropertyChanged(nameof(AsarBadgeBackground));
|
||
OnPropertyChanged(nameof(AsarDetailStatusText));
|
||
}
|
||
}
|
||
}
|
||
|
||
public string? AsarPath
|
||
{
|
||
get => _asarPath;
|
||
set { if (_asarPath != value) { _asarPath = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public string? AsarExtractedDirPath
|
||
{
|
||
get => _asarExtractedDirPath;
|
||
set { if (_asarExtractedDirPath != value) { _asarExtractedDirPath = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public string? RelativePluginsJsInAsar
|
||
{
|
||
get => _relativePluginsJsInAsar;
|
||
set { if (_relativePluginsJsInAsar != value) { _relativePluginsJsInAsar = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public override Visibility AsarBadgeVisibility => IsAsar ? Visibility.Visible : Visibility.Collapsed;
|
||
|
||
public override string AsarBadgeText => !IsAsar ? string.Empty : (IsAsarExtracted ? "ASAR (解凍済)" : "ASAR (圧縮)");
|
||
|
||
public override Brush AsarBadgeBackground => IsAsarExtracted
|
||
? new SolidColorBrush(Color.FromRgb(0x00, 0x89, 0x7B))
|
||
: new SolidColorBrush(Color.FromRgb(0x5E, 0x35, 0xB1));
|
||
|
||
public override string AsarDetailStatusText => !IsAsar
|
||
? string.Empty
|
||
: (IsAsarExtracted ? "📦 app.asar 形式(解凍済み・改造可能)" : "📦 app.asar 形式(圧縮中・起動時またはボタンで解凍可能)");
|
||
|
||
private Dictionary<string, bool> _pluginSettings = new(StringComparer.OrdinalIgnoreCase);
|
||
private ObservableCollection<ModPluginOptionItem> _pluginOptions = [];
|
||
|
||
public Dictionary<string, bool> PluginSettings
|
||
{
|
||
get => _pluginSettings;
|
||
set { if (_pluginSettings != value) { _pluginSettings = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public override ObservableCollection<ModPluginOptionItem> PluginOptions
|
||
{
|
||
get => _pluginOptions;
|
||
set { if (_pluginOptions != value) { _pluginOptions = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public bool IsPluginEnabled(string pluginId, Dictionary<string, bool>? defaultSettings = null, bool fallbackVal = true)
|
||
{
|
||
if (_pluginSettings.TryGetValue(pluginId, out var val))
|
||
{
|
||
return val;
|
||
}
|
||
|
||
if (pluginId is "BattleTurnRecoverHp" or "BattleTurnRecoverMp" or "BattleTurnRecoverTp")
|
||
{
|
||
if (_pluginSettings.TryGetValue("BattleTurnRecover", out var legacyVal))
|
||
{
|
||
return legacyVal;
|
||
}
|
||
}
|
||
|
||
if (defaultSettings != null && defaultSettings.TryGetValue(pluginId, out var defVal))
|
||
{
|
||
return defVal;
|
||
}
|
||
|
||
if (pluginId is "BattleTurnRecoverHp" or "BattleTurnRecoverMp" or "BattleTurnRecoverTp")
|
||
{
|
||
if (defaultSettings != null && defaultSettings.TryGetValue("BattleTurnRecover", out var legacyDefVal))
|
||
{
|
||
return legacyDefVal;
|
||
}
|
||
}
|
||
|
||
return fallbackVal;
|
||
}
|
||
|
||
public static readonly ModPluginDefinition[] DefaultTyranoPlugins =
|
||
[
|
||
new() { Id = "TyranoUnlockAllCg", Name = "🔓 全CG・全回想の全開放", Description = "システム変数(sf)のCG・回想フラグを全開放し、最初からCG・シーン鑑賞を可能にします。" },
|
||
new() { Id = "TyranoFastMessage", Name = "⚡ メッセージ超高速化・演出ウェイト短縮", Description = "文字送り速度を最大化し、[wait]演出の停止時間を短縮して快適にスキップ可能にします。" },
|
||
new() { Id = "TyranoDevTools", Name = "🛠 開発者ツール (F12) の有効化", Description = "F12キーでブラウザ・アプリの開発者ツールコンソールを開けるようにします。" },
|
||
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)
|
||
{
|
||
_pluginOptions.Clear();
|
||
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)
|
||
{
|
||
bool isEnabled = IsPluginEnabled(def.Id, defaultSettings, fallbackVal: true);
|
||
var item = new ModPluginOptionItem
|
||
{
|
||
Definition = def,
|
||
IsEnabled = isEnabled
|
||
};
|
||
item.PropertyChanged += (s, e) =>
|
||
{
|
||
if (e.PropertyName == nameof(ModPluginOptionItem.IsEnabled))
|
||
{
|
||
_pluginSettings[def.Id] = item.IsEnabled;
|
||
}
|
||
};
|
||
_pluginOptions.Add(item);
|
||
}
|
||
}
|
||
|
||
public ModPluginOptions ModOptions
|
||
{
|
||
get => _modOptions;
|
||
set { if (_modOptions != value) { _modOptions = value; OnPropertyChanged(); } }
|
||
}
|
||
|
||
public string EngineDisplayName => EngineType switch
|
||
{
|
||
TkoolEngineType.MV => "RPGツクールMV",
|
||
TkoolEngineType.MZ => "RPGツクールMZ",
|
||
TkoolEngineType.Tyrano => "ティラノスクリプト",
|
||
TkoolEngineType.VX => "RPGツクールVX",
|
||
TkoolEngineType.VXAce => "RPGツクールVX Ace",
|
||
TkoolEngineType.Wolf => "WOLF RPGエディター",
|
||
TkoolEngineType.SrpgStudio => "SRPG Studio",
|
||
_ => "ツクール/ティラノ"
|
||
};
|
||
}
|
||
}
|