本文整理汇总了C++中CClientInfoMgr::GetLocalClient方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientInfoMgr::GetLocalClient方法的具体用法?C++ CClientInfoMgr::GetLocalClient怎么用?C++ CClientInfoMgr::GetLocalClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientInfoMgr
的用法示例。
在下文中一共展示了CClientInfoMgr::GetLocalClient方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateMarker
void CBodyFX::UpdateMarker()
{
if (!m_pClientDE || !m_hServerObject) return;
CClientInfoMgr *pClientMgr = g_pInterfaceMgr->GetClientInfoMgr();
if (!pClientMgr) return;
CLIENT_INFO* pLocalInfo = pClientMgr->GetLocalClient();
CLIENT_INFO* pInfo = pClientMgr->GetClientByID(m_bs.nClientId);
if (!pInfo || !pLocalInfo) return;
LTBOOL bSame = (pInfo->team == pLocalInfo->team);
if (bSame)
{
if (m_hMarker)
RemoveMarker();
return;
}
uint32 dwFlags = g_pLTClient->GetObjectFlags(m_hServerObject);
if (!(dwFlags & FLAG_VISIBLE))
{
RemoveMarker();
return;
}
LTVector vU, vR, vF, vTemp, vDims, vPos;
LTRotation rRot;
ILTPhysics* pPhysics = m_pClientDE->Physics();
m_pClientDE->GetObjectPos(m_hServerObject, &vPos);
pPhysics->GetObjectDims(m_hServerObject, &vDims);
vPos.y += (vDims.y + 20.0f);
if (!m_hMarker)
{
CreateMarker(vPos,bSame);
}
if (m_hMarker)
{
m_pClientDE->SetObjectPos(m_hMarker, &vPos);
}
}
示例2: UpdateNamePositions
void CHUDRadar::UpdateNamePositions()
{
float fx = (float)(m_NamePos.x) * g_pInterfaceResMgr->GetXRatio();
float fy = (float)(m_NamePos.y) * g_pInterfaceResMgr->GetYRatio();
if( IsTeamGameType() )
{
CClientInfoMgr* pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
CLIENT_INFO *pLocalCI = pCIMgr->GetLocalClient();
uint8 nTeam = 0;
if( pLocalCI)
{
nTeam = pLocalCI->nTeamID;
}
g_pDrawPrim->SetRGBA4( &teamPoly, nTeamColors[nTeam][1], nTeamColors[nTeam][0], nTeamColors[nTeam][1], nTeamColors[nTeam][2] );
float fw = 90.0f * g_pInterfaceResMgr->GetXRatio();
float fh = 90.0f * g_pInterfaceResMgr->GetYRatio();
g_pDrawPrim->SetXYWH( &teamPoly, fx-fw, fy, fw, fh);
}
RadarPlayerList::iterator iter = m_Players.begin();
while (iter != m_Players.end())
{
CUIFormattedPolyString* pStr = (*iter)->pName;
if (pStr->GetLength())
{
uint8 nSize = (uint8)(12.0f * g_pInterfaceResMgr->GetXRatio());
pStr->SetCharScreenHeight(nSize);
pStr->SetPosition(fx,fy);
fy += (float)pStr->GetHeight();
}
iter++;
}
}
示例3: AddPlayer
void CHUDRadar::AddPlayer(HOBJECT hObj, uint32 nId)
{
if (!hObj) return;
CClientInfoMgr* pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
CLIENT_INFO* pCI = pCIMgr->GetClientByID(nId);
HOBJECT hLocalObj = g_pLTClient->GetClientObject();
uint8 nTeamID = INVALID_TEAM;
// Check for teams and only display players of the same team...
if( IsTeamGameType() && hLocalObj != hObj)
{
CLIENT_INFO *pLocalCI = pCIMgr->GetLocalClient();
if( !pLocalCI || !pCI )
return;
if( pLocalCI->nTeamID != pCI->nTeamID )
return;
nTeamID = pCI->nTeamID;
}
bool bDead = false;
if (hLocalObj != hObj)
{
AddObject( hObj, RADAR_PLAYER_ALIVE_TYPE, nTeamID );
}
CCharacterFX *pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFX(hObj);
if (pCharacter && pCharacter->IsPlayerDead())
{
bDead = true;
}
RadarPlayerList::iterator iter = m_Players.begin();
while (iter != m_Players.end() && ( (*iter)->hObj != hObj ) )
{
iter++;
}
RADAR_PLAYER_OBJ* pPlayer = NULL;
//new player...
if (iter == m_Players.end())
{
pPlayer = debug_new(RADAR_PLAYER_OBJ);
m_Players.push_back(pPlayer);
}
else
{
pPlayer = (*iter);
}
pPlayer->nID = nId;
pPlayer->hObj = hObj;
if (!pPlayer->pName)
{
uint8 nFont = 0;
CUIFont* pFont = g_pInterfaceResMgr->GetFont(nFont);
pPlayer->pName = g_pFontManager->CreateFormattedPolyString(pFont,"",0.0f,0.0f);
pPlayer->pName->SetAlignmentH(CUI_HALIGN_RIGHT);
}
if (pCI)
{
pPlayer->pName->SetText(pCI->sName.c_str());
}
SetPlayerDead(hObj,bDead);
UpdateNamePositions();
}