Merge pull request #7302 from andyque/fixBinaryOptimization

fix container default color issue
This commit is contained in:
minggo 2014-07-03 14:56:01 +08:00
commit 3fd73d70c0
3 changed files with 65 additions and 14 deletions

View File

@ -44,7 +44,7 @@ Type stExpCocoNode::GetType(CocoLoader* pCoco)
stExpCocoAttribDesc* tpAttribDescArray = (stExpCocoAttribDesc*) tpCocoObjectDesc[m_ObjIndex].GetAttribDescArray(pCoco); stExpCocoAttribDesc* tpAttribDescArray = (stExpCocoAttribDesc*) tpCocoObjectDesc[m_ObjIndex].GetAttribDescArray(pCoco);
tType = Type(tpAttribDescArray[m_AttribIndex].m_cTypeName - 'N' + kNullType); tType = Type(tpAttribDescArray[m_AttribIndex].m_cTypeName - 'N' + kNullType);
if('F' == tType || 'T' == tType) if(kFalseType == tType || kTrueType == tType)
{ {
char* szValue = (char*)GetValue(pCoco); char* szValue = (char*)GetValue(pCoco);
if(szValue[0] == '0') if(szValue[0] == '0')
@ -103,16 +103,13 @@ char* stExpCocoNode::GetName(CocoLoader* pCoco)
} }
else else
{ {
//»Áπ˚√˚◊÷”ο‡√˚≥∆≤ªÕ¨£¨‘Ú∞¥’Ê µ÷µ…Ë÷√
char* szValue = GetValue(pCoco); char* szValue = GetValue(pCoco);
if(szValue[0]) if(szValue[0])
{ {
// ˝◊È
szName = GetValue(pCoco); szName = GetValue(pCoco);
} }
else else
{ {
//Ω·ππ
szName = tpCocoObjectDesc[m_ObjIndex].GetName(pCoco); szName = tpCocoObjectDesc[m_ObjIndex].GetName(pCoco);
} }
} }

View File

@ -3,6 +3,9 @@
#include "LayoutReader.h" #include "LayoutReader.h"
#include "ui/UILayout.h" #include "ui/UILayout.h"
#include "cocostudio/CocoLoader.h" #include "cocostudio/CocoLoader.h"
#include "ui/UIScrollView.h"
#include "ui/UIPageView.h"
#include "ui/UIListView.h"
USING_NS_CC; USING_NS_CC;
using namespace ui; using namespace ui;
@ -194,17 +197,67 @@ namespace cocostudio
bool backGroundScale9Enable = DICTOOL->getBooleanValue_json(options, P_BackGroundScale9Enable); bool backGroundScale9Enable = DICTOOL->getBooleanValue_json(options, P_BackGroundScale9Enable);
panel->setBackGroundImageScale9Enabled(backGroundScale9Enable); panel->setBackGroundImageScale9Enabled(backGroundScale9Enable);
int cr = DICTOOL->getIntValue_json(options, P_BgColorR,150);
int cg = DICTOOL->getIntValue_json(options, P_BgColorG,150);
int cb = DICTOOL->getIntValue_json(options, P_BgColorB,100);
int scr = DICTOOL->getIntValue_json(options, P_BgStartColorR,255);
int scg = DICTOOL->getIntValue_json(options, P_BgStartColorG, 255);
int scb = DICTOOL->getIntValue_json(options, P_BgStartColorB, 255);
int ecr = DICTOOL->getIntValue_json(options, P_BgEndColorR,150); int cr;
int ecg = DICTOOL->getIntValue_json(options, P_BgEndColorG,200); int cg;
int ecb = DICTOOL->getIntValue_json(options, P_BgEndColorB,255); int cb;
int scr;
int scg;
int scb;
int ecr;
int ecg;
int ecb;
if (dynamic_cast<ui::PageView*>(widget)) {
cr = DICTOOL->getIntValue_json(options, "bgColorR",150);
cg = DICTOOL->getIntValue_json(options, "bgColorG",150);
cb = DICTOOL->getIntValue_json(options, "bgColorB",100);
scr = DICTOOL->getIntValue_json(options, "bgStartColorR",255);
scg = DICTOOL->getIntValue_json(options, "bgStartColorG",255);
scb = DICTOOL->getIntValue_json(options, "bgStartColorB",255);
ecr = DICTOOL->getIntValue_json(options, "bgEndColorR",255);
ecg = DICTOOL->getIntValue_json(options, "bgEndColorG",150);
ecb = DICTOOL->getIntValue_json(options, "bgEndColorB",100);
}else if(dynamic_cast<ui::ListView*>(widget)){
cr = DICTOOL->getIntValue_json(options, "bgColorR",150);
cg = DICTOOL->getIntValue_json(options, "bgColorG",150);
cb = DICTOOL->getIntValue_json(options, "bgColorB",255);
scr = DICTOOL->getIntValue_json(options, "bgStartColorR",255);
scg = DICTOOL->getIntValue_json(options, "bgStartColorG",255);
scb = DICTOOL->getIntValue_json(options, "bgStartColorB",255);
ecr = DICTOOL->getIntValue_json(options, "bgEndColorR",150);
ecg = DICTOOL->getIntValue_json(options, "bgEndColorG",150);
ecb = DICTOOL->getIntValue_json(options, "bgEndColorB",255);
}else if(dynamic_cast<ui::ScrollView*>(widget)){
cr = DICTOOL->getIntValue_json(options, "bgColorR",255);
cg = DICTOOL->getIntValue_json(options, "bgColorG",150);
cb = DICTOOL->getIntValue_json(options, "bgColorB",100);
scr = DICTOOL->getIntValue_json(options, "bgStartColorR",255);
scg = DICTOOL->getIntValue_json(options, "bgStartColorG",255);
scb = DICTOOL->getIntValue_json(options, "bgStartColorB",255);
ecr = DICTOOL->getIntValue_json(options, "bgEndColorR",255);
ecg = DICTOOL->getIntValue_json(options, "bgEndColorG",150);
ecb = DICTOOL->getIntValue_json(options, "bgEndColorB",100);
}else{
cr = DICTOOL->getIntValue_json(options, "bgColorR",150);
cg = DICTOOL->getIntValue_json(options, "bgColorG",200);
cb = DICTOOL->getIntValue_json(options, "bgColorB",255);
scr = DICTOOL->getIntValue_json(options, "bgStartColorR",255);
scg = DICTOOL->getIntValue_json(options, "bgStartColorG",255);
scb = DICTOOL->getIntValue_json(options, "bgStartColorB",255);
ecr = DICTOOL->getIntValue_json(options, "bgEndColorR",150);
ecg = DICTOOL->getIntValue_json(options, "bgEndColorG",200);
ecb = DICTOOL->getIntValue_json(options, "bgEndColorB",255);
}
float bgcv1 = DICTOOL->getFloatValue_json(options, P_VectorX); float bgcv1 = DICTOOL->getFloatValue_json(options, P_VectorX);
float bgcv2 = DICTOOL->getFloatValue_json(options, P_VectorY,-0.5); float bgcv2 = DICTOOL->getFloatValue_json(options, P_VectorY,-0.5);
@ -214,6 +267,7 @@ namespace cocostudio
int colorType = DICTOOL->getIntValue_json(options, P_ColorType,1); int colorType = DICTOOL->getIntValue_json(options, P_ColorType,1);
panel->setBackGroundColorType(Layout::BackGroundColorType(colorType)); panel->setBackGroundColorType(Layout::BackGroundColorType(colorType));
panel->setBackGroundColor(Color3B(scr, scg, scb),Color3B(ecr, ecg, ecb)); panel->setBackGroundColor(Color3B(scr, scg, scb),Color3B(ecr, ecg, ecb));
panel->setBackGroundColor(Color3B(cr, cg, cb)); panel->setBackGroundColor(Color3B(cr, cg, cb));
panel->setBackGroundColorOpacity(co); panel->setBackGroundColorOpacity(co);

View File

@ -96,7 +96,7 @@ namespace cocostudio
{ {
textField->setPlaceHolder(DICTOOL->getStringValue_json(options, P_PlaceHolder,"input words here")); textField->setPlaceHolder(DICTOOL->getStringValue_json(options, P_PlaceHolder,"input words here"));
} }
textField->setText(DICTOOL->getStringValue_json(options, P_Text,"text Field")); textField->setText(DICTOOL->getStringValue_json(options, P_Text,"Text Tield"));
textField->setFontSize(DICTOOL->getIntValue_json(options, P_FontSize,20)); textField->setFontSize(DICTOOL->getIntValue_json(options, P_FontSize,20));