Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2008, 10:54:26 PM (15 years ago)
Author:
landauf
Message:
  • Moved some variables from Gametype to GametypeInfo (Gametype exists only on the Server while GametypeInfo is synchronized)
  • Created a new HUD-element, GametypeStatus, based on GametypeInfo (the same effect was formerly achieved by using a hack in Spectator and a TextOverlay)
  • HumanController creates a HUD (additionally to the SpaceShips HUD) which includes GametypeStatus and ChatOverlay and even more in the future
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/orxonox/objects/controllers/Controller.h

    r2362 r2428  
    5757            inline ControllableEntity* getControllableEntity() const
    5858                { return this->controllableEntity_; }
    59             virtual void changedControllableEntity() {}
     59            virtual void changedControllableEntity();
     60
     61            inline void setHUDTemplate(const std::string& name)
     62            {
     63                if (name != this->hudtemplate_)
     64                {
     65                    this->hudtemplate_ = name;
     66                    if (this->controllableEntity_)
     67                        this->updateHUD();
     68                    else
     69                        this->bUpdateHUD_ = true;
     70                }
     71            }
     72            inline const std::string& getHUDTemplate() const
     73                { return this->hudtemplate_; }
     74
     75            inline OverlayGroup* getHUD() const
     76                { return this->hud_; }
    6077
    6178        protected:
     79            void updateHUD();
     80
    6281            PlayerInfo* player_;
    6382            ControllableEntity* controllableEntity_;
     83            std::string hudtemplate_;
     84            OverlayGroup* hud_;
     85            bool bUpdateHUD_;
    6486    };
    6587}
Note: See TracChangeset for help on using the changeset viewer.