aboutsummaryrefslogtreecommitdiff
path: root/libs/game_bethesda/src/games/falloutnv
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 02:37:39 -0600
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 02:37:39 -0600
commit7ee008e150bc5bcf76082d726f719ee0fdfda982 (patch)
tree27fb39be241fdb5ac2734c574de678977d1856d0 /libs/game_bethesda/src/games/falloutnv
Fluorine Manager: full Linux port of Mod Organizer 2
Complete native Linux port with FUSE-based virtual filesystem, Proton/umu-run integration, and Flatpak packaging. Key features: - FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak) - Proton/GE-Proton/umu-run launcher with env var forwarding - Flatpak support (sandbox-aware VFS, NXM handler, umu-run) - Wine prefix management UI - Case-insensitive path resolution for Linux filesystems - QSettings-safe INI handling (avoids Bethesda INI corruption) - Portable instance support with auto-generated launcher scripts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/game_bethesda/src/games/falloutnv')
-rw-r--r--libs/game_bethesda/src/games/falloutnv/CMakeLists.txt31
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.cpp16
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.h20
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.cpp32
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.h23
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvmoddatachecker.h51
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvmoddatacontent.h22
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvsavegame.cpp77
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvsavegame.h23
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvscriptextender.cpp18
-rw-r--r--libs/game_bethesda/src/games/falloutnv/falloutnvscriptextender.h17
-rw-r--r--libs/game_bethesda/src/games/falloutnv/game_falloutNV_en.ts22
-rw-r--r--libs/game_bethesda/src/games/falloutnv/gamefalloutnv.cpp334
-rw-r--r--libs/game_bethesda/src/games/falloutnv/gamefalloutnv.h70
-rw-r--r--libs/game_bethesda/src/games/falloutnv/gamefalloutnv.json1
15 files changed, 757 insertions, 0 deletions
diff --git a/libs/game_bethesda/src/games/falloutnv/CMakeLists.txt b/libs/game_bethesda/src/games/falloutnv/CMakeLists.txt
new file mode 100644
index 0000000..4b7a556
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/CMakeLists.txt
@@ -0,0 +1,31 @@
+cmake_minimum_required(VERSION 3.16)
+
+add_library(game_falloutnv SHARED
+ falloutnvbsainvalidation.cpp
+ falloutnvbsainvalidation.h
+ falloutnvdataarchives.cpp
+ falloutnvdataarchives.h
+ falloutnvmoddatachecker.h
+ falloutnvmoddatacontent.h
+ falloutnvsavegame.cpp
+ falloutnvsavegame.h
+ falloutnvscriptextender.cpp
+ falloutnvscriptextender.h
+ gamefalloutnv.cpp
+ gamefalloutnv.h
+)
+mo2_configure_plugin(game_falloutnv NO_SOURCES WARNINGS 4)
+mo2_default_source_group()
+target_link_libraries(game_falloutnv PRIVATE game_gamebryo)
+set_target_properties(game_falloutnv PROPERTIES OUTPUT_NAME "game_falloutNV")
+mo2_install_plugin(game_falloutnv)
+
+if(NOT WIN32)
+ add_custom_command(TARGET game_falloutnv POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/src/src/plugins"
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "$<TARGET_FILE:game_falloutnv>"
+ "${CMAKE_BINARY_DIR}/src/src/plugins/libgame_falloutNV.so"
+ COMMAND ${CMAKE_COMMAND} -E rm -f
+ "${CMAKE_BINARY_DIR}/src/src/plugins/libgame_falloutnv.so")
+endif()
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.cpp b/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.cpp
new file mode 100644
index 0000000..d66591f
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.cpp
@@ -0,0 +1,16 @@
+#include "falloutnvbsainvalidation.h"
+
+FalloutNVBSAInvalidation::FalloutNVBSAInvalidation(MOBase::DataArchives* dataArchives,
+ MOBase::IPluginGame const* game)
+ : GamebryoBSAInvalidation(dataArchives, "fallout.ini", game)
+{}
+
+QString FalloutNVBSAInvalidation::invalidationBSAName() const
+{
+ return "Fallout - Invalidation.bsa";
+}
+
+unsigned long FalloutNVBSAInvalidation::bsaVersion() const
+{
+ return 0x68;
+}
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.h b/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.h
new file mode 100644
index 0000000..2301acf
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.h
@@ -0,0 +1,20 @@
+#ifndef FALLOUTNVBSAINVALIDATION_H
+#define FALLOUTNVBSAINVALIDATION_H
+
+#include "falloutnvdataarchives.h"
+#include "gamebryobsainvalidation.h"
+
+#include <memory>
+
+class FalloutNVBSAInvalidation : public GamebryoBSAInvalidation
+{
+public:
+ FalloutNVBSAInvalidation(MOBase::DataArchives* dataArchives,
+ MOBase::IPluginGame const* game);
+
+private:
+ virtual QString invalidationBSAName() const override;
+ virtual unsigned long bsaVersion() const override;
+};
+
+#endif // FALLOUTNVBSAINVALIDATION_H
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.cpp b/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.cpp
new file mode 100644
index 0000000..7314561
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.cpp
@@ -0,0 +1,32 @@
+#include "falloutnvdataarchives.h"
+#include <utility.h>
+
+QStringList FalloutNVDataArchives::vanillaArchives() const
+{
+ return {"Fallout - Textures.bsa", "Fallout - Textures2.bsa", "Fallout - Meshes.bsa",
+ "Fallout - Voices1.bsa", "Fallout - Sound.bsa", "Fallout - Misc.bsa"};
+}
+
+QStringList FalloutNVDataArchives::archives(const MOBase::IProfile* profile) const
+{
+ QStringList result;
+
+ QString iniFile = profile->localSettingsEnabled()
+ ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini")
+ : localGameDirectory().absoluteFilePath("fallout.ini");
+ result.append(getArchivesFromKey(iniFile, "SArchiveList",
+ 8192)); // NVAC expands the maximum string limit
+
+ return result;
+}
+
+void FalloutNVDataArchives::writeArchiveList(MOBase::IProfile* profile,
+ const QStringList& before)
+{
+ QString list = before.join(", ");
+
+ QString iniFile = profile->localSettingsEnabled()
+ ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini")
+ : localGameDirectory().absoluteFilePath("fallout.ini");
+ setArchivesToKey(iniFile, "SArchiveList", list);
+}
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.h b/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.h
new file mode 100644
index 0000000..07e64a1
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.h
@@ -0,0 +1,23 @@
+#ifndef FALLOUTNVDATAARCHIVES_H
+#define FALLOUTNVDATAARCHIVES_H
+
+#include <QDir>
+#include <QString>
+#include <QStringList>
+#include <gamebryodataarchives.h>
+#include <iprofile.h>
+
+class FalloutNVDataArchives : public GamebryoDataArchives
+{
+public:
+ using GamebryoDataArchives::GamebryoDataArchives;
+
+ virtual QStringList vanillaArchives() const override;
+ virtual QStringList archives(const MOBase::IProfile* profile) const override;
+
+private:
+ virtual void writeArchiveList(MOBase::IProfile* profile,
+ const QStringList& before) override;
+};
+
+#endif // FALLOUTNVDATAARCHIVES_H
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvmoddatachecker.h b/libs/game_bethesda/src/games/falloutnv/falloutnvmoddatachecker.h
new file mode 100644
index 0000000..02c5c7f
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvmoddatachecker.h
@@ -0,0 +1,51 @@
+#ifndef FALLOUTNV_MODATACHECKER_H
+#define FALLOUTNV_MODATACHECKER_H
+
+#include <gamebryomoddatachecker.h>
+
+class FalloutNVModDataChecker : public GamebryoModDataChecker
+{
+public:
+ using GamebryoModDataChecker::GamebryoModDataChecker;
+
+protected:
+ virtual const FileNameSet& possibleFolderNames() const override
+ {
+ static FileNameSet result{"fonts",
+ "interface",
+ "menus",
+ "meshes",
+ "music",
+ "scripts",
+ "shaders",
+ "sound",
+ "strings",
+ "textures",
+ "trees",
+ "video",
+ "facegen",
+ "materials",
+ "nvse",
+ "distantlod",
+ "asi",
+ "Tools",
+ "MCM",
+ "distantland",
+ "mits",
+ "dllplugins",
+ "CalienteTools",
+ "shadersfx",
+ "config",
+ "KEYWORDS",
+ "BaseObjectSwapper",
+ "RaceMenuPresets"};
+ return result;
+ }
+ virtual const FileNameSet& possibleFileExtensions() const override
+ {
+ static FileNameSet result{"esp", "esm", "bsa", "modgroups", "ini"};
+ return result;
+ }
+};
+
+#endif // FALLOUTNV_MODATACHECKER_H
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvmoddatacontent.h b/libs/game_bethesda/src/games/falloutnv/falloutnvmoddatacontent.h
new file mode 100644
index 0000000..4effd97
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvmoddatacontent.h
@@ -0,0 +1,22 @@
+#ifndef FALLOUTNV_MODDATACONTENT_H
+#define FALLOUTNV_MODDATACONTENT_H
+
+#include <gamebryomoddatacontent.h>
+#include <ifiletree.h>
+
+class FalloutNVModDataContent : public GamebryoModDataContent
+{
+public:
+ /**
+ *
+ */
+ FalloutNVModDataContent(MOBase::IGameFeatures const* gameFeatures)
+ : GamebryoModDataContent(gameFeatures)
+ {
+ // Just need to disable some contents:
+ m_Enabled[CONTENT_MCM] = false;
+ m_Enabled[CONTENT_SKYPROC] = false;
+ }
+};
+
+#endif // FALLOUTNV_MODDATACONTENT_H
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvsavegame.cpp b/libs/game_bethesda/src/games/falloutnv/falloutnvsavegame.cpp
new file mode 100644
index 0000000..e6bbc2d
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvsavegame.cpp
@@ -0,0 +1,77 @@
+#include "falloutnvsavegame.h"
+
+#include "gamefalloutnv.h"
+
+FalloutNVSaveGame::FalloutNVSaveGame(QString const& fileName, GameFalloutNV const* game)
+ : GamebryoSaveGame(fileName, game)
+{
+ FileWrapper file(getFilepath(), "FO3SAVEGAME");
+ uint32_t width, height;
+ fetchInformationFields(file, width, height, m_SaveNumber, m_PCName, m_PCLevel,
+ m_PCLocation);
+}
+
+void FalloutNVSaveGame::fetchInformationFields(FileWrapper& file, uint32_t& width,
+ uint32_t& height,
+ uint32_t& saveNumber,
+ QString& playerName,
+ unsigned short& playerLevel,
+ QString& playerLocation) const
+{
+ file.skip<uint32_t>(); // Save header size
+
+ file.skip<uint32_t>(); // File version?
+ file.skip<unsigned char>(); // Delimiter
+
+ // A huge wodge of text with no length but a delimiter. Given the null bytes
+ // in it I presume it's fixed length (64 bytes + delim) but I have no
+ // definite spec
+ for (unsigned char ignore = 0; ignore != 0x7c;) {
+ file.read(ignore); // unknown
+ }
+
+ file.setHasFieldMarkers(true);
+ file.setPluginString(GamebryoSaveGame::StringType::TYPE_BZSTRING);
+
+ file.read(width);
+ file.read(height);
+ file.read(saveNumber);
+ file.read(playerName);
+
+ QString whatthis;
+ file.read(whatthis);
+
+ long level;
+ file.read(level);
+ playerLevel = level;
+ file.read(playerLocation);
+}
+
+std::unique_ptr<GamebryoSaveGame::DataFields> FalloutNVSaveGame::fetchDataFields() const
+{
+ FileWrapper file(getFilepath(), "FO3SAVEGAME");
+
+ std::unique_ptr<DataFields> fields = std::make_unique<DataFields>();
+
+ uint32_t width, height;
+ {
+ QString dummyName, dummyLocation;
+ unsigned short dummyLevel;
+ uint32_t dummySaveNumber;
+
+ fetchInformationFields(file, width, height, dummySaveNumber, dummyName, dummyLevel,
+ dummyLocation);
+ }
+
+ QString playtime;
+ file.read(playtime);
+
+ fields->Screenshot = file.readImage(width, height, 256);
+
+ file.skip<char>(5); // unknown (1 byte), plugin size (4 bytes)
+
+ file.setPluginString(GamebryoSaveGame::StringType::TYPE_BSTRING);
+ fields->Plugins = file.readPlugins();
+
+ return fields;
+}
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvsavegame.h b/libs/game_bethesda/src/games/falloutnv/falloutnvsavegame.h
new file mode 100644
index 0000000..191deaf
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvsavegame.h
@@ -0,0 +1,23 @@
+#ifndef FALLOUTNVSAVEGAME_H
+#define FALLOUTNVSAVEGAME_H
+
+#include "gamebryosavegame.h"
+
+class GameFalloutNV;
+
+class FalloutNVSaveGame : public GamebryoSaveGame
+{
+public:
+ FalloutNVSaveGame(QString const& fileName, GameFalloutNV const* game);
+
+protected:
+ // Fetch easy-to-access information.
+ void fetchInformationFields(FileWrapper& wrapper, uint32_t& width,
+ uint32_t& height, uint32_t& saveNumber,
+ QString& playerName, unsigned short& playerLevel,
+ QString& playerLocation) const;
+
+ std::unique_ptr<DataFields> fetchDataFields() const override;
+};
+
+#endif // FALLOUTNVSAVEGAME_H
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvscriptextender.cpp b/libs/game_bethesda/src/games/falloutnv/falloutnvscriptextender.cpp
new file mode 100644
index 0000000..fc00c31
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvscriptextender.cpp
@@ -0,0 +1,18 @@
+#include "falloutnvscriptextender.h"
+
+#include <QString>
+#include <QStringList>
+
+FalloutNVScriptExtender::FalloutNVScriptExtender(GameGamebryo const* game)
+ : GamebryoScriptExtender(game)
+{}
+
+QString FalloutNVScriptExtender::BinaryName() const
+{
+ return "nvse_loader.exe";
+}
+
+QString FalloutNVScriptExtender::PluginPath() const
+{
+ return "nvse/plugins";
+}
diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvscriptextender.h b/libs/game_bethesda/src/games/falloutnv/falloutnvscriptextender.h
new file mode 100644
index 0000000..9db160f
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/falloutnvscriptextender.h
@@ -0,0 +1,17 @@
+#ifndef FALLOUTNVSCRIPTEXTENDER_H
+#define FALLOUTNVSCRIPTEXTENDER_H
+
+#include "gamebryoscriptextender.h"
+
+class GameGamebryo;
+
+class FalloutNVScriptExtender : public GamebryoScriptExtender
+{
+public:
+ FalloutNVScriptExtender(const GameGamebryo* game);
+
+ virtual QString BinaryName() const override;
+ virtual QString PluginPath() const override;
+};
+
+#endif // FALLOUTNVSCRIPTEXTENDER_H
diff --git a/libs/game_bethesda/src/games/falloutnv/game_falloutNV_en.ts b/libs/game_bethesda/src/games/falloutnv/game_falloutNV_en.ts
new file mode 100644
index 0000000..8aa62ec
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/game_falloutNV_en.ts
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="en_US">
+<context>
+ <name>GameFalloutNV</name>
+ <message>
+ <location filename="gamefalloutnv.cpp" line="181"/>
+ <source>Fallout NV Support Plugin</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="gamefalloutnv.cpp" line="191"/>
+ <source>Adds support for the game Fallout New Vegas</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="gamefalloutnv.cpp" line="203"/>
+ <source>While not recommended by the FNV modding community, enables LOOT sorting</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.cpp b/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.cpp
new file mode 100644
index 0000000..1e8e9e9
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.cpp
@@ -0,0 +1,334 @@
+#include "gamefalloutnv.h"
+
+#include "falloutnvbsainvalidation.h"
+#include "falloutnvdataarchives.h"
+#include "falloutnvmoddatachecker.h"
+#include "falloutnvmoddatacontent.h"
+#include "falloutnvsavegame.h"
+#include "falloutnvscriptextender.h"
+
+#include "executableinfo.h"
+#include "pluginsetting.h"
+#include "versioninfo.h"
+#include <gamebryogameplugins.h>
+#include <gamebryolocalsavegames.h>
+#include <gamebryosavegameinfo.h>
+#include <gamebryounmanagedmods.h>
+
+#include <QCoreApplication>
+#include <QDir>
+#include <QFileInfo>
+#include <QList>
+#include <QObject>
+#include <QString>
+#include <QStringList>
+
+#include <memory>
+
+using namespace MOBase;
+
+GameFalloutNV::GameFalloutNV() {}
+
+bool GameFalloutNV::init(IOrganizer* moInfo)
+{
+ if (!GameGamebryo::init(moInfo)) {
+ return false;
+ }
+
+ auto dataArchives = std::make_shared<FalloutNVDataArchives>(this);
+ registerFeature(std::make_shared<FalloutNVScriptExtender>(this));
+ registerFeature(dataArchives);
+ registerFeature(std::make_shared<FalloutNVBSAInvalidation>(dataArchives.get(), this));
+ registerFeature(std::make_shared<GamebryoSaveGameInfo>(this));
+ registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "fallout.ini"));
+ registerFeature(std::make_shared<FalloutNVModDataChecker>(this));
+ registerFeature(
+ std::make_shared<FalloutNVModDataContent>(m_Organizer->gameFeatures()));
+ registerFeature(std::make_shared<GamebryoGamePlugins>(moInfo));
+ registerFeature(std::make_shared<GamebryoUnmangedMods>(this));
+
+ return true;
+}
+
+void GameFalloutNV::setVariant(QString variant)
+{
+ m_GameVariant = variant;
+}
+
+void GameFalloutNV::checkVariants()
+{
+ QFileInfo gog_dll(m_GamePath + "\\Galaxy.dll");
+ QFileInfo epic_dll(m_GamePath + "\\EOSSDK-Win32-Shipping.dll");
+ if (gog_dll.exists())
+ setVariant("GOG");
+ else if (epic_dll.exists())
+ setVariant("Epic Games");
+ else
+ setVariant("Steam");
+}
+
+QDir GameFalloutNV::documentsDirectory() const
+{
+ return m_MyGamesPath;
+}
+
+QString GameFalloutNV::identifyGamePath() const
+{
+ auto result = GameGamebryo::identifyGamePath(); // Default registry path
+ // EPIC Game Store
+ if (result.isEmpty()) {
+ /**
+ * Basegame: 5daeb974a22a435988892319b3a4f476
+ * Dead Money: b290229eb58045cbab9501640f3278f3
+ * Honest Hearts: 562d4a2c1b3147b089a7c453e3ddbcbe
+ * Old World Blues: c8dae1ab0570475a8b38a9041e614840
+ * Lonesome Road: 4fa3d8d9b2cb4714a19a38d1a598be8f
+ * Gun Runners' Arsenal: 7dcfb9cd9d134728b2646466c34c7b3b
+ * Courier's Stash: ee9a44b4530942499ef1c8c390731fce
+ */
+ result = parseEpicGamesLocation({"5daeb974a22a435988892319b3a4f476"});
+ if (QFileInfo(result).isDir()) {
+ QDir startPath = QDir(result);
+ auto subDirs = startPath.entryList({"Fallout New Vegas*"},
+ QDir::Dirs | QDir::NoDotAndDotDot);
+ if (!subDirs.isEmpty())
+ result = startPath.absoluteFilePath(subDirs.first());
+ }
+ }
+ return result;
+}
+
+void GameFalloutNV::setGamePath(const QString& path)
+{
+ m_GamePath = path;
+ checkVariants();
+ m_MyGamesPath = determineMyGamesPath(gameDirectoryName());
+}
+
+QDir GameFalloutNV::savesDirectory() const
+{
+ return QDir(m_MyGamesPath + "/Saves");
+}
+
+QString GameFalloutNV::myGamesPath() const
+{
+ return m_MyGamesPath;
+}
+
+bool GameFalloutNV::isInstalled() const
+{
+ return !m_GamePath.isEmpty();
+}
+
+QString GameFalloutNV::gameName() const
+{
+ return "New Vegas";
+}
+
+QString GameFalloutNV::gameDirectoryName() const
+{
+ if (selectedVariant() == "Epic Games")
+ return "FalloutNV_Epic";
+ else
+ return "FalloutNV";
+}
+
+void GameFalloutNV::detectGame()
+{
+ m_GamePath = identifyGamePath();
+ checkVariants();
+ m_MyGamesPath = determineMyGamesPath(gameDirectoryName());
+}
+
+QList<ExecutableInfo> GameFalloutNV::executables() const
+{
+ ExecutableInfo game("New Vegas", findInGameFolder(binaryName()));
+ ExecutableInfo launcher("Fallout Launcher", findInGameFolder(getLauncherName()));
+ QList<ExecutableInfo> extraExecutables =
+ QList<ExecutableInfo>() << ExecutableInfo("Fallout Mod Manager",
+ findInGameFolder("fomm/fomm.exe"))
+ << ExecutableInfo("BOSS",
+ findInGameFolder("BOSS/BOSS.exe"))
+ << ExecutableInfo("GECK", findInGameFolder("geck.exe"))
+ << ExecutableInfo("LOOT", QFileInfo(getLootPath()))
+ .withArgument("--game=\"FalloutNV\"");
+ if (selectedVariant() != "Epic Games") {
+ extraExecutables.prepend(ExecutableInfo(
+ "NVSE", findInGameFolder(m_Organizer->gameFeatures()
+ ->gameFeature<MOBase::ScriptExtender>()
+ ->loaderName())));
+ } else {
+ game.withArgument("-EpicPortal");
+ launcher.withArgument("-EpicPortal");
+ }
+ QList<ExecutableInfo> executables = {game, launcher};
+ executables += extraExecutables;
+ return executables;
+}
+
+QList<ExecutableForcedLoadSetting> GameFalloutNV::executableForcedLoads() const
+{
+ return QList<ExecutableForcedLoadSetting>();
+}
+
+QString GameFalloutNV::name() const
+{
+ return "Fallout NV Support Plugin";
+}
+
+QString GameFalloutNV::localizedName() const
+{
+ return tr("Fallout NV Support Plugin");
+}
+
+QString GameFalloutNV::author() const
+{
+ return "Tannin & MO2 Team";
+}
+
+QString GameFalloutNV::description() const
+{
+ return tr("Adds support for the game Fallout New Vegas");
+}
+
+MOBase::VersionInfo GameFalloutNV::version() const
+{
+ return VersionInfo(1, 6, 0, VersionInfo::RELEASE_FINAL);
+}
+
+QList<PluginSetting> GameFalloutNV::settings() const
+{
+ return QList<PluginSetting>()
+ << PluginSetting("enable_loot_sorting",
+ tr("While not recommended by the FNV modding community, "
+ "enables LOOT sorting"),
+ false);
+}
+
+void GameFalloutNV::initializeProfile(const QDir& path, ProfileSettings settings) const
+{
+ if (settings.testFlag(IPluginGame::MODS)) {
+ copyToProfile(localAppFolder() + "/" + gameDirectoryName(), path, "plugins.txt");
+ }
+
+ if (settings.testFlag(IPluginGame::CONFIGURATION)) {
+ if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) ||
+ !QFileInfo(myGamesPath() + "/fallout.ini").exists()) {
+ copyToProfile(gameDirectory().absolutePath(), path, "fallout_default.ini",
+ "fallout.ini");
+ } else {
+ copyToProfile(myGamesPath(), path, "fallout.ini");
+ }
+
+ copyToProfile(myGamesPath(), path, "falloutprefs.ini");
+ copyToProfile(myGamesPath(), path, "falloutcustom.ini");
+ copyToProfile(myGamesPath(), path, "GECKCustom.ini");
+ copyToProfile(myGamesPath(), path, "GECKPrefs.ini");
+ }
+}
+
+QString GameFalloutNV::savegameExtension() const
+{
+ return "fos";
+}
+
+QString GameFalloutNV::savegameSEExtension() const
+{
+ return "nvse";
+}
+
+std::shared_ptr<const GamebryoSaveGame>
+GameFalloutNV::makeSaveGame(QString filePath) const
+{
+ return std::make_shared<const FalloutNVSaveGame>(filePath, this);
+}
+
+QString GameFalloutNV::steamAPPId() const
+{
+ if (selectedVariant() == "Steam") {
+ if (m_GamePath.endsWith("enplczru")) {
+ return "22490";
+ } else {
+ return "22380";
+ }
+ }
+ return QString();
+}
+
+QStringList GameFalloutNV::primaryPlugins() const
+{
+ return {"falloutnv.esm"};
+}
+
+QStringList GameFalloutNV::gameVariants() const
+{
+ return {"Steam", "GOG", "Epic Games"};
+}
+
+QString GameFalloutNV::gameShortName() const
+{
+ return "FalloutNV";
+}
+
+QStringList GameFalloutNV::validShortNames() const
+{
+ return {"Fallout3"};
+}
+
+QString GameFalloutNV::gameNexusName() const
+{
+ return "newvegas";
+}
+
+QStringList GameFalloutNV::iniFiles() const
+{
+ return {"fallout.ini", "falloutprefs.ini", "falloutcustom.ini", "GECKCustom.ini",
+ "GECKPrefs.ini"};
+}
+
+QStringList GameFalloutNV::DLCPlugins() const
+{
+ return {"DeadMoney.esm", "HonestHearts.esm", "OldWorldBlues.esm",
+ "LonesomeRoad.esm", "GunRunnersArsenal.esm", "CaravanPack.esm",
+ "ClassicPack.esm", "MercenaryPack.esm", "TribalPack.esm"};
+}
+
+MOBase::IPluginGame::SortMechanism GameFalloutNV::sortMechanism() const
+{
+ if (m_Organizer->pluginSetting(name(), "enable_loot_sorting").toBool())
+ return IPluginGame::SortMechanism::LOOT;
+ return IPluginGame::SortMechanism::NONE;
+}
+
+int GameFalloutNV::nexusModOrganizerID() const
+{
+ return 42572;
+}
+
+int GameFalloutNV::nexusGameID() const
+{
+ return 130;
+}
+
+QDir GameFalloutNV::gameDirectory() const
+{
+ return QDir(m_GamePath);
+}
+
+MappingType GameFalloutNV::mappings() const
+{
+ MappingType result;
+
+ for (const QString& profileFile : {"plugins.txt", "loadorder.txt"}) {
+ result.push_back({m_Organizer->profilePath() + "/" + profileFile,
+ localAppFolder() + "/" + gameShortName() + "/" + profileFile,
+ false});
+ if (selectedVariant() == "Epic Games") {
+ result.push_back(
+ {m_Organizer->profilePath() + "/" + profileFile,
+ localAppFolder() + "/" + gameDirectoryName() + "/" + profileFile, false});
+ }
+ }
+
+ return result;
+}
diff --git a/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.h b/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.h
new file mode 100644
index 0000000..74f98b2
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.h
@@ -0,0 +1,70 @@
+#ifndef GAMEFALLOUTNV_H
+#define GAMEFALLOUTNV_H
+
+#include "gamegamebryo.h"
+
+#include <QObject>
+#include <QtGlobal>
+
+class GameFalloutNV : public GameGamebryo
+{
+ Q_OBJECT
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ Q_PLUGIN_METADATA(IID "org.tannin.GameFalloutNV" FILE "gamefalloutnv.json")
+#endif
+
+public:
+ GameFalloutNV();
+
+ virtual bool init(MOBase::IOrganizer* moInfo) override;
+
+public: // IPluginGame interface
+ virtual QString gameName() const override;
+ virtual void detectGame() override;
+ virtual QList<MOBase::ExecutableInfo> executables() const override;
+ virtual QList<MOBase::ExecutableForcedLoadSetting>
+ executableForcedLoads() const override;
+ virtual void initializeProfile(const QDir& path,
+ ProfileSettings settings) const override;
+ virtual QString steamAPPId() const override;
+ virtual QStringList primaryPlugins() const override;
+ virtual QStringList gameVariants() const override;
+ virtual QString gameShortName() const override;
+ virtual QStringList validShortNames() const override;
+ virtual QString gameNexusName() const override;
+ virtual QStringList iniFiles() const override;
+ virtual QStringList DLCPlugins() const override;
+ virtual SortMechanism sortMechanism() const override;
+ virtual int nexusModOrganizerID() const override;
+ virtual int nexusGameID() const override;
+
+ virtual bool isInstalled() const override;
+ virtual void setGamePath(const QString& path) override;
+ virtual QDir gameDirectory() const override;
+
+public: // IPlugin interface
+ virtual QString name() const override;
+ virtual QString localizedName() const override;
+ virtual QString author() const override;
+ virtual QString description() const override;
+ virtual MOBase::VersionInfo version() const override;
+ virtual QList<MOBase::PluginSetting> settings() const override;
+ virtual MappingType mappings() const override;
+
+protected:
+ QString gameDirectoryName() const;
+ QDir documentsDirectory() const;
+ QDir savesDirectory() const;
+ QString myGamesPath() const;
+
+ void setVariant(QString variant);
+ void checkVariants();
+
+protected:
+ virtual QString identifyGamePath() const override;
+ virtual QString savegameExtension() const override;
+ virtual QString savegameSEExtension() const override;
+ std::shared_ptr<const GamebryoSaveGame> makeSaveGame(QString filePath) const override;
+};
+
+#endif // GAMEFALLOUTNV_H
diff --git a/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.json b/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.json
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.json
@@ -0,0 +1 @@
+{}