Merge branch 'fix_revert_pr' into refactor5183

This commit is contained in:
andyque 2014-05-20 16:17:38 +08:00
commit 480c8cfe8f
16 changed files with 308 additions and 258 deletions

View File

@ -845,6 +845,7 @@ Developers:
Fixed a bug that the effect of particle loaded from CocosBuilder is incorrectly Fixed a bug that the effect of particle loaded from CocosBuilder is incorrectly
Fix twice calling onExit Fix twice calling onExit
Fixed bug with cascade opacity and color for control button Fixed bug with cascade opacity and color for control button
Fix Progress Action. Not working with charging from 100 to 0.
twhittock twhittock
Fixed a bug that Application::run returns wrong value on Mac platform Fixed a bug that Application::run returns wrong value on Mac platform

View File

@ -1,3 +1,6 @@
cocos2d-x-3.1 ???
[FIX] ProgressTo: will start from 0 when it reaches 100
cocos2d-x-3.1-rc0 May.18 2014 cocos2d-x-3.1-rc0 May.18 2014
[NEW] Cocos2dxActivity: Adds a virtual method to load native libraries. [NEW] Cocos2dxActivity: Adds a virtual method to load native libraries.
[NEW] Directory Structure: reorder some files within the cocos/ folder [NEW] Directory Structure: reorder some files within the cocos/ folder

View File

@ -72,13 +72,6 @@ void ProgressTo::startWithTarget(Node *target)
{ {
ActionInterval::startWithTarget(target); ActionInterval::startWithTarget(target);
_from = ((kProgressTimerCast)(target))->getPercentage(); _from = ((kProgressTimerCast)(target))->getPercentage();
// XXX: Is this correct ?
// Adding it to support Repeat
if (_from == 100)
{
_from = 0;
}
} }
void ProgressTo::update(float time) void ProgressTo::update(float time)

View File

@ -1,7 +1,7 @@
-------------------------------- --------------------------------
-- @module Layout -- @module Layout
-- @extend Widget,LayoutProtocol -- @extend Widget
-------------------------------- --------------------------------
-- @function [parent=#Layout] setBackGroundColorVector -- @function [parent=#Layout] setBackGroundColorVector

View File

@ -1,13 +1,8 @@
-------------------------------- --------------------------------
-- @module Widget -- @module Widget
-- @extend ProtectedNode,LayoutParameterProtocol -- @extend ProtectedNode
--------------------------------
-- @function [parent=#Widget] clone
-- @param self
-- @return Widget#Widget ret (return value: ccui.Widget)
-------------------------------- --------------------------------
-- @function [parent=#Widget] setSizePercent -- @function [parent=#Widget] setSizePercent
-- @param self -- @param self
@ -19,9 +14,9 @@
-- @return size_table#size_table ret (return value: size_table) -- @return size_table#size_table ret (return value: size_table)
-------------------------------- --------------------------------
-- @function [parent=#Widget] getLeftBoundary -- @function [parent=#Widget] setFlippedY
-- @param self -- @param self
-- @return float#float ret (return value: float) -- @param #bool bool
-------------------------------- --------------------------------
-- @function [parent=#Widget] setFlippedX -- @function [parent=#Widget] setFlippedX
@ -29,9 +24,9 @@
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- @function [parent=#Widget] getVirtualRenderer -- @function [parent=#Widget] getLeftInParent
-- @param self -- @param self
-- @return Node#Node ret (return value: cc.Node) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- @function [parent=#Widget] getTouchEndPos -- @function [parent=#Widget] getTouchEndPos
@ -69,9 +64,9 @@
-- @return bool#bool ret (return value: bool) -- @return bool#bool ret (return value: bool)
-------------------------------- --------------------------------
-- @function [parent=#Widget] getVirtualRendererSize -- @function [parent=#Widget] getBottomInParent
-- @param self -- @param self
-- @return size_table#size_table ret (return value: size_table) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- @function [parent=#Widget] isHighlighted -- @function [parent=#Widget] isHighlighted
@ -81,6 +76,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Widget] getLayoutParameter -- @function [parent=#Widget] getLayoutParameter
-- @param self -- @param self
-- @param #ccui.LayoutParameter::Type type
-- @return LayoutParameter#LayoutParameter ret (return value: ccui.LayoutParameter) -- @return LayoutParameter#LayoutParameter ret (return value: ccui.LayoutParameter)
-------------------------------- --------------------------------
@ -88,11 +84,6 @@
-- @param self -- @param self
-- @return Widget::PositionType#Widget::PositionType ret (return value: ccui.Widget::PositionType) -- @return Widget::PositionType#Widget::PositionType ret (return value: ccui.Widget::PositionType)
--------------------------------
-- @function [parent=#Widget] getTopBoundary
-- @param self
-- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- @function [parent=#Widget] getChildByName -- @function [parent=#Widget] getChildByName
-- @param self -- @param self
@ -109,6 +100,11 @@
-- @param self -- @param self
-- @return bool#bool ret (return value: bool) -- @return bool#bool ret (return value: bool)
--------------------------------
-- @function [parent=#Widget] getVirtualRendererSize
-- @param self
-- @return size_table#size_table ret (return value: size_table)
-------------------------------- --------------------------------
-- @function [parent=#Widget] findNextFocusedWidget -- @function [parent=#Widget] findNextFocusedWidget
-- @param self -- @param self
@ -136,20 +132,15 @@
-- @param self -- @param self
-- @param #bool bool -- @param #bool bool
--------------------------------
-- @function [parent=#Widget] setActionTag
-- @param self
-- @param #int int
-------------------------------- --------------------------------
-- @function [parent=#Widget] setTouchEnabled -- @function [parent=#Widget] setTouchEnabled
-- @param self -- @param self
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- @function [parent=#Widget] setFlippedY -- @function [parent=#Widget] clone
-- @param self -- @param self
-- @param #bool bool -- @return Widget#Widget ret (return value: ccui.Widget)
-------------------------------- --------------------------------
-- @function [parent=#Widget] getTouchMovePos -- @function [parent=#Widget] getTouchMovePos
@ -162,9 +153,9 @@
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- @function [parent=#Widget] getRightBoundary -- @function [parent=#Widget] getVirtualRenderer
-- @param self -- @param self
-- @return float#float ret (return value: float) -- @return Node#Node ret (return value: cc.Node)
-------------------------------- --------------------------------
-- @function [parent=#Widget] setBrightStyle -- @function [parent=#Widget] setBrightStyle
@ -197,9 +188,9 @@
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- @function [parent=#Widget] getBottomBoundary -- @function [parent=#Widget] setActionTag
-- @param self -- @param self
-- @return float#float ret (return value: float) -- @param #int int
-------------------------------- --------------------------------
-- @function [parent=#Widget] isBright -- @function [parent=#Widget] isBright
@ -218,6 +209,11 @@
-- @param #bool bool -- @param #bool bool
-- @return Widget#Widget ret (return value: ccui.Widget) -- @return Widget#Widget ret (return value: ccui.Widget)
--------------------------------
-- @function [parent=#Widget] getTopInParent
-- @param self
-- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- @function [parent=#Widget] requestFocus -- @function [parent=#Widget] requestFocus
-- @param self -- @param self
@ -236,6 +232,11 @@
-- @param self -- @param self
-- @return size_table#size_table ret (return value: size_table) -- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- @function [parent=#Widget] getRightInParent
-- @param self
-- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- @function [parent=#Widget] getSizeType -- @function [parent=#Widget] getSizeType
-- @param self -- @param self

View File

@ -813,50 +813,6 @@ int lua_register_cocos2dx_ui_RelativeLayoutParameter(lua_State* tolua_S)
return 1; return 1;
} }
int lua_cocos2dx_ui_Widget_clone(lua_State* tolua_S)
{
int argc = 0;
cocos2d::ui::Widget* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_clone'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
cocos2d::ui::Widget* ret = cobj->clone();
object_to_luaval<cocos2d::ui::Widget>(tolua_S, "ccui.Widget",(cocos2d::ui::Widget*)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "clone",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_clone'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_ui_Widget_setSizePercent(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_setSizePercent(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
@ -947,7 +903,7 @@ int lua_cocos2dx_ui_Widget_getCustomSize(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_getLeftBoundary(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_setFlippedY(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
cocos2d::ui::Widget* cobj = nullptr; cocos2d::ui::Widget* cobj = nullptr;
@ -967,26 +923,28 @@ int lua_cocos2dx_ui_Widget_getLeftBoundary(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
if (!cobj) if (!cobj)
{ {
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getLeftBoundary'", nullptr); tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_setFlippedY'", nullptr);
return 0; return 0;
} }
#endif #endif
argc = lua_gettop(tolua_S)-1; argc = lua_gettop(tolua_S)-1;
if (argc == 0) if (argc == 1)
{ {
bool arg0;
ok &= luaval_to_boolean(tolua_S, 2,&arg0);
if(!ok) if(!ok)
return 0; return 0;
double ret = cobj->getLeftBoundary(); cobj->setFlippedY(arg0);
tolua_pushnumber(tolua_S,(lua_Number)ret); return 0;
return 1;
} }
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLeftBoundary",argc, 0); CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setFlippedY",argc, 1);
return 0; return 0;
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
tolua_lerror: tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getLeftBoundary'.",&tolua_err); tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_setFlippedY'.",&tolua_err);
#endif #endif
return 0; return 0;
@ -1037,7 +995,7 @@ int lua_cocos2dx_ui_Widget_setFlippedX(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_getVirtualRenderer(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_getLeftInParent(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
cocos2d::ui::Widget* cobj = nullptr; cocos2d::ui::Widget* cobj = nullptr;
@ -1057,7 +1015,7 @@ int lua_cocos2dx_ui_Widget_getVirtualRenderer(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
if (!cobj) if (!cobj)
{ {
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getVirtualRenderer'", nullptr); tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getLeftInParent'", nullptr);
return 0; return 0;
} }
#endif #endif
@ -1067,16 +1025,16 @@ int lua_cocos2dx_ui_Widget_getVirtualRenderer(lua_State* tolua_S)
{ {
if(!ok) if(!ok)
return 0; return 0;
cocos2d::Node* ret = cobj->getVirtualRenderer(); double ret = cobj->getLeftInParent();
object_to_luaval<cocos2d::Node>(tolua_S, "cc.Node",(cocos2d::Node*)ret); tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1; return 1;
} }
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVirtualRenderer",argc, 0); CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLeftInParent",argc, 0);
return 0; return 0;
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
tolua_lerror: tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getVirtualRenderer'.",&tolua_err); tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getLeftInParent'.",&tolua_err);
#endif #endif
return 0; return 0;
@ -1395,7 +1353,7 @@ int lua_cocos2dx_ui_Widget_isIgnoreContentAdaptWithSize(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_getVirtualRendererSize(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_getBottomInParent(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
cocos2d::ui::Widget* cobj = nullptr; cocos2d::ui::Widget* cobj = nullptr;
@ -1415,7 +1373,7 @@ int lua_cocos2dx_ui_Widget_getVirtualRendererSize(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
if (!cobj) if (!cobj)
{ {
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getVirtualRendererSize'", nullptr); tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getBottomInParent'", nullptr);
return 0; return 0;
} }
#endif #endif
@ -1425,16 +1383,16 @@ int lua_cocos2dx_ui_Widget_getVirtualRendererSize(lua_State* tolua_S)
{ {
if(!ok) if(!ok)
return 0; return 0;
const cocos2d::Size& ret = cobj->getVirtualRendererSize(); double ret = cobj->getBottomInParent();
size_to_luaval(tolua_S, ret); tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1; return 1;
} }
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVirtualRendererSize",argc, 0); CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getBottomInParent",argc, 0);
return 0; return 0;
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
tolua_lerror: tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getVirtualRendererSize'.",&tolua_err); tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getBottomInParent'.",&tolua_err);
#endif #endif
return 0; return 0;
@ -1509,15 +1467,18 @@ int lua_cocos2dx_ui_Widget_getLayoutParameter(lua_State* tolua_S)
#endif #endif
argc = lua_gettop(tolua_S)-1; argc = lua_gettop(tolua_S)-1;
if (argc == 0) if (argc == 1)
{ {
cocos2d::ui::LayoutParameter::Type arg0;
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);
if(!ok) if(!ok)
return 0; return 0;
cocos2d::ui::LayoutParameter* ret = cobj->getLayoutParameter(); cocos2d::ui::LayoutParameter* ret = cobj->getLayoutParameter(arg0);
object_to_luaval<cocos2d::ui::LayoutParameter>(tolua_S, "ccui.LayoutParameter",(cocos2d::ui::LayoutParameter*)ret); object_to_luaval<cocos2d::ui::LayoutParameter>(tolua_S, "ccui.LayoutParameter",(cocos2d::ui::LayoutParameter*)ret);
return 1; return 1;
} }
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLayoutParameter",argc, 0); CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLayoutParameter",argc, 1);
return 0; return 0;
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
@ -1571,50 +1532,6 @@ int lua_cocos2dx_ui_Widget_getPositionType(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_getTopBoundary(lua_State* tolua_S)
{
int argc = 0;
cocos2d::ui::Widget* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getTopBoundary'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
double ret = cobj->getTopBoundary();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTopBoundary",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getTopBoundary'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_ui_Widget_getChildByName(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_getChildByName(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
@ -1750,6 +1667,50 @@ int lua_cocos2dx_ui_Widget_isFocused(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_getVirtualRendererSize(lua_State* tolua_S)
{
int argc = 0;
cocos2d::ui::Widget* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getVirtualRendererSize'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
const cocos2d::Size& ret = cobj->getVirtualRendererSize();
size_to_luaval(tolua_S, ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVirtualRendererSize",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getVirtualRendererSize'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_ui_Widget_findNextFocusedWidget(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_findNextFocusedWidget(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
@ -1978,52 +1939,6 @@ int lua_cocos2dx_ui_Widget_setFocused(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_setActionTag(lua_State* tolua_S)
{
int argc = 0;
cocos2d::ui::Widget* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_setActionTag'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
int arg0;
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);
if(!ok)
return 0;
cobj->setActionTag(arg0);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setActionTag",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_setActionTag'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_ui_Widget_setTouchEnabled(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_setTouchEnabled(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
@ -2070,7 +1985,7 @@ int lua_cocos2dx_ui_Widget_setTouchEnabled(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_setFlippedY(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_clone(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
cocos2d::ui::Widget* cobj = nullptr; cocos2d::ui::Widget* cobj = nullptr;
@ -2090,28 +2005,26 @@ int lua_cocos2dx_ui_Widget_setFlippedY(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
if (!cobj) if (!cobj)
{ {
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_setFlippedY'", nullptr); tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_clone'", nullptr);
return 0; return 0;
} }
#endif #endif
argc = lua_gettop(tolua_S)-1; argc = lua_gettop(tolua_S)-1;
if (argc == 1) if (argc == 0)
{ {
bool arg0;
ok &= luaval_to_boolean(tolua_S, 2,&arg0);
if(!ok) if(!ok)
return 0; return 0;
cobj->setFlippedY(arg0); cocos2d::ui::Widget* ret = cobj->clone();
return 0; object_to_luaval<cocos2d::ui::Widget>(tolua_S, "ccui.Widget",(cocos2d::ui::Widget*)ret);
return 1;
} }
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setFlippedY",argc, 1); CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "clone",argc, 0);
return 0; return 0;
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
tolua_lerror: tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_setFlippedY'.",&tolua_err); tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_clone'.",&tolua_err);
#endif #endif
return 0; return 0;
@ -2206,7 +2119,7 @@ int lua_cocos2dx_ui_Widget_setEnabled(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_getRightBoundary(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_getVirtualRenderer(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
cocos2d::ui::Widget* cobj = nullptr; cocos2d::ui::Widget* cobj = nullptr;
@ -2226,7 +2139,7 @@ int lua_cocos2dx_ui_Widget_getRightBoundary(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
if (!cobj) if (!cobj)
{ {
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getRightBoundary'", nullptr); tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getVirtualRenderer'", nullptr);
return 0; return 0;
} }
#endif #endif
@ -2236,16 +2149,16 @@ int lua_cocos2dx_ui_Widget_getRightBoundary(lua_State* tolua_S)
{ {
if(!ok) if(!ok)
return 0; return 0;
double ret = cobj->getRightBoundary(); cocos2d::Node* ret = cobj->getVirtualRenderer();
tolua_pushnumber(tolua_S,(lua_Number)ret); object_to_luaval<cocos2d::Node>(tolua_S, "cc.Node",(cocos2d::Node*)ret);
return 1; return 1;
} }
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getRightBoundary",argc, 0); CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVirtualRenderer",argc, 0);
return 0; return 0;
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
tolua_lerror: tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getRightBoundary'.",&tolua_err); tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getVirtualRenderer'.",&tolua_err);
#endif #endif
return 0; return 0;
@ -2522,7 +2435,7 @@ int lua_cocos2dx_ui_Widget_setFocusEnabled(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_getBottomBoundary(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_setActionTag(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
cocos2d::ui::Widget* cobj = nullptr; cocos2d::ui::Widget* cobj = nullptr;
@ -2542,26 +2455,28 @@ int lua_cocos2dx_ui_Widget_getBottomBoundary(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
if (!cobj) if (!cobj)
{ {
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getBottomBoundary'", nullptr); tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_setActionTag'", nullptr);
return 0; return 0;
} }
#endif #endif
argc = lua_gettop(tolua_S)-1; argc = lua_gettop(tolua_S)-1;
if (argc == 0) if (argc == 1)
{ {
int arg0;
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);
if(!ok) if(!ok)
return 0; return 0;
double ret = cobj->getBottomBoundary(); cobj->setActionTag(arg0);
tolua_pushnumber(tolua_S,(lua_Number)ret); return 0;
return 1;
} }
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getBottomBoundary",argc, 0); CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setActionTag",argc, 1);
return 0; return 0;
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
tolua_lerror: tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getBottomBoundary'.",&tolua_err); tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_setActionTag'.",&tolua_err);
#endif #endif
return 0; return 0;
@ -2704,6 +2619,50 @@ int lua_cocos2dx_ui_Widget_getCurrentFocusedWidget(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_getTopInParent(lua_State* tolua_S)
{
int argc = 0;
cocos2d::ui::Widget* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getTopInParent'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
double ret = cobj->getTopInParent();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTopInParent",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getTopInParent'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_ui_Widget_requestFocus(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_requestFocus(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
@ -2840,6 +2799,50 @@ int lua_cocos2dx_ui_Widget_getSize(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_ui_Widget_getRightInParent(lua_State* tolua_S)
{
int argc = 0;
cocos2d::ui::Widget* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_getRightInParent'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
double ret = cobj->getRightInParent();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getRightInParent",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_getRightInParent'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_ui_Widget_getSizeType(lua_State* tolua_S) int lua_cocos2dx_ui_Widget_getSizeType(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
@ -3470,12 +3473,11 @@ int lua_register_cocos2dx_ui_Widget(lua_State* tolua_S)
tolua_cclass(tolua_S,"Widget","ccui.Widget","cc.ProtectedNode",nullptr); tolua_cclass(tolua_S,"Widget","ccui.Widget","cc.ProtectedNode",nullptr);
tolua_beginmodule(tolua_S,"Widget"); tolua_beginmodule(tolua_S,"Widget");
tolua_function(tolua_S,"clone",lua_cocos2dx_ui_Widget_clone);
tolua_function(tolua_S,"setSizePercent",lua_cocos2dx_ui_Widget_setSizePercent); tolua_function(tolua_S,"setSizePercent",lua_cocos2dx_ui_Widget_setSizePercent);
tolua_function(tolua_S,"getCustomSize",lua_cocos2dx_ui_Widget_getCustomSize); tolua_function(tolua_S,"getCustomSize",lua_cocos2dx_ui_Widget_getCustomSize);
tolua_function(tolua_S,"getLeftBoundary",lua_cocos2dx_ui_Widget_getLeftBoundary); tolua_function(tolua_S,"setFlippedY",lua_cocos2dx_ui_Widget_setFlippedY);
tolua_function(tolua_S,"setFlippedX",lua_cocos2dx_ui_Widget_setFlippedX); tolua_function(tolua_S,"setFlippedX",lua_cocos2dx_ui_Widget_setFlippedX);
tolua_function(tolua_S,"getVirtualRenderer",lua_cocos2dx_ui_Widget_getVirtualRenderer); tolua_function(tolua_S,"getLeftInParent",lua_cocos2dx_ui_Widget_getLeftInParent);
tolua_function(tolua_S,"getTouchEndPos",lua_cocos2dx_ui_Widget_getTouchEndPos); tolua_function(tolua_S,"getTouchEndPos",lua_cocos2dx_ui_Widget_getTouchEndPos);
tolua_function(tolua_S,"setPositionPercent",lua_cocos2dx_ui_Widget_setPositionPercent); tolua_function(tolua_S,"setPositionPercent",lua_cocos2dx_ui_Widget_setPositionPercent);
tolua_function(tolua_S,"getLayoutSize",lua_cocos2dx_ui_Widget_getLayoutSize); tolua_function(tolua_S,"getLayoutSize",lua_cocos2dx_ui_Widget_getLayoutSize);
@ -3483,38 +3485,39 @@ int lua_register_cocos2dx_ui_Widget(lua_State* tolua_S)
tolua_function(tolua_S,"setPositionType",lua_cocos2dx_ui_Widget_setPositionType); tolua_function(tolua_S,"setPositionType",lua_cocos2dx_ui_Widget_setPositionType);
tolua_function(tolua_S,"getName",lua_cocos2dx_ui_Widget_getName); tolua_function(tolua_S,"getName",lua_cocos2dx_ui_Widget_getName);
tolua_function(tolua_S,"isIgnoreContentAdaptWithSize",lua_cocos2dx_ui_Widget_isIgnoreContentAdaptWithSize); tolua_function(tolua_S,"isIgnoreContentAdaptWithSize",lua_cocos2dx_ui_Widget_isIgnoreContentAdaptWithSize);
tolua_function(tolua_S,"getVirtualRendererSize",lua_cocos2dx_ui_Widget_getVirtualRendererSize); tolua_function(tolua_S,"getBottomInParent",lua_cocos2dx_ui_Widget_getBottomInParent);
tolua_function(tolua_S,"isHighlighted",lua_cocos2dx_ui_Widget_isHighlighted); tolua_function(tolua_S,"isHighlighted",lua_cocos2dx_ui_Widget_isHighlighted);
tolua_function(tolua_S,"getLayoutParameter",lua_cocos2dx_ui_Widget_getLayoutParameter); tolua_function(tolua_S,"getLayoutParameter",lua_cocos2dx_ui_Widget_getLayoutParameter);
tolua_function(tolua_S,"getPositionType",lua_cocos2dx_ui_Widget_getPositionType); tolua_function(tolua_S,"getPositionType",lua_cocos2dx_ui_Widget_getPositionType);
tolua_function(tolua_S,"getTopBoundary",lua_cocos2dx_ui_Widget_getTopBoundary);
tolua_function(tolua_S,"getChildByName",lua_cocos2dx_ui_Widget_getChildByName); tolua_function(tolua_S,"getChildByName",lua_cocos2dx_ui_Widget_getChildByName);
tolua_function(tolua_S,"isEnabled",lua_cocos2dx_ui_Widget_isEnabled); tolua_function(tolua_S,"isEnabled",lua_cocos2dx_ui_Widget_isEnabled);
tolua_function(tolua_S,"isFocused",lua_cocos2dx_ui_Widget_isFocused); tolua_function(tolua_S,"isFocused",lua_cocos2dx_ui_Widget_isFocused);
tolua_function(tolua_S,"getVirtualRendererSize",lua_cocos2dx_ui_Widget_getVirtualRendererSize);
tolua_function(tolua_S,"findNextFocusedWidget",lua_cocos2dx_ui_Widget_findNextFocusedWidget); tolua_function(tolua_S,"findNextFocusedWidget",lua_cocos2dx_ui_Widget_findNextFocusedWidget);
tolua_function(tolua_S,"isTouchEnabled",lua_cocos2dx_ui_Widget_isTouchEnabled); tolua_function(tolua_S,"isTouchEnabled",lua_cocos2dx_ui_Widget_isTouchEnabled);
tolua_function(tolua_S,"getActionTag",lua_cocos2dx_ui_Widget_getActionTag); tolua_function(tolua_S,"getActionTag",lua_cocos2dx_ui_Widget_getActionTag);
tolua_function(tolua_S,"getWorldPosition",lua_cocos2dx_ui_Widget_getWorldPosition); tolua_function(tolua_S,"getWorldPosition",lua_cocos2dx_ui_Widget_getWorldPosition);
tolua_function(tolua_S,"setFocused",lua_cocos2dx_ui_Widget_setFocused); tolua_function(tolua_S,"setFocused",lua_cocos2dx_ui_Widget_setFocused);
tolua_function(tolua_S,"setActionTag",lua_cocos2dx_ui_Widget_setActionTag);
tolua_function(tolua_S,"setTouchEnabled",lua_cocos2dx_ui_Widget_setTouchEnabled); tolua_function(tolua_S,"setTouchEnabled",lua_cocos2dx_ui_Widget_setTouchEnabled);
tolua_function(tolua_S,"setFlippedY",lua_cocos2dx_ui_Widget_setFlippedY); tolua_function(tolua_S,"clone",lua_cocos2dx_ui_Widget_clone);
tolua_function(tolua_S,"getTouchMovePos",lua_cocos2dx_ui_Widget_getTouchMovePos); tolua_function(tolua_S,"getTouchMovePos",lua_cocos2dx_ui_Widget_getTouchMovePos);
tolua_function(tolua_S,"setEnabled",lua_cocos2dx_ui_Widget_setEnabled); tolua_function(tolua_S,"setEnabled",lua_cocos2dx_ui_Widget_setEnabled);
tolua_function(tolua_S,"getRightBoundary",lua_cocos2dx_ui_Widget_getRightBoundary); tolua_function(tolua_S,"getVirtualRenderer",lua_cocos2dx_ui_Widget_getVirtualRenderer);
tolua_function(tolua_S,"setBrightStyle",lua_cocos2dx_ui_Widget_setBrightStyle); tolua_function(tolua_S,"setBrightStyle",lua_cocos2dx_ui_Widget_setBrightStyle);
tolua_function(tolua_S,"setName",lua_cocos2dx_ui_Widget_setName); tolua_function(tolua_S,"setName",lua_cocos2dx_ui_Widget_setName);
tolua_function(tolua_S,"setLayoutParameter",lua_cocos2dx_ui_Widget_setLayoutParameter); tolua_function(tolua_S,"setLayoutParameter",lua_cocos2dx_ui_Widget_setLayoutParameter);
tolua_function(tolua_S,"getSizePercent",lua_cocos2dx_ui_Widget_getSizePercent); tolua_function(tolua_S,"getSizePercent",lua_cocos2dx_ui_Widget_getSizePercent);
tolua_function(tolua_S,"getTouchStartPos",lua_cocos2dx_ui_Widget_getTouchStartPos); tolua_function(tolua_S,"getTouchStartPos",lua_cocos2dx_ui_Widget_getTouchStartPos);
tolua_function(tolua_S,"setFocusEnabled",lua_cocos2dx_ui_Widget_setFocusEnabled); tolua_function(tolua_S,"setFocusEnabled",lua_cocos2dx_ui_Widget_setFocusEnabled);
tolua_function(tolua_S,"getBottomBoundary",lua_cocos2dx_ui_Widget_getBottomBoundary); tolua_function(tolua_S,"setActionTag",lua_cocos2dx_ui_Widget_setActionTag);
tolua_function(tolua_S,"isBright",lua_cocos2dx_ui_Widget_isBright); tolua_function(tolua_S,"isBright",lua_cocos2dx_ui_Widget_isBright);
tolua_function(tolua_S,"clippingParentAreaContainPoint",lua_cocos2dx_ui_Widget_clippingParentAreaContainPoint); tolua_function(tolua_S,"clippingParentAreaContainPoint",lua_cocos2dx_ui_Widget_clippingParentAreaContainPoint);
tolua_function(tolua_S,"getCurrentFocusedWidget",lua_cocos2dx_ui_Widget_getCurrentFocusedWidget); tolua_function(tolua_S,"getCurrentFocusedWidget",lua_cocos2dx_ui_Widget_getCurrentFocusedWidget);
tolua_function(tolua_S,"getTopInParent",lua_cocos2dx_ui_Widget_getTopInParent);
tolua_function(tolua_S,"requestFocus",lua_cocos2dx_ui_Widget_requestFocus); tolua_function(tolua_S,"requestFocus",lua_cocos2dx_ui_Widget_requestFocus);
tolua_function(tolua_S,"updateSizeAndPosition",lua_cocos2dx_ui_Widget_updateSizeAndPosition); tolua_function(tolua_S,"updateSizeAndPosition",lua_cocos2dx_ui_Widget_updateSizeAndPosition);
tolua_function(tolua_S,"getSize",lua_cocos2dx_ui_Widget_getSize); tolua_function(tolua_S,"getSize",lua_cocos2dx_ui_Widget_getSize);
tolua_function(tolua_S,"getRightInParent",lua_cocos2dx_ui_Widget_getRightInParent);
tolua_function(tolua_S,"getSizeType",lua_cocos2dx_ui_Widget_getSizeType); tolua_function(tolua_S,"getSizeType",lua_cocos2dx_ui_Widget_getSizeType);
tolua_function(tolua_S,"ignoreContentAdaptWithSize",lua_cocos2dx_ui_Widget_ignoreContentAdaptWithSize); tolua_function(tolua_S,"ignoreContentAdaptWithSize",lua_cocos2dx_ui_Widget_ignoreContentAdaptWithSize);
tolua_function(tolua_S,"addTouchEventListener",lua_cocos2dx_ui_Widget_addTouchEventListener); tolua_function(tolua_S,"addTouchEventListener",lua_cocos2dx_ui_Widget_addTouchEventListener);

View File

@ -938,8 +938,6 @@
"cocos/ui/UIImageView.h", "cocos/ui/UIImageView.h",
"cocos/ui/UILayout.cpp", "cocos/ui/UILayout.cpp",
"cocos/ui/UILayout.h", "cocos/ui/UILayout.h",
"cocos/ui/UILayoutExecutant.cpp",
"cocos/ui/UILayoutExecutant.h",
"cocos/ui/UILayoutParameter.cpp", "cocos/ui/UILayoutParameter.cpp",
"cocos/ui/UILayoutParameter.h", "cocos/ui/UILayoutParameter.h",
"cocos/ui/UIListView.cpp", "cocos/ui/UIListView.cpp",

View File

@ -5,13 +5,41 @@
"runtime/config.json", "runtime/config.json",
"runtime/version.json" "runtime/version.json"
], ],
"append_from_template": {
"from": "frameworks/runtime-src/proj.android",
"to": "frameworks/runtime-src/proj.android",
"exclude": [
"bin",
"assets"
]
},
"project_replace_project_name": { "project_replace_project_name": {
"src_project_name": "HelloLua", "src_project_name": "HelloLua",
"files": [ "files": [
"config.json", "config.json",
".project"] ".project",
"frameworks/runtime-src/proj.android/.project",
"frameworks/runtime-src/proj.android/AndroidManifest.xml",
"frameworks/runtime-src/proj.android/build.xml",
"frameworks/runtime-src/proj.android/res/values/strings.xml"
]
}, },
"append_dir": [ "append_dir": [
{
"from": "cocos/platform/android/java",
"to": "frameworks/cocos2d-x/cocos/platform/android/java"
},
{
"from": "cocos/scripting/lua-bindings/script",
"to": "frameworks/cocos2d-x/cocos/scripting/lua-bindings/script"
},
{
"from": "external/lua/luasocket",
"to": "frameworks/cocos2d-x/external/lua/luasocket",
"include": [
"*.lua"
]
},
{ {
"from": "cocos/scripting/lua-bindings/script", "from": "cocos/scripting/lua-bindings/script",
"to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources",
@ -104,9 +132,7 @@
"from": "frameworks/runtime-src", "from": "frameworks/runtime-src",
"to": "frameworks/runtime-src", "to": "frameworks/runtime-src",
"exclude": [ "exclude": [
"proj.android/bin", "proj.android",
"proj.android/assets",
"proj.android/libs",
"proj.ios_mac/HelloLua.xcodeproj/project.xcworkspace", "proj.ios_mac/HelloLua.xcodeproj/project.xcworkspace",
"proj.ios_mac/HelloLua.xcodeproj/xcuserdata", "proj.ios_mac/HelloLua.xcodeproj/xcuserdata",
"proj.win32/Debug.win32", "proj.win32/Debug.win32",
@ -139,10 +165,6 @@
"frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln",
"frameworks/runtime-src/proj.win32/main.cpp", "frameworks/runtime-src/proj.win32/main.cpp",
"frameworks/runtime-src/proj.win32/Runtime_win32.cpp", "frameworks/runtime-src/proj.win32/Runtime_win32.cpp",
"frameworks/runtime-src/proj.android/.project",
"frameworks/runtime-src/proj.android/AndroidManifest.xml",
"frameworks/runtime-src/proj.android/build.xml",
"frameworks/runtime-src/proj.android/res/values/strings.xml",
"frameworks/runtime-src/proj.ios_mac/ios/main.m", "frameworks/runtime-src/proj.ios_mac/ios/main.m",
"frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch",
"frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm", "frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm",

View File

@ -48,14 +48,21 @@ using namespace cocos2d;
std::string g_resourcePath; std::string g_resourcePath;
static rapidjson::Document g_filecfgjson; static rapidjson::Document g_filecfgjson;
class ConnectWaitLayer;
static ConnectWaitLayer* s_pConnectLayer;
extern string getIPAddress(); extern string getIPAddress();
const char* getRuntimeVersion() const char* getRuntimeVersion()
{ {
return "1.1"; return "1.1";
} }
void hideRcvFile() {
s_pConnectLayer = nullptr;
}
void startScript(string strDebugArg) void startScript(string strDebugArg)
{ {
hideRcvFile();
// register lua engine // register lua engine
auto engine = LuaEngine::getInstance(); auto engine = LuaEngine::getInstance();
if (!strDebugArg.empty()) if (!strDebugArg.empty())
@ -91,6 +98,8 @@ bool reloadScript(const string& modulefile)
class ConnectWaitLayer: public Layer class ConnectWaitLayer: public Layer
{ {
private:
LabelTTF* pLabelUploadFile;
public: public:
ConnectWaitLayer() ConnectWaitLayer()
@ -113,8 +122,11 @@ public:
auto labelwait = LabelTTF::create(strShowMsg.c_str(), "Arial", 22); auto labelwait = LabelTTF::create(strShowMsg.c_str(), "Arial", 22);
addChild(labelwait, 10000); addChild(labelwait, 10000);
labelwait->setPosition( Point(VisibleRect::center().x, VisibleRect::center().y) ); labelwait->setPosition( Point(VisibleRect::center().x, VisibleRect::center().y) );
pLabelUploadFile = LabelTTF::create("", "Arial", 22);
addChild(pLabelUploadFile, 10000);
pLabelUploadFile->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 60) );
auto labelPlay = LabelTTF::create("play", "Arial", 36); auto labelPlay = LabelTTF::create("play", "Arial", 36);
auto menuItem = MenuItemLabel::create(labelPlay, CC_CALLBACK_1(ConnectWaitLayer::playerCallback, this)); auto menuItem = MenuItemLabel::create(labelPlay, CC_CALLBACK_1(ConnectWaitLayer::playerCallback, this));
auto menu = Menu::create(menuItem, NULL); auto menu = Menu::create(menuItem, NULL);
@ -129,8 +141,15 @@ public:
startScript(""); startScript("");
} }
void showCurRcvFile(string fileName) {
pLabelUploadFile->setString(fileName);
}
}; };
void showCurRcvFile(string fileName) {
if (NULL == s_pConnectLayer) return;
s_pConnectLayer->showCurRcvFile(fileName);
}
#if defined(_MSC_VER) || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__MINGW32__)
#include <io.h> #include <io.h>
@ -362,6 +381,7 @@ bool FileServer::receiveFile(int fd)
string file(fullfilename); string file(fullfilename);
file=replaceAll(file,"\\","/"); file=replaceAll(file,"\\","/");
sprintf(fullfilename, "%s", file.c_str()); sprintf(fullfilename, "%s", file.c_str());
showCurRcvFile(filename.c_str());
cocos2d::log("recv fullfilename = %s",fullfilename); cocos2d::log("recv fullfilename = %s",fullfilename);
CreateDir(file.substr(0,file.find_last_of("/")).c_str()); CreateDir(file.substr(0,file.find_last_of("/")).c_str());
FILE *fp =fopen(fullfilename, "wb"); FILE *fp =fopen(fullfilename, "wb");
@ -808,11 +828,10 @@ bool startRuntime()
readResFileFinfo(); readResFileFinfo();
auto scene = Scene::create(); auto scene = Scene::create();
auto layer = new ConnectWaitLayer(); s_pConnectLayer = new ConnectWaitLayer();
layer->autorelease(); s_pConnectLayer->autorelease();
auto director = Director::getInstance(); auto director = Director::getInstance();
scene->addChild(layer); scene->addChild(s_pConnectLayer);
director->runWithScene(scene); director->runWithScene(scene);
return true; return true;
} }

View File

@ -25,5 +25,14 @@ extern "C"
} }
return ConfigParser::getInstance()->isLanscape(); return ConfigParser::getInstance()->isLanscape();
} }
bool Java_org_cocos2dx_lua_AppActivity_nativeIsDebug(JNIEnv *env, jobject thisz)
{
#ifdef NDEBUG
return false;
#else
return true;
#endif
}
} }

View File

@ -69,8 +69,8 @@ public class AppActivity extends Cocos2dxActivity{
//2.Set the format of window //2.Set the format of window
// Check the wifi is opened when the android:debuggable is "true". // Check the wifi is opened when the native is debug.
if(0!=((this.getApplicationInfo().flags) & ApplicationInfo.FLAG_DEBUGGABLE)) if(nativeIsDebug())
{ {
if(!isWifiConnected()) if(!isWifiConnected())
{ {
@ -123,5 +123,6 @@ public class AppActivity extends Cocos2dxActivity{
} }
private static native boolean nativeIsLandScape(); private static native boolean nativeIsLandScape();
private static native boolean nativeIsDebug();
} }

View File

@ -157,8 +157,8 @@ void SpriteProgressToRadial::onEnter()
auto s = Director::getInstance()->getWinSize(); auto s = Director::getInstance()->getWinSize();
auto to1 = ProgressTo::create(2, 100); auto to1 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
auto to2 = ProgressTo::create(2, 100); auto to2 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); auto left = ProgressTimer::create(Sprite::create(s_pathSister1));
left->setType( ProgressTimer::Type::RADIAL ); left->setType( ProgressTimer::Type::RADIAL );
@ -192,8 +192,8 @@ void SpriteProgressToHorizontal::onEnter()
auto s = Director::getInstance()->getWinSize(); auto s = Director::getInstance()->getWinSize();
auto to1 = ProgressTo::create(2, 100); auto to1 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
auto to2 = ProgressTo::create(2, 100); auto to2 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); auto left = ProgressTimer::create(Sprite::create(s_pathSister1));
left->setType(ProgressTimer::Type::BAR); left->setType(ProgressTimer::Type::BAR);
@ -232,8 +232,8 @@ void SpriteProgressToVertical::onEnter()
auto s = Director::getInstance()->getWinSize(); auto s = Director::getInstance()->getWinSize();
auto to1 = ProgressTo::create(2, 100); auto to1 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
auto to2 = ProgressTo::create(2, 100); auto to2 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); auto left = ProgressTimer::create(Sprite::create(s_pathSister1));
left->setType(ProgressTimer::Type::BAR); left->setType(ProgressTimer::Type::BAR);
@ -273,7 +273,7 @@ void SpriteProgressToRadialMidpointChanged::onEnter()
auto s = Director::getInstance()->getWinSize(); auto s = Director::getInstance()->getWinSize();
auto action = ProgressTo::create(2, 100); auto action = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
/** /**
* Our image on the left should be a radial progress indicator, clockwise * Our image on the left should be a radial progress indicator, clockwise
@ -317,7 +317,7 @@ void SpriteProgressBarVarious::onEnter()
auto s = Director::getInstance()->getWinSize(); auto s = Director::getInstance()->getWinSize();
auto to = ProgressTo::create(2, 100); auto to = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); auto left = ProgressTimer::create(Sprite::create(s_pathSister1));
left->setType(ProgressTimer::Type::BAR); left->setType(ProgressTimer::Type::BAR);
@ -367,7 +367,7 @@ void SpriteProgressBarTintAndFade::onEnter()
auto s = Director::getInstance()->getWinSize(); auto s = Director::getInstance()->getWinSize();
auto to = ProgressTo::create(6, 100); auto to = Sequence::createWithTwoActions(ProgressTo::create(6, 100), ProgressTo::create(0, 0));
auto tint = Sequence::create(TintTo::create(1, 255, 0, 0), auto tint = Sequence::create(TintTo::create(1, 255, 0, 0),
TintTo::create(1, 0, 255, 0), TintTo::create(1, 0, 255, 0),
TintTo::create(1, 0, 0, 255), TintTo::create(1, 0, 0, 255),
@ -434,7 +434,7 @@ void SpriteProgressWithSpriteFrame::onEnter()
auto s = Director::getInstance()->getWinSize(); auto s = Director::getInstance()->getWinSize();
auto to = ProgressTo::create(6, 100); auto to = Sequence::createWithTwoActions(ProgressTo::create(6, 100), ProgressTo::create(0, 0));
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("zwoptex/grossini.plist"); SpriteFrameCache::getInstance()->addSpriteFramesWithFile("zwoptex/grossini.plist");

@ -1 +1 @@
Subproject commit 9f8d41077f67a81928acaa9bca4fea1c705b9104 Subproject commit edd24a1dcc0d8344038e4d46367c603b2a846ab5

View File

@ -118,7 +118,7 @@ def ANDROID_BUILD():
print 'clean **CLEAN FAILED**' print 'clean **CLEAN FAILED**'
time.sleep(sleep_time) time.sleep(sleep_time)
def updateProperty(): def updateProperty():
infoUpdate = os.system('android update project -p ./cocos/2d/platform/android/java/ -t 12') infoUpdate = os.system('android update project -p ./cocos/platform/android/java/ -t 12')
print 'cocos update:', infoUpdate print 'cocos update:', infoUpdate
infoUpdate = os.system('android update project -p '+PATH_ANDROID_SRC+' -t 12') infoUpdate = os.system('android update project -p '+PATH_ANDROID_SRC+' -t 12')
print 'test update:', infoUpdate print 'test update:', infoUpdate

View File

@ -149,7 +149,7 @@ def main():
ret = os.system("python build/android-build.py -b " + mode + " -n -j10 all") ret = os.system("python build/android-build.py -b " + mode + " -n -j10 all")
# create and save apk # create and save apk
if(ret == 0): if(ret == 0):
os.system('android update project -p cocos/2d/platform/android/java/ -t android-13') os.system('android update project -p cocos/platform/android/java/ -t android-13')
for i, test in enumerate(tests_dirs): for i, test in enumerate(tests_dirs):
os.system('android update project -p ' + test + ' -t android-13') os.system('android update project -p ' + test + ' -t android-13')
local_apk = test + '/' + tests_names[i] + '.apk' local_apk = test + '/' + tests_names[i] + '.apk'

View File

@ -194,7 +194,7 @@ def main():
# create and save apk # create and save apk
if(ret == 0): if(ret == 0):
sample_dir = 'tests/cpp-empty-test/proj.android/' sample_dir = 'tests/cpp-empty-test/proj.android/'
os.system('android update project -p cocos/2d/platform/android/java/ -t android-13') os.system('android update project -p cocos/platform/android/java/ -t android-13')
os.system('android update project -p ' + sample_dir + ' -t android-13') os.system('android update project -p ' + sample_dir + ' -t android-13')
os.system('ant debug -f ' + sample_dir + 'build.xml') os.system('ant debug -f ' + sample_dir + 'build.xml')
local_apk = sample_dir + 'bin/CppEmptyTest-debug.apk' local_apk = sample_dir + 'bin/CppEmptyTest-debug.apk'