|
@@ -1,6 +1,6 @@
|
|
-#include "elemPropertyData.h"
|
|
|
|
|
|
+#include "datahpp/elemPropertyData.h"
|
|
#include "plisthpp/redream.h"
|
|
#include "plisthpp/redream.h"
|
|
-#include "dataManager.h"
|
|
|
|
|
|
+#include "datahpp/dataManager.h"
|
|
#include <QJsonArray>
|
|
#include <QJsonArray>
|
|
|
|
|
|
ElemPropertyData::ElemPropertyData()
|
|
ElemPropertyData::ElemPropertyData()
|
|
@@ -9,7 +9,7 @@ ElemPropertyData::ElemPropertyData()
|
|
labelName = "0";
|
|
labelName = "0";
|
|
maxLayer = "1";
|
|
maxLayer = "1";
|
|
score = "50";
|
|
score = "50";
|
|
- dropConfig = "随状态而定";
|
|
|
|
|
|
+ dropConfig = DROPOPT::DROPABLE;
|
|
canBeLinked = false;
|
|
canBeLinked = false;
|
|
canMoveAway = false;
|
|
canMoveAway = false;
|
|
}
|
|
}
|
|
@@ -98,7 +98,7 @@ void ElemPropertyData::readData(const QJsonObject &json)
|
|
score = json["score"].toString();
|
|
score = json["score"].toString();
|
|
}
|
|
}
|
|
if(json.contains("dropConfig") && json["maxLayer"].isString()){
|
|
if(json.contains("dropConfig") && json["maxLayer"].isString()){
|
|
- dropConfig = json["dropConfig"].toString();
|
|
|
|
|
|
+ dropConfig = static_cast<DROPOPT>(json["dropConfig"].toInt());
|
|
}
|
|
}
|
|
if(json.contains("iconPath") && json["iconPath"].isString()){
|
|
if(json.contains("iconPath") && json["iconPath"].isString()){
|
|
iconPath = json["iconPath"].toString();
|
|
iconPath = json["iconPath"].toString();
|
|
@@ -138,7 +138,7 @@ void ElemPropertyData::writeData(QJsonObject &json) const
|
|
json["pos"] = pos;
|
|
json["pos"] = pos;
|
|
json["maxLayer"] = maxLayer;
|
|
json["maxLayer"] = maxLayer;
|
|
json["score"] = score;
|
|
json["score"] = score;
|
|
- json["dropConfig"] = dropConfig;
|
|
|
|
|
|
+ json["dropConfig"] = static_cast<int>(dropConfig);
|
|
json["iconPath"] = iconPath;
|
|
json["iconPath"] = iconPath;
|
|
json["canBeLinked"] = canBeLinked;
|
|
json["canBeLinked"] = canBeLinked;
|
|
json["canMoveAway"] = canMoveAway;
|
|
json["canMoveAway"] = canMoveAway;
|
|
@@ -397,17 +397,18 @@ QJsonArray ElemPropertyData::writeChildElem() const
|
|
void ElemPropertyData::exportData(QJsonObject &json) const
|
|
void ElemPropertyData::exportData(QJsonObject &json) const
|
|
{
|
|
{
|
|
//基础元素
|
|
//基础元素
|
|
- json["maxNum"] = maxLayer;
|
|
|
|
|
|
+ json["maxNum"] = maxLayer.toInt();
|
|
json["canBeLinked"] = canBeLinked;
|
|
json["canBeLinked"] = canBeLinked;
|
|
//canDrop是一个bool值,导出的什么数据?在状态配置中导出?
|
|
//canDrop是一个bool值,导出的什么数据?在状态配置中导出?
|
|
json["canMoveAway"] = canMoveAway;
|
|
json["canMoveAway"] = canMoveAway;
|
|
- json["beatScore"] = score;
|
|
|
|
|
|
+ json["beatScore"] = score.toInt();
|
|
json["gridPos"] = exportGridPos();
|
|
json["gridPos"] = exportGridPos();
|
|
json["animation"] = exportAnim();
|
|
json["animation"] = exportAnim();
|
|
json["states"] = exportStates();
|
|
json["states"] = exportStates();
|
|
//容器池
|
|
//容器池
|
|
json["subitem_pools"] = exportPools();
|
|
json["subitem_pools"] = exportPools();
|
|
//子元素
|
|
//子元素
|
|
|
|
+ json["subitems"] = exportChildElems();
|
|
//收集动画
|
|
//收集动画
|
|
json["collectConfig"] = exportCollAnim();
|
|
json["collectConfig"] = exportCollAnim();
|
|
}
|
|
}
|
|
@@ -432,7 +433,7 @@ QJsonObject ElemPropertyData::exportAnim() const
|
|
for(int i=0;i<statusEffect.size();i++)
|
|
for(int i=0;i<statusEffect.size();i++)
|
|
{
|
|
{
|
|
QJsonObject animObj;
|
|
QJsonObject animObj;
|
|
- animObj["showCcbi"] = statusEffect[i].res;
|
|
|
|
|
|
+ animObj["showCcbi"] = DataManager::getFileName(statusEffect[i].res);
|
|
animObj["showAnim"] = statusEffect[i].timeline;
|
|
animObj["showAnim"] = statusEffect[i].timeline;
|
|
animObj["localZOrder"] = statusEffect[i].zOrder.toInt();
|
|
animObj["localZOrder"] = statusEffect[i].zOrder.toInt();
|
|
json.insert(statusEffect[i].name,animObj);
|
|
json.insert(statusEffect[i].name,animObj);
|
|
@@ -454,14 +455,13 @@ QJsonObject ElemPropertyData::exportAnim() const
|
|
//收集
|
|
//收集
|
|
if(statusConfig[i].needCollect){
|
|
if(statusConfig[i].needCollect){
|
|
QJsonObject collObj;
|
|
QJsonObject collObj;
|
|
- collObj["goalType"] = statusConfig[i].collTargetType;
|
|
|
|
- //TODO:确定收集动画的key
|
|
|
|
- collObj["collAnim"] = statusConfig[i].collAnim;
|
|
|
|
|
|
+ collObj["goalType"] = statusConfig[i].collTargetType.toInt();
|
|
|
|
+ collObj["collConf"] = statusConfig[i].collAnim;
|
|
statusObj["collect"] = collObj;
|
|
statusObj["collect"] = collObj;
|
|
}
|
|
}
|
|
//事件
|
|
//事件
|
|
QJsonObject eventObj;
|
|
QJsonObject eventObj;
|
|
- QVector<EventConfig> eventVec;
|
|
|
|
|
|
+ QVector<EventConfig> eventVec = statusConfig[i].eventConfig;
|
|
for(int j=0;j<eventVec.size();j++)
|
|
for(int j=0;j<eventVec.size();j++)
|
|
{
|
|
{
|
|
QJsonObject obj;
|
|
QJsonObject obj;
|
|
@@ -485,11 +485,11 @@ QJsonObject ElemPropertyData::exportAnim() const
|
|
QJsonObject poolObj;
|
|
QJsonObject poolObj;
|
|
poolObj["method"] = DataManager::getInstance()->getTempId("poolTemp",container[i].type);
|
|
poolObj["method"] = DataManager::getInstance()->getTempId("poolTemp",container[i].type);
|
|
QJsonObject tableObj;
|
|
QJsonObject tableObj;
|
|
- QVector<ContainTable> table;
|
|
|
|
|
|
+ QVector<ContainTable> table = container[i].table;
|
|
for(int j=0;j<table.size();j++)
|
|
for(int j=0;j<table.size();j++)
|
|
{
|
|
{
|
|
QJsonObject keyObj;
|
|
QJsonObject keyObj;
|
|
- keyObj["res"] = table[i].res;
|
|
|
|
|
|
+ keyObj["res"] = DataManager::getFileName(table[i].res);
|
|
keyObj["init"] = table[i].initTimeline;
|
|
keyObj["init"] = table[i].initTimeline;
|
|
keyObj["tap"] = table[i].clickTimeline;
|
|
keyObj["tap"] = table[i].clickTimeline;
|
|
keyObj["affect"] = table[i].effectTimeline;
|
|
keyObj["affect"] = table[i].effectTimeline;
|
|
@@ -506,11 +506,12 @@ QJsonObject ElemPropertyData::exportAnim() const
|
|
QJsonArray ElemPropertyData::exportChildElems() const
|
|
QJsonArray ElemPropertyData::exportChildElems() const
|
|
{
|
|
{
|
|
QJsonArray childElemArray;
|
|
QJsonArray childElemArray;
|
|
-// for(int i=0;i<childElem.size();i++)
|
|
|
|
-// {
|
|
|
|
-// QJsonObject childElemObj;
|
|
|
|
-
|
|
|
|
-// }
|
|
|
|
|
|
+ for(int i=0;i<childElem.size();i++)
|
|
|
|
+ {
|
|
|
|
+ QJsonObject childElemObj;
|
|
|
|
+ childElemObj[childElem[i].name] = childElem[i].container;
|
|
|
|
+ childElemArray.append(childElemObj);
|
|
|
|
+ }
|
|
return childElemArray;
|
|
return childElemArray;
|
|
}
|
|
}
|
|
///导出收集动画
|
|
///导出收集动画
|
|
@@ -525,8 +526,8 @@ QJsonObject ElemPropertyData::exportCollAnim() const
|
|
QStringList dataKeys = data.keys();
|
|
QStringList dataKeys = data.keys();
|
|
for(int j=0;j<dataKeys.size();j++)
|
|
for(int j=0;j<dataKeys.size();j++)
|
|
{
|
|
{
|
|
- QString dataKey = dataKeys[i];
|
|
|
|
- QString objKey = DataManager::getInstance()->getTempId("collAnimTemp",dataKey);
|
|
|
|
|
|
+ QString dataKey = dataKeys[j];
|
|
|
|
+ QString objKey = DataManager::getInstance()->getTempFieldId("collAnimTemp",collAnim[i].type,dataKey);
|
|
collAnimObj[objKey] = data[dataKey];
|
|
collAnimObj[objKey] = data[dataKey];
|
|
}
|
|
}
|
|
obj[collAnim[i].name] = collAnimObj;
|
|
obj[collAnim[i].name] = collAnimObj;
|