Exemplo n.º 1
0
//当场景接收到消息时调用
void CLoginScene::onMessage(int nMsg, ARRAY wParam, PARAM lParam)
{
	switch(nMsg)
	{
	//连接成功
	case MSG_UI_CONNECTED:
		this->login();
		break;
	//连接中断
	case MSG_UI_DISCONNECTED:
		CSceneManager::sharedSceneManager()->openPopupBox(GETBOX(CMessageBox), (void*)"disconnected!");
		break;
	//连错错误
	case MSG_UI_CONNECTERROR:
		CSceneManager::sharedSceneManager()->openPopupBox(GETBOX(CMessageBox), (void*)"connect error!");
		break;
	//连接超时
	case MSG_UI_CONNECTTIMEOUT:
		CSceneManager::sharedSceneManager()->openPopupBox(GETBOX(CMessageBox), (void*)"connect timeout!");
		break;
	//登陆成功
	case MSG_SC_INITCLIENT:
		CSceneManager::sharedSceneManager()->closePopupBox(GETBOX(CMessageBox));
		CSceneManager::sharedSceneManager()->pushScene(CCTransitionFlipX::create(0.5, GETSCENE(CSimpleGameScene)));
		break;
	}
}
Exemplo n.º 2
0
BOOL KSceneSceneEditorDialogMisc::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	if ( m_lpSceneSceneEditor )
	{
        D3DCOLOR FogColor = 0;
        GETSCENE() FALSE;
		IEKG3DEnvEffFog* pTempFog = GetFog(pScene);
		if (NULL != pTempFog)
		{
			if(SUCCEEDED(pTempFog->GetFogColor(&FogColor)))
			{
				m_bnFogColorPicker.SetBKColor(FogColor);
			}
		}	

		UpdateSelectOption(FALSE);

	}

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 3
0
void CDownloadPackage::callbackForRestart()
{
#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID)
	CSceneManager::sharedSceneManager()->replaceScene(GETSCENE(LogoScene));
#else
	CJniHelper::getInstance()->restartGame();
	CCDirector::sharedDirector()->end();
#endif
}
Exemplo n.º 4
0
void KSceneSceneEditorDialogMisc::UpdataLogicalSize()
{
	if(m_lpSceneSceneEditor)
	{
		UpdateData(TRUE);

		GETSCENE();

		pScene->SetLogicalSceneSize(m_nLogicalXStart,m_nLogicalZStart,m_nLogicalWidth,m_nLogicalHeight);
	}
}
Exemplo n.º 5
0
void KSceneSceneEditorDialogMisc::OnBnClickedButtonFogcolor()
{
	// TODO: Add your control notification handler code here
	if(!m_lpSceneSceneEditor)
		return;

	/*KColorPickerDialog* pDlg = GetColorPickerDialog();
	pDlg->Init(&m_lpSceneSceneEditor->m_Fog.m_FogColor,"Bloom Gate Color",NULL,TRUE);
	pDlg->ShowWindow(TRUE);*/
	GETSCENE();
	IEKG3DEnvEffFog* pTempFog = GetFog(pScene);
	if (NULL != pTempFog)
	{
		pTempFog->SetFogColor( m_bnFogColorPicker.GetBkColor());
	}		
	
}
Exemplo n.º 6
0
void KSceneSceneEditorDialogMisc::OnShowWindow(BOOL bShow, UINT nStatus)
{
	CDialog::OnShowWindow(bShow, nStatus);

	// TODO: Add your message handler code here
	if (bShow)
	{
		if ( m_lpSceneSceneEditor )
		{
			UpdateFogUI();

			GETSCENE();
			pScene->GetLogicalSceneSize(&m_nLogicalXStart,&m_nLogicalZStart,&m_nLogicalWidth,&m_nLogicalHeight);
			
			UpdateData(FALSE);
		}
	}
}
Exemplo n.º 7
0
void KSceneSceneEditorDialogMisc::OnBnClickedBnFogUpdateFogParam()
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	if(!m_lpSceneSceneEditor)
		return;
	KG3DENVEFFFOG_DESCSTRUCT tempStruct;
	tempStruct.m_fFogDensity = m_fFogDes;
	tempStruct.m_fFogStartValue = m_fFogNear;
	tempStruct.m_fFogEndValue = m_fFogFar;
	GETSCENE();
	IEKG3DEnvEffFog* pTempFog = GetFog(pScene);
	if (NULL != pTempFog)
	{
		pTempFog->RequestModification(&tempStruct, m_dwFogModificationOption | KG3DENVEFFFOG_MDO_MODE_PARAM);
		m_dwFogModificationOption = 0;
	}		
}
Exemplo n.º 8
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;
	}
}
Exemplo n.º 9
0
	void LoadScene::loadResouceEnd()
	{
		CSVFile* tFine = (CSVFile*)FileUtils::sharedFileUtils()->getFile(CSV_ROOT("preloadRes.csv"));
		if (mAsynLoadNum < mResourceVec.size() && mCurrIndex < (tFine->getRowNum() + 600))		//当预加载10秒后还没跳转界面则执行强制跳转处理
			return ;
		if (mCurrIndex >= (tFine->getRowNum() + 600))
			CCLOG("[ *ERROR ] LoadScene::loadResouceEnd");
		for (int i=0; i<mResourceVec.size();++i)
		{
			LoadResourceInfo &res = mResourceVec.at(i);
			if (res.Loadtype>sLoadType::eEffect)
				continue;
			CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile(res.FilePath.c_str());//将plist文件加载进入缓存
			CCLOG("ProgressEnd addSpriteFramesWithFile mode1 %s ",res.FileName.c_str());
			if(res.Loadtype == sLoadType::eFrameAnimation)
				AnimationManager::sharedAction()->ParseAnimation(res.FileName.c_str(),eFrameRole);
			else if(res.Loadtype == sLoadType::eEffect)
				AnimationManager::sharedAction()->ParseAnimation(res.FileName.c_str());
		}
		this->unscheduleAllSelectors();
		CSceneManager::sharedSceneManager()->replaceScene(GETSCENE(CMainScene), 1.0f);
	}
Exemplo n.º 10
0
void KSceneSceneEditorDialogMisc::UpdateFogUI()
{
	D3DCOLOR FogColor = 0;
	GETSCENE();
	IEKG3DEnvEffFog* pTempFog = GetFog(pScene);
	if (NULL != pTempFog)
	{
		KG3DENVEFFFOG_DESCSTRUCT tempStruct;
		if(SUCCEEDED(pTempFog->GetStruct(&tempStruct)))
		{
			m_bnFogColorPicker.SetBKColor(tempStruct.m_FogColor);
			m_fFogFar = tempStruct.m_fFogEndValue;
			m_fFogNear = tempStruct.m_fFogStartValue;
			m_fFogDes = tempStruct.m_fFogDensity;

			CButton* p = static_cast<CButton*>(this->GetDlgItem(IDC_FOG_ENABLE));
			if (NULL != p)
			{
				p->SetCheck(tempStruct.m_bFogEnable ? BST_CHECKED : BST_UNCHECKED);
			}
			UpdateData(FALSE);
		}
	}
}
Exemplo n.º 11
0
void CLoginScene::onSettingsClick(CCObject *pSender)
{
	CCLOG("on click");
	CSceneManager::sharedSceneManager()->pushScene(GETSCENE(CMainScene));
}