Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2008, 10:54:26 PM (16 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
Location:
code/branches/objecthierarchy2/src/core
Files:
2 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
  • code/branches/objecthierarchy2/src/core/Super.h

    r2369 r2428  
    265265    #define SUPER_changedName(classname, functionname, ...) \
    266266        SUPER_NOARGS(classname, functionname)
     267
     268    #define SUPER_changedGametype(classname, functionname, ...) \
     269        SUPER_NOARGS(classname, functionname)
    267270    // (1/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
    268271
     
    513516
    514517        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(9, changedName, false)
     518            ()
     519        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
     520
     521        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(10, changedGametype, false)
    515522            ()
    516523        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
     
    568575    SUPER_INTRUSIVE_DECLARATION(changedOverlayGroup);
    569576    SUPER_INTRUSIVE_DECLARATION(changedName);
     577    SUPER_INTRUSIVE_DECLARATION(changedGametype);
    570578    // (3/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
    571579
Note: See TracChangeset for help on using the changeset viewer.