mirror of https://github.com/axmolengine/axmol.git
Tidy sources
This commit is contained in:
parent
d2d656e83d
commit
bc94591603
|
@ -733,9 +733,9 @@ Frame* ActionTimelineCache::loadColorFrameWithFlatBuffers(const flatbuffers::Col
|
||||||
|
|
||||||
Frame* ActionTimelineCache::loadTextureFrameWithFlatBuffers(const flatbuffers::TextureFrame *flatbuffers)
|
Frame* ActionTimelineCache::loadTextureFrameWithFlatBuffers(const flatbuffers::TextureFrame *flatbuffers)
|
||||||
{
|
{
|
||||||
std::string path = "";
|
std::string path;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
std::string plist = "";
|
std::string plist;
|
||||||
|
|
||||||
TextureFrame* frame = TextureFrame::create();
|
TextureFrame* frame = TextureFrame::create();
|
||||||
|
|
||||||
|
@ -747,19 +747,13 @@ Frame* ActionTimelineCache::loadTextureFrameWithFlatBuffers(const flatbuffers::T
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
path = fileNameData->path()->c_str();
|
path = fileNameData->path()->c_str();
|
||||||
if (!FileUtils::getInstance()->isFileExist(path))
|
// pitfall: use fullPath will lead some asset managment solution not work with ETC1 seperate ALPHA channel.
|
||||||
{
|
|
||||||
path = "";
|
|
||||||
} // pitfall: x-studio spec, use fullPath will lead some asset managment solution not work with ETC1 seperate ALPHA channel.
|
|
||||||
/*if (FileUtils::getInstance()->isFileExist(path))
|
/*if (FileUtils::getInstance()->isFileExist(path))
|
||||||
{
|
{
|
||||||
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(path);
|
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(path);
|
||||||
path = fullPath;
|
path = fullPath;
|
||||||
}
|
}
|
||||||
else
|
*/
|
||||||
{
|
|
||||||
path = "";
|
|
||||||
}*/
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -772,7 +766,7 @@ Frame* ActionTimelineCache::loadTextureFrameWithFlatBuffers(const flatbuffers::T
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
path = "";
|
path;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,7 +431,7 @@ Node* CSLoader::createNodeFromJson(const std::string& filename)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUIReader::getInstance()->setFilePath("");
|
GUIReader::getInstance()->setFilePath("");
|
||||||
_jsonPath = "";
|
_jsonPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node* node = loadNodeWithFile(filename);
|
Node* node = loadNodeWithFile(filename);
|
||||||
|
|
|
@ -302,7 +302,7 @@ void DataReaderHelper::addDataFromFile(const std::string& filePath)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
basefilePath = "";
|
basefilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string fileExtension = cocos2d::FileUtils::getInstance()->getFileExtension(filePath);
|
std::string fileExtension = cocos2d::FileUtils::getInstance()->getFileExtension(filePath);
|
||||||
|
@ -368,7 +368,7 @@ void DataReaderHelper::addDataFromFileAsync(const std::string& imagePath, const
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
basefilePath = "";
|
basefilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -379,7 +379,7 @@ Widget* GUIReader::widgetFromBinaryFile(const char *fileName)
|
||||||
auto fileDataBytes = fileData.getBytes();
|
auto fileDataBytes = fileData.getBytes();
|
||||||
auto fileDataSize = fileData.getSize();
|
auto fileDataSize = fileData.getSize();
|
||||||
|
|
||||||
const char* fileVersion = "";
|
const char* fileVersion;
|
||||||
ui::Widget* widget = nullptr;
|
ui::Widget* widget = nullptr;
|
||||||
|
|
||||||
if (fileDataBytes != nullptr && fileDataSize > 0)
|
if (fileDataBytes != nullptr && fileDataSize > 0)
|
||||||
|
|
|
@ -508,7 +508,7 @@ void SceneReader::setPropertyFromJsonDict(CocoLoader *cocoLoader, stExpCocoNode
|
||||||
stExpCocoNode *stChildArray = cocoNode->GetChildArray(cocoLoader);
|
stExpCocoNode *stChildArray = cocoNode->GetChildArray(cocoLoader);
|
||||||
float x = 0.0f, y = 0.0f, fScaleX = 1.0f, fScaleY = 1.0f, fRotationZ = 1.0f;
|
float x = 0.0f, y = 0.0f, fScaleX = 1.0f, fScaleY = 1.0f, fRotationZ = 1.0f;
|
||||||
bool bVisible = false;
|
bool bVisible = false;
|
||||||
const char *sName = "";
|
const char *sName;
|
||||||
int nTag = 0, nZorder = -1;
|
int nTag = 0, nZorder = -1;
|
||||||
|
|
||||||
for (int i = 0; i < cocoNode->GetChildNum(); ++i)
|
for (int i = 0; i < cocoNode->GetChildNum(); ++i)
|
||||||
|
|
|
@ -190,7 +190,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithOpaque(void* opaque,
|
||||||
pugi::xml_node element = rootElement.first_child();
|
pugi::xml_node element = rootElement.first_child();
|
||||||
|
|
||||||
bool serializeEnabled = false;
|
bool serializeEnabled = false;
|
||||||
std::string rootType = "";
|
std::string rootType;
|
||||||
|
|
||||||
while (element)
|
while (element)
|
||||||
{
|
{
|
||||||
|
@ -346,7 +346,7 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTree(pugi::xml_node objectData,
|
||||||
std::string classname = classType.substr(0, classType.find("ObjectData"));
|
std::string classname = classType.substr(0, classType.find("ObjectData"));
|
||||||
// CCLOG("classname = %s", classname.c_str());
|
// CCLOG("classname = %s", classname.c_str());
|
||||||
|
|
||||||
std::string name = "";
|
std::string name;
|
||||||
|
|
||||||
Offset<Options> options;
|
Offset<Options> options;
|
||||||
std::vector<Offset<NodeTree>> children;
|
std::vector<Offset<NodeTree>> children;
|
||||||
|
@ -430,7 +430,7 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTree(pugi::xml_node objectData,
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
||||||
std::string customClassName = "";
|
std::string customClassName;
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
while (attribute)
|
while (attribute)
|
||||||
{
|
{
|
||||||
|
@ -574,7 +574,7 @@ Offset<NodeAction> FlatBuffersSerialize::createNodeAction(pugi::xml_node objectD
|
||||||
{
|
{
|
||||||
int duration = 0;
|
int duration = 0;
|
||||||
float speed = 0.0f;
|
float speed = 0.0f;
|
||||||
std::string currentAnimationName = "";
|
std::string currentAnimationName;
|
||||||
|
|
||||||
// CCLOG("animation name = %s", objectData->Name());
|
// CCLOG("animation name = %s", objectData->Name());
|
||||||
|
|
||||||
|
@ -623,7 +623,7 @@ Offset<NodeAction> FlatBuffersSerialize::createNodeAction(pugi::xml_node objectD
|
||||||
|
|
||||||
Offset<flatbuffers::AnimationInfo> FlatBuffersSerialize::createAnimationInfo(pugi::xml_node objectData)
|
Offset<flatbuffers::AnimationInfo> FlatBuffersSerialize::createAnimationInfo(pugi::xml_node objectData)
|
||||||
{
|
{
|
||||||
std::string infoName = "";
|
std::string infoName;
|
||||||
int startIndex = 0;
|
int startIndex = 0;
|
||||||
int endIndex = 0;
|
int endIndex = 0;
|
||||||
|
|
||||||
|
@ -652,7 +652,7 @@ Offset<flatbuffers::AnimationInfo> FlatBuffersSerialize::createAnimationInfo(pug
|
||||||
Offset<TimeLine> FlatBuffersSerialize::createTimeLine(pugi::xml_node objectData)
|
Offset<TimeLine> FlatBuffersSerialize::createTimeLine(pugi::xml_node objectData)
|
||||||
{
|
{
|
||||||
int actionTag = 0;
|
int actionTag = 0;
|
||||||
std::string property = "";
|
std::string property;
|
||||||
|
|
||||||
// TimelineData attributes
|
// TimelineData attributes
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
|
@ -959,12 +959,12 @@ Offset<flatbuffers::TextureFrame> FlatBuffersSerialize::createTextureFrame(pugi:
|
||||||
int frameIndex = 0;
|
int frameIndex = 0;
|
||||||
bool tween = true;
|
bool tween = true;
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
while (attribute)
|
while (attribute)
|
||||||
|
@ -1032,7 +1032,7 @@ Offset<flatbuffers::EventFrame> FlatBuffersSerialize::createEventFrame(pugi::xml
|
||||||
{
|
{
|
||||||
int frameIndex = 0;
|
int frameIndex = 0;
|
||||||
bool tween = true;
|
bool tween = true;
|
||||||
std::string value = "";
|
std::string value;
|
||||||
|
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
while (attribute)
|
while (attribute)
|
||||||
|
@ -1138,7 +1138,7 @@ Offset<flatbuffers::InnerActionFrame> FlatBuffersSerialize::createInnerActionFra
|
||||||
int frameIndex = 0;
|
int frameIndex = 0;
|
||||||
bool tween = true;
|
bool tween = true;
|
||||||
int innerActionType = 0;
|
int innerActionType = 0;
|
||||||
std::string currentAniamtionName = "";
|
std::string currentAniamtionName;
|
||||||
int singleFrameIndex = 0;
|
int singleFrameIndex = 0;
|
||||||
|
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
|
@ -1196,8 +1196,8 @@ flatbuffers::Offset<flatbuffers::BlendFrame> FlatBuffersSerialize::createBlendFr
|
||||||
int frameIndex = 0;
|
int frameIndex = 0;
|
||||||
bool tween = true;
|
bool tween = true;
|
||||||
int32_t src = GLBlendConst::ONE, dst = GLBlendConst::ONE_MINUS_SRC_ALPHA;
|
int32_t src = GLBlendConst::ONE, dst = GLBlendConst::ONE_MINUS_SRC_ALPHA;
|
||||||
std::string name = "";
|
std::string name;
|
||||||
std::string value = "";
|
std::string value;
|
||||||
|
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
while (attribute)
|
while (attribute)
|
||||||
|
@ -1322,7 +1322,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato
|
||||||
pugi::xml_node element = rootElement.first_child();
|
pugi::xml_node element = rootElement.first_child();
|
||||||
|
|
||||||
bool serializeEnabled = false;
|
bool serializeEnabled = false;
|
||||||
std::string rootType = "";
|
std::string rootType;
|
||||||
|
|
||||||
while (element)
|
while (element)
|
||||||
{
|
{
|
||||||
|
@ -1436,7 +1436,7 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTreeForSimulator(pugi::xml_node
|
||||||
std::string classname = classType.substr(0, classType.find("ObjectData"));
|
std::string classname = classType.substr(0, classType.find("ObjectData"));
|
||||||
// CCLOG("classname = %s", classname.c_str());
|
// CCLOG("classname = %s", classname.c_str());
|
||||||
|
|
||||||
std::string name = "";
|
std::string name;
|
||||||
|
|
||||||
Offset<Options> options;
|
Offset<Options> options;
|
||||||
std::vector<Offset<NodeTree>> children;
|
std::vector<Offset<NodeTree>> children;
|
||||||
|
@ -1521,7 +1521,7 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTreeForSimulator(pugi::xml_node
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
std::string customClassName = "";
|
std::string customClassName;
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
while (attribute)
|
while (attribute)
|
||||||
{
|
{
|
||||||
|
@ -1549,7 +1549,7 @@ Offset<ProjectNodeOptions> FlatBuffersSerialize::createProjectNodeOptionsForSimu
|
||||||
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, _builder);
|
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, _builder);
|
||||||
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string filename = "";
|
std::string filename;
|
||||||
float innerspeed = 1.0f;
|
float innerspeed = 1.0f;
|
||||||
|
|
||||||
pugi::xml_attribute objattri = objectData.first_attribute();
|
pugi::xml_attribute objattri = objectData.first_attribute();
|
||||||
|
@ -1626,8 +1626,8 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFileForLanguageData
|
||||||
}
|
}
|
||||||
|
|
||||||
//Read all of the Key-Values in the XML file.
|
//Read all of the Key-Values in the XML file.
|
||||||
std::string key = "";
|
std::string key;
|
||||||
std::string text = "";
|
std::string text;
|
||||||
bool hasKeyReaded = false;
|
bool hasKeyReaded = false;
|
||||||
bool hasTextReaded = false;
|
bool hasTextReaded = false;
|
||||||
pugi::xml_node childElement = element.first_child();
|
pugi::xml_node childElement = element.first_child();
|
||||||
|
|
|
@ -109,7 +109,7 @@ public:
|
||||||
/* serialize flat buffers with XML */
|
/* serialize flat buffers with XML */
|
||||||
static std::string serializeFlatBuffersWithXMLFile(const std::string& xmlFileName,
|
static std::string serializeFlatBuffersWithXMLFile(const std::string& xmlFileName,
|
||||||
const std::string& flatbuffersFileName);
|
const std::string& flatbuffersFileName);
|
||||||
/* x-studio365 spec: serialize flat buffers with XML buffer */
|
/* x-studio spec: serialize flat buffers with XML buffer */
|
||||||
static std::string serializeFlatBuffersWithXMLBuffer(std::string& xmlBuffer,
|
static std::string serializeFlatBuffersWithXMLBuffer(std::string& xmlBuffer,
|
||||||
const std::string& flatbuffersFileName);
|
const std::string& flatbuffersFileName);
|
||||||
static std::string serializeFlatBuffersWithOpaque(void* opaque,
|
static std::string serializeFlatBuffersWithOpaque(void* opaque,
|
||||||
|
|
|
@ -56,7 +56,7 @@ Offset<Table> ArmatureNodeReader::createOptionsWithFlatBuffers(pugi::xml_node ob
|
||||||
std::string currentArmatureName;
|
std::string currentArmatureName;
|
||||||
|
|
||||||
int type = 0;
|
int type = 0;
|
||||||
std::string path = "";
|
std::string path;
|
||||||
|
|
||||||
float armatureScale = 1.0f;
|
float armatureScale = 1.0f;
|
||||||
float timeScale = 1.0f;
|
float timeScale = 1.0f;
|
||||||
|
@ -149,7 +149,7 @@ void ArmatureNodeReader::setPropsWithFlatBuffers(cocos2d::Node *node,
|
||||||
auto options = (flatbuffers::CSArmatureNodeOption*)nodeOptions;
|
auto options = (flatbuffers::CSArmatureNodeOption*)nodeOptions;
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
|
|
||||||
std::string filepath(options->fileData()->path()->c_str());
|
std::string filepath(options->fileData()->path()->c_str());
|
||||||
|
|
||||||
|
|
|
@ -108,8 +108,7 @@ namespace cocostudio
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
|
|
||||||
// assets[0] = backgroundValue;
|
// assets[0] = backgroundValue;
|
||||||
auto fileData = cocos2d::wext::makeResourceData(backgroundValue, (int)imageFileNameType);
|
button->loadTextureNormal(backgroundValue, imageFileNameType);
|
||||||
button->loadTextureNormal(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (key == P_PressedData){
|
else if (key == P_PressedData){
|
||||||
|
@ -121,8 +120,7 @@ namespace cocostudio
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
|
|
||||||
auto fileData = cocos2d::wext::makeResourceData(backgroundValue, (int)imageFileNameType);
|
button->loadTexturePressed(backgroundValue, imageFileNameType);
|
||||||
button->loadTexturePressed(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (key == P_DisabledData){
|
else if (key == P_DisabledData){
|
||||||
|
@ -134,8 +132,7 @@ namespace cocostudio
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
|
|
||||||
auto fileData = cocos2d::wext::makeResourceData(backgroundValue, (int)imageFileNameType);
|
button->loadTextureDisabled(backgroundValue, imageFileNameType);
|
||||||
button->loadTextureDisabled(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}else if (key == P_Text){
|
}else if (key == P_Text){
|
||||||
button->setTitleText(value);
|
button->setTitleText(value);
|
||||||
|
@ -161,8 +158,7 @@ namespace cocostudio
|
||||||
}else if(key == P_FontSize){
|
}else if(key == P_FontSize){
|
||||||
button->setTitleFontSize(valueToFloat(value));
|
button->setTitleFontSize(valueToFloat(value));
|
||||||
}else if(key == P_FontName){
|
}else if(key == P_FontName){
|
||||||
auto fileData = cocos2d::wext::makeResourceData(value);
|
button->setTitleFontName(value); // fonts
|
||||||
button->setTitleFontName(fileData.file); // fonts
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} //end of for loop
|
} //end of for loop
|
||||||
|
@ -269,27 +265,27 @@ namespace cocostudio
|
||||||
bool displaystate = true;
|
bool displaystate = true;
|
||||||
bool scale9Enabled = false;
|
bool scale9Enabled = false;
|
||||||
Rect capInsets;
|
Rect capInsets;
|
||||||
std::string text = "";
|
std::string text;
|
||||||
bool isLocalized = false;
|
bool isLocalized = false;
|
||||||
int fontSize = 14;
|
int fontSize = 14;
|
||||||
std::string fontName = "";
|
std::string fontName;
|
||||||
cocos2d::Size scale9Size;
|
cocos2d::Size scale9Size;
|
||||||
Color4B textColor(255, 255, 255, 255);
|
Color4B textColor(255, 255, 255, 255);
|
||||||
|
|
||||||
std::string normalPath = "";
|
std::string normalPath;
|
||||||
std::string normalPlistFile = "";
|
std::string normalPlistFile;
|
||||||
int normalResourceType = 0;
|
int normalResourceType = 0;
|
||||||
|
|
||||||
std::string pressedPath = "";
|
std::string pressedPath;
|
||||||
std::string pressedPlistFile = "";
|
std::string pressedPlistFile;
|
||||||
int pressedResourceType = 0;
|
int pressedResourceType = 0;
|
||||||
|
|
||||||
std::string disabledPath = "";
|
std::string disabledPath;
|
||||||
std::string disabledPlistFile = "";
|
std::string disabledPlistFile;
|
||||||
int disabledResourceType = 0;
|
int disabledResourceType = 0;
|
||||||
|
|
||||||
std::string fontResourcePath = "";
|
std::string fontResourcePath;
|
||||||
std::string fontResourcePlistFile = "";
|
std::string fontResourcePlistFile;
|
||||||
int fontResourceResourceType = 0;
|
int fontResourceResourceType = 0;
|
||||||
|
|
||||||
bool outlineEnabled = false;
|
bool outlineEnabled = false;
|
||||||
|
@ -452,8 +448,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "DisabledFileData")
|
else if (name == "DisabledFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -487,8 +483,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "PressedFileData")
|
else if (name == "PressedFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -522,8 +518,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "NormalFileData")
|
else if (name == "NormalFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -728,10 +724,10 @@ namespace cocostudio
|
||||||
button->setScale9Enabled(scale9Enabled);
|
button->setScale9Enabled(scale9Enabled);
|
||||||
|
|
||||||
bool normalFileExist = false;
|
bool normalFileExist = false;
|
||||||
std::string normalErrorFilePath = "";
|
std::string normalErrorFilePath;
|
||||||
auto normalDic = cocos2d::wext::makeResourceData(options->normalData());
|
auto normalDic = options->normalData();
|
||||||
int normalType = normalDic.type;
|
int normalType = normalDic->resourceType();
|
||||||
std::string& normalTexturePath = normalDic.file;
|
std::string normalTexturePath = normalDic->path()->c_str();
|
||||||
switch (normalType)
|
switch (normalType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -746,14 +742,14 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
normalErrorFilePath = normalTexturePath;
|
normalErrorFilePath = std::move(normalTexturePath);
|
||||||
normalFileExist = false;
|
normalFileExist = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = normalDic.plist;
|
std::string plist = normalDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(normalTexturePath);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(normalTexturePath);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -765,7 +761,7 @@ namespace cocostudio
|
||||||
{
|
{
|
||||||
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
|
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
|
||||||
ValueMap metadata = value["metadata"].asValueMap();
|
ValueMap metadata = value["metadata"].asValueMap();
|
||||||
std::string textureFileName = metadata["textureFileName"].asString();
|
auto& textureFileName = metadata["textureFileName"].asString();
|
||||||
if (!FileUtils::getInstance()->isFileExist(textureFileName))
|
if (!FileUtils::getInstance()->isFileExist(textureFileName))
|
||||||
{
|
{
|
||||||
normalErrorFilePath = textureFileName;
|
normalErrorFilePath = textureFileName;
|
||||||
|
@ -773,7 +769,7 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
normalErrorFilePath = plist;
|
normalErrorFilePath = std::move(plist);
|
||||||
}
|
}
|
||||||
normalFileExist = false;
|
normalFileExist = false;
|
||||||
}
|
}
|
||||||
|
@ -789,10 +785,10 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pressedFileExist = false;
|
bool pressedFileExist = false;
|
||||||
std::string pressedErrorFilePath = "";
|
std::string pressedErrorFilePath;
|
||||||
auto pressedDic = cocos2d::wext::makeResourceData(options->pressedData());
|
auto pressedDic = options->pressedData();
|
||||||
int pressedType = pressedDic.type;
|
int pressedType = pressedDic->resourceType();
|
||||||
std::string& pressedTexturePath = pressedDic.file;
|
std::string pressedTexturePath = pressedDic->path()->c_str();
|
||||||
switch (pressedType)
|
switch (pressedType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -811,7 +807,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = pressedDic.plist;
|
std::string plist = pressedDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(pressedTexturePath);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(pressedTexturePath);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -823,7 +819,7 @@ namespace cocostudio
|
||||||
{
|
{
|
||||||
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
|
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
|
||||||
ValueMap metadata = value["metadata"].asValueMap();
|
ValueMap metadata = value["metadata"].asValueMap();
|
||||||
std::string textureFileName = metadata["textureFileName"].asString();
|
auto& textureFileName = metadata["textureFileName"].asString();
|
||||||
if (!FileUtils::getInstance()->isFileExist(textureFileName))
|
if (!FileUtils::getInstance()->isFileExist(textureFileName))
|
||||||
{
|
{
|
||||||
pressedErrorFilePath = textureFileName;
|
pressedErrorFilePath = textureFileName;
|
||||||
|
@ -831,7 +827,7 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pressedErrorFilePath = plist;
|
pressedErrorFilePath = std::move(plist);
|
||||||
}
|
}
|
||||||
pressedFileExist = false;
|
pressedFileExist = false;
|
||||||
}
|
}
|
||||||
|
@ -847,10 +843,10 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
|
|
||||||
bool disabledFileExist = false;
|
bool disabledFileExist = false;
|
||||||
std::string disabledErrorFilePath = "";
|
std::string disabledErrorFilePath;
|
||||||
auto disabledDic = cocos2d::wext::makeResourceData(options->disabledData());
|
auto disabledDic = options->disabledData();
|
||||||
int disabledType = disabledDic.type;
|
int disabledType = disabledDic->resourceType();
|
||||||
std::string& disabledTexturePath = disabledDic.file;
|
std::string disabledTexturePath = disabledDic->path()->c_str();
|
||||||
switch (disabledType)
|
switch (disabledType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -869,7 +865,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = disabledDic.plist;
|
std::string plist = disabledDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(disabledTexturePath);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(disabledTexturePath);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -881,7 +877,7 @@ namespace cocostudio
|
||||||
{
|
{
|
||||||
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
|
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
|
||||||
ValueMap metadata = value["metadata"].asValueMap();
|
ValueMap metadata = value["metadata"].asValueMap();
|
||||||
std::string textureFileName = metadata["textureFileName"].asString();
|
auto& textureFileName = metadata["textureFileName"].asString();
|
||||||
if (!FileUtils::getInstance()->isFileExist(textureFileName))
|
if (!FileUtils::getInstance()->isFileExist(textureFileName))
|
||||||
{
|
{
|
||||||
disabledErrorFilePath = textureFileName;
|
disabledErrorFilePath = textureFileName;
|
||||||
|
@ -889,7 +885,7 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
disabledErrorFilePath = plist;
|
disabledErrorFilePath = std::move(plist);
|
||||||
}
|
}
|
||||||
disabledFileExist = false;
|
disabledFileExist = false;
|
||||||
}
|
}
|
||||||
|
@ -924,25 +920,15 @@ namespace cocostudio
|
||||||
std::string titleFontName = options->fontName()->c_str();
|
std::string titleFontName = options->fontName()->c_str();
|
||||||
button->setTitleFontName(titleFontName);
|
button->setTitleFontName(titleFontName);
|
||||||
|
|
||||||
auto resourceData = cocos2d::wext::makeResourceData(options->fontResource());
|
auto resourceData = options->fontResource();
|
||||||
bool fileExist = false;
|
std::string errorFilePath;
|
||||||
std::string errorFilePath = "";
|
std::string path = resourceData->path()->c_str();
|
||||||
std::string& path = resourceData.file;
|
if (!path.empty())
|
||||||
if (path != "")
|
|
||||||
{
|
{
|
||||||
if (FileUtils::getInstance()->isFileExist(path))
|
if (FileUtils::getInstance()->isFileExist(path))
|
||||||
{
|
|
||||||
fileExist = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
errorFilePath = path;
|
|
||||||
fileExist = false;
|
|
||||||
}
|
|
||||||
if (fileExist)
|
|
||||||
{
|
|
||||||
button->setTitleFontName(path);
|
button->setTitleFontName(path);
|
||||||
}
|
else
|
||||||
|
errorFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
int titleFontSize = options->fontSize();
|
int titleFontSize = options->fontSize();
|
||||||
|
|
|
@ -75,9 +75,7 @@ namespace cocostudio
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
|
|
||||||
auto fileData = cocos2d::wext::makeResourceData(backgroundValue, (int)imageFileNameType);
|
checkBox->loadTextureBackGround(backgroundValue, imageFileNameType);
|
||||||
|
|
||||||
checkBox->loadTextureBackGround(fileData.file, imageFileNameType);
|
|
||||||
}else if(key == P_BackGroundBoxSelectedData){
|
}else if(key == P_BackGroundBoxSelectedData){
|
||||||
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
||||||
std::string resType = backGroundChildren[2].GetValue(cocoLoader);
|
std::string resType = backGroundChildren[2].GetValue(cocoLoader);
|
||||||
|
@ -85,9 +83,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(backgroundValue, (int)imageFileNameType);
|
checkBox->loadTextureBackGroundSelected(backgroundValue, imageFileNameType);
|
||||||
|
|
||||||
checkBox->loadTextureBackGroundSelected(fileData.file, imageFileNameType);
|
|
||||||
}else if(key == P_FrontCrossData){
|
}else if(key == P_FrontCrossData){
|
||||||
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
||||||
std::string resType = backGroundChildren[2].GetValue(cocoLoader);
|
std::string resType = backGroundChildren[2].GetValue(cocoLoader);
|
||||||
|
@ -95,9 +91,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(backgroundValue, (int)imageFileNameType);
|
checkBox->loadTextureFrontCross(backgroundValue, imageFileNameType);
|
||||||
|
|
||||||
checkBox->loadTextureFrontCross(fileData.file, imageFileNameType);
|
|
||||||
}else if(key == P_BackGroundBoxDisabledData){
|
}else if(key == P_BackGroundBoxDisabledData){
|
||||||
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
||||||
std::string resType = backGroundChildren[2].GetValue(cocoLoader);
|
std::string resType = backGroundChildren[2].GetValue(cocoLoader);
|
||||||
|
@ -105,8 +99,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(backgroundValue, (int)imageFileNameType);
|
checkBox->loadTextureBackGroundDisabled(backgroundValue, imageFileNameType);
|
||||||
checkBox->loadTextureBackGroundDisabled(fileData.file, imageFileNameType);
|
|
||||||
}else if (key == P_FrontCrossDisabledData){
|
}else if (key == P_FrontCrossDisabledData){
|
||||||
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
||||||
std::string resType = backGroundChildren[2].GetValue(cocoLoader);
|
std::string resType = backGroundChildren[2].GetValue(cocoLoader);
|
||||||
|
@ -114,8 +107,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(backgroundValue, (int)imageFileNameType);
|
checkBox->loadTextureFrontCrossDisabled(backgroundValue, imageFileNameType);
|
||||||
checkBox->loadTextureFrontCrossDisabled(fileData.file, imageFileNameType);
|
|
||||||
}
|
}
|
||||||
// else if (key == "selectedState"){
|
// else if (key == "selectedState"){
|
||||||
// checkBox->setSelectedState(valueToBool(value));
|
// checkBox->setSelectedState(valueToBool(value));
|
||||||
|
@ -184,25 +176,25 @@ namespace cocostudio
|
||||||
bool displaystate = true;
|
bool displaystate = true;
|
||||||
|
|
||||||
int backgroundboxResourceType = 0;
|
int backgroundboxResourceType = 0;
|
||||||
std::string backgroundboxPath = "";
|
std::string backgroundboxPath;
|
||||||
std::string backgroundboxPlistFile = "";
|
std::string backgroundboxPlistFile;
|
||||||
|
|
||||||
int backGroundBoxSelectedResourceType = 0;
|
int backGroundBoxSelectedResourceType = 0;
|
||||||
std::string backGroundBoxSelectedPath = "";
|
std::string backGroundBoxSelectedPath;
|
||||||
std::string backGroundBoxSelectedPlistFile = "";
|
std::string backGroundBoxSelectedPlistFile;
|
||||||
|
|
||||||
int frontCrossResourceType = 0;
|
int frontCrossResourceType = 0;
|
||||||
std::string frontCrossPath = "";
|
std::string frontCrossPath;
|
||||||
std::string frontCrossPlistFile = "";
|
std::string frontCrossPlistFile;
|
||||||
|
|
||||||
int backGroundBoxDisabledResourceType = 0;
|
int backGroundBoxDisabledResourceType = 0;
|
||||||
std::string backGroundBoxDisabledPath = "";
|
std::string backGroundBoxDisabledPath;
|
||||||
std::string backGroundBoxDisabledPlistFile = "";
|
std::string backGroundBoxDisabledPlistFile;
|
||||||
|
|
||||||
|
|
||||||
int frontCrossDisabledResourceType = 0;
|
int frontCrossDisabledResourceType = 0;
|
||||||
std::string frontCrossDisabledPath = "";
|
std::string frontCrossDisabledPath;
|
||||||
std::string frontCrossDisabledPlistFile = "";
|
std::string frontCrossDisabledPlistFile;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
|
@ -230,8 +222,8 @@ namespace cocostudio
|
||||||
|
|
||||||
if (name == "NormalBackFileData")
|
if (name == "NormalBackFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -265,8 +257,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "PressedBackFileData")
|
else if (name == "PressedBackFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -300,8 +292,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "NodeNormalFileData")
|
else if (name == "NodeNormalFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -335,8 +327,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "DisableBackFileData")
|
else if (name == "DisableBackFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -370,8 +362,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "NodeDisableFileData")
|
else if (name == "NodeDisableFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -446,10 +438,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//load background image
|
//load background image
|
||||||
bool backGroundFileExist = false;
|
bool backGroundFileExist = false;
|
||||||
std::string backGroundErrorFilePath = "";
|
std::string backGroundErrorFilePath;
|
||||||
auto backGroundDic = cocos2d::wext::makeResourceData(options->backGroundBoxData());
|
auto backGroundDic = options->backGroundBoxData();
|
||||||
int backGroundType = backGroundDic.type;
|
int backGroundType = backGroundDic->resourceType();
|
||||||
std::string& backGroundTexturePath = backGroundDic.file;
|
std::string backGroundTexturePath = backGroundDic->path()->c_str();
|
||||||
|
|
||||||
switch (backGroundType)
|
switch (backGroundType)
|
||||||
{
|
{
|
||||||
|
@ -469,7 +461,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = backGroundDic.plist;
|
std::string plist = backGroundDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundTexturePath);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundTexturePath);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -506,10 +498,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//load background selected image
|
//load background selected image
|
||||||
bool backGroundSelectedfileExist = false;
|
bool backGroundSelectedfileExist = false;
|
||||||
std::string backGroundSelectedErrorFilePath = "";
|
std::string backGroundSelectedErrorFilePath;
|
||||||
auto backGroundSelectedDic = cocos2d::wext::makeResourceData(options->backGroundBoxSelectedData());
|
auto backGroundSelectedDic = options->backGroundBoxSelectedData();
|
||||||
int backGroundSelectedType = backGroundSelectedDic.type;
|
int backGroundSelectedType = backGroundSelectedDic->resourceType();
|
||||||
std::string& backGroundSelectedTexturePath = backGroundSelectedDic.file;
|
std::string backGroundSelectedTexturePath = backGroundSelectedDic->path()->c_str();
|
||||||
|
|
||||||
switch (backGroundSelectedType)
|
switch (backGroundSelectedType)
|
||||||
{
|
{
|
||||||
|
@ -529,7 +521,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = backGroundSelectedDic.plist;
|
std::string plist = backGroundSelectedDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundSelectedTexturePath);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundSelectedTexturePath);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -566,10 +558,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//load frontCross image
|
//load frontCross image
|
||||||
bool frontCrossFileExist = false;
|
bool frontCrossFileExist = false;
|
||||||
std::string frontCrossErrorFilePath = "";
|
std::string frontCrossErrorFilePath;
|
||||||
auto frontCrossDic = cocos2d::wext::makeResourceData(options->frontCrossData());
|
auto frontCrossDic = (options->frontCrossData());
|
||||||
int frontCrossType = frontCrossDic.type;
|
int frontCrossType = frontCrossDic->resourceType();
|
||||||
std::string& frontCrossFileName = frontCrossDic.file;
|
std::string frontCrossFileName = frontCrossDic->path()->c_str();
|
||||||
switch (frontCrossType)
|
switch (frontCrossType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -588,7 +580,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = frontCrossDic.plist;
|
std::string plist = frontCrossDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -625,10 +617,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//load backGroundBoxDisabledData
|
//load backGroundBoxDisabledData
|
||||||
bool backGroundBoxDisabledFileExist = false;
|
bool backGroundBoxDisabledFileExist = false;
|
||||||
std::string backGroundBoxDisabledErrorFilePath = "";
|
std::string backGroundBoxDisabledErrorFilePath;
|
||||||
auto backGroundDisabledDic = cocos2d::wext::makeResourceData(options->backGroundBoxDisabledData());
|
auto backGroundDisabledDic = (options->backGroundBoxDisabledData());
|
||||||
int backGroundDisabledType = backGroundDisabledDic.type;
|
int backGroundDisabledType = backGroundDisabledDic->resourceType();
|
||||||
std::string& backGroundDisabledFileName = backGroundDisabledDic.file;
|
std::string backGroundDisabledFileName = backGroundDisabledDic->path()->c_str();
|
||||||
switch (backGroundDisabledType)
|
switch (backGroundDisabledType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -647,7 +639,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = backGroundDisabledDic.plist;
|
std::string plist = backGroundDisabledDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundDisabledFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundDisabledFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -684,10 +676,10 @@ namespace cocostudio
|
||||||
|
|
||||||
///load frontCrossDisabledData
|
///load frontCrossDisabledData
|
||||||
bool frontCrossDisabledFileExist = false;
|
bool frontCrossDisabledFileExist = false;
|
||||||
std::string frontCrossDisabledErrorFilePath = "";
|
std::string frontCrossDisabledErrorFilePath;
|
||||||
auto frontCrossDisabledDic = cocos2d::wext::makeResourceData(options->frontCrossDisabledData());
|
auto frontCrossDisabledDic = (options->frontCrossDisabledData());
|
||||||
int frontCrossDisabledType = frontCrossDisabledDic.type;
|
int frontCrossDisabledType = frontCrossDisabledDic->resourceType();
|
||||||
std::string& frontCrossDisabledFileName = frontCrossDisabledDic.file;
|
std::string frontCrossDisabledFileName = frontCrossDisabledDic->path()->c_str();
|
||||||
switch (frontCrossDisabledType)
|
switch (frontCrossDisabledType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -706,7 +698,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = frontCrossDisabledDic.plist;
|
std::string plist = frontCrossDisabledDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossDisabledFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossDisabledFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,13 +73,13 @@ namespace cocostudio
|
||||||
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string name = "";
|
std::string name;
|
||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
bool loop = false;
|
bool loop = false;
|
||||||
float volume = 0;
|
float volume = 0;
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plist = "";
|
std::string plist;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
|
|
|
@ -75,8 +75,8 @@ namespace cocostudio
|
||||||
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
// child elements
|
// child elements
|
||||||
|
@ -140,7 +140,7 @@ namespace cocostudio
|
||||||
auto fileNameData = options->fileNameData();
|
auto fileNameData = options->fileNameData();
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
std::string path = fileNameData->path()->c_str();
|
std::string path = fileNameData->path()->c_str();
|
||||||
int resourceType = fileNameData->resourceType();
|
int resourceType = fileNameData->resourceType();
|
||||||
switch (resourceType)
|
switch (resourceType)
|
||||||
|
@ -168,7 +168,7 @@ namespace cocostudio
|
||||||
auto mapInfo = TMXMapInfo::create(path);
|
auto mapInfo = TMXMapInfo::create(path);
|
||||||
auto& layers = mapInfo->getLayers();
|
auto& layers = mapInfo->getLayers();
|
||||||
bool valid = false;
|
bool valid = false;
|
||||||
std::string layerName = "";
|
std::string layerName;
|
||||||
for (const auto &layerInfo : layers)
|
for (const auto &layerInfo : layers)
|
||||||
{
|
{
|
||||||
valid = false;
|
valid = false;
|
||||||
|
|
|
@ -82,38 +82,38 @@ namespace cocostudio
|
||||||
Offset<Table> GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node objectData,
|
Offset<Table> GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node objectData,
|
||||||
flatbuffers::FlatBufferBuilder *builder)
|
flatbuffers::FlatBufferBuilder *builder)
|
||||||
{
|
{
|
||||||
std::string name = "";
|
std::string name;
|
||||||
bool useDefaultLight = false;
|
bool useDefaultLight = false;
|
||||||
int skyBoxMask = 1;
|
int skyBoxMask = 1;
|
||||||
bool skyBoxEnabled = false;
|
bool skyBoxEnabled = false;
|
||||||
bool skyBoxValid = true;
|
bool skyBoxValid = true;
|
||||||
|
|
||||||
std::string leftPath = "";
|
std::string leftPath;
|
||||||
std::string leftPlistFile = "";
|
std::string leftPlistFile;
|
||||||
int leftResourceType = 0;
|
int leftResourceType = 0;
|
||||||
|
|
||||||
std::string rightPath = "";
|
std::string rightPath;
|
||||||
std::string rightPlistFile = "";
|
std::string rightPlistFile;
|
||||||
int rightResourceType = 0;
|
int rightResourceType = 0;
|
||||||
|
|
||||||
std::string upPath = "";
|
std::string upPath;
|
||||||
std::string upPlistFile = "";
|
std::string upPlistFile;
|
||||||
int upResourceType = 0;
|
int upResourceType = 0;
|
||||||
|
|
||||||
std::string downPath = "";
|
std::string downPath;
|
||||||
std::string downPlistFile = "";
|
std::string downPlistFile;
|
||||||
int downResourceType = 0;
|
int downResourceType = 0;
|
||||||
|
|
||||||
std::string forwardPath = "";
|
std::string forwardPath;
|
||||||
std::string forwardPlistFile = "";
|
std::string forwardPlistFile;
|
||||||
int forwardResourceType = 0;
|
int forwardResourceType = 0;
|
||||||
|
|
||||||
std::string backPath = "";
|
std::string backPath;
|
||||||
std::string backPlistFile = "";
|
std::string backPlistFile;
|
||||||
int backResourceType = 0;
|
int backResourceType = 0;
|
||||||
|
|
||||||
std::string frameEvent = "";
|
std::string frameEvent;
|
||||||
std::string customProperty = "";
|
std::string customProperty;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
|
|
|
@ -85,8 +85,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
imageView->loadTexture(backgroundValue, imageFileNameType);
|
||||||
imageView->loadTexture(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(key == P_Scale9Width){
|
else if(key == P_Scale9Width){
|
||||||
|
@ -172,8 +171,8 @@ namespace cocostudio
|
||||||
Rect capInsets;
|
Rect capInsets;
|
||||||
cocos2d::Size scale9Size;
|
cocos2d::Size scale9Size;
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
|
@ -239,8 +238,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "FileData")
|
else if (name == "FileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -299,10 +298,10 @@ namespace cocostudio
|
||||||
|
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
auto imageFileNameDic = cocos2d::wext::makeResourceData(options->fileNameData());
|
auto imageFileNameDic = (options->fileNameData());
|
||||||
int imageFileNameType = imageFileNameDic.type;
|
int imageFileNameType = imageFileNameDic->resourceType();
|
||||||
std::string& imageFileName = imageFileNameDic.file;
|
std::string imageFileName = imageFileNameDic->path()->c_str();
|
||||||
switch (imageFileNameType)
|
switch (imageFileNameType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -321,7 +320,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = imageFileNameDic.plist;
|
std::string plist = imageFileNameDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -144,8 +144,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
panel->setBackGroundImage(backgroundValue, imageFileNameType);
|
||||||
panel->setBackGroundImage(fileData.file, imageFileNameType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(key == P_CapInsetsX){
|
}else if(key == P_CapInsetsX){
|
||||||
|
@ -335,8 +334,8 @@ namespace cocostudio
|
||||||
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
bool clipEnabled = false;
|
bool clipEnabled = false;
|
||||||
|
@ -521,8 +520,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "FileData")
|
else if (name == "FileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -619,10 +618,10 @@ namespace cocostudio
|
||||||
|
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
auto imageFileNameDic = cocos2d::wext::makeResourceData(options->backGroundImageData());
|
auto imageFileNameDic = (options->backGroundImageData());
|
||||||
int imageFileNameType = imageFileNameDic.type;
|
int imageFileNameType = imageFileNameDic->resourceType();
|
||||||
std::string& imageFileName = imageFileNameDic.file;
|
std::string imageFileName = imageFileNameDic->path()->c_str();
|
||||||
if (imageFileName != "")
|
if (imageFileName != "")
|
||||||
{
|
{
|
||||||
switch (imageFileNameType)
|
switch (imageFileNameType)
|
||||||
|
@ -643,7 +642,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = imageFileNameDic.plist;
|
std::string plist = imageFileNameDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -433,10 +433,10 @@ namespace cocostudio
|
||||||
|
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
auto imageFileNameDic = cocos2d::wext::makeResourceData(options->backGroundImageData());
|
auto imageFileNameDic = (options->backGroundImageData());
|
||||||
int imageFileNameType = imageFileNameDic.type;
|
int imageFileNameType = imageFileNameDic->resourceType();
|
||||||
std::string& imageFileName = imageFileNameDic.file;
|
std::string imageFileName = imageFileNameDic->path()->c_str();
|
||||||
if (imageFileName != "")
|
if (imageFileName != "")
|
||||||
{
|
{
|
||||||
switch (imageFileNameType)
|
switch (imageFileNameType)
|
||||||
|
@ -457,7 +457,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = imageFileNameDic.plist;
|
std::string plist = imageFileNameDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -87,8 +87,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
loadingBar->loadTexture(backgroundValue, imageFileNameType);
|
||||||
loadingBar->loadTexture(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(key == P_CapInsetsX){
|
else if(key == P_CapInsetsX){
|
||||||
|
@ -161,8 +160,8 @@ namespace cocostudio
|
||||||
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
int percent = 80;
|
int percent = 80;
|
||||||
|
@ -195,8 +194,8 @@ namespace cocostudio
|
||||||
|
|
||||||
if (name == "ImageFileData")
|
if (name == "ImageFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -251,10 +250,10 @@ namespace cocostudio
|
||||||
auto options = (LoadingBarOptions*)loadingBarOptions;
|
auto options = (LoadingBarOptions*)loadingBarOptions;
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
auto imageFileNameDic = cocos2d::wext::makeResourceData(options->textureData());
|
auto imageFileNameDic = (options->textureData());
|
||||||
int imageFileNameType = imageFileNameDic.type;
|
int imageFileNameType = imageFileNameDic->resourceType();
|
||||||
std::string& imageFileName = imageFileNameDic.file;
|
std::string imageFileName = imageFileNameDic->path()->c_str();
|
||||||
switch (imageFileNameType)
|
switch (imageFileNameType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -278,7 +277,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = imageFileNameDic.plist;
|
std::string plist = imageFileNameDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace cocostudio
|
||||||
Offset<Table> Node3DReader::createOptionsWithFlatBuffersForNode(pugi::xml_node objectData,
|
Offset<Table> Node3DReader::createOptionsWithFlatBuffersForNode(pugi::xml_node objectData,
|
||||||
flatbuffers::FlatBufferBuilder *builder)
|
flatbuffers::FlatBufferBuilder *builder)
|
||||||
{
|
{
|
||||||
std::string name = "";
|
std::string name;
|
||||||
long actionTag = 0;
|
long actionTag = 0;
|
||||||
Vec2 rotationSkew = Vec2::ZERO;
|
Vec2 rotationSkew = Vec2::ZERO;
|
||||||
int zOrder = 0;
|
int zOrder = 0;
|
||||||
|
@ -123,8 +123,8 @@ namespace cocostudio
|
||||||
bool flipY = false;
|
bool flipY = false;
|
||||||
bool ignoreSize = false;
|
bool ignoreSize = false;
|
||||||
bool touchEnabled = false;
|
bool touchEnabled = false;
|
||||||
std::string frameEvent = "";
|
std::string frameEvent;
|
||||||
std::string customProperty = "";
|
std::string customProperty;
|
||||||
|
|
||||||
bool positionXPercentEnabled = false;
|
bool positionXPercentEnabled = false;
|
||||||
bool positionYPercentEnabled = false;
|
bool positionYPercentEnabled = false;
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace cocostudio
|
||||||
Offset<Table> NodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData,
|
Offset<Table> NodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData,
|
||||||
flatbuffers::FlatBufferBuilder *builder)
|
flatbuffers::FlatBufferBuilder *builder)
|
||||||
{
|
{
|
||||||
std::string name = "";
|
std::string name;
|
||||||
long actionTag = 0;
|
long actionTag = 0;
|
||||||
Vec2 rotationSkew;
|
Vec2 rotationSkew;
|
||||||
int zOrder = 0;
|
int zOrder = 0;
|
||||||
|
@ -103,8 +103,8 @@ namespace cocostudio
|
||||||
bool flipY = false;
|
bool flipY = false;
|
||||||
bool ignoreSize = false;
|
bool ignoreSize = false;
|
||||||
bool touchEnabled = false;
|
bool touchEnabled = false;
|
||||||
std::string frameEvent = "";
|
std::string frameEvent;
|
||||||
std::string customProperty = "";
|
std::string customProperty;
|
||||||
|
|
||||||
bool positionXPercentEnabled = false;
|
bool positionXPercentEnabled = false;
|
||||||
bool positionYPercentEnabled = false;
|
bool positionYPercentEnabled = false;
|
||||||
|
@ -123,7 +123,7 @@ namespace cocostudio
|
||||||
float topMargin = 0;
|
float topMargin = 0;
|
||||||
float bottomMargin = 0;
|
float bottomMargin = 0;
|
||||||
|
|
||||||
// x-studio365 spec: read from .csb.
|
// since x-studio 10.0.593.0: read from .csb.
|
||||||
bool cascadeColorEnabled = false;
|
bool cascadeColorEnabled = false;
|
||||||
bool cascadeOpacityEnabled = false;
|
bool cascadeOpacityEnabled = false;
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ namespace cocostudio
|
||||||
int alpha = options->alpha();
|
int alpha = options->alpha();
|
||||||
Color3B color(options->color()->r(), options->color()->g(), options->color()->b());
|
Color3B color(options->color()->r(), options->color()->g(), options->color()->b());
|
||||||
|
|
||||||
// x-studio365 10.0.593.0: read from .csb.
|
// x-studio 10.0.593.0: read from .csb.
|
||||||
node->setCascadeColorEnabled(options->cascadeColorEnabled());
|
node->setCascadeColorEnabled(options->cascadeColorEnabled());
|
||||||
node->setCascadeOpacityEnabled(options->cascadeOpacityEnabled());
|
node->setCascadeOpacityEnabled(options->cascadeOpacityEnabled());
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ namespace cocostudio
|
||||||
node->setRotationSkewX(rotationSkewX);
|
node->setRotationSkewX(rotationSkewX);
|
||||||
if (rotationSkewY != 0)
|
if (rotationSkewY != 0)
|
||||||
node->setRotationSkewY(rotationSkewY);
|
node->setRotationSkewY(rotationSkewY);
|
||||||
// if(anchorx != 0.5f || anchory != 0.5f) x-studio365 spec: fix bugs, No need to check
|
// if(anchorx != 0.5f || anchory != 0.5f) x-studio spec: fix bugs, No need to check
|
||||||
node->setAnchorPoint(Point(anchorx, anchory));
|
node->setAnchorPoint(Point(anchorx, anchory));
|
||||||
if(zorder != 0)
|
if(zorder != 0)
|
||||||
node->setLocalZOrder(zorder);
|
node->setLocalZOrder(zorder);
|
||||||
|
|
|
@ -12,28 +12,3 @@
|
||||||
#include "ui/CocosGUI.h"
|
#include "ui/CocosGUI.h"
|
||||||
#include "cocostudio/CCArmature.h"
|
#include "cocostudio/CCArmature.h"
|
||||||
#include "cocostudio/ActionTimeline/CCSkeletonNode.h"
|
#include "cocostudio/ActionTimeline/CCSkeletonNode.h"
|
||||||
|
|
||||||
cocos2d::ResourceData cocos2d::wext::makeResourceData(const flatbuffers::ResourceData* orig)
|
|
||||||
{
|
|
||||||
cocos2d::ResourceData fileData;
|
|
||||||
fileData.file = orig->path()->c_str();
|
|
||||||
fileData.plist = orig->plistFile()->c_str();
|
|
||||||
fileData.type = orig->resourceType();
|
|
||||||
return fileData;
|
|
||||||
}
|
|
||||||
|
|
||||||
cocos2d::ResourceData cocos2d::wext::makeResourceData(const std::string& path, int type)
|
|
||||||
{
|
|
||||||
cocos2d::ResourceData fileData;
|
|
||||||
fileData.file = path;
|
|
||||||
fileData.type = type;
|
|
||||||
return fileData;
|
|
||||||
}
|
|
||||||
|
|
||||||
cocos2d::ResourceData cocos2d::wext::makeResourceData(std::string&& path, int type)
|
|
||||||
{
|
|
||||||
cocos2d::ResourceData fileData;
|
|
||||||
fileData.file = std::move(path);
|
|
||||||
fileData.type = type;
|
|
||||||
return fileData;
|
|
||||||
}
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace flatbuffers
|
||||||
|
|
||||||
class Table;
|
class Table;
|
||||||
|
|
||||||
struct ResourceData; // x-studio365 spec, csb batch load support, assets hook functions.
|
struct ResourceData;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace cocos2d
|
namespace cocos2d
|
||||||
|
@ -63,8 +63,6 @@ namespace cocostudio
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// x-studio365 spec, csb batch load support, assets hook functions.
|
|
||||||
|
|
||||||
namespace cocostudio
|
namespace cocostudio
|
||||||
{
|
{
|
||||||
class Armature;
|
class Armature;
|
||||||
|
@ -99,11 +97,6 @@ namespace cocos2d {
|
||||||
|
|
||||||
class Widget;
|
class Widget;
|
||||||
}
|
}
|
||||||
namespace wext {
|
|
||||||
CC_STUDIOP_DLL extern cocos2d::ResourceData makeResourceData(const flatbuffers::ResourceData* data);
|
|
||||||
CC_STUDIOP_DLL extern cocos2d::ResourceData makeResourceData(const std::string& path, int type = 0);
|
|
||||||
CC_STUDIOP_DLL extern cocos2d::ResourceData makeResourceData(std::string&& path, int type = 0);
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__cocos2d_libs__NodeReaderProtocol__) */
|
#endif /* defined(__cocos2d_libs__NodeReaderProtocol__) */
|
||||||
|
|
|
@ -62,8 +62,8 @@ namespace cocostudio
|
||||||
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
bool clipEnabled = false;
|
bool clipEnabled = false;
|
||||||
|
@ -248,8 +248,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "FileData")
|
else if (name == "FileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -346,10 +346,10 @@ namespace cocostudio
|
||||||
|
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
auto imageFileNameDic = cocos2d::wext::makeResourceData(options->backGroundImageData());
|
auto imageFileNameDic = (options->backGroundImageData());
|
||||||
int imageFileNameType = imageFileNameDic.type;
|
int imageFileNameType = imageFileNameDic->resourceType();
|
||||||
std::string& imageFileName = imageFileNameDic.file;
|
std::string imageFileName = imageFileNameDic->path()->c_str();
|
||||||
if (imageFileName != "")
|
if (imageFileName != "")
|
||||||
{
|
{
|
||||||
switch (imageFileNameType)
|
switch (imageFileNameType)
|
||||||
|
@ -370,7 +370,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = imageFileNameDic.plist;
|
std::string plist = imageFileNameDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,8 +78,8 @@ namespace cocostudio
|
||||||
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
cocos2d::BlendFunc blendFunc = cocos2d::BlendFunc::ALPHA_PREMULTIPLIED;
|
cocos2d::BlendFunc blendFunc = cocos2d::BlendFunc::ALPHA_PREMULTIPLIED;
|
||||||
|
@ -177,12 +177,12 @@ namespace cocostudio
|
||||||
ParticleSystemQuad* particle = nullptr;
|
ParticleSystemQuad* particle = nullptr;
|
||||||
|
|
||||||
auto options = (ParticleSystemOptions*)particleOptions;
|
auto options = (ParticleSystemOptions*)particleOptions;
|
||||||
auto fileNameData = cocos2d::wext::makeResourceData(options->fileNameData());
|
auto fileNameDataDic = (options->fileNameData());
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
std::string& path = fileNameData.file;
|
std::string path = fileNameDataDic->path()->c_str();
|
||||||
int resourceType = fileNameData.type;
|
int resourceType = fileNameDataDic->resourceType();
|
||||||
switch (resourceType)
|
switch (resourceType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace cocostudio
|
||||||
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string filename = "";
|
std::string filename;
|
||||||
float innerspeed = 1.0f;
|
float innerspeed = 1.0f;
|
||||||
|
|
||||||
pugi::xml_attribute objattri = objectData.first_attribute();
|
pugi::xml_attribute objattri = objectData.first_attribute();
|
||||||
|
|
|
@ -62,25 +62,25 @@ namespace cocostudio
|
||||||
bool displaystate = true;
|
bool displaystate = true;
|
||||||
|
|
||||||
int backgroundboxResourceType = 0;
|
int backgroundboxResourceType = 0;
|
||||||
std::string backgroundboxPath = "";
|
std::string backgroundboxPath;
|
||||||
std::string backgroundboxPlistFile = "";
|
std::string backgroundboxPlistFile;
|
||||||
|
|
||||||
int backGroundBoxSelectedResourceType = 0;
|
int backGroundBoxSelectedResourceType = 0;
|
||||||
std::string backGroundBoxSelectedPath = "";
|
std::string backGroundBoxSelectedPath;
|
||||||
std::string backGroundBoxSelectedPlistFile = "";
|
std::string backGroundBoxSelectedPlistFile;
|
||||||
|
|
||||||
int frontCrossResourceType = 0;
|
int frontCrossResourceType = 0;
|
||||||
std::string frontCrossPath = "";
|
std::string frontCrossPath;
|
||||||
std::string frontCrossPlistFile = "";
|
std::string frontCrossPlistFile;
|
||||||
|
|
||||||
int backGroundBoxDisabledResourceType = 0;
|
int backGroundBoxDisabledResourceType = 0;
|
||||||
std::string backGroundBoxDisabledPath = "";
|
std::string backGroundBoxDisabledPath;
|
||||||
std::string backGroundBoxDisabledPlistFile = "";
|
std::string backGroundBoxDisabledPlistFile;
|
||||||
|
|
||||||
|
|
||||||
int frontCrossDisabledResourceType = 0;
|
int frontCrossDisabledResourceType = 0;
|
||||||
std::string frontCrossDisabledPath = "";
|
std::string frontCrossDisabledPath;
|
||||||
std::string frontCrossDisabledPlistFile = "";
|
std::string frontCrossDisabledPlistFile;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
|
@ -108,8 +108,8 @@ namespace cocostudio
|
||||||
|
|
||||||
if (name == "NormalBackFileData")
|
if (name == "NormalBackFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -143,8 +143,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "PressedBackFileData")
|
else if (name == "PressedBackFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -178,8 +178,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "NodeNormalFileData")
|
else if (name == "NodeNormalFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -213,8 +213,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "DisableBackFileData")
|
else if (name == "DisableBackFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -248,8 +248,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "NodeDisableFileData")
|
else if (name == "NodeDisableFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -322,10 +322,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//load background image
|
//load background image
|
||||||
bool backGroundFileExist = false;
|
bool backGroundFileExist = false;
|
||||||
std::string backGroundErrorFilePath = "";
|
std::string backGroundErrorFilePath;
|
||||||
auto backGroundDic = cocos2d::wext::makeResourceData(options->backGroundBoxData());
|
auto backGroundDic = (options->backGroundBoxData());
|
||||||
int backGroundType = backGroundDic.type;
|
int backGroundType = backGroundDic->resourceType();
|
||||||
std::string& backGroundTexturePath = backGroundDic.file;
|
std::string backGroundTexturePath = backGroundDic->path()->c_str();
|
||||||
switch (backGroundType)
|
switch (backGroundType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -344,7 +344,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = backGroundDic.plist;
|
std::string plist = backGroundDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundTexturePath);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundTexturePath);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -381,10 +381,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//load background selected image
|
//load background selected image
|
||||||
bool backGroundSelectedfileExist = false;
|
bool backGroundSelectedfileExist = false;
|
||||||
std::string backGroundSelectedErrorFilePath = "";
|
std::string backGroundSelectedErrorFilePath;
|
||||||
auto backGroundSelectedDic = cocos2d::wext::makeResourceData(options->backGroundBoxSelectedData());
|
auto backGroundSelectedDic = (options->backGroundBoxSelectedData());
|
||||||
int backGroundSelectedType = backGroundSelectedDic.type;
|
int backGroundSelectedType = backGroundSelectedDic->resourceType();
|
||||||
std::string& backGroundSelectedTexturePath = backGroundSelectedDic.file;
|
std::string backGroundSelectedTexturePath = backGroundSelectedDic->path()->c_str();
|
||||||
switch (backGroundSelectedType)
|
switch (backGroundSelectedType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -403,7 +403,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = backGroundSelectedDic.plist;
|
std::string plist = backGroundSelectedDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundSelectedTexturePath);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundSelectedTexturePath);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -440,10 +440,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//load frontCross image
|
//load frontCross image
|
||||||
bool frontCrossFileExist = false;
|
bool frontCrossFileExist = false;
|
||||||
std::string frontCrossErrorFilePath = "";
|
std::string frontCrossErrorFilePath;
|
||||||
auto frontCrossDic = cocos2d::wext::makeResourceData(options->frontCrossData());
|
auto frontCrossDic = (options->frontCrossData());
|
||||||
int frontCrossType = frontCrossDic.type;
|
int frontCrossType = frontCrossDic->resourceType();
|
||||||
std::string& frontCrossFileName = frontCrossDic.file;
|
std::string frontCrossFileName = frontCrossDic->path()->c_str();
|
||||||
switch (frontCrossType)
|
switch (frontCrossType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -462,7 +462,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = frontCrossDic.plist;
|
std::string plist = frontCrossDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -499,10 +499,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//load backGroundBoxDisabledData
|
//load backGroundBoxDisabledData
|
||||||
bool backGroundBoxDisabledFileExist = false;
|
bool backGroundBoxDisabledFileExist = false;
|
||||||
std::string backGroundBoxDisabledErrorFilePath = "";
|
std::string backGroundBoxDisabledErrorFilePath;
|
||||||
auto backGroundDisabledDic = cocos2d::wext::makeResourceData(options->backGroundBoxDisabledData());
|
auto backGroundDisabledDic = (options->backGroundBoxDisabledData());
|
||||||
int backGroundDisabledType = backGroundDisabledDic.type;
|
int backGroundDisabledType = backGroundDisabledDic->resourceType();
|
||||||
std::string& backGroundDisabledFileName = backGroundDisabledDic.file;
|
std::string backGroundDisabledFileName = backGroundDisabledDic->path()->c_str();
|
||||||
switch (backGroundDisabledType)
|
switch (backGroundDisabledType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -521,7 +521,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = backGroundDisabledDic.plist;
|
std::string plist = backGroundDisabledDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundDisabledFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundDisabledFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -558,10 +558,10 @@ namespace cocostudio
|
||||||
|
|
||||||
///load frontCrossDisabledData
|
///load frontCrossDisabledData
|
||||||
bool frontCrossDisabledFileExist = false;
|
bool frontCrossDisabledFileExist = false;
|
||||||
std::string frontCrossDisabledErrorFilePath = "";
|
std::string frontCrossDisabledErrorFilePath;
|
||||||
auto frontCrossDisabledDic = cocos2d::wext::makeResourceData(options->frontCrossDisabledData());
|
auto frontCrossDisabledDic = (options->frontCrossDisabledData());
|
||||||
int frontCrossDisabledType = frontCrossDisabledDic.type;
|
int frontCrossDisabledType = frontCrossDisabledDic->resourceType();
|
||||||
std::string& frontCrossDisabledFileName = frontCrossDisabledDic.file;
|
std::string frontCrossDisabledFileName = frontCrossDisabledDic->path()->c_str();
|
||||||
switch (frontCrossDisabledType)
|
switch (frontCrossDisabledType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -580,7 +580,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = frontCrossDisabledDic.plist;
|
std::string plist = frontCrossDisabledDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossDisabledFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossDisabledFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,8 +104,8 @@ namespace cocostudio
|
||||||
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
bool clipEnabled = false;
|
bool clipEnabled = false;
|
||||||
|
@ -342,8 +342,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "FileData")
|
else if (name == "FileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -447,10 +447,10 @@ namespace cocostudio
|
||||||
|
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
auto imageFileNameDic = cocos2d::wext::makeResourceData(options->backGroundImageData());
|
auto imageFileNameDic = (options->backGroundImageData());
|
||||||
int imageFileNameType = imageFileNameDic.type;
|
int imageFileNameType = imageFileNameDic->resourceType();
|
||||||
std::string& imageFileName = imageFileNameDic.file;
|
std::string imageFileName = imageFileNameDic->path()->c_str();
|
||||||
if (imageFileName != "")
|
if (imageFileName != "")
|
||||||
{
|
{
|
||||||
switch (imageFileNameType)
|
switch (imageFileNameType)
|
||||||
|
@ -471,7 +471,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = imageFileNameDic.plist;
|
std::string plist = imageFileNameDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -87,8 +87,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
slider->loadBarTexture(backgroundValue, imageFileNameType);
|
||||||
slider->loadBarTexture(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}else if(key == P_Length){
|
}else if(key == P_Length){
|
||||||
barLength = valueToFloat(value);
|
barLength = valueToFloat(value);
|
||||||
|
@ -99,8 +98,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
slider->loadSlidBallTextureNormal(backgroundValue, imageFileNameType);
|
||||||
slider->loadSlidBallTextureNormal(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}else if(key == P_BallPressedData){
|
}else if(key == P_BallPressedData){
|
||||||
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
||||||
|
@ -109,8 +107,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
slider->loadSlidBallTexturePressed(backgroundValue, imageFileNameType);
|
||||||
slider->loadSlidBallTexturePressed(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}else if(key == P_BallDisabledData){
|
}else if(key == P_BallDisabledData){
|
||||||
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
||||||
|
@ -119,8 +116,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
slider->loadSlidBallTextureDisabled(backgroundValue, imageFileNameType);
|
||||||
slider->loadSlidBallTextureDisabled(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}else if(key == P_ProgressBarData){
|
}else if(key == P_ProgressBarData){
|
||||||
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
stExpCocoNode *backGroundChildren = stChildArray[i].GetChildArray(cocoLoader);
|
||||||
|
@ -129,8 +125,7 @@ namespace cocostudio
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
auto fileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
slider->loadProgressBarTexture(backgroundValue, imageFileNameType);
|
||||||
slider->loadProgressBarTexture(fileData.file, imageFileNameType);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,24 +202,24 @@ namespace cocostudio
|
||||||
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string barFileNamePath = "";
|
std::string barFileNamePath;
|
||||||
std::string barFileNamePlistFile = "";
|
std::string barFileNamePlistFile;
|
||||||
int barFileNameResourceType = 0;
|
int barFileNameResourceType = 0;
|
||||||
|
|
||||||
std::string ballNormalPath = "";
|
std::string ballNormalPath;
|
||||||
std::string ballNormalPlistFile = "";
|
std::string ballNormalPlistFile;
|
||||||
int ballNormalResourceType = 0;
|
int ballNormalResourceType = 0;
|
||||||
|
|
||||||
std::string ballPressedPath = "";
|
std::string ballPressedPath;
|
||||||
std::string ballPressedPlistFile = "";
|
std::string ballPressedPlistFile;
|
||||||
int ballPressedResourceType = 0;
|
int ballPressedResourceType = 0;
|
||||||
|
|
||||||
std::string ballDisabledPath = "";
|
std::string ballDisabledPath;
|
||||||
std::string ballDisabledPlistFile = "";
|
std::string ballDisabledPlistFile;
|
||||||
int ballDisabledResourceType = 0;
|
int ballDisabledResourceType = 0;
|
||||||
|
|
||||||
std::string progressBarPath = "";
|
std::string progressBarPath;
|
||||||
std::string progressBarPlistFile = "";
|
std::string progressBarPlistFile;
|
||||||
int progressBarResourceType = 0;
|
int progressBarResourceType = 0;
|
||||||
|
|
||||||
int percent = 0;
|
int percent = 0;
|
||||||
|
@ -257,8 +252,8 @@ namespace cocostudio
|
||||||
|
|
||||||
if (name == "BackGroundData")
|
if (name == "BackGroundData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -292,8 +287,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "BallNormalData")
|
else if (name == "BallNormalData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -327,8 +322,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "BallPressedData")
|
else if (name == "BallPressedData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -362,8 +357,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "BallDisabledData")
|
else if (name == "BallDisabledData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -397,8 +392,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
else if (name == "ProgressBarData")
|
else if (name == "ProgressBarData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -472,10 +467,10 @@ namespace cocostudio
|
||||||
//slider->setPercent(percent);
|
//slider->setPercent(percent);
|
||||||
|
|
||||||
bool imageFileExist = false;
|
bool imageFileExist = false;
|
||||||
std::string imageErrorFilePath = "";
|
std::string imageErrorFilePath;
|
||||||
auto imageFileNameDic = cocos2d::wext::makeResourceData(options->barFileNameData());
|
auto imageFileNameDic = (options->barFileNameData());
|
||||||
int imageFileNameType = imageFileNameDic.type;
|
int imageFileNameType = imageFileNameDic->resourceType();
|
||||||
std::string& imageFileName = imageFileNameDic.file;
|
std::string imageFileName = imageFileNameDic->path()->c_str();
|
||||||
switch (imageFileNameType)
|
switch (imageFileNameType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -494,7 +489,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = imageFileNameDic.plist;
|
std::string plist = imageFileNameDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(imageFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -537,10 +532,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//loading normal slider ball texture
|
//loading normal slider ball texture
|
||||||
bool normalFileExist = false;
|
bool normalFileExist = false;
|
||||||
std::string normalErrorFilePath = "";
|
std::string normalErrorFilePath;
|
||||||
auto normalDic = cocos2d::wext::makeResourceData(options->ballNormalData());
|
auto normalDic = (options->ballNormalData());
|
||||||
int normalType = normalDic.type;
|
int normalType = normalDic->resourceType();
|
||||||
std::string& normalFileName = normalDic.file;
|
std::string normalFileName = normalDic->path()->c_str();
|
||||||
switch (normalType)
|
switch (normalType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -559,7 +554,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = normalDic.plist;
|
std::string plist = normalDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(normalFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(normalFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -602,10 +597,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//loading slider ball press texture
|
//loading slider ball press texture
|
||||||
bool pressedFileExist = false;
|
bool pressedFileExist = false;
|
||||||
std::string pressedErrorFilePath = "";
|
std::string pressedErrorFilePath;
|
||||||
auto pressedDic = cocos2d::wext::makeResourceData(options->ballPressedData());
|
auto pressedDic = (options->ballPressedData());
|
||||||
int pressedType = pressedDic.type;
|
int pressedType = pressedDic->resourceType();
|
||||||
std::string& pressedFileName = pressedDic.file;
|
std::string pressedFileName = pressedDic->path()->c_str();
|
||||||
switch (pressedType)
|
switch (pressedType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -624,7 +619,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = pressedDic.plist;
|
std::string plist = pressedDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(pressedFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(pressedFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -667,10 +662,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//loading slider ball disable texture
|
//loading slider ball disable texture
|
||||||
bool disabledFileExist = false;
|
bool disabledFileExist = false;
|
||||||
std::string disabledErrorFilePath = "";
|
std::string disabledErrorFilePath;
|
||||||
auto disabledDic = cocos2d::wext::makeResourceData(options->ballDisabledData());
|
auto disabledDic = (options->ballDisabledData());
|
||||||
int disabledType = disabledDic.type;
|
int disabledType = disabledDic->resourceType();
|
||||||
std::string& disabledFileName = disabledDic.file;
|
std::string disabledFileName = disabledDic->path()->c_str();
|
||||||
switch (disabledType)
|
switch (disabledType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -689,7 +684,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = disabledDic.plist;
|
std::string plist = disabledDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(disabledFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(disabledFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
@ -732,10 +727,10 @@ namespace cocostudio
|
||||||
|
|
||||||
//load slider progress texture
|
//load slider progress texture
|
||||||
bool progressFileExist = false;
|
bool progressFileExist = false;
|
||||||
std::string progressErrorFilePath = "";
|
std::string progressErrorFilePath;
|
||||||
auto progressBarDic = cocos2d::wext::makeResourceData(options->progressBarData());
|
auto progressBarDic = (options->progressBarData());
|
||||||
int progressBarType = progressBarDic.type;
|
int progressBarType = progressBarDic->resourceType();
|
||||||
std::string& progressBarFileName = progressBarDic.file;
|
std::string progressBarFileName = progressBarDic->path()->c_str();
|
||||||
switch (progressBarType)
|
switch (progressBarType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -754,7 +749,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string plist = progressBarDic.plist;
|
std::string plist = progressBarDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(progressBarFileName);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(progressBarFileName);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -133,8 +133,8 @@ namespace cocostudio
|
||||||
|
|
||||||
if (name == "DataFile")
|
if (name == "DataFile")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
auto attribute = child.first_attribute();
|
auto attribute = child.first_attribute();
|
||||||
|
|
||||||
|
|
|
@ -84,8 +84,8 @@ namespace cocostudio
|
||||||
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = NodeReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
bool intelliShadingEnabled = false;
|
bool intelliShadingEnabled = false;
|
||||||
cocos2d::Vec3 hsv;
|
cocos2d::Vec3 hsv;
|
||||||
|
@ -117,8 +117,8 @@ namespace cocostudio
|
||||||
pugi::xml_attribute attribute;
|
pugi::xml_attribute attribute;
|
||||||
if (name == "FileData")
|
if (name == "FileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -245,12 +245,12 @@ namespace cocostudio
|
||||||
auto nodeReader = NodeReader::getInstance();
|
auto nodeReader = NodeReader::getInstance();
|
||||||
nodeReader->setPropsWithFlatBuffers(node, (Table*)(options->nodeOptions()));
|
nodeReader->setPropsWithFlatBuffers(node, (Table*)(options->nodeOptions()));
|
||||||
|
|
||||||
auto fileNameData = cocos2d::wext::makeResourceData(options->fileNameData());
|
auto fileNameDataDic = (options->fileNameData());
|
||||||
|
|
||||||
int resourceType = fileNameData.type;
|
int resourceType = fileNameDataDic->resourceType();
|
||||||
std::string& path = fileNameData.file;
|
std::string path = fileNameDataDic->path()->c_str();
|
||||||
|
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
|
|
||||||
switch (resourceType)
|
switch (resourceType)
|
||||||
{
|
{
|
||||||
|
@ -269,7 +269,7 @@ namespace cocostudio
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
std::string& plist = fileNameData.plist;
|
std::string plist = fileNameDataDic->plistFile()->c_str();
|
||||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(path);
|
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(path);
|
||||||
if (spriteFrame)
|
if (spriteFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -247,33 +247,33 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
||||||
|
|
||||||
|
|
||||||
int fontsize = 12;
|
int fontsize = 12;
|
||||||
std::string text = "";
|
std::string text;
|
||||||
cocos2d::Color4B textColor(255, 255, 255, 255);
|
cocos2d::Color4B textColor(255, 255, 255, 255);
|
||||||
std::string fontName;
|
std::string fontName;
|
||||||
|
|
||||||
int backgroundboxResourceType = 0;
|
int backgroundboxResourceType = 0;
|
||||||
std::string backgroundboxPath = "";
|
std::string backgroundboxPath;
|
||||||
std::string backgroundboxPlistFile = "";
|
std::string backgroundboxPlistFile;
|
||||||
|
|
||||||
int backGroundBoxSelectedResourceType = 0;
|
int backGroundBoxSelectedResourceType = 0;
|
||||||
std::string backGroundBoxSelectedPath = "";
|
std::string backGroundBoxSelectedPath;
|
||||||
std::string backGroundBoxSelectedPlistFile = "";
|
std::string backGroundBoxSelectedPlistFile;
|
||||||
|
|
||||||
int frontCrossResourceType = 0;
|
int frontCrossResourceType = 0;
|
||||||
std::string frontCrossPath = "";
|
std::string frontCrossPath;
|
||||||
std::string frontCrossPlistFile = "";
|
std::string frontCrossPlistFile;
|
||||||
|
|
||||||
int backGroundBoxDisabledResourceType = 0;
|
int backGroundBoxDisabledResourceType = 0;
|
||||||
std::string backGroundBoxDisabledPath = "";
|
std::string backGroundBoxDisabledPath;
|
||||||
std::string backGroundBoxDisabledPlistFile = "";
|
std::string backGroundBoxDisabledPlistFile;
|
||||||
|
|
||||||
int frontCrossDisabledResourceType = 0;
|
int frontCrossDisabledResourceType = 0;
|
||||||
std::string frontCrossDisabledPath = "";
|
std::string frontCrossDisabledPath;
|
||||||
std::string frontCrossDisabledPlistFile = "";
|
std::string frontCrossDisabledPlistFile;
|
||||||
|
|
||||||
|
|
||||||
std::string fontResourcePath = "";
|
std::string fontResourcePath;
|
||||||
std::string fontResourcePlistFile = "";
|
std::string fontResourcePlistFile;
|
||||||
int fontResourceResourceType = 0;
|
int fontResourceResourceType = 0;
|
||||||
|
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
|
@ -325,8 +325,8 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
||||||
}
|
}
|
||||||
else if (name == "NormalBackFileData")
|
else if (name == "NormalBackFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -360,8 +360,8 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
||||||
}
|
}
|
||||||
else if (name == "PressedBackFileData")
|
else if (name == "PressedBackFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -395,8 +395,8 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
||||||
}
|
}
|
||||||
else if (name == "NodeNormalFileData")
|
else if (name == "NodeNormalFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -430,8 +430,8 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
||||||
}
|
}
|
||||||
else if (name == "DisableBackFileData")
|
else if (name == "DisableBackFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -465,8 +465,8 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
||||||
}
|
}
|
||||||
else if (name == "NodeDisableFileData")
|
else if (name == "NodeDisableFileData")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -574,7 +574,7 @@ void TabHeaderReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuf
|
||||||
|
|
||||||
auto resourceData = options->fontRes();
|
auto resourceData = options->fontRes();
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
std::string path = resourceData->path()->c_str();
|
std::string path = resourceData->path()->c_str();
|
||||||
if (path != "")
|
if (path != "")
|
||||||
{
|
{
|
||||||
|
@ -594,7 +594,7 @@ void TabHeaderReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuf
|
||||||
}
|
}
|
||||||
|
|
||||||
bool backGroundFileExist = false;
|
bool backGroundFileExist = false;
|
||||||
std::string backGroundErrorFilePath = "";
|
std::string backGroundErrorFilePath;
|
||||||
auto backGroundDic = options->normalBackFile();
|
auto backGroundDic = options->normalBackFile();
|
||||||
int backGroundType = backGroundDic->resourceType();
|
int backGroundType = backGroundDic->resourceType();
|
||||||
std::string backGroundTexturePath = backGroundDic->path()->c_str();
|
std::string backGroundTexturePath = backGroundDic->path()->c_str();
|
||||||
|
@ -653,7 +653,7 @@ void TabHeaderReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuf
|
||||||
|
|
||||||
//load background selected image
|
//load background selected image
|
||||||
bool backGroundSelectedfileExist = false;
|
bool backGroundSelectedfileExist = false;
|
||||||
std::string backGroundSelectedErrorFilePath = "";
|
std::string backGroundSelectedErrorFilePath;
|
||||||
auto backGroundSelectedDic = options->pressBackFile();
|
auto backGroundSelectedDic = options->pressBackFile();
|
||||||
int backGroundSelectedType = backGroundSelectedDic->resourceType();
|
int backGroundSelectedType = backGroundSelectedDic->resourceType();
|
||||||
std::string backGroundSelectedTexturePath = backGroundSelectedDic->path()->c_str();
|
std::string backGroundSelectedTexturePath = backGroundSelectedDic->path()->c_str();
|
||||||
|
@ -712,7 +712,7 @@ void TabHeaderReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuf
|
||||||
|
|
||||||
//load frontCross image
|
//load frontCross image
|
||||||
bool frontCrossFileExist = false;
|
bool frontCrossFileExist = false;
|
||||||
std::string frontCrossErrorFilePath = "";
|
std::string frontCrossErrorFilePath;
|
||||||
auto frontCrossDic = options->crossNormalFile();
|
auto frontCrossDic = options->crossNormalFile();
|
||||||
int frontCrossType = frontCrossDic->resourceType();
|
int frontCrossType = frontCrossDic->resourceType();
|
||||||
std::string frontCrossFileName = frontCrossDic->path()->c_str();
|
std::string frontCrossFileName = frontCrossDic->path()->c_str();
|
||||||
|
@ -771,7 +771,7 @@ void TabHeaderReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuf
|
||||||
|
|
||||||
//load backGroundBoxDisabledData
|
//load backGroundBoxDisabledData
|
||||||
bool backGroundBoxDisabledFileExist = false;
|
bool backGroundBoxDisabledFileExist = false;
|
||||||
std::string backGroundBoxDisabledErrorFilePath = "";
|
std::string backGroundBoxDisabledErrorFilePath;
|
||||||
auto backGroundDisabledDic = options->disableBackFile();
|
auto backGroundDisabledDic = options->disableBackFile();
|
||||||
int backGroundDisabledType = backGroundDisabledDic->resourceType();
|
int backGroundDisabledType = backGroundDisabledDic->resourceType();
|
||||||
std::string backGroundDisabledFileName = backGroundDisabledDic->path()->c_str();
|
std::string backGroundDisabledFileName = backGroundDisabledDic->path()->c_str();
|
||||||
|
@ -830,7 +830,7 @@ void TabHeaderReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuf
|
||||||
|
|
||||||
///load frontCrossDisabledData
|
///load frontCrossDisabledData
|
||||||
bool frontCrossDisabledFileExist = false;
|
bool frontCrossDisabledFileExist = false;
|
||||||
std::string frontCrossDisabledErrorFilePath = "";
|
std::string frontCrossDisabledErrorFilePath;
|
||||||
auto frontCrossDisabledDic = options->crossDisableFile();
|
auto frontCrossDisabledDic = options->crossDisableFile();
|
||||||
int frontCrossDisabledType = frontCrossDisabledDic->resourceType();
|
int frontCrossDisabledType = frontCrossDisabledDic->resourceType();
|
||||||
std::string frontCrossDisabledFileName = frontCrossDisabledDic->path()->c_str();
|
std::string frontCrossDisabledFileName = frontCrossDisabledDic->path()->c_str();
|
||||||
|
|
|
@ -65,7 +65,9 @@ namespace cocostudio
|
||||||
std::string startCharMap;
|
std::string startCharMap;
|
||||||
float itemWidth;
|
float itemWidth;
|
||||||
float itemHeight;
|
float itemHeight;
|
||||||
cocos2d::ResourceData charmapFileData;
|
|
||||||
|
int resourceType = 0;
|
||||||
|
std::string charMapFile;
|
||||||
for (int i = 0; i < cocoNode->GetChildNum(); ++i) {
|
for (int i = 0; i < cocoNode->GetChildNum(); ++i) {
|
||||||
std::string key = stChildArray[i].GetName(cocoLoader);
|
std::string key = stChildArray[i].GetName(cocoLoader);
|
||||||
std::string value = stChildArray[i].GetValue(cocoLoader);
|
std::string value = stChildArray[i].GetValue(cocoLoader);
|
||||||
|
@ -84,11 +86,7 @@ namespace cocostudio
|
||||||
|
|
||||||
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
Widget::TextureResType imageFileNameType = (Widget::TextureResType)valueToInt(resType);
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
charMapFile = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
|
|
||||||
//charMapFileName = backgroundValue;
|
|
||||||
//type = imageFileNameType;
|
|
||||||
charmapFileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
|
||||||
}else if(key == P_ItemWidth){
|
}else if(key == P_ItemWidth){
|
||||||
itemWidth = valueToFloat(value);
|
itemWidth = valueToFloat(value);
|
||||||
}else if(key == P_ItemHeight){
|
}else if(key == P_ItemHeight){
|
||||||
|
@ -98,8 +96,8 @@ namespace cocostudio
|
||||||
}
|
}
|
||||||
} //end of for loop
|
} //end of for loop
|
||||||
|
|
||||||
if (charmapFileData.type == 0) {
|
if (resourceType == 0) {
|
||||||
labelAtlas->setProperty(stringValue, charmapFileData.file, itemWidth, itemHeight, startCharMap);
|
labelAtlas->setProperty(stringValue, charMapFile, itemWidth, itemHeight, startCharMap);
|
||||||
}
|
}
|
||||||
this->endSetBasicProperties(widget);
|
this->endSetBasicProperties(widget);
|
||||||
}
|
}
|
||||||
|
@ -152,14 +150,14 @@ namespace cocostudio
|
||||||
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
std::string stringValue = "0123456789";
|
std::string stringValue = "0123456789";
|
||||||
int itemWidth = 0;
|
int itemWidth = 0;
|
||||||
int itemHeight = 0;
|
int itemHeight = 0;
|
||||||
std::string startCharMap = "";
|
std::string startCharMap;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
auto attribute = objectData.first_attribute();
|
auto attribute = objectData.first_attribute();
|
||||||
|
@ -196,8 +194,8 @@ namespace cocostudio
|
||||||
|
|
||||||
if (name == "LabelAtlasFileImage_CNB")
|
if (name == "LabelAtlasFileImage_CNB")
|
||||||
{
|
{
|
||||||
std::string texture = "";
|
std::string texture;
|
||||||
std::string texturePng = "";
|
std::string texturePng;
|
||||||
|
|
||||||
attribute = child.first_attribute();
|
attribute = child.first_attribute();
|
||||||
|
|
||||||
|
@ -247,16 +245,16 @@ namespace cocostudio
|
||||||
TextAtlas* labelAtlas = static_cast<TextAtlas*>(node);
|
TextAtlas* labelAtlas = static_cast<TextAtlas*>(node);
|
||||||
auto options = (TextAtlasOptions*)textAtlasOptions;
|
auto options = (TextAtlasOptions*)textAtlasOptions;
|
||||||
|
|
||||||
auto cmftDic = cocos2d::wext::makeResourceData(options->charMapFileData());
|
auto cmftDic = (options->charMapFileData());
|
||||||
int cmfType = cmftDic.type;
|
int cmfType = cmftDic->resourceType();
|
||||||
switch (cmfType)
|
switch (cmfType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
const char* cmfPath = cmftDic.file.c_str();
|
std::string cmfPath = cmftDic->path()->c_str();
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
|
|
||||||
if (FileUtils::getInstance()->isFileExist(cmfPath))
|
if (FileUtils::getInstance()->isFileExist(cmfPath))
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,9 +73,8 @@ namespace cocostudio
|
||||||
|
|
||||||
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
std::string backgroundValue = this->getResourcePath(cocoLoader, &stChildArray[i], imageFileNameType);
|
||||||
|
|
||||||
auto fileData = cocos2d::wext::makeResourceData(std::move(backgroundValue), (int)imageFileNameType);
|
|
||||||
if (imageFileNameType == (Widget::TextureResType)0) {
|
if (imageFileNameType == (Widget::TextureResType)0) {
|
||||||
labelBMFont->setFntFile(fileData.file);
|
labelBMFont->setFntFile(backgroundValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(key == P_Text){
|
}else if(key == P_Text){
|
||||||
|
@ -129,8 +128,8 @@ namespace cocostudio
|
||||||
std::string text = "Fnt Text Label";
|
std::string text = "Fnt Text Label";
|
||||||
bool isLocalized = false;
|
bool isLocalized = false;
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFlie = "";
|
std::string plistFlie;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
|
@ -204,12 +203,12 @@ namespace cocostudio
|
||||||
TextBMFont* labelBMFont = static_cast<TextBMFont*>(node);
|
TextBMFont* labelBMFont = static_cast<TextBMFont*>(node);
|
||||||
auto options = (TextBMFontOptions*)textBMFontOptions;
|
auto options = (TextBMFontOptions*)textBMFontOptions;
|
||||||
|
|
||||||
auto cmftDic = cocos2d::wext::makeResourceData(options->fileNameData());
|
auto cmftDic = (options->fileNameData());
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
std::string errorContent = "";
|
std::string errorContent;
|
||||||
std::string& path = cmftDic.file;
|
std::string path = cmftDic->path()->c_str();
|
||||||
int cmfType = cmftDic.type;
|
int cmfType = cmftDic->resourceType();
|
||||||
switch (cmfType)
|
switch (cmfType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -75,13 +75,13 @@ namespace cocostudio
|
||||||
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
std::string fontName = "";
|
std::string fontName;
|
||||||
int fontSize = 20;
|
int fontSize = 20;
|
||||||
std::string text = "";
|
std::string text;
|
||||||
bool isLocalized = false;
|
bool isLocalized = false;
|
||||||
std::string placeHolder = "Text Field Extend";
|
std::string placeHolder = "Text Field Extend";
|
||||||
bool passwordEnabled = false;
|
bool passwordEnabled = false;
|
||||||
|
@ -317,9 +317,9 @@ namespace cocostudio
|
||||||
std::string fontName = options->fontName()->c_str();
|
std::string fontName = options->fontName()->c_str();
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
auto resourceData = cocos2d::wext::makeResourceData(options->fontResource());
|
auto resourceDataDic = (options->fontResource());
|
||||||
std::string& path = resourceData.file;
|
std::string path = resourceDataDic->path()->c_str();
|
||||||
if (path != "")
|
if (path != "")
|
||||||
{
|
{
|
||||||
if (FileUtils::getInstance()->isFileExist(path))
|
if (FileUtils::getInstance()->isFileExist(path))
|
||||||
|
|
|
@ -79,8 +79,7 @@ namespace cocostudio
|
||||||
}else if(key == P_FontSize){
|
}else if(key == P_FontSize){
|
||||||
textField->setFontSize(valueToInt(value));
|
textField->setFontSize(valueToInt(value));
|
||||||
}else if(key == P_FontName){
|
}else if(key == P_FontName){
|
||||||
auto fontData = cocos2d::wext::makeResourceData(value);
|
textField->setFontName(value);
|
||||||
textField->setFontName(fontData.file);
|
|
||||||
}else if(key == P_TouchSizeWidth){
|
}else if(key == P_TouchSizeWidth){
|
||||||
textField->setTouchSize(Size(valueToFloat(value), textField->getTouchSize().height));
|
textField->setTouchSize(Size(valueToFloat(value), textField->getTouchSize().height));
|
||||||
}else if(key == P_TouchSizeHeight){
|
}else if(key == P_TouchSizeHeight){
|
||||||
|
@ -159,13 +158,13 @@ namespace cocostudio
|
||||||
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
|
||||||
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
auto widgetOptions = *(Offset<WidgetOptions>*)(&temp);
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
std::string fontName = "";
|
std::string fontName;
|
||||||
int fontSize = 20;
|
int fontSize = 20;
|
||||||
std::string text = "";
|
std::string text;
|
||||||
bool isLocalized = false;
|
bool isLocalized = false;
|
||||||
std::string placeHolder = "Text Field";
|
std::string placeHolder = "Text Field";
|
||||||
bool passwordEnabled = false;
|
bool passwordEnabled = false;
|
||||||
|
@ -334,9 +333,9 @@ namespace cocostudio
|
||||||
|
|
||||||
|
|
||||||
bool fileExist = false;
|
bool fileExist = false;
|
||||||
std::string errorFilePath = "";
|
std::string errorFilePath;
|
||||||
auto resourceData = cocos2d::wext::makeResourceData(options->fontResource());
|
auto resourceDataDic = (options->fontResource());
|
||||||
std::string& path = resourceData.file;
|
std::string path = resourceDataDic->path()->c_str();
|
||||||
if (path != "")
|
if (path != "")
|
||||||
{
|
{
|
||||||
if (FileUtils::getInstance()->isFileExist(path))
|
if (FileUtils::getInstance()->isFileExist(path))
|
||||||
|
|
|
@ -83,14 +83,8 @@ namespace cocostudio
|
||||||
}else if(key == P_FontSize){
|
}else if(key == P_FontSize){
|
||||||
label->setFontSize(valueToInt(value));
|
label->setFontSize(valueToInt(value));
|
||||||
}else if(key == P_FontName){
|
}else if(key == P_FontName){
|
||||||
std::string fontFilePath;
|
auto& fontFilePath = binaryFilePath.append(value);
|
||||||
fontFilePath = binaryFilePath.append(value);
|
label->setFontName(fontFilePath);
|
||||||
auto fontData = cocos2d::wext::makeResourceData(std::move(fontFilePath));
|
|
||||||
if (FileUtils::getInstance()->isFileExist(fontFilePath)) {
|
|
||||||
label->setFontName(fontData.file);
|
|
||||||
}else{
|
|
||||||
label->setFontName(fontData.file);
|
|
||||||
}
|
|
||||||
}else if(key == P_AreaWidth){
|
}else if(key == P_AreaWidth){
|
||||||
label->setTextAreaSize(Size(valueToFloat(value), label->getTextAreaSize().height));
|
label->setTextAreaSize(Size(valueToFloat(value), label->getTextAreaSize().height));
|
||||||
}else if(key == P_AreaHeight){
|
}else if(key == P_AreaHeight){
|
||||||
|
@ -161,7 +155,7 @@ namespace cocostudio
|
||||||
|
|
||||||
bool touchScaleEnabled = false;
|
bool touchScaleEnabled = false;
|
||||||
bool isCustomSize = false;
|
bool isCustomSize = false;
|
||||||
std::string fontName = "";
|
std::string fontName;
|
||||||
int fontSize = 20;
|
int fontSize = 20;
|
||||||
std::string text = "Text Label";
|
std::string text = "Text Label";
|
||||||
bool isLocalized = false;
|
bool isLocalized = false;
|
||||||
|
@ -177,14 +171,14 @@ namespace cocostudio
|
||||||
Size shadowOffset = Size(2, -2);
|
Size shadowOffset = Size(2, -2);
|
||||||
int shadowBlurRadius = 0;
|
int shadowBlurRadius = 0;
|
||||||
|
|
||||||
// since x-studio365 reader 10.0.593.0
|
// since x-studio reader 10.0.593.0
|
||||||
bool glowEnabled = false;
|
bool glowEnabled = false;
|
||||||
Color4B glowColor = Color4B::BLACK;
|
Color4B glowColor = Color4B::BLACK;
|
||||||
|
|
||||||
bool boldEnabled = false, underlineEnabled = false, italicsEnabled = false, strikethroughEnabled = false;
|
bool boldEnabled = false, underlineEnabled = false, italicsEnabled = false, strikethroughEnabled = false;
|
||||||
|
|
||||||
std::string path = "";
|
std::string path;
|
||||||
std::string plistFile = "";
|
std::string plistFile;
|
||||||
int resourceType = 0;
|
int resourceType = 0;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
|
@ -472,16 +466,16 @@ namespace cocostudio
|
||||||
label->setTextAreaSize(areaSize);
|
label->setTextAreaSize(areaSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto resourceData = cocos2d::wext::makeResourceData(options->fontResource());
|
auto resourceDataDic = (options->fontResource());
|
||||||
std::string& path = resourceData.file;
|
std::string path = resourceDataDic->path()->c_str();
|
||||||
if (!path.empty() && FileUtils::getInstance()->isFileExist(path))
|
if (!path.empty() && FileUtils::getInstance()->isFileExist(path))
|
||||||
{
|
{
|
||||||
label->setFontName(path);
|
label->setFontName(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string fontName = options->fontName()->c_str();
|
path = options->fontName()->c_str();
|
||||||
label->setFontName(fontName);
|
label->setFontName(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextHAlignment h_alignment = (TextHAlignment)options->hAlignment();
|
TextHAlignment h_alignment = (TextHAlignment)options->hAlignment();
|
||||||
|
|
|
@ -158,28 +158,28 @@ namespace cocostudio
|
||||||
|
|
||||||
Vec2 clipPlane(1, 1000);
|
Vec2 clipPlane(1, 1000);
|
||||||
|
|
||||||
std::string leftPath = "";
|
std::string leftPath;
|
||||||
std::string leftPlistFile = "";
|
std::string leftPlistFile;
|
||||||
int leftResourceType = 0;
|
int leftResourceType = 0;
|
||||||
|
|
||||||
std::string rightPath = "";
|
std::string rightPath;
|
||||||
std::string rightPlistFile = "";
|
std::string rightPlistFile;
|
||||||
int rightResourceType = 0;
|
int rightResourceType = 0;
|
||||||
|
|
||||||
std::string upPath = "";
|
std::string upPath;
|
||||||
std::string upPlistFile = "";
|
std::string upPlistFile;
|
||||||
int upResourceType = 0;
|
int upResourceType = 0;
|
||||||
|
|
||||||
std::string downPath = "";
|
std::string downPath;
|
||||||
std::string downPlistFile = "";
|
std::string downPlistFile;
|
||||||
int downResourceType = 0;
|
int downResourceType = 0;
|
||||||
|
|
||||||
std::string forwardPath = "";
|
std::string forwardPath;
|
||||||
std::string forwardPlistFile = "";
|
std::string forwardPlistFile;
|
||||||
int forwardResourceType = 0;
|
int forwardResourceType = 0;
|
||||||
|
|
||||||
std::string backPath = "";
|
std::string backPath;
|
||||||
std::string backPlistFile = "";
|
std::string backPlistFile;
|
||||||
int backResourceType = 0;
|
int backResourceType = 0;
|
||||||
|
|
||||||
// FileData
|
// FileData
|
||||||
|
|
|
@ -400,7 +400,7 @@ namespace cocostudio
|
||||||
|
|
||||||
Offset<Table> WidgetReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, flatbuffers::FlatBufferBuilder *builder)
|
Offset<Table> WidgetReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, flatbuffers::FlatBufferBuilder *builder)
|
||||||
{
|
{
|
||||||
std::string name = "";
|
std::string name;
|
||||||
long actionTag = 0;
|
long actionTag = 0;
|
||||||
Vec2 rotationSkew;
|
Vec2 rotationSkew;
|
||||||
int zOrder = 0;
|
int zOrder = 0;
|
||||||
|
@ -416,10 +416,10 @@ namespace cocostudio
|
||||||
bool flipY = false;
|
bool flipY = false;
|
||||||
bool ignoreSize = false;
|
bool ignoreSize = false;
|
||||||
bool touchEnabled = false;
|
bool touchEnabled = false;
|
||||||
std::string frameEvent = "";
|
std::string frameEvent;
|
||||||
std::string customProperty = "";
|
std::string customProperty;
|
||||||
std::string callbackType = "";
|
std::string callbackType;
|
||||||
std::string callbackName = "";
|
std::string callbackName;
|
||||||
|
|
||||||
bool positionXPercentEnabled = false;
|
bool positionXPercentEnabled = false;
|
||||||
bool positionYPercentEnabled = false;
|
bool positionYPercentEnabled = false;
|
||||||
|
@ -438,7 +438,7 @@ namespace cocostudio
|
||||||
float topMargin = 0;
|
float topMargin = 0;
|
||||||
float bottomMargin = 0;
|
float bottomMargin = 0;
|
||||||
|
|
||||||
// x-studio365 10.0.593.0: read from .csb.
|
// x-studio 10.0.593.0: read from .csb.
|
||||||
bool cascadeColorEnabled = false;
|
bool cascadeColorEnabled = false;
|
||||||
bool cascadeOpacityEnabled = false;
|
bool cascadeOpacityEnabled = false;
|
||||||
|
|
||||||
|
@ -798,7 +798,7 @@ namespace cocostudio
|
||||||
|
|
||||||
auto options = (WidgetOptions*)widgetOptions;
|
auto options = (WidgetOptions*)widgetOptions;
|
||||||
|
|
||||||
// x-studio365 10.0.593.0: read from .csb
|
// x-studio 10.0.593.0: read from .csb
|
||||||
node->setCascadeColorEnabled(options->cascadeColorEnabled());
|
node->setCascadeColorEnabled(options->cascadeColorEnabled());
|
||||||
node->setCascadeOpacityEnabled(options->cascadeOpacityEnabled());
|
node->setCascadeOpacityEnabled(options->cascadeOpacityEnabled());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue