void CClientCheckpoint::ReCreateWithSameIdentifier ( void ) { // Recreate if we're streamed in and visible if ( IsStreamedIn () && m_bVisible ) { Destroy (); Create ( m_dwIdentifier ); } }
void CClientCheckpoint::ReCreate ( void ) { // Recreate if we're streamed in and visible if ( IsStreamedIn () && m_bVisible ) { Destroy (); Create (); } }
void CObject::SetPosition(const CVector3& vecPosition) { // Are we spawned? if(IsStreamedIn()) { Scripting::SetObjectCoordinates(m_uiObjectHandle, vecPosition.fX, vecPosition.fY, vecPosition.fZ); Scripting::AddObjectToInteriorRoomByKey(m_uiObjectHandle, (Scripting::eInteriorRoomKey)g_pClient->GetLocalPlayer()->GetInterior()); } m_vecPosition = vecPosition; }
void CPickup::SetRotation(const CVector3& vecRotation) { m_vecRotation = vecRotation; // Are we streamed in? if(IsStreamedIn()) { // Stream ourselves out and back in StreamOut(); StreamIn(); } }
void CPickup::SetValue(unsigned int uiValue) { m_uiValue = uiValue; // Are we streamed in? if(IsStreamedIn()) { // Stream ourselves out and back in StreamOut(); StreamIn(); } }
void CClientPickup::SetVisible ( bool bVisible ) { // Only update visible state if we're streamed in if ( IsStreamedIn () ) { if ( bVisible ) Create (); else Destroy (); } // Update the flag m_bVisible = bVisible; }
void CClientMarker::StreamOut ( void ) { // Streamed in? if ( IsStreamedIn ( ) ) { // Decrement streamed in counter --m_uiStreamedInMarkers; // Stream the marker out m_pMarker->StreamOut (); } }
void CClientMarker::StreamIn ( bool bInstantly ) { // Not already streamed in? if ( !IsStreamedIn ( ) ) { // Stream the marker in m_pMarker->StreamIn (); // Increment streamed in counter ++m_uiStreamedInMarkers; // Tell the streamer we've created this object NotifyCreate (); } }
void CClientCheckpoint::SetVisible ( bool bVisible ) { // If we're streamed in, create/destroy as we're getting visible/invisible if ( IsStreamedIn () ) { if ( !bVisible && m_bVisible ) { Destroy (); } else if ( bVisible && !m_bVisible ) { Create (); } } // Set the new visible state m_bVisible = bVisible; }
void CClientCorona::DoPulse ( void ) { CRegisteredCorona* pCorona = m_pCoronas->CreateCorona ( m_ulIdentifier, &m_Matrix.vPos ); if ( !pCorona ) return; if ( IsStreamedIn () && m_bVisible ) { SColor color = GetColor (); if ( m_pThis->GetInterior () != g_pGame->GetWorld ()->GetCurrentArea () ) color.A = 0; pCorona->SetColor ( color.R, color.G, color.B, color.A ); pCorona->SetSize ( m_fSize ); } else { pCorona->Disable (); } }
void CClientMarker::SetMarkerType ( CClientMarker::eMarkerType eType ) { // Different from current type? eMarkerType eCurrentType = GetMarkerType (); if ( eCurrentType != eType ) { // Current type is a checkpoint and new type is a ring? if ( eCurrentType == MARKER_CHECKPOINT && eType == MARKER_RING ) { // Just change the type static_cast < CClientCheckpoint* > ( m_pMarker ) ->SetCheckpointType ( CClientCheckpoint::TYPE_RING ); } // Or current type is a ring and new type is a checkpoint? if ( eCurrentType == MARKER_RING && eType == MARKER_CHECKPOINT ) { // Just change the type static_cast < CClientCheckpoint* > ( m_pMarker ) ->SetCheckpointType ( CClientCheckpoint::TYPE_NORMAL ); } // Current type is a cylinder and new type is an arrow if ( eCurrentType == MARKER_CYLINDER && eType == MARKER_ARROW ) { // Just change the type static_cast < CClient3DMarker* > ( m_pMarker ) ->Set3DMarkerType ( CClient3DMarker::TYPE_ARROW ); } // Current type is an arrow and new type is an cylinder if ( eCurrentType == MARKER_ARROW && eType == MARKER_CYLINDER ) { // Just change the type static_cast < CClient3DMarker* > ( m_pMarker ) ->Set3DMarkerType ( CClient3DMarker::TYPE_CYLINDER ); } // No easy way of changing the type. Different classes. Remember position and color and recreate it. CVector vecPosition; m_pMarker->GetPosition ( vecPosition ); bool bVisible = m_pMarker->IsVisible (); float fSize = m_pMarker->GetSize (); SColor color = m_pMarker->GetColor (); bool bStreamedIn = IsStreamedIn (); // Destroy the old. delete m_pMarker; m_pMarker = NULL; // Create a new one of the correct type CreateOfType ( eType ); // Set the properties back SetPosition ( vecPosition ); SetSize ( fSize ); SetColor ( color ); SetVisible ( bVisible ); // Stream it in if it was streamed in if ( bStreamedIn ) { m_pMarker->StreamIn (); } } }