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/core/BaseObject.h

    r2369 r2428  
    135135            inline Scene* getScene() const { return this->scene_; }
    136136
    137             inline void setGametype(Gametype* gametype) { this->oldGametype_ = this->gametype_; this->gametype_ = gametype; this->changedGametype(); }
     137            inline void setGametype(Gametype* gametype)
     138            {
     139                if (gametype != this->gametype_)
     140                {
     141                    this->oldGametype_ = this->gametype_;
     142                    this->gametype_ = gametype;
     143                    this->changedGametype();
     144                }
     145            }
    138146            inline Gametype* getGametype() const { return this->gametype_; }
    139147            inline Gametype* getOldGametype() const { return this->oldGametype_; }
    140             virtual inline void changedGametype() {}
     148            virtual void changedGametype() {}
    141149
    142150            void fireEvent();
     
    197205    SUPER_FUNCTION(6, BaseObject, changedMainState, false);
    198206    SUPER_FUNCTION(9, BaseObject, changedName, false);
     207    SUPER_FUNCTION(10, BaseObject, changedGametype, false);
    199208}
    200209
Note: See TracChangeset for help on using the changeset viewer.