Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6236


Ignore:
Timestamp:
Dec 3, 2009, 9:36:22 PM (14 years ago)
Author:
scheusso
Message:

showing and hiding of overlays should now work correct with respawning and menu toggling

Location:
code/branches/presentation2/src/orxonox/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc

    r6223 r6236  
    6969        controlMode_ = 0;
    7070        acceleration_ = 0;
    71         acceleration_ = false;
     71        accelerating_ = false;
    7272        firemode_ = -1;
    7373        showArrows_ = true;
     74        showOverlays_ = false;
    7475
    7576        //currentPitch_ = 1;
     
    129130        NewHumanController::localController_s = this;
    130131
    131         controlPaused_ = true;
     132        controlPaused_ = false;
    132133
    133134//HumanController::localController_s->getControllableEntity()->getCamera()->setDrag(true);
     
    169170
    170171                    if ( this->controlMode_ == 0 || ( this->controlMode_ == 1 && this->firemode_ == 1 ) )
    171                         alignArrows();
     172                    {
     173                        if ( this->showOverlays_ )
     174                            alignArrows();
     175                    }
    172176                    else
    173177                        hideArrows();
    174 
    175                     this->crossHairOverlay_->show();
    176                     this->centerOverlay_->show();
    177178                }
    178             }
    179             else {
    180                 this->crossHairOverlay_->hide();
    181                 this->centerOverlay_->hide();
    182 
    183                 hideArrows();
    184179            }
    185180
     
    384379        this->currentYaw_ = 0;
    385380        this->currentPitch_ = 0;
    386 //         if (this->getControllableEntity() && this->getControllableEntity()->getIdentifier()->getName() == "SpaceShip") {
    387 //             this->doResumeControl();
    388 //         }
     381        if (this->getControllableEntity() && this->getControllableEntity()->getIdentifier()->getName() == "SpaceShip")
     382        {
     383            this->showOverlays_ = true;
     384            if( !this->controlPaused_ )
     385            {
     386                this->showOverlays();
     387                this->alignArrows();
     388            }
     389        }
     390        else
     391        {
     392            this->showOverlays_ = false;
     393            this->hideOverlays();
     394        }
    389395    }
    390396
     
    407413    void NewHumanController::doResumeControl() {
    408414        this->controlPaused_ = false;
    409         this->crossHairOverlay_->show();
    410         this->centerOverlay_->show();
     415        if( this->showOverlays_ ) {
     416            this->showOverlays();
     417        }
    411418    }
    412419
    413420    void NewHumanController::doPauseControl() {
    414421        this->controlPaused_ = true;
    415 
    416         this->crossHairOverlay_->hide();
    417         this->centerOverlay_->hide();
    418 
    419         hideArrows();
     422       
     423        this->hideOverlays();
    420424    }
    421425
     
    447451            }
    448452        }
     453    }
     454
     455    void NewHumanController::showOverlays() {
     456        this->crossHairOverlay_->show();
     457        this->centerOverlay_->show();
     458       
     459        if (showArrows_) {
     460            this->arrowsOverlay1_->show();
     461            this->arrowsOverlay2_->show();
     462            this->arrowsOverlay3_->show();
     463            this->arrowsOverlay4_->show();
     464        }
     465    }
     466
     467    void NewHumanController::hideOverlays() {
     468        this->crossHairOverlay_->hide();
     469        this->centerOverlay_->hide();
     470       
     471        this->hideArrows();
    449472    }
    450473
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.h

    r6210 r6236  
    6868            void updateTarget();
    6969            void alignArrows();
     70            void showOverlays();
     71            void hideOverlays();
    7072            void hideArrows();
    7173
     
    8789            int                         firemode_;
    8890            bool                        showArrows_;
     91            bool                        showOverlays_;
    8992            ClassTreeMask               targetMask_;
    9093    };
Note: See TracChangeset for help on using the changeset viewer.