add item 'uses-display' property

This commit is contained in:
MihailRis
2025-02-18 03:24:52 +03:00
parent 449b0ebca4
commit df2cff3e4c
4 changed files with 56 additions and 13 deletions
+12
View File
@@ -438,6 +438,18 @@ void ContentLoader::loadItem(
root.at("stack-size").get(def.stackSize);
root.at("uses").get(def.uses);
std::string usesDisplayStr = "";
root.at("uses-display").get(usesDisplayStr);
if (usesDisplayStr == "none") {
def.usesDisplay = ItemUsesDisplay::NONE;
} else if (usesDisplayStr == "relation") {
def.usesDisplay = ItemUsesDisplay::RELATION;
} else if (usesDisplayStr == "vbar") {
def.usesDisplay = ItemUsesDisplay::VBAR;
} else if (usesDisplayStr.length()) {
logger.error() << name << ": unknown uses display mode " << usesDisplayStr;
}
if (auto found = root.at("emission")) {
const auto& emissionarr = *found;
def.emission[0] = emissionarr[0].asNumber();