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
|
|
@ -124,7 +124,7 @@ ContentPack ContentPack::read(const std::string& path, const io::path& folder) {
|
|||
}
|
||||
|
||||
void ContentPack::scanFolder(
|
||||
const std::string& path, const io::path& folder, std::vector<ContentPack>& packs
|
||||
const io::path& folder, std::vector<ContentPack>& packs
|
||||
) {
|
||||
if (!io::is_directory(folder)) {
|
||||
return;
|
||||
|
|
@ -133,9 +133,7 @@ void ContentPack::scanFolder(
|
|||
if (!io::is_directory(packFolder)) continue;
|
||||
if (!is_pack(packFolder)) continue;
|
||||
try {
|
||||
packs.push_back(
|
||||
read(path + "/" + packFolder.name(), packFolder)
|
||||
);
|
||||
packs.push_back(read(packFolder.string(), packFolder));
|
||||
} catch (const contentpack_error& err) {
|
||||
std::cerr << "package.json error at " << err.getFolder().string();
|
||||
std::cerr << ": " << err.what() << std::endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue