mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
content pack dependency levels draft
This commit is contained in:
parent
13ae6c6950
commit
f298d6ef1d
4 changed files with 32 additions and 16 deletions
|
|
@ -115,21 +115,21 @@ static void reopen_world(Engine* engine, World* world) {
|
|||
menus::open_world(wname, engine, true);
|
||||
}
|
||||
|
||||
// FIXME
|
||||
// FIXME: dependency levels
|
||||
static bool try_add_dependency(Engine* engine, World* world, const ContentPack& pack, std::string& missing) {
|
||||
auto paths = engine->getPaths();
|
||||
for (const auto& dependency : pack.dependencies) {
|
||||
fs::path folder = ContentPack::findPack(
|
||||
paths,
|
||||
world->wfile->directory,
|
||||
dependency
|
||||
dependency.id
|
||||
);
|
||||
if (!fs::is_directory(folder)) {
|
||||
missing = dependency;
|
||||
missing = dependency.id;
|
||||
return true;
|
||||
}
|
||||
if (!world->hasPack(dependency)) {
|
||||
world->wfile->addPack(world, dependency);
|
||||
if (!world->hasPack(dependency.id)) {
|
||||
world->wfile->addPack(world, dependency.id);
|
||||
}
|
||||
}
|
||||
world->wfile->addPack(world, pack.id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue