// Creation LTBOOL CListCtrl::Create ( int nHeight, LTBOOL bUseArrows, int nArrowOffset) { m_nHeight=nHeight; m_bCreated=LTTRUE; if (bUseArrows) { m_bArrows = LTTRUE; m_nArrowOffset = nArrowOffset; //Add Server Arrows m_pUp = debug_new(CBitmapCtrl); if (!m_pUp->Create(g_pLTClient,"interface\\ListArrowUp.pcx","interface\\ListArrowUpH.pcx","interface\\ListArrowUpD.pcx")) { debug_delete(m_pUp); m_pUp = LTNULL; } m_pDown = debug_new(CBitmapCtrl); if (!m_pDown->Create(g_pLTClient,"interface\\ListArrowDn.pcx","interface\\ListArrowDnH.pcx","interface\\ListArrowDnD.pcx")) { debug_delete(m_pDown); m_pDown = LTNULL; } } return LTTRUE; }
LTBOOL CHUDMessageQueue::Init() { UpdateLayout(); g_pLTClient->RegisterConsoleProgram("SimulateChat", SimulateChatFn); ASSERT(m_nMaxActiveMsgs); if (!m_nMaxActiveMsgs) return LTFALSE; m_ActiveMsgs.reserve(m_nMaxActiveMsgs); m_HistoryMsgs.reserve(m_nMaxHistoryMsgs); m_History.reserve(32); MsgCreate fmt = m_MsgFormat; fmt.sString = ""; fmt.fDuration = 0.0f; for (int i = 0; i < m_nMaxActiveMsgs; i++) { CHUDMessage *pMsg = debug_new(CHUDMessage); if (pMsg->Create(fmt)) { pMsg->Show(LTFALSE); m_ActiveMsgs.push_back(pMsg); } else { debug_delete(pMsg); } } for (i = 0; i < m_nMaxHistoryMsgs; i++) { CHUDMessage *pMsg = debug_new(CHUDMessage); if (pMsg->Create(fmt)) { pMsg->Show(LTFALSE); m_HistoryMsgs.push_back(pMsg); } else { debug_delete(pMsg); } } return LTTRUE; }
CScreenSprite * CScreenSpriteMgr::CreateScreenSprite(char * pFile, bool bExpires, ScreenSpriteLayer eLayer) { // Make sure the ScreenSpriteMgr is operational if (!m_bInitialized) Init(); CScreenSprite * pSpr = debug_new(CScreenSprite); pSpr->Init(); bool bResult = GiveSpriteResources(pSpr, pFile); if (!bResult) { debug_delete(pSpr); return LTNULL; } pSpr->SetExpiration(bExpires); pSpr->m_eLayer = eLayer; // determine the draw-order with the layer number // m_SpriteArray.push_back(pSpr); ScreenSpriteArray::iterator iter = m_SpriteArray.begin(); while (iter != m_SpriteArray.end()) { if (pSpr->m_eLayer <= (*iter)->m_eLayer) { m_SpriteArray.insert(iter, pSpr); return pSpr; } iter++; } // pSpr didn't come before anything in the array, or the array is empty. Add it m_SpriteArray.push_back(pSpr); return pSpr; }
void CIntelItemList::Load(ILTMessage_Read *pMsg) { if (!pMsg) return; uint16 nCount = pMsg->Readuint16(); uint16 i = 0; for (i=0; i < nCount; i++) { INTEL_ITEM *pItem = LTNULL; if (i < m_IntelArray.size()) { pItem = m_IntelArray[i]; } else { pItem = debug_new(INTEL_ITEM); m_IntelArray.push_back(pItem); } pItem->nTextId = pMsg->Readuint32(); pItem->nPopupId = pMsg->Readuint8(); pItem->bIsIntel = pMsg->Readbool() ? LTTRUE : LTFALSE; pItem->nMissionNum = pMsg->Readuint8(); } }
CTeamPlayer* CTeam::AddPlayer(uint32 dwPlayerID, uint32 dwFlags) { // Make sure this player doesn't already exist... if (GetPlayer(dwPlayerID)) { return(NULL); } // Create and init a new player... CTeamPlayer* pPlayer = debug_new(CTeamPlayer); if (!pPlayer) return(NULL); if (!pPlayer->Init(dwPlayerID, dwFlags)) { debug_delete(pPlayer); return(LTFALSE); } // Add the new player to our list... if (!AddPlayer(pPlayer)) { return(LTFALSE); } // All done... return(pPlayer); }
LTBOOL BuildPolyDebrisFXList(PolyDebrisFXList & list, CButeMgr & buteMgr, char* pTagBase) { if (!pTagBase) return LTFALSE; int nNum = 0; sprintf(s_aTagName, "%s%d", pTagBase, nNum); // Read in the properties for each scale fx... while (buteMgr.Exist(s_aTagName)) { CPolyDebrisFX* pFX = debug_new(CPolyDebrisFX); if (pFX && pFX->Init(buteMgr, s_aTagName)) { pFX->nId = nNum; list.AddTail(pFX); } else { debug_delete(pFX); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", pTagBase, nNum); } return LTTRUE; }
CWeapons::CWeapons() : m_nCurWeapon( -1 ) , m_pWeapons( LTNULL ) , m_pAmmo( LTNULL ) { m_pVecProjectile = debug_new( CProjectile ); }
LTBOOL CSoundFilterMgr::Init(const char* szAttributeFile) { if (g_pSoundFilterMgr || !szAttributeFile) return LTFALSE; if (!Parse(szAttributeFile)) return LTFALSE; g_pSoundFilterMgr = this; // Read in the properties for each sound filter record... int nNum = 0; sprintf(s_aTagName, "%s%d", SFM_TAG, nNum); while (m_buteMgr.Exist(s_aTagName)) { SOUNDFILTER* pFilter = debug_new(SOUNDFILTER); if (pFilter && pFilter->Init(m_buteMgr, s_aTagName)) { pFilter->nId = nNum; m_FilterList.AddTail(pFilter); } else { debug_delete(pFilter); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", SFM_TAG, nNum); } return LTTRUE; }
CTeam* CTeamMgr::AddTeam(uint32 dwTeamID, char* sTeamName, uint32 dwFlags) { // Make sure this team doesn't already exist... if (GetTeam(dwTeamID)) return(NULL); if (GetTeam(sTeamName)) return(NULL); // Create and init a new team... CTeam* pTeam = debug_new(CTeam); if (!pTeam) return(NULL); if (!pTeam->Init(dwTeamID, sTeamName, dwFlags)) { debug_delete(pTeam); return(NULL); } // Add the new team to our list... m_lsTeams.InsertLast(pTeam); // All done... return(pTeam); }
LTBOOL CPropTypeMgr::Init(const char* szAttributeFile) { if (g_pPropTypeMgr || !szAttributeFile) return LTFALSE; if (!Parse(szAttributeFile)) return LTFALSE; g_pPropTypeMgr = this; // Read in the properties for each prop type record... int nNum = 0; sprintf(s_aTagName, "%s%d", PTMGR_TAG, nNum); while (m_buteMgr.Exist(s_aTagName)) { PROPTYPE* pPropType = debug_new(PROPTYPE); if (pPropType && pPropType->Init(m_buteMgr, s_aTagName, nNum)) { pPropType->nId = nNum; m_PropTypeList.AddTail(pPropType); } else { debug_delete(pPropType); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", PTMGR_TAG, nNum); } return LTTRUE; }
CLTGUIColumnCtrl* CMenuPlayer::AddColumnCtrl(uint32 nCommand) { CUIFont* pFont = g_pInterfaceResMgr->GetFont(m_FontFace); CLTGUIColumnCtrl* pCtrl=debug_new(CLTGUIColumnCtrl); if (!pCtrl->Create(nCommand,LTNULL,pFont,m_FontSize, this)) { debug_delete(pCtrl); return LTFALSE; } pCtrl->SetBasePos(m_nextPos); if (nCommand > 0) { pCtrl->SetColors(m_SelectedColor,m_NonSelectedColor,m_DisabledColor); pCtrl->Enable(LTTRUE); } else { pCtrl->SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor); pCtrl->Enable(LTFALSE); } pCtrl->SetScale(g_pInterfaceResMgr->GetXRatio()); m_List.AddControl(pCtrl); return pCtrl; }
CAnimationTreePacked* CAnimationTreePackedMgr::CreateAnimationTreePacked( const char* pszFilename ) { // Create a new tree. CAnimationTreePacked* pTree = debug_new( CAnimationTreePacked ); // Bail if we fail to load the specified packed anim tree file. CAnimationTreePackedLoader Loader; if( !Loader.LoadAnimationTreePacked( pTree, pszFilename ) ) { debug_delete( pTree ); return NULL; } // Assign the new tree a unique ID. pTree->m_eTreeID = (AT_TREE_ID)m_iNextTreeID; ++m_iNextTreeID; // Assign global transition IDs. // These IDs allow searching for transitions across multiple trees. AssignGlobalTransitionIDs( pTree ); // Add the new tree to the list. m_lstAnimTrees.push_back( pTree ); return pTree; }
uint16 CBaseMenu::AddControl (char *pString, uint32 commandID, LTBOOL bStatic) { CUIFont* pFont = g_pInterfaceResMgr->GetFont(m_FontFace); if (!pFont) return -1; CLTGUITextCtrl* pCtrl=debug_new(CLTGUITextCtrl); if (!pCtrl->Create(pString, commandID, LTNULL, pFont, m_FontSize, this)) { debug_delete(pCtrl); return -1; } pCtrl->SetBasePos(m_nextPos); if (bStatic) { pCtrl->SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor); pCtrl->Enable(LTFALSE); } else pCtrl->SetColors(m_SelectedColor,m_NonSelectedColor,m_DisabledColor); pCtrl->SetScale(g_pInterfaceResMgr->GetXRatio()); return m_List.AddControl(pCtrl); }
void CLoadingScreen::CreateScaleFX(char *szFXName) { if( m_pRenderScreen ) return; CScaleFX* pScaleFX = g_pFXButeMgr->GetScaleFX(szFXName); if (pScaleFX) { CBaseScaleFX *pSFX = debug_new(CBaseScaleFX); if (!g_pFXButeMgr->CreateScaleFX(pScaleFX,m_vPos, m_vF, LTNULL, &m_rRot, pSFX)) { debug_delete(pSFX); return; } m_SFXArray.Add(pSFX); g_pInterfaceMgr->AddInterfaceSFX(pSFX, IFX_NORMAL); //adjust the object's position based on screen res HOBJECT hSFX = pSFX->GetObject(); if (hSFX) { LTVector vNewPos; g_pLTClient->GetObjectPos(hSFX, &vNewPos); vNewPos.z; g_pLTClient->SetObjectPos(hSFX, &vNewPos); } } }
LTBOOL CDebrisMgr::Init(const char* szAttributeFile) { if (g_pDebrisMgr || !szAttributeFile) return LTFALSE; if (!Parse(szAttributeFile)) return LTFALSE; g_pDebrisMgr = this; // Read in the properties for each debis record... int nNum = 0; sprintf(s_aTagName, "%s%d", DEBRISMGR_DEBRIS_TAG, nNum); while (m_buteMgr.Exist(s_aTagName)) { DEBRIS* pDebris = debug_new(DEBRIS); if (pDebris && pDebris->Init(m_buteMgr, s_aTagName)) { pDebris->nId = nNum; m_DebrisList.AddTail(pDebris); } else { debug_delete(pDebris); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", DEBRISMGR_DEBRIS_TAG, nNum); } return LTTRUE; }
// ----------------------------------------------------------------------- // // // ROUTINE: CLightCycleMgr::BeginLightCycleTrail // // PURPOSE: Starts a new light cycle trail // // ----------------------------------------------------------------------- // bool CLightCycleMgr::BeginLightCycleTrail(LIGHT_CYCLIST* pCyclist, LTVector& vPos) { ASSERT(pCyclist); if(!pCyclist) return false; // Create a new trail LIGHT_CYCLE_TRAIL* pTrail = debug_new(LIGHT_CYCLE_TRAIL); // Set the unique Trail ID and increment it pTrail->wID = pCyclist->wNextTrailID++; // Add this trail to the light cycle's list pCyclist->collTrails.push_back(pTrail); // Set our current trail pCyclist->pCurTrail = pTrail; // Add the point if(AddLightCycleTrailPoint(pCyclist, pTrail, vPos) > 0) { return true; } else { return false; } }
LTBOOL CIntelMgr::Init(ILTCSBase *pInterface, const char* szAttributeFile) { if (g_pIntelMgr || !szAttributeFile) return LTFALSE; if (!Parse(pInterface, szAttributeFile)) return LTFALSE; g_pIntelMgr = this; // Read in the properties for each prop type record... int nNum = 0; sprintf(s_aTagName, "%s%d", INTELMGR_TAG, nNum); while (m_buteMgr.Exist(s_aTagName)) { INTEL* pIntel = debug_new(INTEL); if (pIntel && pIntel->Init(m_buteMgr, s_aTagName)) { pIntel->nId = nNum; m_IntelList.AddTail(pIntel); } else { debug_delete(pIntel); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", INTELMGR_TAG, nNum); } return LTTRUE; }
// Build the screen LTBOOL CScreenAudio::Build() { CreateTitle(IDS_TITLE_SOUND); kGap = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_AUDIO,"ColumnWidth"); kWidth = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_AUDIO,"SliderWidth"); uint32 dwAdvancedOptions = g_pInterfaceMgr->GetAdvancedOptions(); m_bMusicEnabled = (dwAdvancedOptions & AO_MUSIC); //background frame LTRect frameRect = g_pLayoutMgr->GetScreenCustomRect(SCREEN_ID_AUDIO,"FrameRect"); LTIntPt pos(frameRect.left,frameRect.top); int nHt = frameRect.bottom - frameRect.top; int nWd = frameRect.right - frameRect.left; char szFrame[128]; g_pLayoutMgr->GetScreenCustomString(SCREEN_ID_AUDIO,"FrameTexture",szFrame,sizeof(szFrame)); HTEXTURE hFrame = g_pInterfaceResMgr->GetTexture(szFrame); CLTGUIFrame *pFrame = debug_new(CLTGUIFrame); pFrame->Create(hFrame,nWd,nHt+8,LTTRUE); pFrame->SetBasePos(pos); pFrame->SetBorder(2,m_SelectedColor); AddControl(pFrame); m_pSoundVolumeCtrl=AddSlider(IDS_SOUND_FXVOL, IDS_HELP_SOUNDVOL, kGap, kWidth, -1, &m_nSoundVolume); m_pSoundVolumeCtrl->Enable( (dwAdvancedOptions & AO_SOUND) ); m_pSoundVolumeCtrl->SetSliderRange(SOUND_MIN_VOL, SOUND_MAX_VOL); m_pSoundVolumeCtrl->SetSliderIncrement(SOUND_SLIDER_INC); m_pSpeechVolumeCtrl=AddSlider(IDS_SPEECH_FXVOL, IDS_HELP_SPEECHVOL, kGap, kWidth, -1, &m_nSpeechVolume); m_pSpeechVolumeCtrl->Enable( (dwAdvancedOptions & AO_SOUND) ); m_pSpeechVolumeCtrl->SetSliderRange(SPEECH_MIN_VOL, SPEECH_MAX_VOL); m_pSpeechVolumeCtrl->SetSliderIncrement(SPEECH_SLIDER_INC); m_pSoundQualityCtrl=AddToggle(IDS_SOUND_QUALITY, IDS_HELP_SOUNDQUAL, kGap, &m_bSoundQuality); m_pSoundQualityCtrl->SetOnString(LoadTempString(IDS_SOUND_HIGH)); m_pSoundQualityCtrl->SetOffString(LoadTempString(IDS_SOUND_LOW)); m_pSoundQualityCtrl->Enable( (dwAdvancedOptions & AO_SOUND) ); m_pMusicVolumeCtrl = AddSlider(IDS_SOUND_MUSICVOL, IDS_HELP_MUSICVOL, kGap, kWidth, -1, &m_nMusicVolume); m_pMusicVolumeCtrl->Enable( (dwAdvancedOptions & AO_MUSIC) ); m_pMusicVolumeCtrl->SetSliderRange(MUSIC_MIN_VOL, MUSIC_MAX_VOL); m_pMusicVolumeCtrl->SetSliderIncrement(MUSIC_SLIDER_INC); m_pMusicQualityCtrl=AddToggle(IDS_MUSIC_QUALITY, IDS_HELP_MUSIC_QUALITY, kGap, &m_bMusicQuality); m_pMusicQualityCtrl->SetOnString(LoadTempString(IDS_SOUND_HIGH)); m_pMusicQualityCtrl->SetOffString(LoadTempString(IDS_SOUND_LOW)); m_pMusicQualityCtrl->Enable( (dwAdvancedOptions & AO_MUSIC) ); // Make sure to call the base class if (! CBaseScreen::Build()) return LTFALSE; UseBack(LTTRUE,LTTRUE); return LTTRUE; }
void CClientInfoMgr::PlayerConnected( char const* pszName, uint32 nID ) { m_nLocalID = 0; g_pLTClient->GetLocalClientID (&m_nLocalID); // if we already have this client in the list, just return CLIENT_INFO* pDup = GetClientByID(nID, false); if (pDup) { pDup->sName = pszName; } else { // create the new object CLIENT_INFO* pNew = debug_new(CLIENT_INFO); if (!pNew) return; pNew->nID = nID; pNew->sName = pszName; pNew->bIsAdmin = false; pNew->nTeamID = INVALID_TEAM; pNew->sScore.Init(nID); // if we don't have a list yet, set the list pointer to the new object if (!m_pClients) { m_pClients = pNew; return; } // we do have a list - insert the object CLIENT_INFO* ptr = m_pClients; //insert at head? if (ptr->sScore.GetScore() < pNew->sScore.GetScore()) { pNew->pNext = m_pClients; m_pClients = pNew; return; } CLIENT_INFO* pNext = ptr->pNext; while (pNext && pNext->sScore.GetScore() >= pNew->sScore.GetScore()) { ptr = pNext; pNext = ptr->pNext; } if (pNext) { pNext->pPrev = pNew; } ptr->pNext = pNew; pNew->pNext = pNext; pNew->pPrev = ptr; } }
// Build the screen LTBOOL CScreenTeam::Build() { CreateTitle(IDS_TITLE_TEAM); int kColumn0 = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_TEAM,"ColumnWidth"); int kColumn1 = (640 - GetPageLeft()) - kColumn0; int kArrow = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_TEAM,"ArrowWidth"); m_pName = AddColumnCtrl(CMD_EDIT_NAME, IDS_HELP_TEAM_NAME); m_pName->AddColumn(LoadTempString(IDS_TEAM_NAME), kColumn0); m_pName->AddColumn("<Team name>", kColumn1, LTTRUE); m_pModel = AddTextItem(IDS_TEAM_MODEL, LTNULL, IDS_HELP_TEAM_MODEL); LTIntPt arrowPos = m_pModel->GetBasePos(); arrowPos.x += kColumn0; HTEXTURE hLeft = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowlt.dtx"); HTEXTURE hLeftH = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowlt_h.dtx"); m_pLeft = debug_new(CLTGUIButton); if (m_pLeft) { m_pLeft->Create(CMD_LEFT,LTNULL,hLeft,hLeftH); m_pLeft->SetBasePos(arrowPos); AddControl(m_pLeft); m_pLeft->SetCommandHandler(this); } arrowPos.x += kArrow; HTEXTURE hRight = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowrt.dtx"); HTEXTURE hRightH = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowrt_h.dtx"); m_pRight = debug_new(CLTGUIButton); if (m_pRight) { m_pRight->Create(CMD_RIGHT,LTNULL,hRight,hRightH); m_pRight->SetBasePos(arrowPos); AddControl(m_pRight); m_pRight->SetCommandHandler(this); } // Make sure to call the base class return CBaseScreen::Build(); }
LTBOOL CRatingMgr::Init(const char* szAttributeFile) { if (g_pRatingMgr) return LTFALSE; // Set up global pointer... g_pRatingMgr = this; m_AddArray.clear(); m_AddArray.reserve(5); m_PlayerAddArray.clear(); // Check for legitimate additive file if (!szAttributeFile) return LTFALSE; if (!Parse(szAttributeFile)) { // If you broke on this assert, // you need to grab "attributes/additives.txt" out of SourceSafe ASSERT(LTFALSE); return LTFALSE; } // TODO for now, setting all ratings to "50" eventually set these elsewhere for (int i = 0; i < NUM_RATINGS; i++) { m_iBaseRating[i] = 50; } m_iRatingGoo = 0; // Read in all of the additives uint16 nNumAdditives = 0; sprintf(s_aTagName, "%s0", ADDITIVE_TAG); while (m_buteMgr.Exist(s_aTagName)) { ADDITIVE* pNew = debug_new(ADDITIVE); m_buteMgr.GetString(s_aTagName, ADDITIVE_NAME, "", pNew->szName, sizeof(pNew->szName)); pNew->nNameId = (uint16)m_buteMgr.GetInt(s_aTagName, ADDITIVE_NAME_ID, 0); pNew->nDescriptionId = (uint16)m_buteMgr.GetInt(s_aTagName, ADDITIVE_DESC_ID, 0); m_buteMgr.GetString(s_aTagName, ADDITIVE_SPRITE, "", pNew->szSprite, sizeof(pNew->szSprite)); pNew->pSprite = LTNULL; for (int i = 0; i < NUM_RATINGS; i++) { pNew->Adjust[i] = (int8)m_buteMgr.GetInt(s_aTagName, szRatings[i], 0); } m_AddArray.push_back(pNew); nNumAdditives++; sprintf(s_aTagName, "%s%d", ADDITIVE_TAG, nNumAdditives); } m_buteMgr.Term(); return (LTTRUE); }
//---------------------------------------------------------------------------- // // ROUTINE: CRelationMgr::GetGlobalRelationMgr() // // PURPOSE: Created a new instance of the RelationMgr, and returns it if // one hasn't been created yet. Otherwise, just returns it. // //---------------------------------------------------------------------------- CRelationMgr* CRelationMgr::GetGlobalRelationMgr() { if ( m_pSingleInstance == NULL ) { m_pSingleInstance = debug_new ( CRelationMgr ); } return m_pSingleInstance; }
bool CClientWeaponMgr::Init() { // Determine m_nMaxWeapons m_nMaxWeapons = g_pWeaponDB->GetNumPlayerWeapons(); // Allocate space for our array... m_apClientWeapon = debug_newa( CClientWeapon*, m_nMaxWeapons ); if( !m_apClientWeapon ) { ASSERT( !"CClientWeaponMgr::Init. Could not allocate clientweapon array." ); return false; } // Clear us out. memset( m_apClientWeapon, 0, m_nMaxWeapons * sizeof( CClientWeapon* )); for( uint8 nWeapon = 0; nWeapon < m_nMaxWeapons; ++nWeapon ) { // Get the weapon datadase record... HWEAPON hWeapon = g_pWeaponDB->GetPlayerWeapon( nWeapon ); if( !hWeapon ) { ASSERT( !"CClientWeaponMgr::Init. Could not get HWEAPON." ); return false; } m_apClientWeapon[nWeapon] = debug_new( CClientWeapon ); if( !m_apClientWeapon[nWeapon] ) { ASSERT( !"CClientWeaponMgr::Init. Could not create clientweapon." ); return false; } // init the weapon if( !m_apClientWeapon[nWeapon]->Init( hWeapon )) { ASSERT( !"CClientWeaponMgr::Init. Could not init clientweapon." ); return false; } } m_pCurrentWeapon = NULL; m_nCurClientWeaponIndex = CWM_NO_WEAPON; m_hLastWeapon = NULL; g_vtKeepCurrentAmmo.Init( g_pLTClient, "KeepCurrentAmmo", NULL, 1.0f ); HRECORD hShared = ClientDB::Instance( ).GetClientSharedRecord( ); // for now, always succeed return true; }
void CFolderIntel::BuildIntelList() { if (m_nMissionNum < 0) return; MISSION* pMission = g_pMissionMgr->GetMission(m_nMissionNum); if (!pMission) return; CreateTitle(pMission->nNameId); for (int n =0;n < kNumSFXTypes;n++) { nSFXCounts[n] = 0; } CLTGUIFont *pFont; if (g_pLayoutMgr->GetListFontSize((eFolderID)m_nFolderID) == 0) pFont = GetSmallFont(); else if (g_pLayoutMgr->GetListFontSize((eFolderID)m_nFolderID) == 1) pFont = GetMediumFont(); else pFont = GetLargeFont(); int numItems = g_pGameClientShell->GetIntelItemMgr()->GetNumItems(m_nMissionNum); for (int i = 0; i < numItems; i++) { IntelItem *pItem = debug_new(IntelItem); g_pGameClientShell->GetIntelItemMgr()->GetItem(m_nMissionNum,i,pItem); int nNameID = 0; int nCount = 0; if (pItem->nID) { for (int n =0;!nNameID && n < kNumSFXTypes;n++) { if (pItem->nType == nSFXIDs[n]) { nSFXCounts[n]++; nNameID = nSFXNameIDs[n]; nCount = nSFXCounts[n]; } } } if (nNameID) { m_intelArray.Add(pItem); HSTRING hStr = g_pLTClient->FormatString(nNameID,nCount); CLTGUITextItemCtrl *pCtrl = AddTextItem(hStr,0,0,LTFALSE,pFont); g_pLTClient->FreeString(hStr); pCtrl->SetParam1(m_intelArray.GetSize()); } else { debug_delete(pItem); } } }
// 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); } } }
CClientFXMgr::CClientFXMgr() { m_bGoreEnabled = true; m_bInSlowMotion = false; m_hCamera = NULL; if( !g_pCLIENTFX_INSTANCE_Bank ) { g_pCLIENTFX_INSTANCE_Bank = debug_new( ClientFXBank ); } }
void CRelationMgr::Load(ILTMessage_Read *pMsg) { // Load the Collective count, then allocate and load each int nCollectives; LOAD_INT( nCollectives ); for ( int x = 0; x < nCollectives; x++ ) { CCollectiveRelationMgr* pCollective = debug_new( CCollectiveRelationMgr ); pCollective->Load(pMsg); m_listCollectives.push_back(pCollective); } }
LTBOOL CMissionData::AddWeapon(int weaponID) { CWeaponData* pData = GetWeaponData(weaponID); if (pData == LTNULL) { pData = debug_new(CWeaponData); m_Weapons.Add(pData); pData->m_nID = weaponID; return LTTRUE; } return LTFALSE; }
LTBOOL CMissionData::AddGear(int gearID) { CGearData* pData = GetGearData(gearID); if (pData == LTNULL) { pData = debug_new(CGearData); m_Gear.Add(pData); pData->m_nID = gearID; return LTTRUE; } return LTFALSE; }
LTBOOL CMissionData::AddMod(int modID) { CModData* pData = GetModData(modID); if (pData == LTNULL) { pData = debug_new(CModData); m_Mods.Add(pData); pData->m_nID = modID; return LTTRUE; } return LTFALSE; }