aboutsummaryrefslogtreecommitdiff
path: root/libs/game_gamebryo/src/gamebryo/gamegamebryo.h
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_gamebryo/src/gamebryo/gamegamebryo.h
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_gamebryo/src/gamebryo/gamegamebryo.h')
-rw-r--r--libs/game_gamebryo/src/gamebryo/gamegamebryo.h151
1 files changed, 151 insertions, 0 deletions
diff --git a/libs/game_gamebryo/src/gamebryo/gamegamebryo.h b/libs/game_gamebryo/src/gamebryo/gamegamebryo.h
new file mode 100644
index 0000000..2ff07db
--- /dev/null
+++ b/libs/game_gamebryo/src/gamebryo/gamegamebryo.h
@@ -0,0 +1,151 @@
+#ifndef GAMEGAMEBRYO_H
+#define GAMEGAMEBRYO_H
+
+#include "iplugingame.h"
+
+class BSAInvalidation;
+class DataArchives;
+class LocalSavegames;
+class SaveGameInfo;
+class BSAInvalidation;
+class LocalSavegames;
+class ScriptExtender;
+class GamePlugins;
+class UnmanagedMods;
+
+#include <QObject>
+#include <QString>
+#include <ShlObj.h>
+#include <dbghelp.h>
+#include <ipluginfilemapper.h>
+#include <iplugingame.h>
+#include <memory>
+
+#include "gamebryosavegame.h"
+#include "igamefeatures.h"
+
+class GameGamebryo : public MOBase::IPluginGame, public MOBase::IPluginFileMapper
+{
+ Q_OBJECT
+ Q_INTERFACES(MOBase::IPlugin MOBase::IPluginGame MOBase::IPluginFileMapper)
+
+ friend class GamebryoScriptExtender;
+ friend class GamebryoSaveGameInfo;
+ friend class GamebryoSaveGameInfoWidget;
+ friend class GamebryoSaveGame;
+
+ /**
+ * Some Bethesda games do not have a valid file version but a valid product
+ * version. If the file version starts with FALLBACK_GAME_VERSION, the product
+ * version will be tried.
+ */
+ static constexpr const char* FALLBACK_GAME_VERSION = "1.0.0";
+
+public:
+ GameGamebryo();
+
+ void detectGame() override;
+ bool init(MOBase::IOrganizer* moInfo) override;
+
+public: // IPluginGame interface
+ // getName
+ // initializeProfile
+ virtual std::vector<std::shared_ptr<const MOBase::ISaveGame>>
+ listSaves(QDir folder) const override;
+
+ virtual bool isInstalled() const override;
+ virtual QIcon gameIcon() const override;
+ virtual QDir gameDirectory() const override;
+ virtual QDir dataDirectory() const override;
+ // secondaryDataDirectories
+ virtual void setGamePath(const QString& path) override;
+ virtual QDir documentsDirectory() const override;
+ virtual QDir savesDirectory() const override;
+ // executables
+ // steamAPPId
+ // primaryPlugins
+ // enabledPlugins
+ // gameVariants
+ virtual void setGameVariant(const QString& variant) override;
+ virtual QString binaryName() const override;
+ // gameShortName
+ // primarySources
+ // validShortNames
+ // iniFiles
+ // DLCPlugins
+ // CCPlugins
+ virtual LoadOrderMechanism loadOrderMechanism() const override;
+ virtual SortMechanism sortMechanism() const override;
+ // nexusModOrganizerID
+ // nexusGameID
+ virtual bool looksValid(QDir const&) const override;
+ virtual QString gameVersion() const override;
+ virtual QString getLauncherName() const override;
+
+public: // IPluginFileMapper interface
+ virtual MappingType mappings() const;
+
+public: // Other (e.g. for game features)
+ QString myGamesPath() const;
+
+protected:
+ // Retrieve the saves extension for the game.
+ virtual QString savegameExtension() const = 0;
+ virtual QString savegameSEExtension() const = 0;
+
+ // Create a save game.
+ virtual std::shared_ptr<const GamebryoSaveGame>
+ makeSaveGame(QString filepath) const = 0;
+
+ QFileInfo findInGameFolder(const QString& relativePath) const;
+ QString selectedVariant() const;
+ WORD getArch(QString const& program) const;
+
+ static QString localAppFolder();
+ // Arguably this shouldn't really be here but every gamebryo program seems to
+ // use it
+ static QString getLootPath();
+
+ // This function is not terribly well named as it copies exactly where it's told
+ // to, irrespective of whether it's in the profile...
+ static void copyToProfile(const QString& sourcePath, const QDir& destinationDirectory,
+ const QString& sourceFileName);
+
+ static void copyToProfile(const QString& sourcePath, const QDir& destinationDirectory,
+ const QString& sourceFileName,
+ const QString& destinationFileName);
+
+ virtual QString identifyGamePath() const;
+
+ virtual bool prepareIni(const QString& exec);
+
+ static std::unique_ptr<BYTE[]> getRegValue(HKEY key, LPCWSTR path, LPCWSTR value,
+ DWORD flags, LPDWORD type);
+
+ static QString findInRegistry(HKEY baseKey, LPCWSTR path, LPCWSTR value);
+
+ static QString getKnownFolderPath(REFKNOWNFOLDERID folderId, bool useDefault);
+
+ static QString getSpecialPath(const QString& name);
+
+ static QString determineMyGamesPath(const QString& gameName);
+
+ static QString parseEpicGamesLocation(const QStringList& manifests);
+
+ static QString parseSteamLocation(const QString& appid, const QString& directoryName);
+
+protected:
+ void registerFeature(std::shared_ptr<MOBase::GameFeature> feature);
+
+protected:
+ // to access organizer for game features, avoid having to pass it to all saves since
+ // we already pass the game
+ friend class GamebryoSaveGame;
+
+ QString m_GamePath;
+ QString m_MyGamesPath;
+ QString m_GameVariant;
+ MOBase::IOrganizer* m_Organizer;
+};
+
+#endif // GAMEGAMEBRYO_H