From 353221dabfe1defe22dca5d81bf2ce1c218854bc Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Fri, 16 Aug 2013 14:41:00 +0100 Subject: [PATCH] Updated libespm usage to reflect library changes. --- src/backend/game.cpp | 14 ++++---------- src/backend/game.h | 4 ++-- src/backend/globals.cpp | 1 - src/backend/globals.h | 1 - src/backend/metadata.cpp | 2 +- src/gui/main.cpp | 3 --- 6 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/backend/game.cpp b/src/backend/game.cpp index 2858180d..08351e4a 100644 --- a/src/backend/game.cpp +++ b/src/backend/game.cpp @@ -62,45 +62,39 @@ namespace boss { Game::Game(const std::string& folder) : bossFolderName(folder) {} Game::Game(const unsigned int gameCode, const std::string& folder) : id(gameCode) { - string libespmGame; if (Id() == g_game_tes4) { _name = "TES IV: Oblivion"; registryKey = "Software\\Bethesda Softworks\\Oblivion\\Installed Path"; bossFolderName = "Oblivion"; _masterFile = "Oblivion.esm"; - libespmGame = "Oblivion"; + espm::InitPredefinedSettings("Oblivion", espm_settings); _masterlistURL = "http://better-oblivion-sorting-software.googlecode.com/svn/data/boss-oblivion/masterlist.yaml"; } else if (Id() == g_game_tes5) { _name = "TES V: Skyrim"; registryKey = "Software\\Bethesda Softworks\\Skyrim\\Installed Path"; bossFolderName = "Skyrim"; _masterFile = "Skyrim.esm"; - libespmGame = "Skyrim"; + espm::InitPredefinedSettings("Skyrim", espm_settings); _masterlistURL = "http://better-oblivion-sorting-software.googlecode.com/svn/data/boss-skyrim/masterlist.yaml"; } else if (Id() == g_game_fo3) { _name = "Fallout 3"; registryKey = "Software\\Bethesda Softworks\\Fallout3\\Installed Path"; bossFolderName = "Fallout3"; _masterFile = "Fallout3.esm"; - libespmGame = "Fallout3"; + espm::InitPredefinedSettings("Fallout3", espm_settings); _masterlistURL = "http://better-oblivion-sorting-software.googlecode.com/svn/data/boss-fallout/masterlist.yaml"; } else if (Id() == g_game_fonv) { _name = "Fallout: New Vegas"; registryKey = "Software\\Bethesda Softworks\\FalloutNV\\Installed Path"; bossFolderName = "FalloutNV"; _masterFile = "FalloutNV.esm"; - libespmGame = "FalloutNV"; + espm::InitPredefinedSettings("FalloutNV", espm_settings); _masterlistURL = "http://better-oblivion-sorting-software.googlecode.com/svn/data/boss-fallout-nv/masterlist.yaml"; } else throw error(error::invalid_args, "Invalid game ID supplied."); if (!folder.empty()) bossFolderName = folder; - - if (fs::exists(g_path_libespm_settings)) - espm_settings = espm::Settings(g_path_libespm_settings.string(), libespmGame); - else - throw error(error::path_not_found, "Libespm settings file could not be found."); } Game& Game::SetDetails(const std::string& name, const std::string& masterFile, diff --git a/src/backend/game.h b/src/backend/game.h index 6c7d75bd..4ecdeda0 100644 --- a/src/backend/game.h +++ b/src/backend/game.h @@ -33,8 +33,8 @@ #include #include -#include -#include +#include +#include namespace boss { diff --git a/src/backend/globals.cpp b/src/backend/globals.cpp index a75961f0..d7a97796 100644 --- a/src/backend/globals.cpp +++ b/src/backend/globals.cpp @@ -52,7 +52,6 @@ namespace boss { //Common paths. const boost::filesystem::path g_path_readme = boost::filesystem::current_path() / "docs" / "BOSS Readme.html"; - const boost::filesystem::path g_path_libespm_settings = boost::filesystem::current_path() / "resources" / "libespm.yaml"; const boost::filesystem::path g_path_css = boost::filesystem::current_path() / "resources" / "style.css"; const boost::filesystem::path g_path_js = boost::filesystem::current_path() / "resources" / "script.js"; const boost::filesystem::path g_path_polyfill = boost::filesystem::current_path() / "resources" / "polyfill.js"; diff --git a/src/backend/globals.h b/src/backend/globals.h index b0433339..8decce06 100644 --- a/src/backend/globals.h +++ b/src/backend/globals.h @@ -55,7 +55,6 @@ namespace boss { extern const boost::filesystem::path g_path_local; extern const boost::filesystem::path g_path_readme; extern const boost::filesystem::path g_path_settings; - extern const boost::filesystem::path g_path_libespm_settings; extern const boost::filesystem::path g_path_css; extern const boost::filesystem::path g_path_js; extern const boost::filesystem::path g_path_polyfill; diff --git a/src/backend/metadata.cpp b/src/backend/metadata.cpp index fe80129e..3b357b14 100644 --- a/src/backend/metadata.cpp +++ b/src/backend/metadata.cpp @@ -25,7 +25,7 @@ #include "metadata.h" #include "parsers.h" -#include +#include #include #include diff --git a/src/gui/main.cpp b/src/gui/main.cpp index a036cb92..06a38022 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -41,9 +41,6 @@ #include #include -#include -#include - #include #include #include