1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Introduce dummy spell animation/ animation pause configuration

* save format changed with backward compatibility, UNTESTED
This commit is contained in:
AlexVinS 2015-03-22 13:49:14 +03:00
parent 832d69ec11
commit 98ea8bf314
4 changed files with 20 additions and 2 deletions

View File

@ -12,6 +12,10 @@
"type": "array",
"items":{
"anyOf":[
{
//dummy animation, pause, Value - frame count
"type": "number"
},
{
//assumed verticalPosition: top
"type": "string",

View File

@ -27,8 +27,8 @@
#include "mapping/CCampaignHandler.h" //for CCampaignState
#include "rmg/CMapGenerator.h" // for CMapGenOptions
const ui32 version = 753;
const ui32 minSupportedVersion = version;
const ui32 version = 754;
const ui32 minSupportedVersion = 753;
class CISer;
class COSer;

View File

@ -970,6 +970,11 @@ CSpell * CSpellHandler::loadFromJson(const JsonNode & json)
if("bottom" == vPosStr)
newItem.verticalPosition = VerticalPosition::BOTTOM;
}
else if(item.getType() == JsonNode::DATA_FLOAT)
{
newItem.pause = item.Float();
}
q.push_back(newItem);
}
};

View File

@ -104,10 +104,19 @@ public:
{
std::string resourceName;
VerticalPosition verticalPosition;
int pause;
template <typename Handler> void serialize(Handler & h, const int version)
{
h & resourceName & verticalPosition;
if(version >= 754)
{
h & pause;
}
else if(!h.saving)
{
pause = 0;
}
}
};