CCRichLabelTTF::~CCRichLabelTTF() { CC_SAFE_DELETE(m_pFontName); // release callfunc CCMenu* menu = (CCMenu*)getChildByTag(TAG_MENU); if(menu) { CCObject* obj; const auto& children = menu->getChildren(); for (const auto& child : children) { CCNode* item = (CCNode*)child; CCObject* data = (CCObject*)item->getUserData(); CC_SAFE_RELEASE(data); } // CCARRAY_FOREACH(menu->getChildren(), obj) { // CCNode* item = (CCNode*)obj; // CCObject* data = (CCObject*)item->getUserData(); // CC_SAFE_RELEASE(data); // } } // release other m_stateListener->release(); }
void GameRankLayer::btnJoinCallback(CCObject* pSender) { SoundPlayer::play(SNDI_CLICK); CCNode* sender = dynamic_cast<CCNode*>(pSender); if(sender) { PokerPlayerRankInfo* ptrInfo = static_cast<PokerPlayerRankInfo*>(sender->getUserData()); if(ptrInfo) { TableLayer* tableLayer = (TableLayer*)getParent(); tableLayer->sendGotoTableCmd(ptrInfo->account_id); } } }
//失败回调 void GameStage::failCallBackFun(CCObject* data) { this->updateCombo(); this->updateScore(); this->updateHighScore(); this->layoutScoreNum(this->highScoreList, 2); //this->newHighScore->stopAllActions(); CCNode* nNode = (CCNode*) data; CCString* str = (CCString*)nNode->getUserData(); CCString* newRecordStr = new CCString(NEW_RECORD); //判断2个字符串相等 if(str->isEqual(newRecordStr)) { Cookie::getShareUserData()->setIntegerForKey("highScore", this->pukaManCore->highScore); Cookie::getShareUserData()->flush(); this->newHighScore->stopAllActions(); this->newHighScore->setScale(0.0f); CCActionInterval* scaleTo1 = CCScaleTo::create(0.5f, 1.0f); CCDelayTime* delayTime = CCDelayTime::create(1.0f); CCActionInterval* scaleTo2 = CCScaleTo::create(0.5f, 0.0f); CCSequence* sequence = CCSequence::create(scaleTo1, delayTime, scaleTo2, NULL); this->newHighScore->runAction(sequence); } }