// build a list of objectives for a new mission void CFolderObjectives::BuildObjectivesList() { int missionNum = g_pInterfaceMgr->GetMissionData()->GetMissionNum(); MISSION* pMission = g_pMissionMgr->GetMission(missionNum); if (!pMission) return; CLTGUIFont *pFont = GetSmallFont(); for (int i = 0; i < pMission->nNumObjectives ; i++) { uint32 objID = pMission->aObjectiveIds[i]; CGroupCtrl *pGroup = debug_new(CGroupCtrl); CLTGUITextItemCtrl *pCtrl = CreateTextItem((int)objID,LTNULL,LTNULL,LTTRUE,pFont); if (pCtrl) { pCtrl->Enable(LTFALSE); pCtrl->SetFixedWidth(440); int nIndex= 0; CBitmapCtrl *pCheck = debug_new(CBitmapCtrl); pCheck->Create(g_pLTClient,"interface\\check-off.pcx"); int strHeight = pCtrl->GetHeight(); int bmpHeight = pCheck->GetHeight(); int height = Max(strHeight,bmpHeight) + 4; pGroup->Create(480,height); LTIntPt offset(40, (height - strHeight) / 2 ); pGroup->AddControl(pCtrl,offset); offset.x = 0; offset.y = (height - bmpHeight) / 2; pGroup->AddControl(pCheck,offset); pGroup->Enable(LTFALSE); AddFreeControl(pGroup); } } }
void CFolderMultiBriefing::OnFocus(LTBOOL bFocus) { if (bFocus) { int missionId = g_pGameClientShell->GetMPMissionName(); int briefId = g_pGameClientShell->GetMPMissionBriefing(); if (missionId) { CLTGUIFont *pFont = (briefId ? GetMediumFont() : GetLargeFont()); CLTGUITextItemCtrl* pCtrl =AddTextItem(missionId,LTNULL,0,LTTRUE,pFont); pCtrl->SetFixedWidth(480); pCtrl->Enable(LTFALSE); } if (briefId) { if (missionId) AddBlankLine(); CLTGUITextItemCtrl* pCtrl=AddTextItem(IDS_BRIEFING,LTNULL,0,LTTRUE,GetMediumFont()); pCtrl->Enable(LTFALSE); CStaticTextCtrl *pBrief = AddStaticTextItem(briefId,LTNULL,LTNULL,480,0,LTTRUE,GetSmallFont()); if (pBrief) { pBrief->Enable(LTFALSE); } } UseBack(LTFALSE); } else { RemoveFree(); } CBaseFolder::OnFocus(bFocus); }