From 3bd23501a7f3a4ef8fda00851e6882188ca6eb49 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 1 Feb 2018 20:23:45 +0000 Subject: [PATCH] Add GameType value for Fallout 4 VR Also update to the latest libloadorder for its FO4VR support. --- CMakeLists.txt | 2 +- include/loot/enum/game_type.h | 2 ++ src/api/game/load_order_handler.cpp | 3 +++ src/api/plugin/plugin.cpp | 5 +++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0512413b..fc9d75cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,7 @@ set(LIBGIT2_LIBRARIES "${BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_ ExternalProject_Add(libloadorder PREFIX "external" - URL "https://github.com/WrinklyNinja/libloadorder/archive/10.0.4.tar.gz" + URL "https://github.com/WrinklyNinja/libloadorder/archive/10.1.0.tar.gz" CONFIGURE_COMMAND "" BUILD_IN_SOURCE 1 BUILD_COMMAND cargo build --release --all --all-features --target ${RUST_TARGET} diff --git a/include/loot/enum/game_type.h b/include/loot/enum/game_type.h index d937798d..f66a34b9 100644 --- a/include/loot/enum/game_type.h +++ b/include/loot/enum/game_type.h @@ -43,6 +43,8 @@ enum struct GameType : unsigned int { fo4, /** The Elder Scrolls V: Skyrim Special Edition */ tes5se, + /** Fallout 4 VR */ + fo4vr, }; } diff --git a/src/api/game/load_order_handler.cpp b/src/api/game/load_order_handler.cpp index 35f487ce..773c2b44 100644 --- a/src/api/game/load_order_handler.cpp +++ b/src/api/game/load_order_handler.cpp @@ -75,6 +75,9 @@ void LoadOrderHandler::Init(const GameType& gameType, else if (gameType == GameType::fo4) ret = lo_create_handle( &gh_, LIBLO_GAME_FO4, gamePath.string().c_str(), gameLocalDataPath); + else if (gameType == GameType::fo4vr) + ret = lo_create_handle( + &gh_, LIBLO_GAME_FO4VR, gamePath.string().c_str(), gameLocalDataPath); else ret = LIBLO_ERROR_INVALID_ARGS; diff --git a/src/api/plugin/plugin.cpp b/src/api/plugin/plugin.cpp index d244cc8f..6b9b0014 100644 --- a/src/api/plugin/plugin.cpp +++ b/src/api/plugin/plugin.cpp @@ -306,7 +306,7 @@ std::string Plugin::GetDescription() const { } std::string Plugin::GetArchiveFileExtension(const GameType gameType) { - if (gameType == GameType::fo4) + if (gameType == GameType::fo4 || gameType == GameType::fo4vr) return ".ba2"; else return ".bsa"; @@ -362,7 +362,8 @@ bool hasPluginFileExtension(const std::string& filename, GameType gameType) { bool espOrEsm = boost::iends_with(filename, ".esp") || boost::iends_with(filename, ".esm"); bool lightMaster = - (gameType == GameType::fo4 || gameType == GameType::tes5se) && + (gameType == GameType::fo4 || gameType == GameType::fo4vr || + gameType == GameType::tes5se) && boost::iends_with(filename, ".esl"); return espOrEsm || lightMaster;