mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Plugin active state now included in report data.
This commit is contained in:
@@ -141,12 +141,18 @@ namespace loot {
|
||||
out << YAML::EndMap;
|
||||
}
|
||||
|
||||
void WritePlugin(YAML::Emitter& out, const Plugin& plugin) {
|
||||
void WritePlugin(YAML::Emitter& out, const Plugin& plugin, const Game& game) {
|
||||
out << YAML::BeginMap;
|
||||
|
||||
out << YAML::Key << "name"
|
||||
<< YAML::Value << plugin.Name();
|
||||
|
||||
out << YAML::Key << "isActive";
|
||||
if (game.IsActive(plugin.Name()))
|
||||
out << YAML::Value << "true";
|
||||
else
|
||||
out << YAML::Value << "false";
|
||||
|
||||
if (plugin.Crc() != 0) {
|
||||
out << YAML::Key << "crc"
|
||||
<< YAML::Value << IntToHexString(plugin.Crc());
|
||||
@@ -216,7 +222,7 @@ namespace loot {
|
||||
out << YAML::EndMap;
|
||||
}
|
||||
|
||||
void GenerateReport(const boost::filesystem::path& file,
|
||||
void GenerateReportData(const Game& game,
|
||||
std::list<Message>& messages,
|
||||
const std::list<Plugin>& plugins,
|
||||
const std::string& masterlistVersion,
|
||||
@@ -224,7 +230,7 @@ namespace loot {
|
||||
const bool masterlistUpdateEnabled) {
|
||||
|
||||
YAML::Node oldDetails;
|
||||
GetOldReportDetails(file, oldDetails);
|
||||
GetOldReportDetails(game.ReportDataPath(), oldDetails);
|
||||
|
||||
//Need to output YAML as a JSON Javascript variable.
|
||||
YAML::Emitter yout;
|
||||
@@ -268,7 +274,7 @@ namespace loot {
|
||||
|
||||
tempout << YAML::BeginSeq;
|
||||
for (std::list<Plugin>::const_iterator it = plugins.begin(), endit = plugins.end(); it != endit; ++it) {
|
||||
WritePlugin(tempout, *it);
|
||||
WritePlugin(tempout, *it, game);
|
||||
}
|
||||
tempout << YAML::EndSeq;
|
||||
|
||||
@@ -281,7 +287,7 @@ namespace loot {
|
||||
yout << YAML::Key << "plugins"
|
||||
<< YAML::Value << YAML::BeginSeq;
|
||||
for (std::list<Plugin>::const_iterator it = plugins.begin(), endit = plugins.end(); it != endit; ++it) {
|
||||
WritePlugin(yout, *it);
|
||||
WritePlugin(yout, *it, game);
|
||||
}
|
||||
yout << YAML::EndSeq;
|
||||
}
|
||||
@@ -369,7 +375,7 @@ namespace loot {
|
||||
|
||||
yout << YAML::EndMap;
|
||||
|
||||
loot::ofstream out(file);
|
||||
loot::ofstream out(game.ReportDataPath());
|
||||
out << "var data = " << yout.c_str();
|
||||
out.close();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
namespace loot {
|
||||
//LOOT Report generation stuff.
|
||||
void GenerateReport(const boost::filesystem::path& file,
|
||||
void GenerateReportData(const Game& game,
|
||||
std::list<Message>& messages,
|
||||
const std::list<Plugin>& plugins,
|
||||
const std::string& masterlistVersion,
|
||||
|
||||
+1
-1
@@ -909,7 +909,7 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) {
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "Generating report...";
|
||||
try {
|
||||
GenerateReport(_game->ReportDataPath(),
|
||||
GenerateReportData(*_game,
|
||||
messages,
|
||||
plugins,
|
||||
revision,
|
||||
|
||||
Reference in New Issue
Block a user