From 968c4390a65abbde00d60550a1fde8cab4bb831e Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Sun, 28 Jul 2013 18:24:10 +0100 Subject: [PATCH] Added tester code to initial BOSS startup, will not be kept when branch is merged, but useful for now. --- src/gui/main.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/gui/main.cpp b/src/gui/main.cpp index b333fbe5..9d879774 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -33,6 +33,7 @@ #include "../backend/generators.h" #include "../backend/network.h" #include "../backend/streams.h" +#include "../backend/legacy-parser.h" #include #include @@ -283,6 +284,31 @@ bool BossGUI::OnInit() { return false; } + //Legacy parser test. +try { + fs::path v2masterlist("../../BOSS/data/boss-skyrim/masterlist.txt"); + list plugins; + list globalMessages; + Loadv2Masterlist(v2masterlist, plugins, globalMessages); + + YAML::Emitter yout; + yout.SetIndent(2); + yout << YAML::BeginMap + << YAML::Key << "globals" << YAML::Value << globalMessages + << YAML::Key << "plugins" << YAML::Value << plugins + << YAML::EndMap; + + boss::ofstream out("foo.txt"); + out << yout.c_str(); + out.close(); + + for (list::iterator it=plugins.begin(), endIt=plugins.end(); it != endIt; ++it) { + it->EvalAllConditions(_game, boss::g_lang_any); + } +} catch (boss::error& e) { + BOOST_LOG_TRIVIAL(error) << "Error using legacy parser: " << e.what(); +} + //Create launcher window. BOOST_LOG_TRIVIAL(debug) << "Opening the main BOSS window."; Launcher * launcher = new Launcher(wxT("BOSS"), _settings, _game, _games);