FModManager
Mods for a shipped game: content paks found under the mod roots, an enable list the player owns, a load order from dependencies and loadAfter, every pak's signature checked, and a report of everything that does not fit — before anything mounts above the game's own archives.
- Module
- Game
- Header
#include "Mods/ModManager.h"- Namespace
Mowo
Type aliases
| Alias | Description |
|---|---|
using FRootProvider = std::function<std::vector<FModRoot>()> |
Constructors
| Signature | Name | Description |
|---|---|---|
FModManager(const FModManager&) = delete | FModManager |
Public functions
| Returns | Name | Description |
|---|---|---|
FModManager& | Get | |
FModManager& | operator= | |
void | AddSearchRoot | Mod roots: each holds one folder per mod. |
void | ClearSearchRoots | |
void | RegisterRootProvider | |
void | UnregisterRootProvider | |
void | SetEnableListPath | INI the player's choices live in: which mods are on, their order, and the key each was first seen signed with. |
void | SetTrustedKeys | Keys trusted to sign any mod — the studio's, a curated list. |
int32_t | Scan | Finds every mod under the roots (and the providers'). |
int32_t | MountEnabled | Orders the enabled mods, verifies and mounts them above the game's paks from basePriority up. |
void | UnmountAll | |
void | StartupForGame | The shipped game's entry: roots <package>/Mods and Saved/Mods, the enable list in Saved/Config/Mods.ini, then Scan + MountEnabled. |
bool | SetEnabled | |
bool | IsEnabled | |
bool | MoveInOrder | |
bool | SaveEnableList | |
std::vector<FModInfo> | GetMods | |
std::vector<std::string> | GetLoadOrder | |
std::vector<FModConflictInfo> | GetConflicts | |
std::string | BuildReport | |
bool | LoadDescriptor | |
bool | ParseKeyHex | |
std::string | KeyToHex | |
void | Reset | Resets everything; tests start clean with it. |
Function details
FModManager
FModManager(const FModManager&) = deleteGet
static FModManager& Get()operator=
FModManager& operator=(const FModManager&) = deleteAddSearchRoot
void AddSearchRoot(const std::string& path, const std::string& source = "local")Mod roots: each holds one folder per mod.
ClearSearchRoots
void ClearSearchRoots()RegisterRootProvider
void RegisterRootProvider(const std::string& name, FRootProvider provider)UnregisterRootProvider
void UnregisterRootProvider(const std::string& name)SetEnableListPath
void SetEnableListPath(const std::string& path)INI the player's choices live in: which mods are on, their order, and the key each was first seen signed with.
SetTrustedKeys
void SetTrustedKeys(const std::vector<std::array<uint8_t, 32>>& keys)Keys trusted to sign any mod — the studio's, a curated list. Under mods.TrustedOnly only these are accepted; otherwise a mod may be signed by its author's key, the one its manifest names.
Scan
int32_t Scan()Finds every mod under the roots (and the providers'). Returns the count.
MountEnabled
int32_t MountEnabled(int32_t basePriority = 300)Orders the enabled mods, verifies and mounts them above the game's paks from basePriority up. Returns the number mounted.
UnmountAll
void UnmountAll()StartupForGame
void StartupForGame(const std::string& paksDir)The shipped game's entry: roots <package>/Mods and Saved/Mods, the enable list in Saved/Config/Mods.ini, then Scan + MountEnabled.
SetEnabled
bool SetEnabled(const std::string& name, bool enabled)IsEnabled
bool IsEnabled(const std::string& name) constMoveInOrder
bool MoveInOrder(const std::string& name, int32_t delta)SaveEnableList
bool SaveEnableList() constGetMods
std::vector<FModInfo> GetMods() constGetLoadOrder
std::vector<std::string> GetLoadOrder() constGetConflicts
std::vector<FModConflictInfo> GetConflicts() constBuildReport
std::string BuildReport() constLoadDescriptor
static bool LoadDescriptor(const std::string& manifestPath, FModDescriptor& out, std::string& error)ParseKeyHex
static bool ParseKeyHex(const std::string& hex, std::array<uint8_t, 32>& out)KeyToHex
static std::string KeyToHex(const uint8_t key[32])Reset
void Reset()Resets everything; tests start clean with it.