Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 22, 2009, 9:59:34 PM (15 years ago)
Author:
landauf
Message:

moved gametype-HUD from PlayerInfo to HumanPlayer

File:
1 edited

Legend:

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

    r2789 r2819  
    3535#include "network/ClientInformation.h"
    3636#include "objects/gametypes/Gametype.h"
    37 #include "overlays/OverlayGroup.h"
    3837
    3938namespace orxonox
     
    5150        this->controllableEntity_ = 0;
    5251        this->controllableEntityID_ = CLIENTID_UNKNOWN;
    53         this->gametypeHud_ = 0;
    5452
    5553        this->registerVariables();
     
    7068            if (this->getGametype())
    7169                this->getGametype()->playerLeft(this);
    72 
    73             if (this->BaseObject::isInitialized() && this->gametypeHud_)
    74                 delete this->gametypeHud_;
    7570        }
    7671    }
     
    109104                else
    110105                    this->getGametype()->playerEntered(this);
    111 
    112                 if (this->isLocalPlayer() && this->isHumanPlayer())
    113                     if (this->getGametype()->getHUDTemplate() != "")
    114                         this->setGametypeHUDTemplate(this->getGametype()->getHUDTemplate());
    115106            }
    116107        }
     
    185176        }
    186177    }
    187 
    188     void PlayerInfo::changedControllableEntity()
    189     {
    190         if (this->gametypeHud_)
    191             this->gametypeHud_->setOwner(this->getControllableEntity());
    192     }
    193 
    194     void PlayerInfo::updateGametypeHUD()
    195     {
    196         if (this->gametypeHud_)
    197         {
    198             delete this->gametypeHud_;
    199             this->gametypeHud_ = 0;
    200         }
    201 
    202         if (this->isLocalPlayer() && this->isHumanPlayer() && this->gametypeHudTemplate_ != "")
    203         {
    204             this->gametypeHud_ = new OverlayGroup(this);
    205             this->gametypeHud_->addTemplate(this->gametypeHudTemplate_);
    206             this->gametypeHud_->setOwner(this->getControllableEntity());
    207         }
    208     }
    209178}
Note: See TracChangeset for help on using the changeset viewer.