- Timestamp:
- Dec 5, 2016, 3:59:27 PM (8 years ago)
- Location:
- code/branches/Dialog_HS16/src/modules/notifications/dispatchers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.