Пример #1
0
void CCheatMgr::ToggleEndgameFlag()
{
	
	CRegMgr* pRegMgr = g_pVersionMgr->GetRegMgr();
	if (pRegMgr->IsValid())
	{
		uint32 nDone = pRegMgr->Get("EndGame",0);
		pRegMgr->Set("EndGame",!nDone);
	}

}
Пример #2
0
void CScreenSingle::OnFocus(LTBOOL bFocus)
{
	if (bFocus)
	{
		// We should not be connected to a server at this point.
		if(g_pLTClient->IsConnected())
		{
			_ASSERT(!"ERROR: ClientMultiplayerMgr::StartClient( ) : Already connected!");
			g_pLTClient->Disconnect();
		}

		// Initialize to the sp mission bute.
		if( !g_pMissionButeMgr->Init( MISSION_DEFAULT_FILE ))
		{
			g_pLTClient->ShutdownWithMessage("Could not load mission bute %s.", MISSION_DEFAULT_FILE );
			return;
  		}

		m_pLoadCtrl->Enable( g_pClientSaveLoadMgr->ReloadSaveExists() );
		m_pDiff->Show(LTFALSE);
		m_pDiffFrame->Show(LTFALSE);


		m_pChapter->Show(LTFALSE);
		m_pChapterFrame->Show(LTFALSE);


#ifndef _REMOVE_CUSTOM_LEVELS
		m_pCustom->Show(LTFALSE);
		m_pCustomFrame->Show(LTFALSE);
#endif _REMOVE_CUSTOM_LEVELS

		//have they completed game?
		LTBOOL bCompleted = LTFALSE;
		CRegMgr* pRegMgr = g_pVersionMgr->GetRegMgr();
		if (pRegMgr->IsValid())
		{
			bCompleted = (pRegMgr->Get("EndGame") > 0);
		}

		m_pChapterCtrl->Show(bCompleted);

		if (bCompleted && m_pChapter->GetNumControls() == 0)
			BuildChapterList();






	}

	CBaseScreen::OnFocus(bFocus);
}
Пример #3
0
bool CMissionMgr::HandleEndGame( ILTMessage_Read& msg  )
{
	// Go to the main menu.
	g_pInterfaceMgr->ChangeState(GS_SCREEN);

	m_bGameOver = true;

	if (g_pGameClientShell->IsRunningPerformanceTest())
	{
		//since our history was cleared by loading the level... rebuild it
		g_pInterfaceMgr->GetScreenMgr()->AddScreenToHistory( SCREEN_ID_MAIN );
		g_pInterfaceMgr->GetScreenMgr()->AddScreenToHistory( SCREEN_ID_OPTIONS );
	
		//we're done performance testing go back to performance screen
		g_pInterfaceMgr->SwitchToScreen(SCREEN_ID_PERFORMANCE);
	}
	else if (IsMultiplayerGame())
	{
		switch( g_pGameClientShell->GetGameType( ))
		{
			case eGameTypeCooperative:
				g_pInterfaceMgr->SwitchToScreen(SCREEN_ID_END_COOP_MISSION);
				break;
			case eGameTypeDeathmatch:
			case eGameTypeTeamDeathmatch:
			case eGameTypeDoomsDay:
				g_pInterfaceMgr->SwitchToScreen(SCREEN_ID_END_DM_MISSION);
				break;
		}
	}
	else
	{
		g_pInterfaceMgr->SwitchToScreen(SCREEN_ID_END_MISSION);

		//record the completion
		CRegMgr* pRegMgr = g_pVersionMgr->GetRegMgr();
		if (pRegMgr->IsValid())
		{
			pRegMgr->Set("EndGame",1);
		}

	}

	return true;
}