Exemplo n.º 1
0
// Change in focus
void    CScreenHostLevels::OnFocus(bool bFocus)
{
	if (bFocus)
	{
		GameModeMgr& gameModeMgr = GameModeMgr::Instance( );
		m_setRequiredMapFeatures.clear();
		DelimitedStringToStringContainer(gameModeMgr.m_grsRequiredMapFeatures.GetValue(),m_setRequiredMapFeatures,",");

		FillAvailList();
		LoadMissionList();

		if (!m_pSelMissions->GetNumControls())
		{
			MakeDefaultMissionList();
		}

		UpdateButtons();
        UpdateData(false);

	}
	else
	{
		UpdateData();

		SaveMissionList();

		m_pAvailMissions->RemoveAll();
		m_pSelMissions->RemoveAll();
	}
	CBaseScreen::OnFocus(bFocus);

}
Exemplo n.º 2
0
// Change in focus
void    CScreenHostLevels::OnFocus(LTBOOL bFocus)
{
	if (bFocus)
	{
		m_pAvailMissions->Enable(LTFALSE);
		m_pAdd->Enable(LTTRUE);
		m_pSelMissions->Enable(LTFALSE);
		m_pRemove->Enable(LTTRUE);

		CUserProfile* pUserProfile = g_pProfileMgr->GetCurrentProfile( );
		m_sCampaignFile = GetCampaignFile( pUserProfile->m_ServerGameOptions );
		
		if(!CWinUtil::FileExist( m_sCampaignFile.c_str() ) )
		{
			//TODO handle more cleanly
			g_pLTClient->CPrint("Could not load campaign file %s.",  m_sCampaignFile.c_str() );
			m_sCampaignFile = "";
		}



		FillAvailList();

		LoadMissionList();

		if (!m_pSelMissions->GetNumControls())
		{
			MakeDefaultMissionList();
		}

		if (g_pGameClientShell->GetGameType() != eGameTypeCooperative)
		{
			m_pLoopToggle->Enable(LTFALSE);
			m_bLoopMissions = LTTRUE;
		}
		else
		{
			m_pLoopToggle->Enable(LTTRUE);
		}

		UpdateButtons();
        UpdateData(LTFALSE);

	}
	else
	{
		UpdateData();

		if (m_sCampaignFile.length())
		{
			SaveMissionList();
		}
		m_pAvailMissions->RemoveAll();
		m_pSelMissions->RemoveAll();
	}
	CBaseScreen::OnFocus(bFocus);

}