Merge pull request #14779 from xiaofeng11/v3.10

Bug fix & update
This commit is contained in:
pandamicro 2015-12-23 12:35:52 +08:00
commit 45d1d655cc
3 changed files with 9 additions and 9 deletions

View File

@ -104,6 +104,14 @@ void MenuItem::activate()
{
_callback(this);
}
#if CC_ENABLE_SCRIPT_BINDING
if (kScriptTypeLua == _scriptType)
{
BasicScriptData data(this);
ScriptEvent scriptEvent(kMenuClickedEvent, &data);
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&scriptEvent);
}
#endif
}
}

View File

@ -22,9 +22,7 @@ enum
TouchesTests::TouchesTests()
{
ADD_TEST_CASE(PongScene);
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0 // Use 9.0 or higher SDK to compile
ADD_TEST_CASE(ForceTouchTest);
#endif
}
//------------------------------------------------------------------
//
@ -115,8 +113,6 @@ void PongLayer::doStep(float delta)
resetAndScoreBallForPlayer( kHighPlayer );
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0 // Use 9.0 or higher SDK to compile
const char * _Info_Formatter = "Current force value : %0.02f, maximum possible force : %0.02f";
char formatBuffer[256] = {0, };
@ -146,7 +142,7 @@ std::string ForceTouchTest::title() const
std::string ForceTouchTest::subtitle() const
{
return std::string("Touch with force to see info label changes");
return std::string("Touch with force to see info label changes\nOnly work on iPhone6s / iPhone6s Plus");
}
void ForceTouchTest::onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event)
@ -169,5 +165,3 @@ void ForceTouchTest::onTouchesEnded(const std::vector<cocos2d::Touch*>& touches,
sprintf(formatBuffer, _Info_Formatter, 0.0f, 0.0f);
_infoLabel->setString(std::string(formatBuffer));
}
#endif

View File

@ -31,7 +31,6 @@ public:
void doStep(float delta);
};
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0 // Use 9.0 or higher SDK to compile
class ForceTouchTest : public TestCase
{
public:
@ -50,6 +49,5 @@ protected:
cocos2d::Label * _infoLabel;
};
#endif
#endif