Beispiel #1
0
void CQuickProduct::onUserStone(CCObject* pSender)
{
	CButton *btn = (CButton*)pSender;
	CPopTip *tip = (CPopTip*)btn->getParent()->getParent();
	
	CCScaleTo *smal = CCScaleTo::create(0.2f,0.0f);
	CCSequence *seque = CCSequence::createWithTwoActions(smal, CCCallFuncN::create(this,callfuncN_selector(CQuickProduct::removeTip)));
	tip->runAction(seque);

	if (btn->getTag()==1)
	{
		/*tip->removeFromParent();*/
// 		CPopTip *pop = CPopTip::create("tips/bg.png");
// 		pop->addBeforeImage("tips/blackbg.png",0,20);
// 		pop->addButton("public/btn_yellow_befor.png","public/btn_yellow_after.png",nullptr,3,1);
// 		pop->buttonAddImage("public/font_queiding.png",3);
// 		pop->addTextRichTip("沒有足夠的鑽石",ccWHITE,"Arail",18.0f);
// 		/*pop->addRichImage("mainCity/icon_11.png");*/
// 		pop->reloadTextRich(ccp(VCENTER.x,VCENTER.y+50));
// 
// 		pop->setBottomOffset(-10);
// 		pop->setTouchEnabled(true);
// 		pop->setTouchPriority(-100);
// 		pop->setButtonLisener(this,ccw_click_selector(CQuickProduct::onUserStone));
// 		this->addChild(pop,10,2);
// 		pop->runScaleAction();
//		ShowPopTextTip(GETLANGSTR(263));
	}	
	LayerManager::instance()->pop();
	LayerManager::instance()->pop();
}
Beispiel #2
0
void CDownloadPackage::showHelpTipsClick( CCObject *pSender )
{
	//点击取消重启,点击确定下载新的apk
	CButton *btn = (CButton*)pSender;
	if (btn->getTag()==PopTipConfirm)
	{
		//确定
		runAction(CCCallFunc::create(this, callfunc_selector(CDownloadPackage::callbackForRestart)));
	}
}
Beispiel #3
0
void CCommandLayer::onGarrsion(CCObject* pSender)
{
	CButton *btn = (CButton*)pSender;
	m_selectHero = btn->getTag();
	vector<CHero> &heroList = m_city.heroList;
	if (heroList.size()>=btn->getTag())
	{
		CHero hero = heroList[btn->getTag()-1];
		CDefendWuJiang *layer =CDefendWuJiang::create();
		layer->setCityId(m_city.id,m_city.cityId);
		layer->setReplaceId(hero.id);
		LayerManager::instance()->push(layer);
		CPlayerControl::getInstance().sendHeroList(3);
	}
	else
	{
		CDefendWuJiang *layer =CDefendWuJiang::create();
		layer->setCityId(m_city.id,m_city.cityId);
		layer->setReplaceId(0);
		LayerManager::instance()->push(layer);
		CPlayerControl::getInstance().sendHeroList(3);
	}
}
Beispiel #4
0
void BackLayer::onExitGame(CCObject* pSender)
{
	CButton *btn = (CButton*)pSender;
	if (btn->getTag()==PopTipConfirm)
	{
		CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
		CCDirector::sharedDirector()->end();
	}                                    
	else
	{
		LayerManager::instance()->pop();
		m_backTip->removeFromParent();
		m_backTip = nullptr;
	}
}
Beispiel #5
0
void BackLayer::onReturnLogin(CCObject* pSender)
{
	CButton *btn = (CButton*)pSender;
	if (btn->getTag()==PopTipConfirm)
	{
		//销毁多余数据,确保不影响切换账号重新登录
		DataCenter::destroy();
		CTaskControl::getInstance()->resetGameTips();
		CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
		CNetClient::getShareInstance()->setIsCloseConn(true);
		CCDirector::sharedDirector()->replaceScene(GETSCENE(LoginScene));
	}                                    
	else
	{
		LayerManager::instance()->pop();
		m_backTip->removeFromParent();
		m_backTip = nullptr;
	}
}
Beispiel #6
0
void LoginLayerUC::onClickDownloadPackage( CCObject* pSender )
{
	CButton* pBtn = (CButton*)pSender;

	if(pBtn->getTag()==PopTipConfirm)
	{
		CDownloadPackage* pLayer = CDownloadPackage::create();
		pLayer->setDownloadPacakgeDelegate(this);
		CCDirector::sharedDirector()->getRunningScene()->addChild(pLayer, 1147);
		pLayer->downLoadPackage();
	}
	else
	{
		//不更新,重启游戏,重复引导
		//CJniHelper::getInstance()->restartGame();
		CCDirector::sharedDirector()->end();
	}

	((CPopTip*)(pBtn->getParent()->getParent()))->removeFromParentAndCleanup(true);
}
Beispiel #7
0
void SetPanel::onClick(CCObject* ob)
{
	CButton* btn = (CButton*)ob;
	int tag = btn->getTag();
	switch(tag)
	{
	case 1:
		{
			if(this->getParent())
				this->getParent()->removeChild(this);
		}
		break;
	case 2:
		{
			CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
			//CSceneManager::sharedSceneManager()->getScene("CityScene")->release();
			CCDirector::sharedDirector()->replaceScene(GETSCENE(LoginScene));
		}
		break;
	case 3:
		{
			CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
			CCDirector::sharedDirector()->end();
		}
		break;
	case 4:
		{
			CCMessageBox(GETLANGSTR(1012), GETLANGSTR(1005));
			//ShowTexttip(U8("此功能尚未开放,敬请期待"),RGB_RED);
		}
		break;
	case 5:
		{
			CCMessageBox(GETLANGSTR(1012), GETLANGSTR(1005));
			//ShowTexttip(U8("此功能尚未开放,敬请期待"),RGB_RED);
		}
		break;
	default:
		break;
	}
}
Beispiel #8
0
void CSignLayer::onResignDay(CCObject *pSender)
{
	CButton *btn = (CButton*)pSender;
	if (btn->getTag()==PopTipConfirm)
	{
		//货币不足
		if(!CheckGold(m_resignGold))
		{
			//ShowPopTextTip(GETLANGSTR(203));
			CShowToBuyResource* pShow = CShowToBuyResource::create();
			pShow->showToBuyResourceByType(ShowBuyResourceGold);
			return;
		}
		else
		{
			m_bIsReSign = true;
			CPlayerControl::getInstance().sendSignReq(m_bIsReSign);
		}
	}
	((CPopTip*)(btn->getParent()->getParent()))->onClose(nullptr);
}