Skip to content

Commit

Permalink
feat: add manifest version field to JSON file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alystrasz committed Dec 8, 2024
1 parent 206796f commit 8850bb2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions primedev/mods/modmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ void ModManager::LoadMods()
// This is used to check if some mods have a folder but no entry in enabledmods.json
bool newModsDetected = false;

// Set manifest version
const char* versionMember = "Version";
if (!m_EnabledModsCfg.HasMember(versionMember))
{
m_EnabledModsCfg.AddMember(rapidjson_document::StringRefType(versionMember), "1", m_EnabledModsCfg.GetAllocator());

// Force manifesto write to disk
newModsDetected = true;
}

for (Mod& mod : m_LoadedMods)
{
// Add mod entry to enabledmods.json if it doesn't exist
Expand Down

0 comments on commit 8850bb2

Please sign in to comment.