Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 16, 2009, 2:11:14 AM (15 years ago)
Author:
landauf
Message:
  • Moved default-hud (chat, gamestate info) from Controller to HumanPlayer
  • Added support for a Gametype-HUD to Gametype and PlayerInfo
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/miniprojects/src/orxonox/objects/controllers/Controller.cc

    r2662 r2789  
    4343        this->player_ = 0;
    4444        this->controllableEntity_ = 0;
    45         this->hud_ = 0;
    46         this->bUpdateHUD_ = false;
    4745    }
    4846
    4947    Controller::~Controller()
    5048    {
    51         if (this->isInitialized() && this->hud_)
    52             delete this->hud_;
    53     }
    54 
    55     void Controller::changedControllableEntity()
    56     {
    57         if (this->bUpdateHUD_)
    58         {
    59             this->updateHUD();
    60             this->bUpdateHUD_ = false;
    61         }
    62 
    63         if (this->hud_)
    64             this->hud_->setOwner(this->getControllableEntity());
    65     }
    66 
    67     void Controller::updateHUD()
    68     {
    69         if (this->hud_)
    70         {
    71             delete this->hud_;
    72             this->hud_ = 0;
    73         }
    74 
    75         if (this->hudtemplate_ != "")
    76         {
    77             this->hud_ = new OverlayGroup(this);
    78             this->hud_->addTemplate(this->hudtemplate_);
    79             this->hud_->setOwner(this->getControllableEntity());
    80         }
    8149    }
    8250}
Note: See TracChangeset for help on using the changeset viewer.