feat(ui): 右側詳細パネルのシンプル化とスクリプト改造不可時の項目非表示化

This commit is contained in:
armonica committed 2026-10-20 10:54:53 +09:00
1 parent c03cc97af1
commit ec4d718311
4 files changed
+81 -31

No files matched your search

+51 -2
View File
@@ -148,6 +148,7 @@ namespace GameLauncher.Engines.Tkool
this.OnPropertyChanged(nameof(this.EvbExtractedVisibility));
this.OnPropertyChanged(nameof(this.EvbExtractedBadgeText));
this.OnPropertyChanged(nameof(this.EvbDetailStatusText));
this.OnPropertyChanged(nameof(this.CanApplyScriptMod));
this.OnPropertyChanged(nameof(this.IsEvbToolMissing));
}
}
@@ -170,6 +171,7 @@ namespace GameLauncher.Engines.Tkool
this.OnPropertyChanged(nameof(this.EvbExtractedVisibility));
this.OnPropertyChanged(nameof(this.EvbExtractedBadgeText));
this.OnPropertyChanged(nameof(this.EvbDetailStatusText));
this.OnPropertyChanged(nameof(this.CanApplyScriptMod));
}
}
}
@@ -192,7 +194,8 @@ namespace GameLauncher.Engines.Tkool
public string EvbUnderlyingEngine
{
get => this._evbUnderlyingEngine;
set { if (this._evbUnderlyingEngine != value) { this._evbUnderlyingEngine = value; this.OnPropertyChanged(); this.OnPropertyChanged(nameof(this.EvbDetailStatusText)); } }
set { if (this._evbUnderlyingEngine != value) { this._evbUnderlyingEngine = value; this.OnPropertyChanged(); this.OnPropertyChanged(nameof(this.EvbDetailStatusText));
this.OnPropertyChanged(nameof(this.CanApplyScriptMod)); } }
}
/// <summary>EVB として扱うか(UI バッジ判定用)</summary>
@@ -310,7 +313,7 @@ namespace GameLauncher.Engines.Tkool
public string PluginsJsPath
{
get => this._pluginsJsPath;
set { if (this._pluginsJsPath != value) { this._pluginsJsPath = value; this.OnPropertyChanged(); } }
set { if (this._pluginsJsPath != value) { this._pluginsJsPath = value; this.OnPropertyChanged(); this.OnPropertyChanged(nameof(this.CanApplyScriptMod)); } }
}
public string PluginsDirPath
@@ -330,6 +333,46 @@ namespace GameLauncher.Engines.Tkool
public override bool IsNwjs => this.EngineType == TkoolEngineType.Nwjs;
public override bool IsOther => this.EngineType == TkoolEngineType.Other;
/// <summary>
/// スクリプト改造(プラグイン注入など)が適用可能な状態かどうか。
/// 該当ゲームが改造非対応(ウディタ・SRPG・NW.js・その他・未解凍状態など)の場合は false を返します。
/// </summary>
public override bool CanApplyScriptMod
{
get
{
if (this.IsWolf || this.IsNwjs || this.IsSrpgStudio || this.IsOther)
{
return false;
}
if (this.IsEvbPacked && !this.IsEvbExtracted)
{
return false;
}
if (this.IsAsar && !this.IsAsarExtracted)
{
return false;
}
if (this.IsStandaloneExePackage && (string.IsNullOrEmpty(this.PluginsJsPath) || !File.Exists(this.PluginsJsPath)))
{
return false;
}
if (this.IsRgss)
{
if (this.HasRgssArchive && !this.IsRgssExtracted)
{
return false;
}
return !string.IsNullOrEmpty(this.PluginsJsPath) && File.Exists(this.PluginsJsPath);
}
if (this.IsMV || this.IsMZ || this.IsTyrano)
{
return !string.IsNullOrEmpty(this.PluginsJsPath) && File.Exists(this.PluginsJsPath);
}
return false;
}
}
/// <summary>
/// エンジン種別ラベルの表示文字列。該当エンジンが無い場合は空文字を返し、ラベル自体を非表示にします。
/// </summary>
@@ -454,6 +497,7 @@ namespace GameLauncher.Engines.Tkool
this.OnPropertyChanged(nameof(this.RgssBadgeText));
this.OnPropertyChanged(nameof(this.RgssBadgeBackground));
this.OnPropertyChanged(nameof(this.RgssDetailStatusText));
this.OnPropertyChanged(nameof(this.CanApplyScriptMod));
}
}
}
@@ -470,6 +514,7 @@ namespace GameLauncher.Engines.Tkool
this.OnPropertyChanged(nameof(this.RgssBadgeText));
this.OnPropertyChanged(nameof(this.RgssBadgeBackground));
this.OnPropertyChanged(nameof(this.RgssDetailStatusText));
this.OnPropertyChanged(nameof(this.CanApplyScriptMod));
}
}
}
@@ -507,6 +552,7 @@ namespace GameLauncher.Engines.Tkool
this.OnPropertyChanged(nameof(this.EngineDisplayName));
this.OnPropertyChanged(nameof(this.EngineLabelText));
this.OnPropertyChanged(nameof(this.EngineLabelBackground));
this.OnPropertyChanged(nameof(this.CanApplyScriptMod));
this.OnPropertyChanged(nameof(this.IsMV));
this.OnPropertyChanged(nameof(this.IsMZ));
this.OnPropertyChanged(nameof(this.IsTyrano));
@@ -532,6 +578,7 @@ namespace GameLauncher.Engines.Tkool
this.OnPropertyChanged(nameof(this.RgssBadgeText));
this.OnPropertyChanged(nameof(this.RgssBadgeBackground));
this.OnPropertyChanged(nameof(this.RgssDetailStatusText));
this.OnPropertyChanged(nameof(this.CanApplyScriptMod));
}
}
}
@@ -679,6 +726,7 @@ namespace GameLauncher.Engines.Tkool
this.OnPropertyChanged(nameof(this.AsarBadgeText));
this.OnPropertyChanged(nameof(this.AsarBadgeBackground));
this.OnPropertyChanged(nameof(this.AsarDetailStatusText));
this.OnPropertyChanged(nameof(this.CanApplyScriptMod));
}
}
}
@@ -695,6 +743,7 @@ namespace GameLauncher.Engines.Tkool
this.OnPropertyChanged(nameof(this.AsarBadgeText));
this.OnPropertyChanged(nameof(this.AsarBadgeBackground));
this.OnPropertyChanged(nameof(this.AsarDetailStatusText));
this.OnPropertyChanged(nameof(this.CanApplyScriptMod));
}
}
}
+18
View File
@@ -130,4 +130,22 @@ namespace GameLauncher.Helpers
throw new NotImplementedException();
}
}
/// <summary>
/// bool値が true の場合に Visible、false または null の場合に Collapsed を返すコンバーター
/// </summary>
public class BooleanToVisibilityConverter : IValueConverter
{
public static readonly BooleanToVisibilityConverter Instance = new();
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value is true ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value is Visibility v && v == Visibility.Visible;
}
}
}
+6 -29
View File
@@ -869,20 +869,8 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Style="{StaticResource ModernButton}" Content="📁 フォルダを開く" Click="btnOpenFolder_Click"/>
<Button Grid.Column="2" Content="↩ 改造を解除(復元)" Click="btnRestoreOriginal_Click">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource ModernButton}">
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
<DataTrigger Binding="{Binding SelectedItem.IsNwjs, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button Grid.Column="2" Content="↩ 改造を解除(復元)" Click="btnRestoreOriginal_Click" Style="{StaticResource ModernButton}"
Visibility="{Binding SelectedItem.CanApplyScriptMod, ElementName=lstGames, Converter={x:Static helpers:BooleanToVisibilityConverter.Instance}}"/>
</Grid>
<!-- パス・日時情報 -->
@@ -1008,20 +996,9 @@
</StackPanel>
</Border>
<!-- スクリプト改造セクション -->
<Border Background="#252535" BorderBrush="{StaticResource AccentPrimary}" BorderThickness="1.5" CornerRadius="8" Padding="14" Margin="0,0,0,14">
<Border.Style>
<Style TargetType="Border">
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
<DataTrigger Binding="{Binding SelectedItem.IsNwjs, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<!-- スクリプト改造セクション(該当ゲームで改造不可能な場合は非表示) -->
<Border Background="#252535" BorderBrush="{StaticResource AccentPrimary}" BorderThickness="1.5" CornerRadius="8" Padding="14" Margin="0,0,0,14"
Visibility="{Binding SelectedItem.CanApplyScriptMod, ElementName=lstGames, Converter={x:Static helpers:BooleanToVisibilityConverter.Instance}}">
<StackPanel>
<CheckBox x:Name="chkApplyMod" IsChecked="{Binding SelectedItem.ApplyMod, ElementName=lstGames, Mode=TwoWay}"
FontSize="15" FontWeight="Bold" Foreground="#A29BFE">
@@ -1031,7 +1008,7 @@
FontSize="11" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="24,4,0,10"/>
<!-- 個別プラグインアコーディオン -->
<Expander Header="プラグイン個別設定(詳細)" IsExpanded="True" Foreground="{StaticResource TextSecondary}" FontSize="12">
<Expander Header="プラグイン個別設定(詳細)" IsExpanded="False" Foreground="{StaticResource TextSecondary}" FontSize="12">
<StackPanel Margin="4,8,0,0">
<!-- 共通機能プラグイン グループ -->
<TextBlock Text="【共通プラグイン】" FontSize="11" FontWeight="Bold" Foreground="#A29BFE" Margin="2,2,0,6"/>
+6
View File
@@ -449,5 +449,11 @@ namespace GameLauncher.Models
get => false;
set { }
}
/// <summary>
/// スクリプト改造(プラグイン注入など)が適用可能な状態かどうか。
/// 該当ゲームが改造非対応(ウディタ・SRPG・NW.js・その他・未解凍状態など)の場合は false を返し、
/// 右側パネルのスクリプト改造項目を非表示にします。
/// </summary>
public virtual bool CanApplyScriptMod => false;
}
}