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:
@@ -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",
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user