1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +02:00

Merge pull request #5540 from GeorgeK1ng/campaign_sets

Make campaign sets modable
This commit is contained in:
Ivan Savenko
2025-03-12 14:56:10 +02:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -48,6 +48,7 @@
#include "../../lib/TerrainHandler.h"
#include "../../lib/UnlockGuard.h"
#include "../../lib/GameLibrary.h"
#include "../../lib/json/JsonUtils.h"
bool mapSorter::operator()(const std::shared_ptr<ElementInfo> aaa, const std::shared_ptr<ElementInfo> bbb)
{
@@ -962,7 +963,7 @@ void SelectionTab::handleUnsupportedSavegames(const std::vector<ResourcePath> &
void SelectionTab::parseCampaigns(const std::unordered_set<ResourcePath> & files)
{
auto campaignSets = JsonNode(JsonPath::builtin("config/campaignSets.json"));
auto campaignSets = JsonUtils::assembleFromFiles("config/campaignSets.json");
auto mainmenu = JsonNode(JsonPath::builtin("config/mainmenu.json"));
allItems.reserve(files.size());

View File

@@ -60,6 +60,7 @@
#include "../../lib/GameConstants.h"
#include "../../lib/CRandomGenerator.h"
#include "../../lib/GameLibrary.h"
#include "../../lib/json/JsonUtils.h"
ISelectionScreenInfo * SEL = nullptr;
@@ -305,7 +306,7 @@ CMenuEntry::CMenuEntry(CMenuScreen * parent, const JsonNode & config)
}
CMainMenuConfig::CMainMenuConfig()
: campaignSets(JsonPath::builtin("config/campaignSets.json"))
: campaignSets(JsonUtils::assembleFromFiles("config/campaignSets.json"))
, config(JsonPath::builtin("config/mainmenu.json"))
{
if (!config["scenario-selection"].isStruct())