//----------------------------------------------------------------------------- // Purpose: The player holding this weapon has just gained new technology. // Check to see if it affects the medikit //----------------------------------------------------------------------------- void CWeaponBuilder::GainedNewTechnology( CBaseTechnology *pTechnology ) { CBaseTFPlayer *pPlayer = ToBaseTFPlayer( GetOwner() ); if ( pPlayer ) { // Force a recalculation of the state for this object SetCurrentObject( m_iCurrentObject ); } }
void Loaders::t3DSLoader::ProcessNextKeyFrameChunk(t3DModel *pModel, tChunk *pPreviousChunk) { char strKeyFrameObject[50] = {0}; float temp = 0.0f; m_CurrentChunk = new tChunk; while (pPreviousChunk->bytesRead < pPreviousChunk->length) { ReadChunk(m_CurrentChunk); switch (m_CurrentChunk->ID) { case KEYFRAME_MESH_INFO: ProcessNextKeyFrameChunk(pModel, m_CurrentChunk); break; case KEYFRAME_OBJECT_NAME: m_CurrentChunk->bytesRead += GetString(strKeyFrameObject); SetCurrentObject(pModel, strKeyFrameObject); m_CurrentChunk->bytesRead += fread(gBuffer, 1, m_CurrentChunk->length - m_CurrentChunk->bytesRead, m_FilePointer); break; case KEYFRAME_START_AND_END: m_CurrentChunk->bytesRead += fread(&(pModel->numberOfFrames), 1, 4, m_FilePointer); m_CurrentChunk->bytesRead += fread(&(pModel->numberOfFrames), 1, 4, m_FilePointer); break; case PIVOT: m_CurrentChunk->bytesRead += fread(&(m_CurrentObject->vPivot), 1, sizeof(CVector3), m_FilePointer); temp = m_CurrentObject->vPivot.y; m_CurrentObject->vPivot.y = m_CurrentObject->vPivot.z; m_CurrentObject->vPivot.z = -temp; break; case POSITION_TRACK_TAG: ReadKeyFramePositions(pModel, m_CurrentChunk); break; case ROTATION_TRACK_TAG: ReadKeyFrameRotations(pModel, m_CurrentChunk); break; case SCALE_TRACK_TAG: ReadKeyFrameScales(pModel, m_CurrentChunk); break; default: m_CurrentChunk->bytesRead += fread(gBuffer, 1, m_CurrentChunk->length - m_CurrentChunk->bytesRead, m_FilePointer); break; } pPreviousChunk->bytesRead += m_CurrentChunk->bytesRead; } delete m_CurrentChunk; m_CurrentChunk = pPreviousChunk; }
//----------------------------------------------------------------------------- // Purpose: Player holding this weapon has aborted the build of an object //----------------------------------------------------------------------------- void CWeaponBuilder::StoppedBuilding( int iObjectType ) { CBaseTFPlayer *pPlayer = ToBaseTFPlayer( GetOwner() ); if ( pPlayer ) { // Force a recalculation of the state for this object SetCurrentObject( m_iCurrentObject ); SetCurrentState( BS_IDLE ); WeaponSound( SPECIAL2 ); } }
//----------------------------------------------------------------------------- // Purpose: The player holding this weapon has just finished building an object //----------------------------------------------------------------------------- void CWeaponBuilder::FinishedObject( void ) { CBaseTFPlayer *pPlayer = ToBaseTFPlayer( GetOwner() ); if ( pPlayer ) { // We're no longer building anything... m_hObjectBeingBuilt = NULL; // Force a recalculation of the state for this object SetCurrentObject( m_iCurrentObject ); SetCurrentState( BS_IDLE ); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- bool CWeaponBuilder::CanDeploy( void ) { if ( m_iCurrentObject != BUILDER_INVALID_OBJECT ) { SetCurrentState( BS_PLACING ); StartPlacement(); m_flNextPrimaryAttack = gpGlobals->curtime + 0.35f; } else { m_hObjectBeingBuilt = NULL; SetCurrentState( BS_IDLE ); SetCurrentObject( m_iCurrentObject ); } return BaseClass::CanDeploy(); }
/** * Unload project. * * All windows are destroyed and objects freed. */ void UnloadCurrentProject() { if ( cur_project == NULL ) { return; } SetCurrentObject( NULL); OBJ_LIST_ITERATE_BEGIN( GetProjectChildList( cur_project)); DestroyObjectWindow( node->elem, TWC_TRUE); OBJ_LIST_ITERATE_END(); FreeProject( cur_project); cur_project = NULL; SetStatusText( NULL); return; }
/** * Load current project. * * Creates windows for all objects in project, with childs. */ int LoadCurrentProject() { RT_OBJECT *obj; OBJ_LIST_ITERATE_BEGIN( GetProjectChildList( cur_project)); if ( CreateObjectWindow( node->elem, TWC_TRUE) == 0) { if ( MessageBox( hMainWnd, T("Error creating one of windows! Continue loading?"), T("Error"), MB_YESNO) == IDNO ) { return 0; } } OBJ_LIST_ITERATE_END(); obj = GetProjectChildList( cur_project)->first->elem; if ( obj != NULL ) { TWC_CHECKIT( IsObjectWindow( obj) ); SetCurrentObject( obj); SetFocus( obj->hwnd); } return 1; }