feat(nwjs): NW.js汎用ゲームの自動検出・専用タブおよびバッジ表示機能を追加

- package.jsonを起点とする汎用NW.jsゲームの検出ロジック(NwjsDetector)を新規実装
- メインナビゲーションタブに「NW.js」タブを追加し、エンジン別フィルタリングに対応
- 一覧カードおよび詳細パネルヘッダーにNW.jsバッジを追加
- キャッシュ復元およびステータスバー集計にNW.jsエンジン分類を反映
This commit is contained in:
armonica committed 2026-10-09 10:36:57 +09:00
1 parent 90584379b7
commit 59519208f3
8 files changed
+433 -11

No files matched your search

+1 -2
View File
@@ -136,8 +136,7 @@ namespace GameLauncher.Engines.Common
return EngineTkool; return EngineTkool;
} }
var packageJson = Path.Combine(gameDirectory, "package.json"); if (Engines.Nwjs.NwjsDetector.IsNwjsGame(gameDirectory))
if (File.Exists(packageJson) && Directory.Exists(Path.Combine(gameDirectory, "nwjs")))
{ {
return EngineNwjs; return EngineNwjs;
} }
+332
View File
@@ -0,0 +1,332 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Windows.Media;
using GameLauncher.Engines.Common;
using GameLauncher.Engines.Tkool;
using GameLauncher.Engines.Unity;
using GameLauncher.Models;
namespace GameLauncher.Engines.Nwjs
{
/// <summary>
/// 汎用 NW.js (Node-Webkit) アプリケーション/ゲームの検出およびアイテム生成を行うヘルパークラス
/// </summary>
public static class NwjsDetector
{
private static readonly HashSet<string> ExcludedExeNames = new(StringComparer.OrdinalIgnoreCase)
{
"notification_helper.exe",
"crashpad_handler.exe",
"elevate.exe"
};
/// <summary>
/// 指定されたディレクトリが汎用 NW.js ゲームであるかを判定します。
/// ツクール(MV/MZ/RGSS)、ティラノスクリプト、ウディタ、SRPG Studio など既存エンジン形式は除外します。
/// </summary>
/// <param name="dirPath">対象ディレクトリパス</param>
/// <returns>NW.js ゲームであれば true</returns>
public static bool IsNwjsGame(string dirPath)
{
try
{
if (string.IsNullOrWhiteSpace(dirPath) || !Directory.Exists(dirPath))
{
return false;
}
var packageJsonPath = Path.Combine(dirPath, "package.json");
if (!File.Exists(packageJsonPath))
{
return false;
}
// 既存の他エンジン判定(ツクール・ティラノ・ウディタ・SRPG)を最優先で除外
if (Directory.Exists(Path.Combine(dirPath, "www")) ||
File.Exists(Path.Combine(dirPath, "data", "System.json")) ||
File.Exists(Path.Combine(dirPath, "Game.ini")) ||
Directory.Exists(Path.Combine(dirPath, "tyrano")) ||
Directory.GetFiles(dirPath, "*.tjs", SearchOption.TopDirectoryOnly).Length > 0 ||
Directory.GetFiles(dirPath, "*.wolf", SearchOption.TopDirectoryOnly).Length > 0 ||
File.Exists(Path.Combine(dirPath, "data.dts")))
{
return false;
}
// NW.js の痕跡を確認
if (File.Exists(Path.Combine(dirPath, "nw.dll")) ||
File.Exists(Path.Combine(dirPath, "nw.exe")) ||
File.Exists(Path.Combine(dirPath, "resources.pak")) ||
File.Exists(Path.Combine(dirPath, "node.dll")) ||
Directory.Exists(Path.Combine(dirPath, "nwjs")))
{
return true;
}
// package.json に main や window 記述があるか確認
if (TryReadPackageJson(dirPath, out _, out _, out var main, out _))
{
if (!string.IsNullOrWhiteSpace(main) && File.Exists(Path.Combine(dirPath, main)))
{
return true;
}
}
}
catch
{
return false;
}
return false;
}
/// <summary>
/// 指定ディレクトリ内の NW.js ゲームを検出し、TkoolGameItem を生成します。
/// </summary>
/// <param name="dirPath">ゲームフォルダの絶対パス</param>
/// <param name="folderName">フォルダ名</param>
/// <param name="folderModified">フォルダ更新日時</param>
/// <param name="iconLoader">アイコン読み込み関数</param>
/// <returns>検出されたゲームアイテム。該当しない場合は null</returns>
public static TkoolGameItem? DetectNwjsGame(
string dirPath,
string folderName,
DateTime? folderModified,
Func<string?, string?, ImageSource?> iconLoader)
{
try
{
if (!IsNwjsGame(dirPath))
{
return null;
}
TryReadPackageJson(dirPath, out var windowTitle, out var packageName, out var mainFile, out var iconRelPath);
// タイトルの決定: window.title > index.html の <title> > package.json の name > フォルダ名
string title = string.Empty;
if (!string.IsNullOrWhiteSpace(windowTitle))
{
title = windowTitle.Trim();
}
if (string.IsNullOrWhiteSpace(title))
{
var htmlPath = !string.IsNullOrWhiteSpace(mainFile)
? Path.Combine(dirPath, mainFile)
: Path.Combine(dirPath, "index.html");
title = ExtractHtmlTitle(htmlPath);
}
if (string.IsNullOrWhiteSpace(title) && !string.IsNullOrWhiteSpace(packageName))
{
title = packageName.Trim();
}
if (string.IsNullOrWhiteSpace(title))
{
title = folderName;
}
// 実行ファイルの探索
var exePath = FindNwjsExecutable(dirPath, title, packageName);
// アイコンの取得
ImageSource? icon = null;
if (iconLoader != null)
{
icon = iconLoader(exePath, dirPath);
}
return new TkoolGameItem
{
Title = title,
FolderName = folderName,
RootDirectory = dirPath,
ExecutablePath = exePath ?? string.Empty,
PluginsJsPath = string.Empty,
PluginsDirPath = string.Empty,
EngineType = TkoolEngineType.Nwjs,
IsModded = false,
ApplyMod = false,
IconImage = icon,
FolderLastModified = folderModified
};
}
catch
{
return null;
}
}
/// <summary>
/// NW.js ゲーム用の実行可能ファイル(.exe)を探索します。
/// notification_helper.exe などの Chromium 内部ユーティリティを除外し、ゲーム本体の exe を特定します。
/// </summary>
/// <param name="dirPath">ディレクトリパス</param>
/// <param name="title">ゲームタイトル</param>
/// <param name="packageName">package.json の name</param>
/// <returns>実行ファイルのパス。見つからない場合は null</returns>
public static string? FindNwjsExecutable(string dirPath, string? title, string? packageName)
{
try
{
var exes = Directory.GetFiles(dirPath, "*.exe", SearchOption.TopDirectoryOnly)
.Where(f =>
{
var fileName = Path.GetFileName(f);
if (fileName.StartsWith("unins", StringComparison.OrdinalIgnoreCase))
{
return false;
}
if (ExcludedExeNames.Contains(fileName))
{
return false;
}
return true;
})
.ToList();
if (exes.Count == 0)
{
return null;
}
if (exes.Count == 1)
{
return exes[0];
}
// 優先度1: タイトル名またはパッケージ名が含まれる実行ファイル
if (!string.IsNullOrWhiteSpace(title))
{
var match = exes.FirstOrDefault(f => Path.GetFileNameWithoutExtension(f).Contains(title, StringComparison.OrdinalIgnoreCase));
if (match != null)
{
return match;
}
}
if (!string.IsNullOrWhiteSpace(packageName))
{
var match = exes.FirstOrDefault(f => Path.GetFileNameWithoutExtension(f).Contains(packageName, StringComparison.OrdinalIgnoreCase));
if (match != null)
{
return match;
}
}
// 優先度2: Game.exe または nw.exe
var gameExe = exes.FirstOrDefault(f => string.Equals(Path.GetFileName(f), "Game.exe", StringComparison.OrdinalIgnoreCase));
if (gameExe != null)
{
return gameExe;
}
var nwExe = exes.FirstOrDefault(f => string.Equals(Path.GetFileName(f), "nw.exe", StringComparison.OrdinalIgnoreCase));
if (nwExe != null)
{
return nwExe;
}
// 優先度3: 候補の先頭
return exes[0];
}
catch
{
return null;
}
}
/// <summary>
/// package.json を読み込み、主要な設定値を抽出します。
/// </summary>
private static bool TryReadPackageJson(
string dirPath,
out string? windowTitle,
out string? name,
out string? main,
out string? iconRelPath)
{
windowTitle = null;
name = null;
main = null;
iconRelPath = null;
try
{
var packageJsonPath = Path.Combine(dirPath, "package.json");
if (!File.Exists(packageJsonPath))
{
return false;
}
var json = File.ReadAllText(packageJsonPath);
using var doc = JsonDocument.Parse(json);
var root = doc.RootElement;
if (root.TryGetProperty("name", out var nameProp) && nameProp.ValueKind == JsonValueKind.String)
{
name = nameProp.GetString();
}
if (root.TryGetProperty("main", out var mainProp) && mainProp.ValueKind == JsonValueKind.String)
{
main = mainProp.GetString();
}
if (root.TryGetProperty("window", out var winProp) && winProp.ValueKind == JsonValueKind.Object)
{
if (winProp.TryGetProperty("title", out var titleProp) && titleProp.ValueKind == JsonValueKind.String)
{
windowTitle = titleProp.GetString();
}
if (winProp.TryGetProperty("icon", out var iconProp) && iconProp.ValueKind == JsonValueKind.String)
{
iconRelPath = iconProp.GetString();
}
}
return true;
}
catch
{
return false;
}
}
/// <summary>
/// HTML ファイルから title タグのテキストを抽出します。
/// </summary>
private static string ExtractHtmlTitle(string htmlPath)
{
try
{
if (!File.Exists(htmlPath))
{
return string.Empty;
}
var html = File.ReadAllText(htmlPath);
var match = Regex.Match(html, @"<title[^>]*>(.*?)</title>", RegexOptions.IgnoreCase | RegexOptions.Singleline);
if (match.Success)
{
var title = match.Groups[1].Value.Trim();
return System.Net.WebUtility.HtmlDecode(title);
}
}
catch
{
}
return string.Empty;
}
}
}
+3 -2
View File
@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.IO; using System.IO;
@@ -733,7 +733,7 @@ namespace GameLauncher.Engines.Tkool
public void SyncPluginOptions(IEnumerable<ModPluginDefinition> availablePlugins, Dictionary<string, bool>? defaultSettings = null) public void SyncPluginOptions(IEnumerable<ModPluginDefinition> availablePlugins, Dictionary<string, bool>? defaultSettings = null)
{ {
_pluginOptions.Clear(); _pluginOptions.Clear();
if (EngineType == TkoolEngineType.Wolf) if (EngineType is TkoolEngineType.Wolf or TkoolEngineType.Nwjs)
{ {
return; return;
} }
@@ -790,6 +790,7 @@ namespace GameLauncher.Engines.Tkool
TkoolEngineType.VXAce => "RPGツクールVX Ace", TkoolEngineType.VXAce => "RPGツクールVX Ace",
TkoolEngineType.Wolf => "WOLF RPGエディター", TkoolEngineType.Wolf => "WOLF RPGエディター",
TkoolEngineType.SrpgStudio => "SRPG Studio", TkoolEngineType.SrpgStudio => "SRPG Studio",
TkoolEngineType.Nwjs => "NW.js",
_ => "ツクール/ティラノ" _ => "ツクール/ティラノ"
}; };
} }
+4 -2
View File
@@ -1,4 +1,4 @@
namespace GameLauncher.Engines.Unity namespace GameLauncher.Engines.Unity
{ {
/// <summary> /// <summary>
/// ゲームエンジンの大分類 /// ゲームエンジンの大分類
@@ -10,7 +10,8 @@
Unity, Unity,
Wolf, Wolf,
SrpgStudio, SrpgStudio,
Evb Evb,
Nwjs
} }
/// <summary> /// <summary>
@@ -25,6 +26,7 @@
VXAce, VXAce,
Wolf, Wolf,
SrpgStudio, SrpgStudio,
Nwjs,
Unknown Unknown
} }
+39
View File
@@ -42,6 +42,7 @@
<SolidColorBrush x:Key="AccentWolf" Color="#4834D4"/> <SolidColorBrush x:Key="AccentWolf" Color="#4834D4"/>
<SolidColorBrush x:Key="AccentWolfHover" Color="#686DE0"/> <SolidColorBrush x:Key="AccentWolfHover" Color="#686DE0"/>
<SolidColorBrush x:Key="BadgeSrpgBg" Color="#0984E3"/> <SolidColorBrush x:Key="BadgeSrpgBg" Color="#0984E3"/>
<SolidColorBrush x:Key="BadgeNwjsBg" Color="#00838F"/>
<SolidColorBrush x:Key="AccentSrpg" Color="#0984E3"/> <SolidColorBrush x:Key="AccentSrpg" Color="#0984E3"/>
<SolidColorBrush x:Key="AccentSrpgHover" Color="#74B9FF"/> <SolidColorBrush x:Key="AccentSrpgHover" Color="#74B9FF"/>
@@ -377,6 +378,7 @@
<RadioButton x:Name="tabWolf" Style="{StaticResource NavTabRadioButton}" Content="ウディタ" ToolTip="WOLF RPGエディター" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="9,5"/> <RadioButton x:Name="tabWolf" Style="{StaticResource NavTabRadioButton}" Content="ウディタ" ToolTip="WOLF RPGエディター" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="9,5"/>
<RadioButton x:Name="tabSrpg" Style="{StaticResource NavTabRadioButton}" Content="SRPG" ToolTip="SRPG Studio" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="9,5"/> <RadioButton x:Name="tabSrpg" Style="{StaticResource NavTabRadioButton}" Content="SRPG" ToolTip="SRPG Studio" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="9,5"/>
<RadioButton x:Name="tabUnity" Style="{StaticResource NavTabRadioButton}" Content="Unity" ToolTip="Unity" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="9,5"/> <RadioButton x:Name="tabUnity" Style="{StaticResource NavTabRadioButton}" Content="Unity" ToolTip="Unity" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="9,5"/>
<RadioButton x:Name="tabNwjs" Style="{StaticResource NavTabRadioButton}" Content="NW.js" ToolTip="NW.js" GroupName="MainEngineTabs" Checked="EngineTab_Checked" Padding="9,5"/>
</StackPanel> </StackPanel>
</Border> </Border>
@@ -630,6 +632,22 @@
<TextBlock Text="{Binding SrpgBadgeText}" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/> <TextBlock Text="{Binding SrpgBadgeText}" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
</Border> </Border>
<!-- NW.jsバッジ -->
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Background" Value="{StaticResource BadgeNwjsBg}"/>
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsNwjs}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock Text="NW.js" FontSize="10" FontWeight="Bold" Foreground="#FFFFFF"/>
</Border>
<!-- IL2CPPバッジ --> <!-- IL2CPPバッジ -->
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0"> <Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0">
<Border.Style> <Border.Style>
@@ -911,6 +929,21 @@
<TextBlock Text="{Binding SelectedItem.WolfArchiveBadgeText, ElementName=lstGames}" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/> <TextBlock Text="{Binding SelectedItem.WolfArchiveBadgeText, ElementName=lstGames}" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
</Border> </Border>
<!-- NW.jsバッジ -->
<Border CornerRadius="4" Padding="6,2" Margin="0,0,6,0" Background="{StaticResource BadgeNwjsBg}">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedItem.IsNwjs, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock Text="NW.js" FontSize="11" FontWeight="Bold" Foreground="#FFFFFF"/>
</Border>
<!-- 改造中バッジ --> <!-- 改造中バッジ -->
<Border CornerRadius="4" Padding="6,2" Background="{StaticResource BadgeModdedBg}" Margin="0,0,6,0"> <Border CornerRadius="4" Padding="6,2" Background="{StaticResource BadgeModdedBg}" Margin="0,0,6,0">
<Border.Style> <Border.Style>
@@ -954,6 +987,9 @@
<DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True"> <DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/> <Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger> </DataTrigger>
<DataTrigger Binding="{Binding SelectedItem.IsNwjs, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</Button.Style> </Button.Style>
@@ -1089,6 +1125,9 @@
<DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True"> <DataTrigger Binding="{Binding SelectedItem.IsWolf, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/> <Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger> </DataTrigger>
<DataTrigger Binding="{Binding SelectedItem.IsNwjs, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</Border.Style> </Border.Style>
+13 -4
View File
@@ -137,6 +137,7 @@ namespace GameLauncher
case 6: tabUnity.IsChecked = true; break; case 6: tabUnity.IsChecked = true; break;
case 7: tabWolf.IsChecked = true; break; case 7: tabWolf.IsChecked = true; break;
case 8: tabSrpg.IsChecked = true; break; case 8: tabSrpg.IsChecked = true; break;
case 9: tabNwjs.IsChecked = true; break;
default: tabAll.IsChecked = true; break; default: tabAll.IsChecked = true; break;
} }
@@ -173,6 +174,7 @@ namespace GameLauncher
else if (tabUnity.IsChecked == true) tabIndex = 6; else if (tabUnity.IsChecked == true) tabIndex = 6;
else if (tabWolf.IsChecked == true) tabIndex = 7; else if (tabWolf.IsChecked == true) tabIndex = 7;
else if (tabSrpg.IsChecked == true) tabIndex = 8; else if (tabSrpg.IsChecked == true) tabIndex = 8;
else if (tabNwjs.IsChecked == true) tabIndex = 9;
_config.SelectedTab = tabIndex; _config.SelectedTab = tabIndex;
_config.UnityBackendFilter = rbUnityIL2CPP.IsChecked == true ? "IL2CPP" : (rbUnityMono.IsChecked == true ? "Mono" : "All"); _config.UnityBackendFilter = rbUnityIL2CPP.IsChecked == true ? "IL2CPP" : (rbUnityMono.IsChecked == true ? "Mono" : "All");
@@ -281,13 +283,15 @@ namespace GameLauncher
if (_games.Count > 0) if (_games.Count > 0)
{ {
int tkoolCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano && !tg.IsRgss && !tg.IsWolf); int tkoolCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano && !tg.IsRgss && !tg.IsWolf && !tg.IsSrpgStudio && !tg.IsNwjs);
int rgssCount = _games.Count(g => g is TkoolGameItem tg && tg.IsRgss); int rgssCount = _games.Count(g => g is TkoolGameItem tg && tg.IsRgss);
int tyranoCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType == TkoolEngineType.Tyrano); int tyranoCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType == TkoolEngineType.Tyrano);
int wolfCount = _games.Count(g => g is TkoolGameItem tg && tg.IsWolf); int wolfCount = _games.Count(g => g is TkoolGameItem tg && tg.IsWolf);
int srpgCount = _games.Count(g => g is TkoolGameItem tg && tg.IsSrpgStudio);
int nwjsCount = _games.Count(g => g is TkoolGameItem tg && tg.IsNwjs);
int unityCount = _games.Count(g => g is UnityGameItem); int unityCount = _games.Count(g => g is UnityGameItem);
AppendLog($"キャッシュから計 {_games.Count} 件(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, Unity: {unityCount})を即時表示しました。(待たずに即起動可能です)"); AppendLog($"キャッシュから計 {_games.Count} 件(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, SRPG Studio: {srpgCount}, NW.js: {nwjsCount}, Unity: {unityCount})を即時表示しました。(待たずに即起動可能です)");
lblStatusEngine.Text = "裏で更新・実在検証を実行中..."; lblStatusEngine.Text = "裏で更新・実在検証を実行中...";
} }
else else
@@ -472,6 +476,10 @@ namespace GameLauncher
if (rbUnityIL2CPP.IsChecked == true && ug.BackendType != UnityBackendType.IL2CPP) return false; if (rbUnityIL2CPP.IsChecked == true && ug.BackendType != UnityBackendType.IL2CPP) return false;
if (rbUnityMono.IsChecked == true && ug.BackendType != UnityBackendType.Mono) return false; if (rbUnityMono.IsChecked == true && ug.BackendType != UnityBackendType.Mono) return false;
} }
else if (tabNwjs.IsChecked == true)
{
if (game is not TkoolGameItem tg || tg.EngineType != TkoolEngineType.Nwjs) return false;
}
// 3. 追加属性フィルター(全タブ共通) // 3. 追加属性フィルター(全タブ共通)
if (chkFilterModdedOnly.IsChecked == true && !game.IsModded) return false; if (chkFilterModdedOnly.IsChecked == true && !game.IsModded) return false;
@@ -536,15 +544,16 @@ namespace GameLauncher
int total = _games.Count; int total = _games.Count;
int visible = _gamesView?.Count ?? 0; int visible = _gamesView?.Count ?? 0;
int tkoolCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano && !tg.IsRgss && !tg.IsWolf && !tg.IsSrpgStudio); int tkoolCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType != TkoolEngineType.Tyrano && !tg.IsRgss && !tg.IsWolf && !tg.IsSrpgStudio && !tg.IsNwjs);
int rgssCount = _games.Count(g => g is TkoolGameItem tg && tg.IsRgss); int rgssCount = _games.Count(g => g is TkoolGameItem tg && tg.IsRgss);
int tyranoCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType == TkoolEngineType.Tyrano); int tyranoCount = _games.Count(g => g is TkoolGameItem tg && tg.EngineType == TkoolEngineType.Tyrano);
int wolfCount = _games.Count(g => g is TkoolGameItem tg && tg.IsWolf); int wolfCount = _games.Count(g => g is TkoolGameItem tg && tg.IsWolf);
int srpgCount = _games.Count(g => g is TkoolGameItem tg && tg.IsSrpgStudio); int srpgCount = _games.Count(g => g is TkoolGameItem tg && tg.IsSrpgStudio);
int nwjsCount = _games.Count(g => g is TkoolGameItem tg && tg.IsNwjs);
int unityCount = _games.Count(g => g is UnityGameItem); int unityCount = _games.Count(g => g is UnityGameItem);
lblStatusSummary.Text = $"総ゲーム数: {total} 件 | 表示: {visible} 件"; lblStatusSummary.Text = $"総ゲーム数: {total} 件 | 表示: {visible} 件";
lblStatusBreakdown.Text = $"(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, SRPG Studio: {srpgCount}, Unity: {unityCount})"; lblStatusBreakdown.Text = $"(ツクールMV/MZ: {tkoolCount}, ツクールVX系: {rgssCount}, ティラノ: {tyranoCount}, ウディタ: {wolfCount}, SRPG Studio: {srpgCount}, NW.js: {nwjsCount}, Unity: {unityCount})";
} }
#endregion #endregion
+15
View File
@@ -157,6 +157,9 @@ namespace GameLauncher.Models
/// <summary>SRPG Studioか</summary> /// <summary>SRPG Studioか</summary>
public virtual bool IsSrpgStudio => false; public virtual bool IsSrpgStudio => false;
/// <summary>NW.js汎用ゲームか</summary>
public virtual bool IsNwjs => false;
/// <summary>プリンセスシナジー(専用改造対象のMZゲーム)か</summary> /// <summary>プリンセスシナジー(専用改造対象のMZゲーム)か</summary>
public virtual bool IsPrincessSynergy => false; public virtual bool IsPrincessSynergy => false;
@@ -226,6 +229,18 @@ namespace GameLauncher.Models
/// <summary>SRPG Studio詳細状態テキスト</summary> /// <summary>SRPG Studio詳細状態テキスト</summary>
public virtual string SrpgDetailStatusText => string.Empty; public virtual string SrpgDetailStatusText => string.Empty;
/// <summary>NW.jsバッジのテキスト</summary>
public virtual string NwjsBadgeText => string.Empty;
/// <summary>NW.jsバッジの背景色</summary>
public virtual Brush NwjsBadgeBackground => Brushes.Transparent;
/// <summary>NW.jsバッジの可視性</summary>
public virtual Visibility NwjsBadgeVisibility => Visibility.Collapsed;
/// <summary>NW.js詳細状態テキスト</summary>
public virtual string NwjsDetailStatusText => string.Empty;
/// <summary>Unity IL2CPPか</summary> /// <summary>Unity IL2CPPか</summary>
public virtual bool IsIL2CPP => false; public virtual bool IsIL2CPP => false;
+26 -1
View File
@@ -692,6 +692,24 @@ namespace GameLauncher.Services
onGameUpdated(tg); onGameUpdated(tg);
} }
} }
else if (tg.IsNwjs)
{
if (!File.Exists(tg.ExecutablePath) && !File.Exists(Path.Combine(tg.RootDirectory, "package.json")))
{
onGameRemoved(tg);
cacheNeedsSave = true;
continue;
}
}
else if (tg.IsEvbPacked || tg.IsStandaloneExePackage)
{
if (!File.Exists(tg.ExecutablePath))
{
onGameRemoved(tg);
cacheNeedsSave = true;
continue;
}
}
else else
{ {
if (!File.Exists(tg.PluginsJsPath)) if (!File.Exists(tg.PluginsJsPath))
@@ -715,7 +733,7 @@ namespace GameLauncher.Services
} }
// 改造状態の確認 // 改造状態の確認
if (tg.IsWolf) if (tg.IsWolf || tg.IsNwjs)
{ {
tg.IsModded = false; tg.IsModded = false;
} }
@@ -1138,6 +1156,13 @@ namespace GameLauncher.Services
{ {
return rgssGame; return rgssGame;
} }
// 8. 汎用 NW.js ゲームの検出
var nwjsGame = Engines.Nwjs.NwjsDetector.DetectNwjsGame(dirPath, folderName, folderModified, (exe, dir) => LoadIcon(exe, dir));
if (nwjsGame != null)
{
return nwjsGame;
}
} }
catch { } catch { }