diff --git a/AUTHORS b/AUTHORS
index d62059fb13..4ec7b7de70 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -485,6 +485,12 @@ Developers:
musikov
Fixing a bug that missing precision when getting strokeColor and fontFillColor
+
+ hawkwood (Justin Hawkwood)
+ Fixing a bug that EditBox doesn't show any text if it's initialized with text.
+
+ wtyqm (zhang peng)
+ Fixing a bug that ccbRootPath wasn't passed to sub ccb nodes.
Retired Core Developers:
WenSheng Yang
diff --git a/cocos2dx/CCScheduler.cpp b/cocos2dx/CCScheduler.cpp
index 74b61fe152..796d07d10b 100644
--- a/cocos2dx/CCScheduler.cpp
+++ b/cocos2dx/CCScheduler.cpp
@@ -491,6 +491,40 @@ void Scheduler::scheduleUpdateForTarget(Object *pTarget, int nPriority, bool bPa
}
}
+bool Scheduler::isScheduledForTarget(SEL_SCHEDULE pfnSelector, Object *pTarget)
+{
+ CCAssert(pfnSelector, "Argument selector must be non-NULL");
+ CCAssert(pTarget, "Argument target must be non-NULL");
+
+ tHashTimerEntry *pElement = NULL;
+ HASH_FIND_INT(_hashForTimers, &pTarget, pElement);
+
+ if (!pElement)
+ {
+ return false;
+ }
+
+ if (pElement->timers == NULL)
+ {
+ return false;
+ }else
+ {
+ for (unsigned int i = 0; i < pElement->timers->num; ++i)
+ {
+ Timer *timer = (Timer*)pElement->timers->arr[i];
+
+ if (pfnSelector == timer->getSelector())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ return false; // should never get here
+}
+
void Scheduler::removeUpdateFromHash(struct _listEntry *entry)
{
tHashUpdateEntry *element = NULL;
diff --git a/cocos2dx/CCScheduler.h b/cocos2dx/CCScheduler.h
index 5cab6f186c..04ea895366 100644
--- a/cocos2dx/CCScheduler.h
+++ b/cocos2dx/CCScheduler.h
@@ -159,6 +159,11 @@ public:
@since v0.99.3
*/
void scheduleUpdateForTarget(Object *pTarget, int nPriority, bool bPaused);
+
+ /** Checks whether a selector for a given taget is scheduled.
+ @since v3.0.0
+ */
+ bool isScheduledForTarget(SEL_SCHEDULE pfnSelector, Object *pTarget);
/** Unschedule a selector for a given target.
If you want to unschedule the "update", use unscheudleUpdateForTarget.
diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp
index 5dd95f6d85..0673a5fee6 100644
--- a/cocos2dx/base_nodes/CCNode.cpp
+++ b/cocos2dx/base_nodes/CCNode.cpp
@@ -1039,6 +1039,11 @@ Scheduler* Node::getScheduler()
return _scheduler;
}
+bool Node::isScheduled(SEL_SCHEDULE selector)
+{
+ return _scheduler->isScheduledForTarget(selector, this);
+}
+
void Node::scheduleUpdate()
{
scheduleUpdateWithPriority(0);
diff --git a/cocos2dx/platform/CCImage.h b/cocos2dx/platform/CCImage.h
index 977aa31279..01aa23b46f 100644
--- a/cocos2dx/platform/CCImage.h
+++ b/cocos2dx/platform/CCImage.h
@@ -45,6 +45,8 @@ NS_CC_BEGIN
class CC_DLL Image : public Object
{
public:
+ friend class TextureCache;
+
Image();
~Image();
@@ -79,15 +81,6 @@ public:
*/
bool initWithImageFile(const char * strPath, EImageFormat imageType = kFmtPng);
- /*
- @brief The same result as with initWithImageFile, but thread safe. It is caused by
- loadImage() in TextureCache.cpp.
- @param fullpath full path of the file.
- @param imageType the type of image, currently only supporting two types.
- @return true if loaded correctly.
- */
- bool initWithImageFileThreadSafe(const char *fullpath, EImageFormat imageType = kFmtPng);
-
/**
@brief Load image from stream buffer.
@@ -189,6 +182,15 @@ private:
// noncopyable
Image(const Image& rImg);
Image & operator=(const Image&);
+
+ /*
+ @brief The same result as with initWithImageFile, but thread safe. It is caused by
+ loadImage() in TextureCache.cpp.
+ @param fullpath full path of the file.
+ @param imageType the type of image, currently only supporting two types.
+ @return true if loaded correctly.
+ */
+ bool initWithImageFileThreadSafe(const char *fullpath, EImageFormat imageType = kFmtPng);
};
// end of platform group
diff --git a/cocos2dx/platform/android/CCFileUtilsAndroid.cpp b/cocos2dx/platform/android/CCFileUtilsAndroid.cpp
index 9197d8e54c..775c1258a7 100644
--- a/cocos2dx/platform/android/CCFileUtilsAndroid.cpp
+++ b/cocos2dx/platform/android/CCFileUtilsAndroid.cpp
@@ -92,13 +92,8 @@ bool FileUtilsAndroid::isFileExist(const std::string& strFilePath)
{
const char* s = strFilePath.c_str();
- if (strFilePath.find(_defaultResRootPath) != 0)
- {
- // Didn't find "assets/" at the beginning of the path
- } else {
- // Found "assets/" at the beginning of the path and we don't want it
- s += strlen("assets/");
- }
+ // Found "assets/" at the beginning of the path and we don't want it
+ if (strFilePath.find(_defaultResRootPath) == 0) s += strlen("assets/");
if (s_assetmanager) {
AAsset* aa = AAssetManager_open(s_assetmanager, s, AASSET_MODE_UNKNOWN);
@@ -160,13 +155,14 @@ unsigned char* FileUtilsAndroid::doGetFileData(const char* pszFileName, const ch
if (fullPath[0] != '/')
{
- if (forAsync)
+
+ string fullPath(pszFileName);
+ // fullPathForFilename is not thread safe.
+ if (! forAsync)
{
- // Nothing to do when using the Android assetmanager APIs???
+ fullPath = fullPathForFilename(pszFileName);
}
- string fullPath = fullPathForFilename(pszFileName);
-
const char* relativepath = fullPath.c_str();
// "assets/" is at the beginning of the path and we don't want it
diff --git a/cocos2dx/platform/ios/CCImage.mm b/cocos2dx/platform/ios/CCImage.mm
index 8cced182d7..cdd3a8a2c4 100644
--- a/cocos2dx/platform/ios/CCImage.mm
+++ b/cocos2dx/platform/ios/CCImage.mm
@@ -428,7 +428,7 @@ bool Image::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFm
bool Image::initWithImageFileThreadSafe(const char *fullpath, EImageFormat imageType)
{
/*
- * FileUtils::fullPathFromRelativePath() is not thread-safe, it use autorelease().
+ * FileUtils::fullPathFromRelativePath() is not thread-safe.
*/
bool bRet = false;
unsigned long nSize = 0;
diff --git a/cocos2dx/proj.linux/.cproject b/cocos2dx/proj.linux/.cproject
index f1c8fc20db..b618cc6921 100755
--- a/cocos2dx/proj.linux/.cproject
+++ b/cocos2dx/proj.linux/.cproject
@@ -37,7 +37,6 @@
-
@@ -60,7 +59,6 @@
-
@@ -87,7 +85,6 @@
-
@@ -170,7 +167,6 @@
-
@@ -192,7 +188,6 @@
-
@@ -218,7 +213,6 @@
-
@@ -302,7 +296,6 @@
-
@@ -325,7 +318,6 @@
-
@@ -352,7 +344,6 @@
-
@@ -435,7 +426,6 @@
-
@@ -458,7 +448,6 @@
-
@@ -485,7 +474,6 @@
-
diff --git a/cocos2dx/support/zip_support/ZipUtils.cpp b/cocos2dx/support/zip_support/ZipUtils.cpp
index 2f1dd4e2ec..1a2cddaa4e 100644
--- a/cocos2dx/support/zip_support/ZipUtils.cpp
+++ b/cocos2dx/support/zip_support/ZipUtils.cpp
@@ -456,14 +456,9 @@ public:
ZipFile::ZipFile(const std::string &zipFile, const std::string &filter)
: _data(new ZipFilePrivate)
-, _dataThread(new ZipFilePrivate)
{
_data->zipFile = unzOpen(zipFile.c_str());
- _dataThread->zipFile = unzOpen(zipFile.c_str());
- if (_data->zipFile && _dataThread->zipFile)
- {
- setFilter(filter);
- }
+ setFilter(filter);
}
ZipFile::~ZipFile()
@@ -472,36 +467,32 @@ ZipFile::~ZipFile()
{
unzClose(_data->zipFile);
}
- if (_dataThread && _dataThread->zipFile)
- {
- unzClose(_dataThread->zipFile);
- }
+
CC_SAFE_DELETE(_data);
- CC_SAFE_DELETE(_dataThread);
}
-bool ZipFile::setFilter(const std::string &filter, ZipFilePrivate *data)
+bool ZipFile::setFilter(const std::string &filter)
{
bool ret = false;
do
{
- CC_BREAK_IF(!data);
- CC_BREAK_IF(!data->zipFile);
+ CC_BREAK_IF(!_data);
+ CC_BREAK_IF(!_data->zipFile);
// clear existing file list
- data->fileList.clear();
+ _data->fileList.clear();
// UNZ_MAXFILENAMEINZIP + 1 - it is done so in unzLocateFile
char szCurrentFileName[UNZ_MAXFILENAMEINZIP + 1];
unz_file_info64 fileInfo;
// go through all files and store position information about the required files
- int err = unzGoToFirstFile64(data->zipFile, &fileInfo,
+ int err = unzGoToFirstFile64(_data->zipFile, &fileInfo,
szCurrentFileName, sizeof(szCurrentFileName) - 1);
while (err == UNZ_OK)
{
unz_file_pos posInfo;
- int posErr = unzGetFilePos(data->zipFile, &posInfo);
+ int posErr = unzGetFilePos(_data->zipFile, &posInfo);
if (posErr == UNZ_OK)
{
std::string currentFileName = szCurrentFileName;
@@ -512,11 +503,11 @@ bool ZipFile::setFilter(const std::string &filter, ZipFilePrivate *data)
ZipEntryInfo entry;
entry.pos = posInfo;
entry.uncompressed_size = (uLong)fileInfo.uncompressed_size;
- data->fileList[currentFileName] = entry;
+ _data->fileList[currentFileName] = entry;
}
}
// next file - also get the information about it
- err = unzGoToNextFile64(data->zipFile, &fileInfo,
+ err = unzGoToNextFile64(_data->zipFile, &fileInfo,
szCurrentFileName, sizeof(szCurrentFileName) - 1);
}
ret = true;
@@ -526,11 +517,6 @@ bool ZipFile::setFilter(const std::string &filter, ZipFilePrivate *data)
return ret;
}
-bool ZipFile::setFilter(const std::string &filter)
-{
- return (setFilter(filter, _data) && setFilter(filter, _dataThread));
-}
-
bool ZipFile::fileExists(const std::string &fileName) const
{
bool ret = false;
@@ -545,11 +531,6 @@ bool ZipFile::fileExists(const std::string &fileName) const
}
unsigned char *ZipFile::getFileData(const std::string &fileName, unsigned long *pSize)
-{
- return getFileData(fileName, pSize, _data);
-}
-
-unsigned char *ZipFile::getFileData(const std::string &fileName, unsigned long *pSize, ZipFilePrivate *data)
{
unsigned char * pBuffer = NULL;
if (pSize)
@@ -559,29 +540,29 @@ unsigned char *ZipFile::getFileData(const std::string &fileName, unsigned long *
do
{
- CC_BREAK_IF(!data->zipFile);
+ CC_BREAK_IF(!_data->zipFile);
CC_BREAK_IF(fileName.empty());
- ZipFilePrivate::FileListContainer::const_iterator it = data->fileList.find(fileName);
- CC_BREAK_IF(it == data->fileList.end());
+ ZipFilePrivate::FileListContainer::const_iterator it = _data->fileList.find(fileName);
+ CC_BREAK_IF(it == _data->fileList.end());
ZipEntryInfo fileInfo = it->second;
- int nRet = unzGoToFilePos(data->zipFile, &fileInfo.pos);
+ int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos);
CC_BREAK_IF(UNZ_OK != nRet);
- nRet = unzOpenCurrentFile(data->zipFile);
+ nRet = unzOpenCurrentFile(_data->zipFile);
CC_BREAK_IF(UNZ_OK != nRet);
pBuffer = new unsigned char[fileInfo.uncompressed_size];
- int CC_UNUSED nSize = unzReadCurrentFile(data->zipFile, pBuffer, fileInfo.uncompressed_size);
+ int CC_UNUSED nSize = unzReadCurrentFile(_data->zipFile, pBuffer, fileInfo.uncompressed_size);
CCAssert(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong");
if (pSize)
{
*pSize = fileInfo.uncompressed_size;
}
- unzCloseCurrentFile(data->zipFile);
+ unzCloseCurrentFile(_data->zipFile);
} while (0);
return pBuffer;
diff --git a/cocos2dx/support/zip_support/ZipUtils.h b/cocos2dx/support/zip_support/ZipUtils.h
index a13660981b..d245760271 100644
--- a/cocos2dx/support/zip_support/ZipUtils.h
+++ b/cocos2dx/support/zip_support/ZipUtils.h
@@ -171,10 +171,6 @@ namespace cocos2d
class ZipFile
{
public:
-#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
- friend class FileUtilsAndroid;
-#endif
-
/**
* Constructor, open zip file and store file list.
*
@@ -220,13 +216,8 @@ namespace cocos2d
unsigned char *getFileData(const std::string &fileName, unsigned long *pSize);
private:
- bool setFilter(const std::string &filer, ZipFilePrivate *data);
- unsigned char *getFileData(const std::string &fileName, unsigned long *pSize, ZipFilePrivate *data);
-
/** Internal data like zip file pointer / file list array and so on */
ZipFilePrivate *_data;
- /** Another data used not in main thread */
- ZipFilePrivate *_dataThread;
};
} // end of namespace cocos2d
#endif // __SUPPORT_ZIPUTILS_H__
diff --git a/extensions/CCBReader/CCBReader.cpp b/extensions/CCBReader/CCBReader.cpp
index 4b87193cfa..9b8f22d884 100644
--- a/extensions/CCBReader/CCBReader.cpp
+++ b/extensions/CCBReader/CCBReader.cpp
@@ -108,6 +108,9 @@ CCBReader::CCBReader(CCBReader * pCCBReader)
this->mOwnerOutletNames = pCCBReader->mOwnerOutletNames;
this->mOwnerOutletNodes = pCCBReader->mOwnerOutletNodes;
this->mOwnerOutletNodes->retain();
+
+ this->mCCBRootPath = pCCBReader->getCCBRootPath();
+
init();
}
diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm
index deb5644850..655132037c 100644
--- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm
+++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm
@@ -77,7 +77,8 @@ static const int CC_EDIT_BOX_PADDING = 5;
textField_.backgroundColor = [UIColor clearColor];
textField_.borderStyle = UITextBorderStyleNone;
textField_.delegate = self;
- textField_.returnKeyType = UIReturnKeyDefault;
+ textField_.hidden = true;
+ textField_.returnKeyType = UIReturnKeyDefault;
[textField_ addTarget:self action:@selector(textChanged) forControlEvents:UIControlEventEditingChanged];
self.editBox = editBox;
diff --git a/plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml b/plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml
index 035a395c49..b0d65245fa 100644
--- a/plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml
+++ b/plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml
@@ -4,16 +4,16 @@
android:versionName="3.2.0"
android:installLocation="preferExternal">
-
-
-
-
-
+
+
+
+
+
-
+
-
+
@@ -22,22 +22,22 @@
-
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamecenter_default.png.REMOVED.git-id b/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamecenter_default.png.REMOVED.git-id
new file mode 100644
index 0000000000..8fee1b7bd7
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamecenter_default.png.REMOVED.git-id
@@ -0,0 +1 @@
+a19769aee91a80e7148db4238e0cb6df4cc5a250
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamezone_default.png.REMOVED.git-id b/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamezone_default.png.REMOVED.git-id
new file mode 100644
index 0000000000..bb1906a48a
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamezone_default.png.REMOVED.git-id
@@ -0,0 +1 @@
+dad94a0903f7d1b167e72bc36e0b9134d49e7b69
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml
index 501669d871..0fde0134a1 100644
--- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml
@@ -115,7 +115,9 @@
android:layout_weight="1"
android:hint="@string/nd3_account_login_hint_account"
android:singleLine="true"
- android:inputType="textEmailAddress">
+ android:nextFocusDown="@+id/nd3_account_login_password"
+ android:inputType="textEmailAddress"
+ android:imeOptions="actionNext">
+ android:singleLine="true"
+ android:imeOptions="actionDone" >
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml
index 2909d63194..eb78473082 100644
--- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml
@@ -119,7 +119,9 @@
android:layout_weight="1"
android:hint="@string/nd3_account_login_hint_account"
android:singleLine="true"
- android:inputType="textEmailAddress">
+ android:nextFocusDown="@+id/nd3_account_login_password"
+ android:inputType="textEmailAddress"
+ android:imeOptions="actionNext">
+ android:singleLine="true"
+ android:imeOptions="actionDone">
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml
index 8b9b690d86..cd76a0ba13 100644
--- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml
@@ -113,6 +113,7 @@
android:maxLength="70"
android:hint="@string/nd3_account_register_hint_account"
style="@style/nd3_option_edittext_style"
+ android:imeOptions="actionNext"
>
@@ -152,6 +153,7 @@
android:maxLength="12"
android:hint="@string/nd3_account_register_hint_password"
style="@style/nd3_option_edittext_style"
+ android:imeOptions="actionDone"
>
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml
index e575e847e3..6ae7992eb8 100644
--- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml
@@ -109,6 +109,7 @@
android:maxLength="70"
android:hint="@string/nd3_account_register_hint_account"
style="@style/nd3_option_edittext_style"
+ android:imeOptions="actionNext"
>
@@ -188,6 +189,7 @@
android:maxLength="12"
android:hint="@string/nd3_account_register_hint_password"
style="@style/nd3_option_edittext_style"
+ android:imeOptions="actionDone"
>
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml
index 2303eb7cc3..d3746c3d26 100644
--- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml
@@ -4,16 +4,16 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content">
+ android:id="@+id/nd3_empty_listview_txt"
+ android:text="@string/nd3_list_item_loading"
+ android:textColor="@color/nd3_black"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/nd3_margin_size"/>
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/nd3_horizontal_line"
+ android:layout_below="@id/nd3_empty_listview_txt"/>
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq.xml
new file mode 100644
index 0000000000..b7a89fe5c5
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq_list.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq_list.xml
new file mode 100644
index 0000000000..4595839d15
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq_list.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_fb.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_fb.xml
new file mode 100644
index 0000000000..a7937815c5
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_fb.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu.xml
new file mode 100644
index 0000000000..ea3a66a77d
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu_item.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu_item.xml
new file mode 100644
index 0000000000..8c9d776e54
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu_item.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_item.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_item.xml
new file mode 100644
index 0000000000..25eef4e5da
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_item.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_list.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_list.xml
new file mode 100644
index 0000000000..1a519d194c
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_list.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_landscape.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_landscape.xml
new file mode 100644
index 0000000000..05869f7d65
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_landscape.xml
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_portrait.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_portrait.xml
new file mode 100644
index 0000000000..68f45fca4c
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_portrait.xml
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply.xml
new file mode 100644
index 0000000000..0262e51c3b
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_bottom.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_bottom.xml
new file mode 100644
index 0000000000..2142863960
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_bottom.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_left.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_left.xml
new file mode 100644
index 0000000000..9770daf0fc
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_left.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_right.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_right.xml
new file mode 100644
index 0000000000..2f7b926dd1
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_right.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_custom_toast.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_custom_toast.xml
new file mode 100644
index 0000000000..64395d246f
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_custom_toast.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_exitpage.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_exitpage.xml
new file mode 100644
index 0000000000..318e7d2189
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_exitpage.xml
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_pausepage.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_pausepage.xml
new file mode 100644
index 0000000000..55f482b97e
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_pausepage.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_1.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_1.xml
new file mode 100644
index 0000000000..8106250ba2
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_1.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_2.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_2.xml
new file mode 100644
index 0000000000..22778ad83a
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_2.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_3.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_3.xml
new file mode 100644
index 0000000000..5340c9e815
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_3.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_listitem.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_listitem.xml
index 58d260b27b..343f9bee46 100644
--- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_listitem.xml
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_listitem.xml
@@ -38,9 +38,9 @@
android:layout_height="wrap_content"
android:id="@+id/nd_app_desc"
android:textSize="14sp"
- android:textColor="#f43f00"
- android:singleLine="true"
+ android:textColor="#f43f00"
android:ellipsize="end"
+ android:maxLines="2"
/>
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_misc.xml b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_misc.xml
index ca913395c2..227b5c79c3 100644
--- a/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_misc.xml
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_misc.xml
@@ -47,6 +47,7 @@
#FFd8d8df
#FF9dc4ed
+ #ffffbb33
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_strings.xml b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_strings.xml
index f1a208c032..16c133140d 100644
--- a/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_strings.xml
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_strings.xml
@@ -779,10 +779,10 @@
- 推广墙
+ 精品游戏推荐
立即下载
暂时没有待推广的应用
- 获取推广墙数据失败
+ 获取精品游戏推荐数据失败
正在请求下载地址……
获取下载地址失败
%1$s 下载失败
@@ -790,4 +790,40 @@
开始下载 %1$s
%1$s 下载完成
+
+
+ 意见反馈
+ 客服答复
+ 新回复
+ 我要反馈
+ 请选择问题类型
+ *
+ 您遇到的问题
+ 输入要求最少10字
+ 500
+ 您的联系电话
+ 客服电话:
+ 服务时间:%1$s
+ 您对我的服务是否满意?
+ 麻烦亲抽一点时间帮我打一下分哦
+ 满意
+ 问题未解决
+ 态度不满意
+ 客服答复
+ 请输入您的反馈信息
+ 亲,上面常见问题,可能有您的答案哦
+ 请输入您的联系电话
+ 常见问题
+ 我的反馈
+ 处理中
+ 未评价
+ 已评价
+ 谢谢亲的肯定!我一定再接再厉为您提供更优质的服务
+ 您可以继续说明问题
+ 谢谢亲的反馈!我一定尽力改正,期待下次给我好评噢~
+ 谢谢您的回复,我们将在3个工作日之内给你回复,请注意查询回复结果。
+ 暂时没有信息
+ 联系电话格式不正确
+ 您有新的回复
+ 详情
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_colors.xml b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_colors.xml
new file mode 100644
index 0000000000..06255eee8a
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_colors.xml
@@ -0,0 +1,11 @@
+
+
+ #FFFFFF
+
+ #90000000
+
+ #00000000
+
+
+ #0C64AB
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_misc.xml b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_misc.xml
new file mode 100644
index 0000000000..47bfe20a69
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_misc.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_strings.xml b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_strings.xml
new file mode 100644
index 0000000000..9045208d7b
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_strings.xml
@@ -0,0 +1,16 @@
+
+
+ 继续游戏?
+ 点击进入游戏专区
+
+ 最近在玩的其他91游戏
+ 退出%1$s?
+ 接着玩其他精品游戏吗?
+ 不玩啦,退出
+ 退出
+
+ 新版本正在下载,请到桌面的消息通知栏查看下载进度。
+
+ 请先安装游戏中心
+
+
diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_styles.xml b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_styles.xml
new file mode 100644
index 0000000000..0f12e256dd
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_styles.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/sdk/NdComPlatform.jar.REMOVED.git-id b/plugin/plugins/nd91/proj.android/sdk/NdComPlatform.jar.REMOVED.git-id
index ef7be55acd..45878e3ca4 100644
--- a/plugin/plugins/nd91/proj.android/sdk/NdComPlatform.jar.REMOVED.git-id
+++ b/plugin/plugins/nd91/proj.android/sdk/NdComPlatform.jar.REMOVED.git-id
@@ -1 +1 @@
-5c8912fd6b26ff821f7f36d90c210af9c3041f87
\ No newline at end of file
+921633367143def1d9627cc893bf0a5513b00bb8
\ No newline at end of file
diff --git a/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/IAPNd91.java b/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/IAPNd91.java
index c60c1e4348..ee68cb4d65 100644
--- a/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/IAPNd91.java
+++ b/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/IAPNd91.java
@@ -29,13 +29,10 @@ import java.util.UUID;
import com.nd.commplatform.NdCommplatform;
import com.nd.commplatform.NdErrorCode;
import com.nd.commplatform.NdMiscCallbackListener;
-import com.nd.commplatform.entry.NdAppInfo;
import com.nd.commplatform.entry.NdBuyInfo;
import android.app.Activity;
import android.content.Context;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
import android.util.Log;
public class IAPNd91 implements InterfaceIAP {
@@ -70,27 +67,12 @@ public class IAPNd91 implements InterfaceIAP {
@Override
public void run() {
try {
- String appId = curCPInfo.get("Nd91AppId");
- String appKey = curCPInfo.get("Nd91AppKey");
- int id = Integer.parseInt(appId);
+ String appId = curCPInfo.get("Nd91AppId");
+ String appKey = curCPInfo.get("Nd91AppKey");
+ int id = Integer.parseInt(appId);
- NdAppInfo appInfo = new NdAppInfo();
- appInfo.setCtx(mContext);
-
- appInfo.setAppId(id);
- appInfo.setAppKey(appKey);
-
- NdCommplatform.getInstance().initial(0, appInfo);
-
- String orientation = curCPInfo.get("Nd91Orientation");
- if (null != orientation) {
- if (orientation.equals("landscape")) {
- NdCommplatform.getInstance().ndSetScreenOrientation(NdCommplatform.SCREEN_ORIENTATION_LANDSCAPE);
- } else
- if (orientation.equals("auto")) {
- NdCommplatform.getInstance().ndSetScreenOrientation(NdCommplatform.SCREEN_ORIENTATION_AUTO);
- }
- }
+ String orientation = curCPInfo.get("Nd91Orientation");
+ Nd91Wrapper.initSDK(mContext, id, appKey, orientation);
} catch (Exception e) {
LogE("Developer info is wrong!", e);
}
@@ -101,7 +83,7 @@ public class IAPNd91 implements InterfaceIAP {
@Override
public void payForProduct(Hashtable info) {
LogD("payForProduct invoked " + info.toString());
- if (! networkReachable()) {
+ if (! Nd91Wrapper.networkReachable(mContext)) {
payResult(IAPWrapper.PAYRESULT_FAIL, "网络不可用");
return;
}
@@ -115,7 +97,7 @@ public class IAPNd91 implements InterfaceIAP {
PluginWrapper.runOnMainThread(new Runnable() {
@Override
public void run() {
- if (! isLogin()) {
+ if (! Nd91Wrapper.isLogined()) {
userLogin();
} else {
addPayment(curProductInfo);
@@ -131,20 +113,7 @@ public class IAPNd91 implements InterfaceIAP {
@Override
public String getSDKVersion() {
- return "Unknown version";
- }
-
- private boolean networkReachable() {
- boolean bRet = false;
- try {
- ConnectivityManager conn = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
- NetworkInfo netInfo = conn.getActiveNetworkInfo();
- bRet = (null == netInfo) ? false : netInfo.isAvailable();
- } catch (Exception e) {
- LogE("Fail to check network status", e);
- }
- LogD("NetWork reachable : " + bRet);
- return bRet;
+ return Nd91Wrapper.getSDKVersion();
}
private static void payResult(int ret, String msg) {
@@ -159,16 +128,10 @@ public class IAPNd91 implements InterfaceIAP {
return text;
}
- private static boolean isLogin() {
- boolean bRet = NdCommplatform.getInstance().isLogined();
- LogD("isLogin : " + bRet);
- return bRet;
- }
-
private static void userLogin() {
LogD("User begin login");
try {
- NdCommplatform.getInstance().ndLogin(mContext, new NdMiscCallbackListener.OnLoginProcessListener() {
+ Nd91Wrapper.userLogin(mContext, new NdMiscCallbackListener.OnLoginProcessListener() {
@Override
public void finishLoginProcess(int code) {
if (code == NdErrorCode.ND_COM_PLATFORM_SUCCESS) {
@@ -251,6 +214,6 @@ public class IAPNd91 implements InterfaceIAP {
@Override
public String getPluginVersion() {
- return "0.2.0";
+ return Nd91Wrapper.getPluginVersion();
}
}
diff --git a/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/Nd91Wrapper.java b/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/Nd91Wrapper.java
new file mode 100644
index 0000000000..8afcb1a3bc
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/Nd91Wrapper.java
@@ -0,0 +1,92 @@
+/****************************************************************************
+Copyright (c) 2012-2013 cocos2d-x.org
+
+http://www.cocos2d-x.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+****************************************************************************/
+package org.cocos2dx.plugin;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+
+import com.nd.commplatform.NdCommplatform;
+import com.nd.commplatform.NdMiscCallbackListener.OnLoginProcessListener;
+import com.nd.commplatform.entry.NdAppInfo;
+
+public class Nd91Wrapper {
+
+ private static boolean isInited = false;
+
+ public static void initSDK(Context ctx, int appId, String appKey, String orientation) {
+ if (isInited) {
+ return;
+ }
+
+ NdAppInfo appInfo = new NdAppInfo();
+ appInfo.setCtx(ctx);
+
+ appInfo.setAppId(appId);
+ appInfo.setAppKey(appKey);
+
+ NdCommplatform.getInstance().initial(0, appInfo);
+
+ if (null != orientation) {
+ if (orientation.equals("landscape")) {
+ NdCommplatform.getInstance().ndSetScreenOrientation(NdCommplatform.SCREEN_ORIENTATION_LANDSCAPE);
+ } else
+ if (orientation.equals("auto")) {
+ NdCommplatform.getInstance().ndSetScreenOrientation(NdCommplatform.SCREEN_ORIENTATION_AUTO);
+ }
+ }
+
+ isInited = true;
+ }
+
+ public static boolean isLogined() {
+ boolean bRet = NdCommplatform.getInstance().isLogined();
+ return bRet;
+ }
+
+ public static void userLogin(Context ctx, OnLoginProcessListener listener) {
+ NdCommplatform.getInstance().ndLogin(ctx, listener);
+ }
+
+ public static String getSDKVersion() {
+ return "20130607_3.2.5.1";
+ }
+
+ public static String getPluginVersion() {
+ return "0.2.0";
+ }
+
+ public static boolean networkReachable(Context ctx) {
+ boolean bRet = false;
+ try {
+ ConnectivityManager conn = (ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo netInfo = conn.getActiveNetworkInfo();
+ bRet = (null == netInfo) ? false : netInfo.isAvailable();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return bRet;
+ }
+}
diff --git a/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/UserNd91.java b/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/UserNd91.java
new file mode 100644
index 0000000000..2a460d225d
--- /dev/null
+++ b/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/UserNd91.java
@@ -0,0 +1,165 @@
+/****************************************************************************
+Copyright (c) 2012-2013 cocos2d-x.org
+
+http://www.cocos2d-x.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+****************************************************************************/
+package org.cocos2dx.plugin;
+
+import java.util.Hashtable;
+import com.nd.commplatform.NdCommplatform;
+import com.nd.commplatform.NdErrorCode;
+import com.nd.commplatform.NdMiscCallbackListener;
+import com.nd.commplatform.NdMiscCallbackListener.OnSwitchAccountListener;
+
+import android.app.Activity;
+import android.content.Context;
+import android.util.Log;
+
+public class UserNd91 implements InterfaceUser {
+
+ private static final String LOG_TAG = "UserNd91";
+ private static Activity mContext = null;
+ private static UserNd91 mNd91 = null;
+ private static boolean bDebug = false;
+
+ protected static void LogE(String msg, Exception e) {
+ Log.e(LOG_TAG, msg, e);
+ e.printStackTrace();
+ }
+
+ protected static void LogD(String msg) {
+ if (bDebug) {
+ Log.d(LOG_TAG, msg);
+ }
+ }
+
+ public UserNd91(Context context) {
+ mContext = (Activity) context;
+ mNd91 = this;
+ }
+
+ @Override
+ public void configDeveloperInfo(Hashtable cpInfo) {
+ LogD("initDeveloperInfo invoked " + cpInfo.toString());
+ final Hashtable curCPInfo = cpInfo;
+ PluginWrapper.runOnMainThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ String appId = curCPInfo.get("Nd91AppId");
+ String appKey = curCPInfo.get("Nd91AppKey");
+ int id = Integer.parseInt(appId);
+
+ String orientation = curCPInfo.get("Nd91Orientation");
+ Nd91Wrapper.initSDK(mContext, id, appKey, orientation);
+
+ NdCommplatform.getInstance().setOnSwitchAccountListener(new OnSwitchAccountListener() {
+ @Override
+ public void onSwitchAccount(int arg0) {
+ switch (arg0) {
+ case NdErrorCode.ND_COM_PLATFORM_ERROR_USER_RESTART:
+ break;
+ case NdErrorCode.ND_COM_PLATFORM_ERROR_USER_SWITCH_ACCOUNT:
+ break;
+ case NdErrorCode.ND_COM_PLATFORM_SUCCESS:
+ UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_SUCCEED, "User login succeed");
+ break;
+ case NdErrorCode.ND_COM_PLATFORM_ERROR_CANCEL:
+ break;
+ default:
+ UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGOUT_SUCCEED, "User logout");
+ break;
+ }
+ }
+ });
+ } catch (Exception e) {
+ LogE("Developer info is wrong!", e);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void setDebugMode(boolean debug) {
+ bDebug = debug;
+ }
+
+ @Override
+ public String getSDKVersion() {
+ return Nd91Wrapper.getSDKVersion();
+ }
+
+ @Override
+ public String getPluginVersion() {
+ return Nd91Wrapper.getPluginVersion();
+ }
+
+ @Override
+ public void login() {
+ if (isLogined()) {
+ UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_SUCCEED, "Already logined!");
+ return;
+ }
+
+ PluginWrapper.runOnMainThread(new Runnable() {
+ @Override
+ public void run() {
+ Nd91Wrapper.userLogin(mContext, new NdMiscCallbackListener.OnLoginProcessListener() {
+ @Override
+ public void finishLoginProcess(int code) {
+ if (code == NdErrorCode.ND_COM_PLATFORM_SUCCESS) {
+ UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_SUCCEED, "User login succeed");
+ } else if (code == NdErrorCode.ND_COM_PLATFORM_ERROR_CANCEL) {
+ UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_FAILED, "User canceled");
+ } else {
+ UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_FAILED, "User login failed");
+ }
+ }
+ });
+ }
+ });
+ }
+
+ @Override
+ public void logout() {
+ PluginWrapper.runOnMainThread(new Runnable() {
+ @Override
+ public void run() {
+ NdCommplatform.getInstance().ndLogout(NdCommplatform.LOGOUT_TO_NON_RESET_AUTO_LOGIN_CONFIG, mContext);
+ UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGOUT_SUCCEED, "User logout");
+ }
+ });
+ }
+
+ @Override
+ public boolean isLogined() {
+ return Nd91Wrapper.isLogined();
+ }
+
+ @Override
+ public String getSessionID() {
+ String strRet = "";
+ if (isLogined()) {
+ strRet = NdCommplatform.getInstance().getSessionId();
+ }
+ return strRet;
+ }
+}
diff --git a/plugin/samples/HelloUser/Classes/HelloWorldScene.cpp b/plugin/samples/HelloUser/Classes/HelloWorldScene.cpp
index f80939e7cb..4d6326ff8f 100644
--- a/plugin/samples/HelloUser/Classes/HelloWorldScene.cpp
+++ b/plugin/samples/HelloUser/Classes/HelloWorldScene.cpp
@@ -5,6 +5,7 @@ USING_NS_CC;
const std::string s_aTestCases[] = {
"QH360",
+ "ND91",
};
Scene* HelloWorld::scene()
diff --git a/plugin/samples/HelloUser/Classes/MyUserManager.cpp b/plugin/samples/HelloUser/Classes/MyUserManager.cpp
index 9d8db8d2ad..d4c12b583c 100644
--- a/plugin/samples/HelloUser/Classes/MyUserManager.cpp
+++ b/plugin/samples/HelloUser/Classes/MyUserManager.cpp
@@ -33,6 +33,7 @@ MyUserManager* MyUserManager::s_pManager = NULL;
MyUserManager::MyUserManager()
: _retListener(NULL)
, _qh360(NULL)
+, _nd91(NULL)
{
}
@@ -81,6 +82,25 @@ void MyUserManager::loadPlugin()
_qh360->setActionListener(_retListener);
}
}
+
+ {
+ _nd91 = dynamic_cast(PluginManager::getInstance()->loadPlugin("UserNd91"));
+ if (NULL != _nd91)
+ {
+ TUserDeveloperInfo pNdInfo;
+ pNdInfo["Nd91AppId"] = "100010";
+ pNdInfo["Nd91AppKey"] = "C28454605B9312157C2F76F27A9BCA2349434E546A6E9C75";
+ pNdInfo["Nd91Orientation"] = "landscape";
+ if (pNdInfo.empty()) {
+ char msg[256] = { 0 };
+ sprintf(msg, "Developer info is empty. PLZ fill your Nd91 info in %s(nearby line %d)", __FILE__, __LINE__);
+ MessageBox(msg, "Nd91 Warning");
+ }
+ _nd91->configDeveloperInfo(pNdInfo);
+ _nd91->setDebugMode(true);
+ _nd91->setActionListener(_retListener);
+ }
+ }
}
void MyUserManager::unloadPlugin()
@@ -90,6 +110,12 @@ void MyUserManager::unloadPlugin()
PluginManager::getInstance()->unloadPlugin("UserQH360");
_qh360 = NULL;
}
+
+ if (_nd91)
+ {
+ PluginManager::getInstance()->unloadPlugin("UserNd91");
+ _nd91 = NULL;
+ }
}
void MyUserManager::loginByMode(MyUserMode mode)
@@ -100,6 +126,9 @@ void MyUserManager::loginByMode(MyUserMode mode)
case kQH360:
pUser = _qh360;
break;
+ case kND91:
+ pUser = _nd91;
+ break;
default:
break;
}
@@ -117,6 +146,9 @@ void MyUserManager::logoutByMode(MyUserMode mode)
case kQH360:
pUser = _qh360;
break;
+ case kND91:
+ pUser = _nd91;
+ break;
default:
break;
}
@@ -146,4 +178,7 @@ void MyUserActionResult::onActionResult(ProtocolUser* pPlugin, UserActionResultC
// get session ID
std::string sessionID = pPlugin->getSessionID();
CCLog("User Session ID of plugin %s is : %s", pPlugin->getPluginName(), sessionID.c_str());
+
+ std::string strStatus = pPlugin->isLogined() ? "online" : "offline";
+ CCLog("User status of plugin %s is : %s", pPlugin->getPluginName(), strStatus.c_str());
}
diff --git a/plugin/samples/HelloUser/Classes/MyUserManager.h b/plugin/samples/HelloUser/Classes/MyUserManager.h
index 90eb5bc95f..05ec6f2143 100755
--- a/plugin/samples/HelloUser/Classes/MyUserManager.h
+++ b/plugin/samples/HelloUser/Classes/MyUserManager.h
@@ -41,6 +41,7 @@ public:
typedef enum {
kNoneMode = 0,
kQH360,
+ kND91,
} MyUserMode;
void unloadPlugin();
@@ -55,6 +56,7 @@ private:
static MyUserManager* s_pManager;
cocos2d::plugin::ProtocolUser* _qh360;
+ cocos2d::plugin::ProtocolUser* _nd91;
MyUserActionResult* _retListener;
};
diff --git a/plugin/samples/HelloUser/proj.android/.classpath b/plugin/samples/HelloUser/proj.android/.classpath
index 069475ad2b..6cffa0e876 100644
--- a/plugin/samples/HelloUser/proj.android/.classpath
+++ b/plugin/samples/HelloUser/proj.android/.classpath
@@ -7,5 +7,7 @@
+
+
diff --git a/plugin/samples/HelloUser/proj.android/project.properties b/plugin/samples/HelloUser/proj.android/project.properties
index b93e70be46..5c8ad64c04 100644
--- a/plugin/samples/HelloUser/proj.android/project.properties
+++ b/plugin/samples/HelloUser/proj.android/project.properties
@@ -11,3 +11,4 @@
target=android-17
android.library.reference.1=../../../../cocos2dx/platform/android/java
+android.library.reference.2=../../../publish/plugins/nd91/android/DependProject
diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id
index 7da3843a7a..7097c76425 100644
--- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id
+++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id
@@ -1 +1 @@
-253f988944cc6a6bcf53f404c88bed043d4b9610
\ No newline at end of file
+cc6d51ba9715ed20f35723c4a40d03a4f5d95d0f
\ No newline at end of file
diff --git a/tools/tolua++/CCImage.pkg b/tools/tolua++/CCImage.pkg
index 7bae5db7be..cbd0c65b42 100644
--- a/tools/tolua++/CCImage.pkg
+++ b/tools/tolua++/CCImage.pkg
@@ -28,7 +28,6 @@ class CCImage : public CCObject
bool initWithImageFile(const char * strPath, EImageFormat imageType = kFmtPng);
- bool initWithImageFileThreadSafe(const char *fullpath, EImageFormat imageType = kFmtPng);
bool initWithImageData(void * pData,
int nDataLen,
EImageFormat eFmt = kFmtUnKnown,