Changeset 11317 for code/branches/Dialog_HS16/src/modules/overlays
- Timestamp:
- Dec 5, 2016, 3:59:27 PM (8 years ago)
- Location:
- code/branches/Dialog_HS16/src/modules/overlays/hud
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.cc
r11292 r11317 1 2 3 4 1 5 2 … … 13 10 #include <OgreTextAreaOverlayElement.h> 14 11 #include <OgrePanelOverlayElement.h> 12 #include "core/CoreIncludes.h" 15 13 16 14 namespace orxonox … … 23 21 { 24 22 RegisterObject(HUDDialogue); 25 26 overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Dialogue" + getUniqueNumberString())); 23 } 24 void HUDDialogue::updateTarget(std::string portrait) 25 { 26 overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Dialogue" + getUniqueNumberString())); 27 27 overlayElementIcon_->setPosition(0.0f,0.0f); 28 28 overlayElementIcon_->setDimensions(1.0f,1.0f); 29 this->background_->addChild(overlayElementIcon_); 29 this->background_->addChild(overlayElementIcon_); 30 30 31 overlayElementIcon_->setMaterialName("Orxonox/DialogueHUD_Person");32 33 } 34 35 void HUDDialogue::tick(float dt)31 overlayElementIcon_->setMaterialName(portrait); 32 this->setVisible(true); 33 portraitTimer.setTimer(2.9f,false,createExecutor(createFunctor(&HUDDialogue::invisible, this))); 34 } 35 void HUDDialogue::invisible() 36 36 { 37 SUPER(HUDDialogue, tick, dt); 38 39 37 this->setVisible(false); 38 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->overlayElementIcon_); 40 39 } 41 42 40 HUDDialogue::~HUDDialogue() 43 41 { … … 45 43 46 44 } 47 48 void HUDDialogue::XMLPort(Element& xmlelement, XMLPort::Mode mode)49 {50 SUPER(HUDDialogue, XMLPort, xmlelement, mode);51 }52 53 45 } -
code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.h
r11292 r11317 1 2 3 4 1 5 2 … … 13 10 14 11 #include "util/OgreForwardRefs.h" 15 #include "tools/interfaces/Tickable.h"16 12 #include "overlays/OrxonoxOverlay.h" 13 #include "tools/Timer.h" 17 14 18 15 namespace orxonox 19 16 { 20 class _OverlaysExport HUDDialogue : public OrxonoxOverlay , public Tickable17 class _OverlaysExport HUDDialogue : public OrxonoxOverlay 21 18 { 22 19 public: … … 24 21 virtual ~HUDDialogue(); 25 22 26 virtual void tick(float dt) override;23 virtual void updateTarget(std::string portrait); 27 24 28 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 29 30 25 virtual void invisible(); 31 26 32 27 private: 33 28 Ogre::PanelOverlayElement* overlayElementIcon_; 29 30 Timer portraitTimer; 34 31 }; 35 32 } 36 37 33 #endif
Note: See TracChangeset
for help on using the changeset viewer.