Merge pull request #2323 from natural-law/master

fixed #1471: Optimize the sample code.
This commit is contained in:
James Chen 2013-04-08 03:09:14 -07:00
commit 33213e5177
3 changed files with 102 additions and 25 deletions

4
.gitignore vendored
View File

@ -87,7 +87,3 @@ tools/tojs/user.cfg
tools/tojs/userconf.ini
# ... userconf.ini generated if running from tools/jenkins_scripts/mac/android/
tools/jenkins_scripts/mac/android/userconf.ini
# Ignore files built by plugin
plugin/publish/*
plugin/tools/toolsForPublish/environment.sh

97
plugin/.gitignore vendored Normal file
View File

@ -0,0 +1,97 @@
# Ignore thumbnails created by windows
Thumbs.db
# Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.aps
*.vcproj.*.user
*.vspscc
*_i.c
*.i
*.icf
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
[Bb]in
[Dd]ebug*/
*.sbr
*.sdf
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
ipch/
*.opensdf
# Ignore files build by ndk and eclipse
libs/
bin/
obj/
gen/
assets/
local.properties
# Ignore files built by NaCl
samples/Cpp/HelloCpp/proj.nacl/Resources/
samples/Cpp/TestCpp/proj.nacl/Resources/
samples/Cpp/TestCpp/proj.nacl/out/
samples/Cpp/SimpleGame/proj.nacl/Resources/
samples/Lua/HelloLua/proj.nacl/Resources/
samples/Lua/TestLua/proj.nacl/Resources/
# Ignore python compiled files
*.pyc
# Ignore files build by airplay and marmalade
build_*_xcode/
build_*_vc10/
# Ignore files build by xcode
*.mode*v*
*.pbxuser
*.xcbkptlist
*.xcscheme
*.xcworkspacedata
*.xcuserstate
xcschememanagement.plist
build/
.DS_Store
._.*
xcuserdata/
DerivedData/
# Ignore files built by bada
.Simulator-Debug/
.Target-Debug/
.Target-Release/
# Ignore files built by blackberry
Simulator/
Device-Debug/
Device-Release/
# Ignore vim swaps
*.swp
# Ignore config files in javascript bindings generator
tools/tojs/user.cfg
# ... userconf.ini generated if running from tools/tojs
tools/tojs/userconf.ini
# ... userconf.ini generated if running from tools/jenkins_scripts/mac/android/
tools/jenkins_scripts/mac/android/userconf.ini
# Ignore files built by plugin
publish/*
tools/toolsForPublish/environment.sh
.settings
plugins/china*
plugins/punchbox*
samplesPrivate*

View File

@ -112,27 +112,11 @@ void HelloWorld::eventMenuCallback(CCObject* pSender)
{
CCMenuItemLabel* pMenuItem = (CCMenuItemLabel*)pSender;
TProductInfo pInfo;
MyPurchase::MyPayMode mode = MyPurchase::eNoneMode;
switch (pMenuItem->getTag())
{
case TAG_PAY_BY_ALIPAY:
pInfo["productName"] = "100金币";
pInfo["productPrice"] = "0.1";
pInfo["productDesc"] = "100个金灿灿的游戏币哦";
mode = MyPurchase::eAlipay;
break;
case TAG_PAY_BY_ND91:
pInfo["productName"] = "100金币";
pInfo["productPrice"] = "0.01";
pInfo["productDesc"] = "100个金灿灿的游戏币哦";
pInfo["Nd91ProductId"] = "685994";
mode = MyPurchase::eND91;
break;
default:
break;
}
MyPurchase::MyPayMode mode = (MyPurchase::MyPayMode) (pMenuItem->getTag() - TAG_PAY_BY_ALIPAY + 1);
pInfo["productName"] = "100金币";
pInfo["productPrice"] = "0.01";
pInfo["productDesc"] = "100个金灿灿的游戏币哦";
pInfo["Nd91ProductId"] = "685994";
MyPurchase::sharedPurchase()->payByMode(pInfo, mode);
}