Exemplo n.º 1
0
void CTopLayer::updateActionTime(float dt)
{
	UserData *data = DataCenter::sharedData()->getUser()->getUserData();
	if (data->getRoleAction() < data->getActionLimit())
	{
		data->setRoleAction(data->getRoleAction()+1);
		CLabel *action = (CLabel*)(m_ui->findWidgetById("action"));
		action->setString(CCString::createWithFormat("%d/%d",data->getRoleAction(),data->getActionLimit())->getCString());
		data->setActionTime(data->getActionTime() + data->getInterval()*60*60);
	}
	else
	{
		this->unschedule(schedule_selector(CTopLayer::updateActionTime));
	}
}