Merge pull request #362 from MihailRis/new-pack-props
New pack properties
This commit is contained in:
commit
a17314d5e0
@ -1,6 +1,8 @@
|
||||
# Documentation
|
||||
|
||||
Documentation for the engine of version 0.24.
|
||||
Documentation for the engine of in-development version 0.25.
|
||||
|
||||
[Documentation for stable release 0.24.x.](https://github.com/MihailRis/VoxelEngine-Cpp/blob/release-0.24/doc/en/main-page.md)
|
||||
|
||||
## Sections
|
||||
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
}
|
||||
```
|
||||
|
||||
Вместо `creator` можно указать массив `creators`
|
||||
|
||||
Уровни зависимостей указываются с помощью префиксов в имени:
|
||||
- '!' - обязательная зависимость
|
||||
- '?' - опциональная зависимость
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
# Документация
|
||||
|
||||
Документация движка версии 0.24.
|
||||
Документация движка разрабатываемой версии 0.25.
|
||||
|
||||
[Документация стабильной версии 0.24.x.](https://github.com/MihailRis/VoxelEngine-Cpp/blob/release-0.24/doc/ru/main-page.md)
|
||||
|
||||
## Разделы
|
||||
|
||||
|
||||
@ -76,8 +76,19 @@ ContentPack ContentPack::read(const fs::path& folder) {
|
||||
root.at("id").get(pack.id);
|
||||
root.at("title").get(pack.title);
|
||||
root.at("version").get(pack.version);
|
||||
if (root.has("creators")) {
|
||||
const auto& creators = root["creators"];
|
||||
for (int i = 0; i < creators.size(); i++) {
|
||||
if (i > 0) {
|
||||
pack.creator += ", ";
|
||||
}
|
||||
pack.creator += creators[i].asString();
|
||||
}
|
||||
} else {
|
||||
root.at("creator").get(pack.creator);
|
||||
}
|
||||
root.at("description").get(pack.description);
|
||||
root.at("source").get(pack.source);
|
||||
pack.folder = folder;
|
||||
|
||||
if (auto found = root.at("dependencies")) {
|
||||
|
||||
@ -44,6 +44,7 @@ struct ContentPack {
|
||||
std::string description = "no description";
|
||||
fs::path folder;
|
||||
std::vector<DependencyPack> dependencies;
|
||||
std::string source = "";
|
||||
|
||||
fs::path getContentFile() const;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user