From 7ee008e150bc5bcf76082d726f719ee0fdfda982 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Wed, 11 Feb 2026 02:37:39 -0600 Subject: 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 --- .../src/games/enderal/gameenderal.cpp | 267 +++++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 libs/game_bethesda/src/games/enderal/gameenderal.cpp (limited to 'libs/game_bethesda/src/games/enderal/gameenderal.cpp') diff --git a/libs/game_bethesda/src/games/enderal/gameenderal.cpp b/libs/game_bethesda/src/games/enderal/gameenderal.cpp new file mode 100644 index 0000000..fb4e1d7 --- /dev/null +++ b/libs/game_bethesda/src/games/enderal/gameenderal.cpp @@ -0,0 +1,267 @@ +#include "gameenderal.h" + +#include "enderalbsainvalidation.h" +#include "enderaldataarchives.h" +#include "enderalgameplugins.h" +#include "enderallocalsavegames.h" +#include "enderalmoddatachecker.h" +#include "enderalmoddatacontent.h" +#include "enderalsavegame.h" +#include "enderalscriptextender.h" + +#include "executableinfo.h" +#include "pluginsetting.h" +#include "steamutility.h" +#include "utility.h" + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#ifdef _WIN32 +#include +#include +#endif + +#include +#include +#include +#include +#include + +using namespace MOBase; + +GameEnderal::GameEnderal() {} + +bool GameEnderal::init(IOrganizer* moInfo) +{ + if (!GameGamebryo::init(moInfo)) { + return false; + } + + auto dataArchives = std::make_shared(this); + registerFeature(std::make_shared(this)); + registerFeature(dataArchives); + registerFeature(std::make_shared(dataArchives.get(), this)); + registerFeature(std::make_shared(this)); + registerFeature(std::make_shared(this, "enderal.ini")); + registerFeature(std::make_shared(this)); + registerFeature(std::make_shared(moInfo->gameFeatures())); + registerFeature(std::make_shared(moInfo)); + registerFeature(std::make_shared(this)); + + return true; +} + +QString GameEnderal::gameName() const +{ + return "Enderal"; +} + +QList GameEnderal::executables() const +{ + return QList() + //<< ExecutableInfo("SKSE", + // findInGameFolder(feature()->loaderName())) + //<< ExecutableInfo("SBW", findInGameFolder("SBW.exe")) + << ExecutableInfo("Enderal (SKSE)", findInGameFolder(binaryName())) + << ExecutableInfo("Enderal Launcher", findInGameFolder(getLauncherName())) + << ExecutableInfo("BOSS", findInGameFolder("BOSS/BOSS.exe")) + << ExecutableInfo("LOOT", QFileInfo(getLootPath())) + .withArgument("--game=\"Enderal\"") + << ExecutableInfo("Creation Kit", findInGameFolder("CreationKit.exe")) + .withSteamAppId("202480"); +} + +QList GameEnderal::executableForcedLoads() const +{ + return QList(); +} + +QString GameEnderal::name() const +{ + return "Enderal Support Plugin"; +} + +QString GameEnderal::localizedName() const +{ + return tr("Enderal Support Plugin"); +} + +QString GameEnderal::author() const +{ + return "AL12 & MO2 Team"; +} + +QString GameEnderal::description() const +{ + return tr("Adds support for the game Enderal"); +} + +MOBase::VersionInfo GameEnderal::version() const +{ + return VersionInfo(1, 3, 1, VersionInfo::RELEASE_FINAL); +} + +QList GameEnderal::settings() const +{ + QList results; + results.push_back( + PluginSetting("sse_downloads", "allow Skyrim SE downloads", QVariant(false))); + return results; +} + +void GameEnderal::initializeProfile(const QDir& path, ProfileSettings settings) const +{ + if (settings.testFlag(IPluginGame::MODS)) { + copyToProfile(localAppFolder() + "/enderal", path, "plugins.txt"); + } + + if (settings.testFlag(IPluginGame::CONFIGURATION)) { + if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || + !QFileInfo(myGamesPath() + "/enderal.ini").exists()) { + + // there is no default ini, actually they are going to put them in for us! + copyToProfile(gameDirectory().absolutePath(), path, "enderal_default.ini", + "enderal.ini"); + copyToProfile(gameDirectory().absolutePath(), path, "enderalprefs_default.ini", + "enderalprefs.ini"); + } else { + copyToProfile(myGamesPath(), path, "enderal.ini"); + copyToProfile(myGamesPath(), path, "enderalprefs.ini"); + } + } +} + +bool GameEnderal::looksValid(QDir const& path) const +{ + // we need to check both launcher and binary because the binary also exists for + // Skyrim and the launcher for Enderal SE + return path.exists(getLauncherName()) && path.exists(binaryName()); +} + +QIcon GameEnderal::gameIcon() const +{ + return MOBase::iconForExecutable(gameDirectory().absoluteFilePath(getLauncherName())); +} + +QString GameEnderal::savegameExtension() const +{ + return "ess"; +} + +QString GameEnderal::savegameSEExtension() const +{ + return "skse"; +} + +std::shared_ptr +GameEnderal::makeSaveGame(QString filepath) const +{ + return std::make_shared(filepath, this); +} + +QString GameEnderal::steamAPPId() const +{ + return "933480"; +} + +QStringList GameEnderal::primaryPlugins() const +{ + return {"Skyrim.esm", "Enderal - Forgotten Stories.esm", "Update.esm"}; +} + +QString GameEnderal::binaryName() const +{ + return "skse_loader.exe"; +} + +QString GameEnderal::getLauncherName() const +{ + return "Enderal Launcher.exe"; +} + +QString GameEnderal::gameShortName() const +{ + return "Enderal"; +} + +QString GameEnderal::gameNexusName() const +{ + return "enderal"; +} + +QStringList GameEnderal::primarySources() const +{ + return {"Skyrim"}; +} + +QStringList GameEnderal::validShortNames() const +{ + QStringList results; + results.push_back("Skyrim"); + if (m_Organizer->pluginSetting(name(), "sse_downloads").toBool()) { + results.push_back("SkyrimSE"); + } + return results; +} + +QStringList GameEnderal::iniFiles() const +{ + return {"enderal.ini", "enderalprefs.ini"}; +} + +QStringList GameEnderal::DLCPlugins() const +{ + return {}; +} + +IPluginGame::LoadOrderMechanism GameEnderal::loadOrderMechanism() const +{ + return LoadOrderMechanism::PluginsTxt; +} + +int GameEnderal::nexusModOrganizerID() const +{ + return 0; +} + +int GameEnderal::nexusGameID() const +{ + return 2736; +} + +QString GameEnderal::identifyGamePath() const +{ +#ifdef _WIN32 + QString path = "Software\\SureAI\\Enderal"; + QString result; + try { + result = + findInRegistry(HKEY_CURRENT_USER, path.toStdWString().c_str(), L"Install_Path"); + } catch (MOBase::MyException) { + result = MOBase::findSteamGame("Enderal", "Data\\Enderal - Forgotten Stories.esm"); + } + return result; +#else + // Prefer exact Steam app-id resolution for Enderal LE. + QString result = parseSteamLocation(steamAPPId(), "Enderal"); + if (!result.isEmpty() && looksValid(QDir(result))) { + return result; + } + + result = MOBase::findSteamGame("Enderal", "Data/Enderal - Forgotten Stories.esm"); + if (!result.isEmpty() && looksValid(QDir(result))) { + return result; + } + + return GameGamebryo::identifyGamePath(); +#endif +} -- cgit v1.3.1