mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
added comment (and commented-out code) about skill legacy data
This commit is contained in:
@@ -113,8 +113,24 @@ CSkillHandler::CSkillHandler()
|
|||||||
|
|
||||||
std::vector<JsonNode> CSkillHandler::loadLegacyData(size_t dataSize)
|
std::vector<JsonNode> CSkillHandler::loadLegacyData(size_t dataSize)
|
||||||
{
|
{
|
||||||
// not supported - no legacy data to load
|
|
||||||
std::vector<JsonNode> legacyData;
|
std::vector<JsonNode> legacyData;
|
||||||
|
/* problem: CGI is client-side only
|
||||||
|
for(int id = 0; id < GameConstants::SKILL_QUANTITY; id++)
|
||||||
|
{
|
||||||
|
CSkill & skill = *objects[id];
|
||||||
|
JsonNode skillNode(JsonNode::DATA_STRUCT);
|
||||||
|
for(int level = 1; level < NSecondarySkill::levels.size(); level++)
|
||||||
|
{
|
||||||
|
//only "real" legacy data is skill description
|
||||||
|
std::string desc = CGI->generaltexth->skillInfoTexts[skill.id][level-1];
|
||||||
|
//update both skill & JSON
|
||||||
|
skill.setDescription(desc, level);
|
||||||
|
auto & levelNode = skillNode[NSecondarySkill::levels[level]].Struct();
|
||||||
|
levelNode["description"].String() = desc;
|
||||||
|
}
|
||||||
|
legacyData.push_back(skillNode);
|
||||||
|
}
|
||||||
|
*/
|
||||||
return legacyData;
|
return legacyData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +171,6 @@ CSkill * CSkillHandler::loadFromJson(const JsonNode & json, const std::string &
|
|||||||
}
|
}
|
||||||
// parse skill description - tracked separately
|
// parse skill description - tracked separately
|
||||||
if(vstd::contains(levelNode.Struct(), "description") && !levelNode["description"].isNull())
|
if(vstd::contains(levelNode.Struct(), "description") && !levelNode["description"].isNull())
|
||||||
//CGI->generaltexth->skillInfoTexts[skill->id][level-1] = levelNode["description"].String();
|
|
||||||
skill->setDescription(levelNode["description"].String(), level);
|
skill->setDescription(levelNode["description"].String(), level);
|
||||||
}
|
}
|
||||||
logMod->debug("loaded secondary skill %s(%d)", identifier, (int)skill->id);
|
logMod->debug("loaded secondary skill %s(%d)", identifier, (int)skill->id);
|
||||||
|
|||||||
Reference in New Issue
Block a user