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:
parent
832d69ec11
commit
98ea8bf314
@ -12,6 +12,10 @@
|
||||
"type": "array",
|
||||
"items":{
|
||||
"anyOf":[
|
||||
{
|
||||
//dummy animation, pause, Value - frame count
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
//assumed verticalPosition: top
|
||||
"type": "string",
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user