mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
adding/removing packs update
This commit is contained in:
parent
657b09da9e
commit
7c4c511826
5 changed files with 61 additions and 95 deletions
|
|
@ -24,6 +24,10 @@ void PacksManager::scan() {
|
|||
}
|
||||
}
|
||||
|
||||
void PacksManager::exclude(const std::string& id) {
|
||||
packs.erase(id);
|
||||
}
|
||||
|
||||
std::vector<std::string> PacksManager::getAllNames() const {
|
||||
std::vector<std::string> names;
|
||||
for (auto& entry : packs) {
|
||||
|
|
@ -82,7 +86,7 @@ static bool resolve_dependencies (
|
|||
auto found = packs.find(dep.id);
|
||||
bool exists = found != packs.end();
|
||||
if (!exists && dep.level == DependencyLevel::required) {
|
||||
throw contentpack_error(pack->id, pack->folder, "missing dependency '"+dep.id+"'");
|
||||
throw contentpack_error(dep.id, fs::path(), "dependency of '"+pack->id+"'");
|
||||
}
|
||||
if (!exists) {
|
||||
// ignored for optional or weak dependencies
|
||||
|
|
@ -144,3 +148,11 @@ std::vector<std::string> PacksManager::assembly(const std::vector<std::string>&
|
|||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
std::vector<std::string> PacksManager::getNames(const std::vector<ContentPack>& packs) {
|
||||
std::vector<std::string> result;
|
||||
for (const auto& pack : packs) {
|
||||
result.push_back(pack.id);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue