mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Merge branch 'fallout4-support' into dev
This commit is contained in:
+15
-24
@@ -7,24 +7,14 @@
|
||||
# Get Build Revision
|
||||
##############################
|
||||
|
||||
# Uses the CMake module in this repo: https://github.com/rpavlik/cmake-modules
|
||||
# On Windows, this requires Git for Windows to be installed.
|
||||
find_package(Git)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
|
||||
include(GetGitRevisionDescription OPTIONAL RESULT_VARIABLE GIT_MODULE_PATH)
|
||||
IF (NOT GIT_MODULE_PATH MATCHES "NOTFOUND")
|
||||
get_git_head_revision(GIT_REFSPEC GIT_COMMIT_STRING --tags --long)
|
||||
|
||||
IF (GIT_COMMIT_STRING MATCHES "GITDIR-NOTFOUND")
|
||||
set(GIT_COMMIT_STRING "unknown")
|
||||
ELSE ()
|
||||
# Get a shortened ID. Although knowing the shortest unique string requires Git,
|
||||
# 8 characters should be a good compromise between chance of ambiguity and length,
|
||||
# especially since the version numbers would narrow down the range of possibly
|
||||
# ambiguous commits.
|
||||
string(SUBSTRING ${GIT_COMMIT_STRING} 0 8 GIT_COMMIT_STRING)
|
||||
ENDIF ()
|
||||
ELSE ()
|
||||
IF (GIT_FOUND)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
OUTPUT_VARIABLE GIT_COMMIT_STRING
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
ELSE()
|
||||
SET (GIT_COMMIT_STRING "unknown")
|
||||
ENDIF ()
|
||||
|
||||
@@ -92,7 +82,6 @@ find_package(GTest)
|
||||
|
||||
set (LOOT_SRC "${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/file.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/formid.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/location.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/message.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/message_content.cpp"
|
||||
@@ -106,7 +95,6 @@ set (LOOT_SRC "${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.c
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata_list.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/masterlist.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin_loader.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/helpers/git_helper.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/helpers/helpers.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/helpers/language.cpp"
|
||||
@@ -117,7 +105,6 @@ set (LOOT_SRC "${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.c
|
||||
set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_grammar.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/file.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/formid.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/location.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/message.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/message_content.h"
|
||||
@@ -131,7 +118,6 @@ set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_grammar.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata_list.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/masterlist.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin_loader.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/helpers/git_helper.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/helpers/helpers.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/helpers/language.h"
|
||||
@@ -190,7 +176,6 @@ set (LOOT_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/tests/fixtures.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_condition_grammar.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_conditional_metadata.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_file.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_formid.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_location.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_message.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_message_content.h"
|
||||
@@ -198,7 +183,6 @@ set (LOOT_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/tests/fixtures.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_plugin_metadata.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_tag.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/plugin/test_plugin.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/plugin/test_plugin_loader.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/test_metadata_list.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/test_masterlist.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/test_plugin_sorter.h")
|
||||
@@ -373,12 +357,19 @@ IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
)
|
||||
|
||||
# Copy CEF binaries.
|
||||
FOREACH(cef_dll libcef.dll natives_blob.bin snapshot_blob.bin d3dcompiler_47.dll libEGL.dll libGLESv2.dll wow_helper.exe)
|
||||
FOREACH(cef_dll libcef.dll natives_blob.bin snapshot_blob.bin d3dcompiler_47.dll libEGL.dll libGLESv2.dll)
|
||||
add_custom_command(TARGET LOOT POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMAKE_SOURCE_DIR}/${CEF_ROOT}/$<CONFIGURATION>/${cef_dll}"
|
||||
$<TARGET_FILE_DIR:LOOT>/${cef_dll})
|
||||
ENDFOREACH()
|
||||
|
||||
IF (PROJECT_ARCH MATCHES "32")
|
||||
add_custom_command(TARGET LOOT POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMAKE_SOURCE_DIR}/${CEF_ROOT}/$<CONFIGURATION>/wow_helper.exe"
|
||||
$<TARGET_FILE_DIR:LOOT>/wow_helper.exe)
|
||||
ENDIF ()
|
||||
ELSE ()
|
||||
# Copy CEF binaries.
|
||||
FOREACH(cef_dll libcef.so natives_blob.bin snapshot_blob.bin chrome-sandbox)
|
||||
|
||||
@@ -31,9 +31,9 @@ LOOT requires the following C/C++ libraries (version numbers used in latest deve
|
||||
* [Boost](http://www.boost.org) v1.59.0
|
||||
* [Chromium Embedded Framework](https://bitbucket.org/chromiumembedded/cef) branch 2454: Required to build the GUI, but not the API or tests.
|
||||
* [Google Test](https://github.com/google/googletest) v1.7: Required to build the tests, but not the API or the GUI.
|
||||
* [Libespm](http://github.com/WrinklyNinja/libespm) v1.0.0
|
||||
* [Libgit2](http://libgit2.github.com/) v0.23.3
|
||||
* [Libloadorder](http://github.com/WrinklyNinja/libloadorder) revision 50342d7
|
||||
* [Libespm](http://github.com/WrinklyNinja/libespm) v2.5.0
|
||||
* [Libgit2](http://libgit2.github.com/) v0.23.4
|
||||
* [Libloadorder](http://github.com/WrinklyNinja/libloadorder) revision 3a7d694
|
||||
* [Pseudosem](http://github.com/WrinklyNinja/pseudosem): v1.0.1
|
||||
* [yaml-cpp](http://github.com/WrinklyNinja/yaml-cpp): Use the `patched-for-loot` branch.
|
||||
|
||||
|
||||
@@ -67,8 +67,6 @@ Example CMake keys: `-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=build -DCMAKE_ARCHIVE_OUTP
|
||||
|
||||
#### LOOT
|
||||
|
||||
LOOT uses a third-party CMake module to generate its build revision data, so first download the `GetGitRevisionDescription.cmake` and `GetGitRevisionDescription.cmake.in` files found in [this repository](https://github.com/rpavlik/cmake-modules) to the `build` subdirectory of the LOOT folder.
|
||||
|
||||
1. Set CMake up so that it builds the binaries in the `build` subdirectory of the LOOT folder.
|
||||
2. Define any necessary parameters.
|
||||
3. Configure CMake, then generate a build system for Visual Studio 12.
|
||||
|
||||
@@ -165,7 +165,8 @@ var {
|
||||
</style>
|
||||
<!-- LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and Fallout: New Vegas.
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3,
|
||||
Fallout: New Vegas and Fallout 4.
|
||||
|
||||
Copyright (C) 2012–2015 WrinklyNinja
|
||||
|
||||
|
||||
@@ -165,7 +165,8 @@ var {
|
||||
</style>
|
||||
<!-- LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and Fallout: New Vegas.
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3,
|
||||
Fallout: New Vegas and Fallout 4.
|
||||
|
||||
Copyright (C) 2012–2015 WrinklyNinja
|
||||
|
||||
@@ -211,7 +212,7 @@ var {
|
||||
|
||||
<h2 id="intro">Introduction</h2>
|
||||
|
||||
<p>LOOT is a plugin load order optimiser for TES IV: Oblivion, TES V: Skyrim, Fallout 3 and Fallout: New Vegas. It is designed to assist mod users in avoiding detrimental conflicts, by automatically calculating a load order that satisfies all plugin dependencies and maximises each plugin's impact on the user's game.
|
||||
<p>LOOT is a plugin load order optimiser for TES IV: Oblivion, TES V: Skyrim, Fallout 3, Fallout: New Vegas and Fallout 4. It is designed to assist mod users in avoiding detrimental conflicts, by automatically calculating a load order that satisfies all plugin dependencies and maximises each plugin's impact on the user's game.
|
||||
|
||||
<p>LOOT also provides some load order error checking, including checks for requirements, incompatibilities and cyclic dependencies. In addition, it provides a large number of plugin-specific usage notes, bug warnings and Bash Tag suggestions for Wrye Bash.
|
||||
|
||||
@@ -239,7 +240,7 @@ var {
|
||||
|
||||
<p>When LOOT is run, it will attempt to detect which of the supported games are installed. If a <a href="#settingsDefaultGame">default game</a> has been set, LOOT will run for it, otherwise it will run for the same game as it last ran for. If the relevant game cannot be detected, or if there is no record of the last game LOOT ran for, it will run for the first detected game.
|
||||
|
||||
<p>LOOT can also be launched with the <code>--game=<game folder name></code> command line parameter to set the game to run for. If the supplied game folder name is valid, the default and last game values are ignored. The default folder names are <code>Oblivion</code>, <code>Skyrim</code>, <code>Fallout3</code> and <code>FalloutNV</code>.
|
||||
<p>LOOT can also be launched with the <code>--game=<game folder name></code> command line parameter to set the game to run for. If the supplied game folder name is valid, the default and last game values are ignored. The default folder names are <code>Oblivion</code>, <code>Skyrim</code>, <code>Fallout3</code>, <code>FalloutNV</code> and <code>Fallout4</code>.
|
||||
|
||||
<p>If LOOT cannot detect any supported game installs, it will immediately open the <a href="#usage-settings">Settings dialog</a>. There you can edit LOOT's settings to provide a path to a supported game, after which you can select it from the game menu.
|
||||
|
||||
@@ -315,7 +316,7 @@ var {
|
||||
<li>The plugin's <abbr title="Cyclic Redundancy Checksum">CRC</abbr>, which can be used to uniquely identify it. CRCs are only displayed after they have been calculated during conflict filtering or sorting.
|
||||
<li>The <q>Master File</q> icon.
|
||||
<li>The <q>Empty Plugin</q> icon.
|
||||
<li>The <q>Loads BSA</q> icon.
|
||||
<li>The <q>Loads Archive</q> icon.
|
||||
<li>The <q>Has User Metadata</q> icon.
|
||||
<li>The plugin menu button, which provides access to a few plugin-specific features, including a conflict filter and access to its metadata editor. These are explained in later sections.
|
||||
</ol>
|
||||
@@ -444,7 +445,7 @@ var {
|
||||
<tr><td>Enable Debug Logging<td>If enabled, writes debug output to <code>%LOCALAPPDATA%\LOOT\LOOTDebugLog.txt</code>. Debug logging can have a noticeable impact on performance, so it is off by default.
|
||||
<tr><td id="settingsUpdateMasterlist">Update masterlist before sorting<td>If checked, LOOT will update its masterlist, should an update be available, before sorting plugins.
|
||||
</table>
|
||||
<p>LOOT's game-specific settings can be customised in the games table. New game profiles can be added, making it easy to use LOOT across multiple copies of a game, including total conversion mods. LOOT ships with settings for the <q>Nehrim - At Fate's Edge</q> total conversion mod as an example. Game profiles can also be deleted, though the active game cannot have its profile deleted, and LOOT will recreate the profiles for the four base games it supports (Oblivion, Skyrim, Fallout 3, Fallout: New Vegas) when it is next run.
|
||||
<p>LOOT's game-specific settings can be customised in the games table. New game profiles can be added, making it easy to use LOOT across multiple copies of a game, including total conversion mods. LOOT ships with settings for the <q>Nehrim - At Fate's Edge</q> total conversion mod as an example. Game profiles can also be deleted, though the active game cannot have its profile deleted, and LOOT will recreate the profiles for the four base games it supports (Oblivion, Skyrim, Fallout 3, Fallout: New Vegas, Fallout 4) when it is next run.
|
||||
|
||||
<p>The game settings are explained in the table below.
|
||||
<table>
|
||||
@@ -458,9 +459,10 @@ var {
|
||||
<li>TES V: Skyrim
|
||||
<li>Fallout 3
|
||||
<li>Fallout: New Vegas
|
||||
<li>Fallout 4
|
||||
</ul>
|
||||
<tr><td>LOOT Folder Name<td>The sub-folder which LOOT uses to store the game's files in. Each game must be given a unique sub-folder.
|
||||
<tr><td>Master File<td>The game's main master file. This is specified as it must load before all other plugins. Note that Skyrim-based games will always load Skyrim.esm first, so this column must always be set to <q>Skyrim.esm</q> for such games.
|
||||
<tr><td>Master File<td>The game's main master file. This is checked for when detecting if the game is installed.
|
||||
<tr><td id="settingsMasterlistURL">Masterlist Repository URL<td>The URL of the repository that LOOT uses to update its local copy of the masterlist. If left empty, masterlist updating will be skipped.
|
||||
<br><br>
|
||||
Masterlist repositories are <a href="http://git-scm.com/">Git</a> repositories that are configured to allow unauthenticated read access and contain a masterlist file named <code>masterlist.yaml</code> in their root directory. The LOOT team maintains a set of official repositories for the games that LOOT supports by default.
|
||||
|
||||
@@ -246,6 +246,7 @@ extern "C"
|
||||
LOOT_API extern const unsigned int loot_game_tes5; /**< Game code for The Elder Scrolls V: Skyrim. */
|
||||
LOOT_API extern const unsigned int loot_game_fo3; /**< Game code for Fallout 3. */
|
||||
LOOT_API extern const unsigned int loot_game_fonv; /**< Game code for Fallout: New Vegas. */
|
||||
LOOT_API extern const unsigned int loot_game_fo4; /**< Game code for Fallout: New Vegas. */
|
||||
|
||||
/**@}*/
|
||||
/**********************************************************************//**
|
||||
|
||||
+256
-268
File diff suppressed because it is too large
Load Diff
@@ -46,6 +46,15 @@ games:
|
||||
path: ~
|
||||
registry: Software\Bethesda Softworks\FalloutNV\Installed Path
|
||||
|
||||
- folder: Fallout4
|
||||
name: "Fallout 4"
|
||||
type: Fallout4
|
||||
master: Fallout4.esm
|
||||
repo: https://github.com/loot/fallout4.git
|
||||
branch: master
|
||||
path: ~
|
||||
registry: Software\Bethesda Softworks\Fallout4\Installed Path
|
||||
|
||||
- folder: Nehrim
|
||||
name: Nehrim - At Fate's Edge
|
||||
type: Oblivion
|
||||
|
||||
+4
-1
@@ -58,7 +58,6 @@ function createAppArchive(release_path, dest_path) {
|
||||
'libEGL.dll',
|
||||
'libGLESv2.dll',
|
||||
'libcef.dll',
|
||||
'wow_helper.exe',
|
||||
'natives_blob.bin',
|
||||
'snapshot_blob.bin',
|
||||
'cef.pak',
|
||||
@@ -67,6 +66,10 @@ function createAppArchive(release_path, dest_path) {
|
||||
'devtools_resources.pak',
|
||||
'icudtl.dat'
|
||||
];
|
||||
|
||||
if (helpers.fileExists(path.join(release_path, 'wow_helper.exe'))) {
|
||||
binaries.push('wow_helper.exe');
|
||||
}
|
||||
} else {
|
||||
binaries = [
|
||||
'LOOT',
|
||||
|
||||
@@ -8,8 +8,8 @@ wget -P build https://raw.githubusercontent.com/rpavlik/cmake-modules/master/Get
|
||||
cd ../..
|
||||
|
||||
# Install libespm.
|
||||
wget https://github.com/WrinklyNinja/libespm/archive/1.0.0.tar.gz -O - | tar -xz
|
||||
mv libespm-1.0.0 libespm
|
||||
wget https://github.com/WrinklyNinja/libespm/archive/2.5.0.tar.gz -O - | tar -xz
|
||||
mv libespm-2.5.0 libespm
|
||||
|
||||
# Build yaml-cpp
|
||||
wget https://github.com/WrinklyNinja/yaml-cpp/archive/patched-for-loot.tar.gz -O - | tar -xz
|
||||
@@ -20,16 +20,16 @@ make yaml-cpp
|
||||
cd ../..
|
||||
|
||||
# Build libgit2
|
||||
wget https://github.com/libgit2/libgit2/archive/v0.23.1.tar.gz -O - | tar -xz
|
||||
mv libgit2-0.23.1 libgit2
|
||||
wget https://github.com/libgit2/libgit2/archive/v0.23.4.tar.gz -O - | tar -xz
|
||||
mv libgit2-0.23.4 libgit2
|
||||
mkdir libgit2/build && cd libgit2/build
|
||||
cmake .. -DBUILD_SHARED_LIBS=OFF
|
||||
make git2
|
||||
cd ../..
|
||||
|
||||
# Build libloadorder
|
||||
wget https://github.com/WrinklyNinja/libloadorder/archive/50342d7298f27a6a4366175119bd17aaf09000c7.tar.gz -O - | tar -xz
|
||||
mv libloadorder-50342d7298f27a6a4366175119bd17aaf09000c7 libloadorder
|
||||
wget https://github.com/WrinklyNinja/libloadorder/archive/3a7d694e2eab9957b745fe828da1ed00f537c989.tar.gz -O - | tar -xz
|
||||
mv libloadorder-3a7d694e2eab9957b745fe828da1ed00f537c989 libloadorder
|
||||
mkdir libloadorder/build && cd libloadorder/build
|
||||
cmake .. -DPROJECT_ARCH=64 -DPROJECT_STATIC_RUNTIME=OFF -DBUILD_SHARED_LIBS=OFF -DGTEST_ROOT=../gtest-1.7.0
|
||||
make loadorder64
|
||||
|
||||
@@ -159,16 +159,19 @@ Type: files; Name: "{localappdata}\{#MyAppName}\Oblivion\masterlist.yaml";
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\Skyrim\masterlist.yaml";
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\Fallout3\masterlist.yaml";
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\FalloutNV\masterlist.yaml";
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\Fallout4\masterlist.yaml";
|
||||
|
||||
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Oblivion\.git";
|
||||
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Skyrim\.git";
|
||||
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Fallout3\.git";
|
||||
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\FalloutNV\.git";
|
||||
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Fallout4\.git";
|
||||
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}\Oblivion";
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}\Skyrim";
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}\Fallout3";
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}\FalloutNV";
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}\Fallout4";
|
||||
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}";
|
||||
|
||||
@@ -230,6 +233,7 @@ begin
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\Skyrim\userlist.yaml'));
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\Fallout3\userlist.yaml'));
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\FalloutNV\userlist.yaml'));
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\Fallout4\userlist.yaml'));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
+7
-1
@@ -63,6 +63,7 @@ const unsigned int loot_game_tes4 = loot::Game::tes4;
|
||||
const unsigned int loot_game_tes5 = loot::Game::tes5;
|
||||
const unsigned int loot_game_fo3 = loot::Game::fo3;
|
||||
const unsigned int loot_game_fonv = loot::Game::fonv;
|
||||
const unsigned int loot_game_fo4 = loot::Game::fo4;
|
||||
|
||||
// LOOT message types.
|
||||
const unsigned int loot_message_say = loot::Message::say;
|
||||
@@ -243,7 +244,12 @@ LOOT_API unsigned int loot_create_db(loot_db * const db,
|
||||
const unsigned int clientGame,
|
||||
const char * const gamePath,
|
||||
const char * const gameLocalPath) {
|
||||
if (db == nullptr || (clientGame != loot_game_tes4 && clientGame != loot_game_tes5 && clientGame != loot_game_fo3 && clientGame != loot_game_fonv))
|
||||
if (db == nullptr
|
||||
|| (clientGame != loot_game_tes4
|
||||
&& clientGame != loot_game_tes5
|
||||
&& clientGame != loot_game_fo3
|
||||
&& clientGame != loot_game_fonv
|
||||
&& clientGame != loot_game_fo4))
|
||||
return c_error(loot_error_invalid_args, "Null pointer passed.");
|
||||
|
||||
//Set the locale to get encoding conversions working correctly.
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace loot {
|
||||
Game::Game(const unsigned int gameCode, const std::string& folder) : GameSettings(gameCode, folder), _pluginsFullyLoaded(false) {}
|
||||
|
||||
void Game::Init(bool createFolder, const boost::filesystem::path& gameLocalAppData) {
|
||||
if (Id() != Game::tes4 && Id() != Game::tes5 && Id() != Game::fo3 && Id() != Game::fonv) {
|
||||
if (Id() != Game::tes4 && Id() != Game::tes5 && Id() != Game::fo3 && Id() != Game::fonv && Id() != Game::fo4) {
|
||||
throw error(error::invalid_args, lc::translate("Invalid game ID supplied.").str());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace loot {
|
||||
const unsigned int GameSettings::tes5 = 2;
|
||||
const unsigned int GameSettings::fo3 = 3;
|
||||
const unsigned int GameSettings::fonv = 4;
|
||||
const unsigned int GameSettings::fo4 = 5;
|
||||
|
||||
GameSettings::GameSettings() : _id(GameSettings::autodetect) {}
|
||||
|
||||
@@ -78,6 +79,14 @@ namespace loot {
|
||||
_repositoryURL = "https://github.com/loot/falloutnv.git";
|
||||
_repositoryBranch = "v0.8";
|
||||
}
|
||||
else if (Id() == GameSettings::fo4) {
|
||||
_name = "Fallout 4";
|
||||
_registryKey = "Software\\Bethesda Softworks\\Fallout4\\Installed Path";
|
||||
_lootFolderName = "Fallout4";
|
||||
_masterFile = "Fallout4.esm";
|
||||
_repositoryURL = "https://github.com/loot/fallout4.git";
|
||||
_repositoryBranch = "v0.8";
|
||||
}
|
||||
|
||||
if (!folder.empty())
|
||||
_lootFolderName = folder;
|
||||
@@ -120,6 +129,19 @@ namespace loot {
|
||||
return _id;
|
||||
}
|
||||
|
||||
libespm::GameId GameSettings::LibespmId() const {
|
||||
if (_id == GameSettings::tes4)
|
||||
return libespm::GameId::OBLIVION;
|
||||
else if (_id == GameSettings::tes5)
|
||||
return libespm::GameId::SKYRIM;
|
||||
else if (_id == GameSettings::fo3)
|
||||
return libespm::GameId::FALLOUT3;
|
||||
else if (_id == GameSettings::fonv)
|
||||
return libespm::GameId::FALLOUTNV;
|
||||
else
|
||||
return libespm::GameId::FALLOUT4;
|
||||
}
|
||||
|
||||
string GameSettings::Name() const {
|
||||
return _name;
|
||||
}
|
||||
@@ -223,6 +245,9 @@ namespace loot {
|
||||
if (find(games.begin(), games.end(), GameSettings(GameSettings::fonv)) == games.end())
|
||||
games.push_back(GameSettings(GameSettings::fonv));
|
||||
|
||||
if (find(games.begin(), games.end(), GameSettings(GameSettings::fo4)) == games.end())
|
||||
games.push_back(GameSettings(GameSettings::fo4));
|
||||
|
||||
// If there were any missing defaults, make sure they're in settings now.
|
||||
settings["games"] = games;
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#include <libespm/GameId.h>
|
||||
|
||||
namespace loot {
|
||||
class GameSettings {
|
||||
public:
|
||||
@@ -44,6 +46,7 @@ namespace loot {
|
||||
bool operator == (const GameSettings& rhs) const; //Compares names and folder names.
|
||||
|
||||
unsigned int Id() const;
|
||||
libespm::GameId LibespmId() const;
|
||||
std::string Name() const; //Returns the game's name, eg. "TES IV: Oblivion".
|
||||
std::string FolderName() const;
|
||||
std::string Master() const;
|
||||
@@ -68,6 +71,7 @@ namespace loot {
|
||||
static const unsigned int tes5;
|
||||
static const unsigned int fo3;
|
||||
static const unsigned int fonv;
|
||||
static const unsigned int fo4;
|
||||
private:
|
||||
unsigned int _id;
|
||||
std::string _name;
|
||||
@@ -119,6 +123,8 @@ namespace YAML {
|
||||
rhs = loot::GameSettings(loot::GameSettings::fo3, node["folder"].as<std::string>());
|
||||
else if (node["type"].as<std::string>() == loot::GameSettings(loot::GameSettings::fonv).FolderName())
|
||||
rhs = loot::GameSettings(loot::GameSettings::fonv, node["folder"].as<std::string>());
|
||||
else if (node["type"].as<std::string>() == loot::GameSettings(loot::GameSettings::fo4).FolderName())
|
||||
rhs = loot::GameSettings(loot::GameSettings::fo4, node["folder"].as<std::string>());
|
||||
else
|
||||
throw RepresentationException(node.Mark(), "bad conversion: invalid value for 'type' key in 'game settings' object");
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ namespace loot {
|
||||
if (game.Id() != GameSettings::tes4
|
||||
&& game.Id() != GameSettings::tes5
|
||||
&& game.Id() != GameSettings::fo3
|
||||
&& game.Id() != GameSettings::fonv) {
|
||||
&& game.Id() != GameSettings::fonv
|
||||
&& game.Id() != GameSettings::fo4) {
|
||||
throw error(error::invalid_args, lc::translate("Unsupported game ID supplied.").str());
|
||||
}
|
||||
|
||||
@@ -74,6 +75,8 @@ namespace loot {
|
||||
ret = lo_create_handle(&_gh, LIBLO_GAME_FO3, game.GamePath().string().c_str(), gameLocalDataPath);
|
||||
else if (game.Id() == GameSettings::fonv)
|
||||
ret = lo_create_handle(&_gh, LIBLO_GAME_FNV, game.GamePath().string().c_str(), gameLocalDataPath);
|
||||
else if (game.Id() == GameSettings::fo4)
|
||||
ret = lo_create_handle(&_gh, LIBLO_GAME_FO4, game.GamePath().string().c_str(), gameLocalDataPath);
|
||||
else
|
||||
ret = LIBLO_ERROR_INVALID_ARGS;
|
||||
|
||||
@@ -92,28 +95,6 @@ namespace loot {
|
||||
lo_cleanup();
|
||||
throw error(error::liblo_error, err);
|
||||
}
|
||||
|
||||
if (game.Id() != GameSettings::tes5) {
|
||||
ret = lo_set_game_master(_gh, game.Master().c_str());
|
||||
if (ret != LIBLO_OK && ret != LIBLO_WARN_BAD_FILENAME && ret != LIBLO_WARN_INVALID_LIST && ret != LIBLO_WARN_LO_MISMATCH) {
|
||||
const char * e = nullptr;
|
||||
string err;
|
||||
lo_get_error_message(&e);
|
||||
lo_destroy_handle(_gh);
|
||||
_gh = nullptr;
|
||||
|
||||
if (e == nullptr) {
|
||||
BOOST_LOG_TRIVIAL(error) << "libloadorder failed to initialise game master file support. Details could not be fetched.";
|
||||
err = lc::translate("libloadorder failed to initialise game master file support. Details could not be fetched.").str();
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(error) << "libloadorder failed to initialise game master file support. Details: " << e;
|
||||
err = lc::translate("libloadorder failed to initialise game master file support. Details:").str() + " " + e;
|
||||
}
|
||||
lo_cleanup();
|
||||
throw error(error::liblo_error, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::unordered_set<std::string> LoadOrderHandler::GetActivePlugins() const {
|
||||
|
||||
@@ -165,6 +165,10 @@ namespace loot {
|
||||
BOOST_LOG_TRIVIAL(info) << "Repository doesn't exist, cloning the remote repository.";
|
||||
|
||||
fs::path tempPath = fs::temp_directory_path() / fs::unique_path();
|
||||
|
||||
//Delete temporary folder in case it already exists.
|
||||
fs::remove_all(tempPath);
|
||||
|
||||
if (!fs::is_empty(path)) {
|
||||
// Directory is non-empty. Delete the masterlist file and
|
||||
// .git folder, then move any remaining files to a temporary
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2012-2015 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "formid.h"
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace loot {
|
||||
FormID::FormID() : id(0) {}
|
||||
|
||||
FormID::FormID(const std::string& sourcePlugin, const uint32_t objectID) : plugin(sourcePlugin), id(objectID) {}
|
||||
|
||||
FormID::FormID(const std::vector<std::string>& sourcePlugins, const uint32_t formID) {
|
||||
unsigned int index = formID >> 24;
|
||||
id = formID & ~((uint32_t)index << 24);
|
||||
|
||||
if (index >= sourcePlugins.size()) {
|
||||
BOOST_LOG_TRIVIAL(trace) << hex << formID << dec << " in " << sourcePlugins.back() << " has a higher modIndex than expected.";
|
||||
index = sourcePlugins.size() - 1;
|
||||
}
|
||||
|
||||
plugin = sourcePlugins[index];
|
||||
}
|
||||
|
||||
bool FormID::operator == (const FormID& rhs) const {
|
||||
return (id == rhs.Id() && boost::iequals(plugin, rhs.Plugin()));
|
||||
}
|
||||
|
||||
bool FormID::operator < (const FormID& rhs) const {
|
||||
if (id != rhs.Id())
|
||||
return id < rhs.Id();
|
||||
else
|
||||
return boost::ilexicographical_compare(plugin, rhs.Plugin());
|
||||
}
|
||||
|
||||
std::string FormID::Plugin() const {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
uint32_t FormID::Id() const {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2012-2015 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __LOOT_METADATA_FORMID__
|
||||
#define __LOOT_METADATA_FORMID__
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace loot {
|
||||
// A FormID is a 32 bit unsigned integer of the form xxYYYYYY in hex.
|
||||
// The xx is the position in the masters list of the plugin that the FormID
|
||||
// is from, and the YYYYYY is the rest of the FormID. Here the xx bit is
|
||||
// stored as the corresponding filename to allow comparison between FormIDs
|
||||
// from different plugins.
|
||||
class FormID {
|
||||
public:
|
||||
FormID();
|
||||
FormID(const std::string& pluginName, const uint32_t objectID);
|
||||
FormID(const std::vector<std::string>& masters, const uint32_t formID); //The masters here also includes the plugin that they are masters of as the last element.
|
||||
|
||||
bool operator < (const FormID& rhs) const;
|
||||
bool operator == (const FormID& rhs) const;
|
||||
|
||||
std::string Plugin() const;
|
||||
uint32_t Id() const;
|
||||
private:
|
||||
std::string plugin;
|
||||
uint32_t id;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -296,8 +296,12 @@ namespace loot {
|
||||
++it;
|
||||
}
|
||||
|
||||
//First need to get plugin's CRC, if it is an exact plugin and it does not have its CRC set.
|
||||
if (!IsRegexPlugin()) {
|
||||
// Regex plugins shouldn't have dirty info, but just clear in case.
|
||||
if (IsRegexPlugin())
|
||||
_dirtyInfo.clear();
|
||||
|
||||
if (!_dirtyInfo.empty()) {
|
||||
//First need to get plugin's CRC, if it is an exact plugin and it does not have its CRC set.
|
||||
uint32_t crc = game.GetCachedCrc(name);
|
||||
if (crc == 0) {
|
||||
if (boost::filesystem::exists(game.DataPath() / name)) {
|
||||
@@ -324,10 +328,6 @@ namespace loot {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Regex plugins shouldn't have dirty info, but just clear in case.
|
||||
_dirtyInfo.clear();
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user