Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8682


Ignore:
Timestamp:
May 30, 2011, 10:20:27 AM (13 years ago)
Author:
dafrick
Message:

Hack-ish Hack to just have one HUD at a time.

Location:
code/branches/presentation/src/orxonox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/infos/PlayerInfo.cc

    r8561 r8682  
    176176        if (!entity)
    177177            return;
    178        
     178
     179        this->controllableEntity_->destroyHud(); // HACK-ish
    179180        this->previousControllableEntity_.push_back(WeakPtr<ControllableEntity>(this->controllableEntity_));
    180181        this->controllableEntity_ = entity;
     
    234235
    235236        this->controllableEntity_->setController(0);
     237        this->controllableEntity_->destroyHud(); // HACK-ish
    236238       
    237239//        this->controllableEntity_ = this->previousControllableEntity_.back();
     
    245247            this->controller_->setControllableEntity(this->controllableEntity_);
    246248
     249         // HACK-ish
     250        if(this->controllableEntity_ != NULL)
     251            this->controllableEntity_->createHud();
     252
    247253        if ( GameMode::isMaster() )
    248254            entity->removePlayer();
  • code/branches/presentation/src/orxonox/worldentities/ControllableEntity.cc

    r8680 r8682  
    406406        }
    407407
     408        this->createHud();
     409    }
     410
     411    // HACK-ish
     412    void ControllableEntity::createHud(void)
     413    {
    408414        if (!this->hud_ && GameMode::showsGraphics())
    409415        {
     
    414420                this->hud_->setOwner(this);
    415421            }
     422        }
     423    }
     424
     425    void ControllableEntity::destroyHud(void)
     426    {
     427        if (this->hud_ != NULL)
     428        {
     429            this->hud_->destroy();
     430            this->hud_ = NULL;
    416431        }
    417432    }
  • code/branches/presentation/src/orxonox/worldentities/ControllableEntity.h

    r8680 r8682  
    176176            inline void setHudTemplate(const std::string& name)
    177177                { this->hudtemplate_ = name; }
     178            // HACK-ish
     179            void createHud(void);
     180            void destroyHud(void);
    178181
    179182            Ogre::SceneNode* cameraPositionRootNode_;
Note: See TracChangeset for help on using the changeset viewer.