Limo
A simple mod manager
Loading...
Searching...
No Matches
bg3deployer.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include "bg3pakfile.h"
9#include "plugindeployer.h"
10#include <map>
11
12
17{
18public:
25 Bg3Deployer(const std::filesystem::path& source_path,
26 const std::filesystem::path& dest_path,
27 const std::string& name);
28
33 virtual void unDeploy(std::optional<ProgressNode*> progress_node = {}) override;
38 virtual std::vector<std::string> getModNames() const override;
44 virtual void setProfile(int profile) override;
52 virtual std::unordered_set<int> getModConflicts(
53 int mod_id,
54 std::optional<ProgressNode*> progress_node = {}) override;
55
56protected:
58 static constexpr std::string BG3_PLUGINS_FILE_NAME = "modsettings.lsx";
60 static inline const std::set<std::string> NON_PLUGIN_ARCHIVES = { "ModFixer.pak" };
62 std::map<std::string, std::filesystem::path> uuid_map_;
64 std::map<std::filesystem::path, Bg3PakFile> pak_files_;
65
67 virtual void updatePlugins() override;
69 virtual void saveSettings() const override;
71 virtual void loadSettings() override;
73 virtual void resetSettings() override;
75 void cleanState();
77 virtual void writePlugins() const override;
79 bool initPluginFile();
81 virtual void updateSourceMods() override;
83 virtual void updatePluginTags() override;
84
85private:
89 void saveSettingsPrivate() const;
93 void writePluginsPrivate() const;
94};
Header for the Bg3PakFile class.
void loadSettingsPrivate()
Reads pak file and profile data from disk.
Definition bg3deployer.cpp:347
virtual void writePlugins() const override
Wrapper for writePluginsPrivate.
Definition bg3deployer.cpp:140
std::map< std::filesystem::path, Bg3PakFile > pak_files_
Maps pak file paths to the object containing that files plugin data.
Definition bg3deployer.h:64
virtual void setProfile(int profile) override
Setter for the active profile. Changes the currently active plugin files to the ones saved in the new...
Definition bg3deployer.cpp:60
virtual std::unordered_set< int > getModConflicts(int mod_id, std::optional< ProgressNode * > progress_node={}) override
Checks for conflicts with other mods. Two mods are conflicting if they share at least one record.
Definition bg3deployer.cpp:68
Bg3Deployer(const std::filesystem::path &source_path, const std::filesystem::path &dest_path, const std::string &name)
Loads mods.
Definition bg3deployer.cpp:14
virtual void updateSourceMods() override
Updates the source mod map.
Definition bg3deployer.cpp:174
virtual std::vector< std::string > getModNames() const override
Generates a vector of names for every plugin.
Definition bg3deployer.cpp:51
void cleanState()
Ensures plugins_ uuid_map_ and pak_files_ are coherent.
Definition bg3deployer.cpp:111
void writePluginsPrivate() const
Writes plugins to modsettings.lsx.
Definition bg3deployer.cpp:398
virtual void saveSettings() const override
Wrapper for saveSettingsPrivate.
Definition bg3deployer.cpp:94
void updatePluginsPrivate()
Reads all pak files in the source directory and extracts all plugins.
Definition bg3deployer.cpp:203
virtual void updatePlugins() override
Wrapper for updatePluginsPrivate.
Definition bg3deployer.cpp:89
static const std::set< std::string > NON_PLUGIN_ARCHIVES
Mod fixer is a popular mod which does not contain plugins.
Definition bg3deployer.h:60
void saveSettingsPrivate() const
Saves pak file and profile data to disk.
Definition bg3deployer.cpp:448
virtual void loadSettings() override
Wrapper for loadSettingsPrivate.
Definition bg3deployer.cpp:99
virtual void resetSettings() override
Resets profiles to 1 and active profile to 0.
Definition bg3deployer.cpp:104
std::map< std::string, std::filesystem::path > uuid_map_
Maps plugin UUIDs to the pak file containing them.
Definition bg3deployer.h:62
virtual void updatePluginTags() override
Tags are currently not supported by this type.
Definition bg3deployer.cpp:201
bool initPluginFile()
Reads current plugins from modsettings.lsx and writes them to the plugins file.
Definition bg3deployer.cpp:145
static constexpr std::string BG3_PLUGINS_FILE_NAME
Name of the mod settings file.
Definition bg3deployer.h:58
virtual void unDeploy(std::optional< ProgressNode * > progress_node={}) override
If no backup exists: Backs up the current plugin file, then reloads all plugins.
Definition bg3deployer.cpp:35
PluginDeployer(const std::filesystem::path &source_path, const std::filesystem::path &dest_path, const std::string &name)
Constructor.
Definition plugindeployer.cpp:17
Header for the PluginDeployer class.