Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 12, 2009, 9:24:58 PM (16 years ago)
Author:
landauf
Message:

changed type of gametype-HUD and default-HUD to PlayerInfo (instead of Gametype and ControllableEntity respectively). The owner of the Pawn-HUD remains Pawn.

Location:
code/trunk/src/orxonox/overlays/hud
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/overlays/hud/GametypeStatus.cc

    r2662 r2973  
    5858        SUPER(GametypeStatus, tick, dt);
    5959
    60         if (this->owner_ && this->owner_->getGametypeInfo() && this->owner_->getPlayer())
     60        if (this->owner_ && this->owner_->getGametypeInfo() && this->owner_->getControllableEntity())
    6161        {
    6262            const GametypeInfo* gtinfo = this->owner_->getGametypeInfo();
    63             PlayerInfo* pinfo = this->owner_->getPlayer();
     63            ControllableEntity* ce = this->owner_->getControllableEntity();
    6464
    6565            if (!gtinfo->hasStarted() && !gtinfo->isStartCountdownRunning())
    6666            {
    67                 if (!pinfo->isReadyToSpawn())
     67                if (!this->owner_->isReadyToSpawn())
    6868                    this->setCaption("Press [Fire] to start the match");
    6969                else
     
    7474                if (gtinfo->isStartCountdownRunning())
    7575                    this->setCaption(convertToString((int)ceil(gtinfo->getStartCountdown())));
    76                 else if (this->owner_->isA(Class(Spectator)))
     76                else if (ce->isA(Class(Spectator)))
    7777                    this->setCaption("Press [Fire] to respawn");
    7878                else
     
    8989        SUPER(GametypeStatus, changedOwner);
    9090
    91         this->owner_ = dynamic_cast<ControllableEntity*>(this->getOwner());
     91        this->owner_ = dynamic_cast<PlayerInfo*>(this->getOwner());
    9292    }
    9393}
  • code/trunk/src/orxonox/overlays/hud/GametypeStatus.h

    r2662 r2973  
    4747
    4848        private:
    49             ControllableEntity* owner_;
     49            PlayerInfo* owner_;
    5050    };
    5151}
  • code/trunk/src/orxonox/overlays/hud/PongScore.cc

    r2890 r2973  
    135135        SUPER(PongScore, changedOwner);
    136136
    137         this->owner_ = dynamic_cast<Pong*>(this->getOwner());
     137        if (this->getOwner() && this->getOwner()->getGametype())
     138            this->owner_ = dynamic_cast<Pong*>(this->getOwner()->getGametype());
     139        else
     140            this->owner_ = 0;
    138141    }
    139142}
Note: See TracChangeset for help on using the changeset viewer.