1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +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", "type": "array",
"items":{ "items":{
"anyOf":[ "anyOf":[
{
//dummy animation, pause, Value - frame count
"type": "number"
},
{ {
//assumed verticalPosition: top //assumed verticalPosition: top
"type": "string", "type": "string",

View File

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

View File

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

View File

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