mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
refactor: add ContentControl class
This commit is contained in:
parent
7262119f5b
commit
331734792d
21 changed files with 324 additions and 246 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include "debug/Logger.hpp"
|
||||
#include "coders/json.hpp"
|
||||
#include "content/ContentReport.hpp"
|
||||
#include "content/ContentControl.hpp"
|
||||
#include "world/files/WorldConverter.hpp"
|
||||
#include "world/files/WorldFiles.hpp"
|
||||
#include "frontend/locale.hpp"
|
||||
|
|
@ -318,7 +319,8 @@ void EngineController::reconfigPacks(
|
|||
runnable removeFunc = [this, controller, packsToAdd, packsToRemove]() {
|
||||
if (controller == nullptr) {
|
||||
try {
|
||||
auto manager = engine.createPacksManager("");
|
||||
PacksManager manager;
|
||||
manager.setSources(engine.getContentControl().getDefaultSources());
|
||||
manager.scan();
|
||||
auto names = PacksManager::getNames(engine.getContentPacks());
|
||||
for (const auto& id : packsToAdd) {
|
||||
|
|
@ -339,7 +341,9 @@ void EngineController::reconfigPacks(
|
|||
auto world = controller->getLevel()->getWorld();
|
||||
auto& wfile = *world->wfile;
|
||||
controller->saveWorld();
|
||||
auto manager = engine.createPacksManager(wfile.getFolder());
|
||||
|
||||
PacksManager manager;
|
||||
manager.setSources(engine.getContentControl().getDefaultSources());
|
||||
manager.scan();
|
||||
|
||||
auto names = PacksManager::getNames(world->getPacks());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue