add user properties methods support items

This commit is contained in:
MihailRis
2025-08-30 20:44:50 +03:00
parent e3da256c5d
commit d59a901ae0
3 changed files with 28 additions and 15 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
#define VC_ENABLE_REFLECTION
#include "ContentUnitLoader.hpp"
#include "ContentLoadingCommons.hpp"
#include "../ContentBuilder.hpp"
#include "coders/json.hpp"
@@ -12,11 +13,12 @@
static debug::Logger logger("item-content-loader");
template<> void ContentUnitLoader<ItemDef>::loadUnit(
ItemDef& def, const std::string& name, const io::path& file
) {
auto root = io::read_json(file);
def.properties = root;
process_properties(def, name, root);
if (root.has("parent")) {
const auto& parentName = root["parent"].asString();