Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:58:47 AM (16 years ago)
Author:
dafrick
Message:

Reverted to revision 2906 (because I'm too stupid to merge correctly, 2nd try will follow shortly. ;))

Location:
code/branches/questsystem5
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

  • code/branches/questsystem5/src/orxonox/objects/controllers/AIController.cc

    r2907 r2908  
    3030#include "AIController.h"
    3131
    32 #include "core/GameMode.h"
     32#include "core/Core.h"
    3333#include "core/CoreIncludes.h"
    3434#include "core/Executor.h"
     
    4545        RegisterObject(AIController);
    4646
    47         if (GameMode::isMaster())
     47        if (Core::isMaster())
    4848            this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action)));
    4949    }
  • code/branches/questsystem5/src/orxonox/objects/controllers/CMakeLists.txt

    r2907 r2908  
    55  AIController.cc
    66  ScriptController.cc
    7   PongAI.cc
    87)
  • code/branches/questsystem5/src/orxonox/objects/controllers/Controller.cc

    r2907 r2908  
    4343        this->player_ = 0;
    4444        this->controllableEntity_ = 0;
     45        this->hud_ = 0;
     46        this->bUpdateHUD_ = false;
    4547    }
    4648
    4749    Controller::~Controller()
    4850    {
     51        if (this->isInitialized() && this->hud_)
     52            delete this->hud_;
     53    }
     54
     55    void Controller::changedControllableEntity()
     56    {
     57        if (this->bUpdateHUD_)
     58        {
     59            this->updateHUD();
     60            this->bUpdateHUD_ = false;
     61        }
     62
     63        if (this->hud_)
     64            this->hud_->setOwner(this->getControllableEntity());
     65    }
     66
     67    void Controller::updateHUD()
     68    {
     69        if (this->hud_)
     70        {
     71            delete this->hud_;
     72            this->hud_ = 0;
     73        }
     74
     75        if (this->hudtemplate_ != "")
     76        {
     77            this->hud_ = new OverlayGroup(this);
     78            this->hud_->addTemplate(this->hudtemplate_);
     79            this->hud_->setOwner(this->getControllableEntity());
     80        }
    4981    }
    5082}
  • code/branches/questsystem5/src/orxonox/objects/controllers/Controller.h

    r2907 r2908  
    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}
  • code/branches/questsystem5/src/orxonox/objects/controllers/HumanController.cc

    r2907 r2908  
    3535#include "objects/worldentities/pawns/Pawn.h"
    3636#include "objects/gametypes/Gametype.h"
    37 #include "objects/infos/PlayerInfo.h"
    3837
    3938namespace orxonox
     
    158157            if (pawn)
    159158                pawn->kill();
    160             else if (HumanController::localController_s->player_)
    161                 HumanController::localController_s->player_->stopControl(HumanController::localController_s->controllableEntity_);
    162159        }
    163160    }
Note: See TracChangeset for help on using the changeset viewer.