Changeset 5929 for code/trunk/src/modules/overlays/hud
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core5 (added) merged: 5768-5769,5772,5775-5780,5783-5785,5791-5792,5795-5807,5809-5814,5816-5832,5836-5839,5842-5853,5855-5899,5904-5922,5924-5928
- Property svn:mergeinfo changed
-
code/trunk/src/modules/overlays/hud/ChatOverlay.cc
r5781 r5929 58 58 ChatOverlay::~ChatOverlay() 59 59 { 60 for (std::set<Timer*>::iterator it = this->timers_.begin(); it != this->timers_.end(); ++it) 61 delete (*it); 60 62 } 61 63 … … 87 89 COUT(0) << "Chat: " << text << std::endl; 88 90 89 new Timer<ChatOverlay>(this->displayTime_, false, this, createExecutor(createFunctor(&ChatOverlay::dropMessage)), true); 91 Timer* timer = new Timer(); 92 this->timers_.insert(timer); // store the timer in a set to destroy it in the destructor 93 Executor* executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this)); 94 executor->setDefaultValues(timer); 95 timer->setTimer(this->displayTime_, false, executor, true); 90 96 91 97 this->updateOverlayText(); 92 98 } 93 99 94 void ChatOverlay::dropMessage( )100 void ChatOverlay::dropMessage(Timer* timer) 95 101 { 96 102 if (this->messages_.size() > 0) 97 103 this->messages_.pop_front(); 98 104 this->updateOverlayText(); 105 this->timers_.erase(timer); // the timer destroys itself, but we have to remove it from the set 99 106 } 100 107 -
code/trunk/src/modules/overlays/hud/ChatOverlay.h
r5781 r5929 55 55 private: 56 56 void updateOverlayText(); 57 void dropMessage( );57 void dropMessage(Timer* timer); 58 58 59 59 float displayTime_; 60 std::set<Timer*> timers_; 60 61 }; 61 62 } -
code/trunk/src/modules/overlays/hud/HUDBar.cc
r5781 r5929 96 96 { 97 97 if (this->isInitialized()) 98 { 98 99 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->bar_); 100 for (std::vector<BarColour*>::const_iterator it = this->barColours_.begin(); it != this->barColours_.end(); ) 101 (*it++)->destroy(); 102 } 99 103 } 100 104 -
code/trunk/src/modules/overlays/hud/HUDHealthBar.cc
r5781 r5929 56 56 { 57 57 if (this->isInitialized()) 58 delete this->textoverlay_;58 this->textoverlay_->destroy(); 59 59 } 60 60 … … 84 84 this->setValue(this->owner_->getHealth() / this->owner_->getInitialHealth()); 85 85 this->textoverlay_->setCaption(multi_cast<std::string>(static_cast<int>(this->owner_->getHealth()))); 86 } 87 else 88 { 89 this->setValue(0); 90 this->textoverlay_->setCaption("0"); 86 91 } 87 92 -
code/trunk/src/modules/overlays/hud/HUDHealthBar.h
r5781 r5929 111 111 112 112 private: 113 Pawn*owner_;113 WeakPtr<Pawn> owner_; 114 114 OverlayText* textoverlay_; 115 115 bool bUseBarColour_; -
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
r5781 r5929 39 39 #include "core/CoreIncludes.h" 40 40 #include "core/XMLPort.h" 41 #include "Scene.h" 41 42 #include "Radar.h" 42 43 … … 130 131 SUPER(HUDNavigation, tick, dt); 131 132 132 if (!Radar::getInstance().getFocus()) 133 // Get radar 134 Radar* radar = this->getOwner()->getScene()->getRadar(); 135 136 if (!radar->getFocus()) 133 137 { 134 138 this->overlay_->hide(); … … 150 154 */ 151 155 // transform to screen coordinates 152 Vector3 pos = /*transformationMatrix * */ Radar::getInstance().getFocus()->getRVWorldPosition();156 Vector3 pos = /*transformationMatrix * */radar->getFocus()->getRVWorldPosition(); 153 157 154 158 bool outOfView; -
code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.cc
r5781 r5929 118 118 119 119 if (this->getOwner() && this->getOwner()->getGametype()) 120 this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype() );120 this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype().get()); 121 121 else 122 122 this->owner_ = 0; -
code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.cc
r5781 r5929 52 52 this->text_->setPickPoint(Vector2(0.5, 0)); 53 53 54 this->inittimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&UnderAttackHealthBar::init)));54 this->inittimer_.setTimer(0.0f, false, createExecutor(createFunctor(&UnderAttackHealthBar::init, this))); 55 55 } 56 56 … … 58 58 { 59 59 if (this->isInitialized()) 60 delete this->text_;60 this->text_->destroy(); 61 61 } 62 62 … … 78 78 this->owner_ = player; 79 79 80 UnderAttack* ua = orxonox_cast<UnderAttack*>(player->getGametype() );80 UnderAttack* ua = orxonox_cast<UnderAttack*>(player->getGametype().get()); 81 81 if (ua) 82 82 { -
code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.h
r5781 r5929 62 62 PlayerInfo* owner_; 63 63 OverlayText* text_; 64 Timer <UnderAttackHealthBar>inittimer_;64 Timer inittimer_; 65 65 }; 66 66 }
Note: See TracChangeset
for help on using the changeset viewer.