TimeSlider::TimeSlider( QWidget * parent ) : MySlider(parent) { dont_update = FALSE; setMinimum(0); #ifdef SEEKBAR_RESOLUTION setMaximum(SEEKBAR_RESOLUTION); #else setMaximum(100); #endif setFocusPolicy( Qt::NoFocus ); setSizePolicy( QSizePolicy::Expanding , QSizePolicy::Fixed ); connect( this, SIGNAL( sliderPressed() ), this, SLOT( stopUpdate() ) ); connect( this, SIGNAL( sliderReleased() ), this, SLOT( resumeUpdate() ) ); connect( this, SIGNAL( sliderReleased() ), this, SLOT( mouseReleased() ) ); connect( this, SIGNAL( valueChanged(int) ), this, SLOT( valueChanged_slot(int) ) ); #if ENABLE_DELAYED_DRAGGING connect( this, SIGNAL(draggingPos(int) ), this, SLOT(checkDragging(int)) ); last_pos_to_send = -1; timer = new QTimer(this); connect( timer, SIGNAL(timeout()), this, SLOT(sendDelayedPos()) ); timer->start(200); #endif }
/** * Function to be implemented. * This function is called every time the Manager is updated (every frame...) */ void TimeBomb::update(void) { mBlowTime -= GLOBAL_TIME_FRAME; if(mBlowTime >= 0.0f){ return; } // else we f*****g blow the bomb debugRED("Reproducir sonido + efecto\n"); performExplosion(mRadius, mPower); // stop the update stopUpdate(); }
void VisualizationManager::load( const Config& config ) { stopUpdate(); emitStatusUpdate( "Creating displays" ); root_display_group_->load( config ); emitStatusUpdate( "Creating tools" ); tool_manager_->load( config.mapGetChild( "Tools" )); emitStatusUpdate( "Creating views" ); view_manager_->load( config.mapGetChild( "Views" )); startUpdate(); }
/** * Function to be implemented. * This function is called every time the Manager is updated (every frame...) */ void ProximityBomb::update(void) { mAuxTime -= GLOBAL_TIME_FRAME; if(mActivationTime > 0.0f){ mActivationTime -= GLOBAL_TIME_FRAME; // we will emmit a sound if(mAuxTime < 0.0f){ debugBLUE("Si quermeos aca deberiamos emitir el beep de la bomba\n"); mAuxTime = CHECK_TIME; } return; } // else... here we have to check if there are units that can trigger the // bomb if(mAuxTime < 0.0f){ mAuxTime = CHECK_TIME; // perform the check mCollMngr->getCollisionObjects(mProximityQuery, PROXIMITY_MASK, mCollResult); if(mCollResult.empty()) { // nothing happens... return return; } // else... we have to blow the bomb debugRED("Aca tenemos que:\n " "1) Reproducir efecto de explosion.\n" "2) Reproducir sonido de explosion\n" "Notar que estamos explotando la bomba aun asi si no tenemos" " \"linea de vision\" directa con el objetivo. Tendriamos" " en todo caso que implementar una funcion en Bomb que permita" " chequear esto\n"); performExplosion(mRadius, mPower); stopUpdate(); } }
TimeSlider::TimeSlider( QWidget * parent ) : MySlider(parent) { dont_update = false; setMinimum(0); setMaximum(100); setFocusPolicy( Qt::NoFocus ); setSizePolicy( QSizePolicy::Expanding , QSizePolicy::Fixed ); connect( this, SIGNAL( sliderPressed() ), this, SLOT( stopUpdate() ) ); connect( this, SIGNAL( sliderReleased() ), this, SLOT( resumeUpdate() ) ); connect( this, SIGNAL( sliderReleased() ), this, SLOT( mouseReleased() ) ); connect( this, SIGNAL( valueChanged(int) ), this, SLOT( valueChanged_slot(int) ) ); connect( this, SIGNAL(draggingPos(int) ), this, SLOT(checkDragging(int)) ); last_pos_to_send = -1; timer = new QTimer(this); connect( timer, SIGNAL(timeout()), this, SLOT(sendDelayedPos()) ); timer->start(200); }