From 52e831e4b102da9fb68cc233b4144fbf6cc823ac Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Wed, 16 Jul 2014 12:00:08 +0100 Subject: [PATCH] On init, plugins are no longer marked as dummies. A check for record count in plugins' TES4 headers could tell us if they are or not without requiring the whole plugin to be read. --- src/backend/json.h | 1 + src/gui/handler.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/json.h b/src/backend/json.h index 1d3bd107..d31e4df6 100644 --- a/src/backend/json.h +++ b/src/backend/json.h @@ -61,6 +61,7 @@ namespace loot { boost::replace_all(json, ": \"true\"", ": true"); boost::replace_all(json, ": \"false\"", ": false"); boost::replace_all(json, ": \"null\"", ": null"); + //boost::replace_all(json, ": ~", ": null"); // Using the definition at . std::regex numbers(": \"(-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)\"", std::regex::ECMAScript); diff --git a/src/gui/handler.cpp b/src/gui/handler.cpp index 57c91b9b..50592f50 100644 --- a/src/gui/handler.cpp +++ b/src/gui/handler.cpp @@ -220,7 +220,7 @@ namespace loot { YAML::Node pluginNode; pluginNode["name"] = plugin.second.Name(); pluginNode["isActive"] = g_app_state.CurrentGame().IsActive(plugin.first); - pluginNode["isDummy"] = (plugin.second.FormIDs().size() == 0); + pluginNode["isDummy"] = false; // Set to false for now because null is a bit iffy and we just don't know yet. Although, we could read the record count from the TES4 header... Usual check is (plugin.second.FormIDs().size() == 0); pluginNode["loadsBSA"] = plugin.second.LoadsBSA(g_app_state.CurrentGame()); pluginNode["crc"] = IntToHexString(plugin.second.Crc()); pluginNode["version"] = plugin.second.Version();