From 354e67087c939e032c2afa0bdec69207885b8694 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 10 Nov 2024 19:41:08 +0300 Subject: [PATCH 1/3] add 'creators' property --- doc/en/main-page.md | 4 +++- doc/ru/content-packs.md | 2 ++ doc/ru/main-page.md | 4 +++- src/content/ContentPack.cpp | 12 +++++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/en/main-page.md b/doc/en/main-page.md index 06636ea0..4d487f5a 100644 --- a/doc/en/main-page.md +++ b/doc/en/main-page.md @@ -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 diff --git a/doc/ru/content-packs.md b/doc/ru/content-packs.md index 33d46ffb..77a78636 100644 --- a/doc/ru/content-packs.md +++ b/doc/ru/content-packs.md @@ -22,6 +22,8 @@ } ``` +Вместо `creator` можно указать массив `creators` + Уровни зависимостей указываются с помощью префиксов в имени: - '!' - обязательная зависимость - '?' - опциональная зависимость diff --git a/doc/ru/main-page.md b/doc/ru/main-page.md index 30445fb6..800415c6 100644 --- a/doc/ru/main-page.md +++ b/doc/ru/main-page.md @@ -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) ## Разделы diff --git a/src/content/ContentPack.cpp b/src/content/ContentPack.cpp index 777e8ae1..1dae138c 100644 --- a/src/content/ContentPack.cpp +++ b/src/content/ContentPack.cpp @@ -76,7 +76,17 @@ 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); - root.at("creator").get(pack.creator); + 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); pack.folder = folder; From 3fa5369c7c0af82c09fcacd345279d6ad5e7258b Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 10 Nov 2024 20:09:07 +0300 Subject: [PATCH 2/3] add 'source' property --- src/content/ContentPack.cpp | 1 + src/content/ContentPack.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/content/ContentPack.cpp b/src/content/ContentPack.cpp index 1dae138c..166400c6 100644 --- a/src/content/ContentPack.cpp +++ b/src/content/ContentPack.cpp @@ -88,6 +88,7 @@ ContentPack ContentPack::read(const fs::path& folder) { 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")) { diff --git a/src/content/ContentPack.hpp b/src/content/ContentPack.hpp index 5aa1a22b..292400a5 100644 --- a/src/content/ContentPack.hpp +++ b/src/content/ContentPack.hpp @@ -42,6 +42,7 @@ struct ContentPack { std::string version = "0.0"; std::string creator = ""; std::string description = "no description"; + std::string source = ""; fs::path folder; std::vector dependencies; From af4edee06313948d13b585856a232db3bafc3a8e Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 10 Nov 2024 21:02:48 +0300 Subject: [PATCH 3/3] fix --- src/content/ContentPack.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/ContentPack.hpp b/src/content/ContentPack.hpp index 292400a5..9d25d752 100644 --- a/src/content/ContentPack.hpp +++ b/src/content/ContentPack.hpp @@ -42,9 +42,9 @@ struct ContentPack { std::string version = "0.0"; std::string creator = ""; std::string description = "no description"; - std::string source = ""; fs::path folder; std::vector dependencies; + std::string source = ""; fs::path getContentFile() const;