Changeset 11317 for code/branches
- Timestamp:
- Dec 5, 2016, 3:59:27 PM (8 years ago)
- Location:
- code/branches/Dialog_HS16
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Dialog_HS16/data/levels/missionOne.oxw
r11292 r11317 35 35 displayTime=3.9 36 36 position="0.2, 0, 0.1, 0" 37 fontSize=" 23"37 fontSize="19" 38 38 fontColor="0.3, 1, 0.2, 0.8" 39 39 alignment="HorzCentred" … … 371 371 372 372 <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=2/> 373 <Dialogue speaker=" ABC: " message=" Press (F3) to see your mission briefing.">373 <Dialogue speaker="Speaker" message=" Press (F3) to see your mission briefing." portrait="Orxonox/DialogueHUD_Person"> 374 374 <events> 375 375 <trigger> … … 410 410 411 411 <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=6/> 412 < SimpleNotification message="Let's fly to the blinking light.">412 <Dialogue speaker="Speaker" message="Let's fly to the blinking light." portrait="Orxonox/DialogueHUD_Person"> 413 413 <events> 414 414 <trigger> … … 416 416 </trigger> 417 417 </events> 418 </ SimpleNotification>418 </Dialogue> 419 419 420 420 <DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=10/> 421 < SimpleNotification message="Use (W) to accelerate and the mouse to steer.">421 <Dialogue speaker="Speaker" message="Use (W) to accelerate and the mouse to steer." portrait="Orxonox/DialogueHUD_Person"> 422 422 <events> 423 423 <trigger> … … 425 425 </trigger> 426 426 </events> 427 </ SimpleNotification>427 </Dialogue> 428 428 429 429 <!-- QUEST-Trigger && Message Trigger: navigationend is activated after flying4 was triggered --> … … 433 433 434 434 435 <Dialogue message="Three arrows just appeared.">435 <Dialogue speaker="Speaker2" message="Three arrows just appeared." portrait="Orxonox/DialogueHUD_Person2"> 436 436 <events> 437 437 <trigger> … … 442 442 443 443 <DistanceTrigger name="flying5" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=5/> 444 < SimpleNotification message="Follow those arrows.">444 <Dialogue speaker="Speaker2" message="Follow those arrows." portrait="Orxonox/DialogueHUD_Person2"> 445 445 <events> 446 446 <trigger> … … 448 448 </trigger> 449 449 </events> 450 </ SimpleNotification>450 </Dialogue> 451 451 452 452 <!-------------------------------------- PART ONE : Destroy boxes ---------------------------------------> … … 486 486 487 487 <!-- @Text: How to shoot--> 488 < SimpleNotification message="Destroy the four boxes." broadcast="true">488 <Dialogue speaker="Speaker" message="Destroy the four boxes." portrait="Orxonox/DialogueHUD_Person" broadcast="true"> 489 489 <events> 490 490 <trigger> … … 492 492 </trigger> 493 493 </events> 494 </ SimpleNotification>495 496 <SimpleNotification message=" 1. Aim the ared cycle." broadcast="true">494 </Dialogue> 495 496 <SimpleNotification message=" 1. Aim at the red cycle." broadcast="true"> 497 497 <events> 498 498 <trigger> -
code/branches/Dialog_HS16/data/overlays/HUDTemplates3.oxo
r11292 r11317 188 188 name = "Dialogue" 189 189 position = "0.5, 0.85" 190 font = "VeraMono" 190 pickpoint = "0.5, 0.5" 191 font = "VeraMono" 192 size = "0.2, 0.2" 191 193 textsize = 0.1 192 194 colour = "1.0, 1.0, 0.0, 0.8" -
code/branches/Dialog_HS16/src/modules/notifications/CMakeLists.txt
r8706 r11317 17 17 NotificationsPrecompiledHeaders.h 18 18 LINK_LIBRARIES 19 overlays 19 20 orxonox 20 21 SOURCE_FILES ${NOTIFICATIONS_SRC_FILES} -
code/branches/Dialog_HS16/src/modules/notifications/dispatchers/CMakeLists.txt
r11292 r11317 3 3 SimpleNotification.cc 4 4 Dialogue.cc 5 DialogueManager.cc6 5 ) -
code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.cc
r11270 r11317 1 1 2 2 3 … … 5 6 #include "core/EventIncludes.h" 6 7 #include "core/XMLPort.h" 8 9 #include "overlays/hud/HUDDialogue.h" 10 11 #include "NotificationDispatcher.h" 7 12 8 13 namespace orxonox{ … … 28 33 XMLPortParam(Dialogue, "speaker", setSpeaker, getSpeaker, xmlelement, mode); 29 34 XMLPortParam(Dialogue, "message", setMessage, getMessage, xmlelement, mode); 35 XMLPortParam(Dialogue, "portrait", setPortrait, getPortrait, xmlelement, mode); 30 36 31 37 } 38 void Dialogue::update() 39 { 40 for(HUDDialogue* huddialogue : ObjectList<HUDDialogue>()) 41 huddialogue->updateTarget(portrait_); 42 } 43 32 44 const std::string& Dialogue::createNotificationMessage(void) 33 45 { 34 dialogue_ = speaker_ + message_; 46 dialogue_ = speaker_ + ": " + message_; 47 this->update(); 35 48 return this->dialogue_ ; 36 49 } -
code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h
r11292 r11317 20 20 21 21 const std::string& getMessage(void) 22 { return this->message_; }22 { return this->message_; } 23 23 const std::string& getSpeaker(void) 24 24 {return this->speaker_;} 25 const std::string& getPortrait(void) 26 { return this->portrait_;} 27 25 28 protected: 26 29 virtual const std::string& createNotificationMessage(void); 27 30 virtual void update(void); 28 31 29 32 private: … … 31 34 std::string speaker_; 32 35 std::string dialogue_; 36 std::string portrait_; 33 37 34 38 void setSpeaker(const std::string& speaker) … … 36 40 void setMessage(const std::string& message) 37 41 { this->message_ = message; } 42 void setPortrait(const std::string& portrait) 43 { this->portrait_ = portrait;} 38 44 } ; 39 40 45 } 41 46 -
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.