本文整理汇总了C++中UserData::getOnlinePrizeTime方法的典型用法代码示例。如果您正苦于以下问题:C++ UserData::getOnlinePrizeTime方法的具体用法?C++ UserData::getOnlinePrizeTime怎么用?C++ UserData::getOnlinePrizeTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserData
的用法示例。
在下文中一共展示了UserData::getOnlinePrizeTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onEnter
//.........这里部分代码省略.........
CAccessLayer* pAccess = CAccessLayer::create();
this->addChild(pAccess, 99);
CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_HERO,this,GameMsghandler_selector(CMainCityUI::updateRoleProperty));
CSceneManager::sharedSceneManager()->addMsgObserver(TASK_NOTICE,this,GameMsghandler_selector(CMainCityUI::updateTaskNotice));
CSceneManager::sharedSceneManager()->addMsgObserver(MAIL_NOTICE,this,GameMsghandler_selector(CMainCityUI::updateMailNotice));
CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_FUNCTIONOPEN,this,GameMsghandler_selector(CMainCityUI::updateFuctionOpen));
CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_GAMETIP,this,GameMsghandler_selector(CMainCityUI::updateGameTip));
CSceneManager::sharedSceneManager()->addMsgObserver(SHOW_HEAD,this,GameMsghandler_selector(CMainCityUI::showHead));
CCSprite *red = (CCSprite*)(m_ui->findWidgetById("redPoint"));
CCSprite *mailPoint = (CCSprite*)(m_ui->findWidgetById("mailPoint"));
if (user->getRoleAction()<user->getActionLimit())
{
this->schedule(schedule_selector(CMainCityUI::updateActionTime),user->getInterval()*60);
}
GetTcpNet->registerMsgHandler(FriendReqNumMsg,this,CMsgHandler_selector(CMainCityUI::processNetMsg));
GetTcpNet->registerMsgHandler(CBExchangeMsg,this,CMsgHandler_selector(CMainCityUI::exchangeMsg));
//正在引导,不自动弹窗
if(user->getNewStep()==2||user->getNewStep()==17/*CGuideManager::getInstance()->getIsRunGuide()*/)
{
DataCenter::sharedData()->setCityActionType(CA_None);
}
else if(user->getNewStep()<=0 || user->getNewStep()>=100)
{
//自动弹签到
runAction(CCSequence::createWithTwoActions(CCDelayTime::create(0.7f), CCCallFunc::create(this, callfunc_selector(CMainCityUI::autoShowSign))));
}
switch (DataCenter::sharedData()->getCityActionType())
{
case CA_Levelup:
{
CButton *btn = (CButton*)m_ui->getChildByTag(HeroInfo_Btn);
btn->runAction(CCSequence::create(CCDelayTime::create(0.6f),
CCCallFuncN::create(this, callfuncN_selector(CMainCityUI::onTimeWaitCityAction)),
NULL));
DataCenter::sharedData()->setCityActionType(CA_None);
}
break;
case CA_GoToChapater:
{
CButton *btn = (CButton*)m_ui->getChildByTag(Battle_Btn);
btn->runAction(CCSequence::create(CCDelayTime::create(0.2f),
CCCallFuncN::create(this, callfuncN_selector(CMainCityUI::onTimeWaitCityAction)),
NULL));
m_bShowChapterFlag = true;
DataCenter::sharedData()->setCityActionType(CA_None);
}
break;
case CA_GoToStage:
{
this->runAction(CCSequence::create(CCDelayTime::create(0.8f),
CCCallFunc::create(this, callfunc_selector(CMainCityUI::runTollgatepreviewCallBack)),
NULL));
DataCenter::sharedData()->setCityActionType(CA_None);
}break;
default:
break;
}
//绑定场景隐藏和显示的消息
NOTIFICATION->addObserver(this, callfuncO_selector(CMainCityUI::show), SHOW_MAIN_SCENE, nullptr);
NOTIFICATION->addObserver(this, callfuncO_selector(CMainCityUI::hide), HIDE_MAIN_SCENE, nullptr);
NOTIFICATION->addObserver(this, callfuncO_selector(CMainCityUI::checkShowActivity), "CheckShowActivity", nullptr);
CCNode *lay = dynamic_cast<CCNode*>( m_ui->getChildByTag(6));
button = dynamic_cast<CButton*>(lay->getChildByTag(6));
CCAnimation *batAnim = AnimationManager::sharedAction()->getAnimation("9015");
batAnim->setDelayPerUnit(0.1f);
CCSprite *batLight = createAnimationSprite("skill/9015.png",button->getPosition(),batAnim,true);
batLight->setScale(1.4f);
m_ui->addChild(batLight);
showNoticeTip(CTaskControl::getInstance()->getGameTips());
// CCSprite *spr = CCSprite::create("headImg/506.png");
// spr->setScale(1.2f);
// CCSprite *sp = maskedSprite(spr);
// CCSprite *headBg = (CCSprite *)(headPart->findWidgetById("headbg"));
// sp->setPosition(headBg->getPosition());
// headPart->addChild(sp);
//在线礼包
int iNexTime = user->getOnlinePrizeTime();
if (iNexTime!=-1)
{
if (m_pTimeGift==nullptr)
{
m_pTimeGift = CTimeGift::create();
m_pTimeGift->setTouchPriority(-3);
this->addChild(m_pTimeGift, 2);
}
m_pTimeGift->setTime(iNexTime);
}
}