[Orxonox-commit 6631] r11270 - in code/branches/Dialog_HS16: data/levels src/modules/notifications src/modules/notifications/dispatchers

dmoritz at orxonox.net dmoritz at orxonox.net
Mon Nov 7 15:59:00 CET 2016


Author: dmoritz
Date: 2016-11-07 15:59:00 +0100 (Mon, 07 Nov 2016)
New Revision: 11270

Modified:
   code/branches/Dialog_HS16/data/levels/missionOne.oxw
   code/branches/Dialog_HS16/src/modules/notifications/NotificationDispatcher.h
   code/branches/Dialog_HS16/src/modules/notifications/NotificationManager.h
   code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.cc
   code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h
Log:
Speaker added

Modified: code/branches/Dialog_HS16/data/levels/missionOne.oxw
===================================================================
--- code/branches/Dialog_HS16/data/levels/missionOne.oxw	2016-11-07 14:56:14 UTC (rev 11269)
+++ code/branches/Dialog_HS16/data/levels/missionOne.oxw	2016-11-07 14:59:00 UTC (rev 11270)
@@ -31,7 +31,7 @@
   <NotificationQueueCEGUI
     name="narrative"
     targets="simpleNotification,dialogue"
-    size=3
+    size=3,1
     displayTime=3.9
     position="0.2, 0, 0.1, 0"
     fontSize="23"
@@ -370,7 +370,7 @@
 
 
     <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=2/>
-    <Dialogue message="Press (F3) to see your mission briefing.">
+    <Dialogue speaker="ABC: " message=" Press (F3) to see your mission briefing.">
         <events>
             <trigger>
                 <EventListener event="spawndelaytrigger0" />

Modified: code/branches/Dialog_HS16/src/modules/notifications/NotificationDispatcher.h
===================================================================
--- code/branches/Dialog_HS16/src/modules/notifications/NotificationDispatcher.h	2016-11-07 14:56:14 UTC (rev 11269)
+++ code/branches/Dialog_HS16/src/modules/notifications/NotificationDispatcher.h	2016-11-07 14:59:00 UTC (rev 11270)
@@ -125,8 +125,7 @@
             */
             virtual const std::string& createNotificationMessage(void)
                 { return BLANKSTRING; }
-            virtual const std::string& createNotificationSpeaker(void)
-                { return BLANKSTRING; }
+            
 
     };
 

Modified: code/branches/Dialog_HS16/src/modules/notifications/NotificationManager.h
===================================================================
--- code/branches/Dialog_HS16/src/modules/notifications/NotificationManager.h	2016-11-07 14:56:14 UTC (rev 11269)
+++ code/branches/Dialog_HS16/src/modules/notifications/NotificationManager.h	2016-11-07 14:59:00 UTC (rev 11270)
@@ -76,7 +76,6 @@
             */
             inline const std::string & getMessage(void) const
                 { return this->message_; }
-
             /**
             @brief Get the sender of the Notification.
             @return Returns the sender of the Notification.
@@ -93,7 +92,7 @@
 
         private:
             std::string message_; //!< The Notification message.
-            std::string sender_; //!< The sender of the notifications.
+            std::string sender_;//!< The sender of the notifications.
             NotificationMessageType type_; //!< The type of the notification.
 
             void initialize(void); //!< Registers the object and sets some default values.

Modified: code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.cc
===================================================================
--- code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.cc	2016-11-07 14:56:14 UTC (rev 11269)
+++ code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.cc	2016-11-07 14:59:00 UTC (rev 11270)
@@ -15,8 +15,6 @@
 		this->setSender("dialogue");
 
         this->setSyncMode(ObjectDirection::None);
-
-
 	}
 
 	Dialogue::~Dialogue()
@@ -27,8 +25,13 @@
     {
         SUPER(Dialogue, XMLPort, xmlelement, mode);
 
+        XMLPortParam(Dialogue, "speaker", setSpeaker, getSpeaker, xmlelement, mode);
         XMLPortParam(Dialogue, "message", setMessage, getMessage, xmlelement, mode);
-        //XMLPortParam(Dialogue, "speaker", setSpeaker, getSpeaker, xmlelement, mode);
         
     }
+    const std::string& Dialogue::createNotificationMessage(void)
+                { 	
+                	dialogue_ = speaker_ + message_;
+                	return this->dialogue_ ;
+                }
 }
\ No newline at end of file

Modified: code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h
===================================================================
--- code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h	2016-11-07 14:56:14 UTC (rev 11269)
+++ code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h	2016-11-07 14:59:00 UTC (rev 11270)
@@ -20,22 +20,23 @@
 
             const std::string& getMessage(void)
                 { return this->message_; }
-         //   const std::string& getSpeaker(void)
-            //	{return this->speaker_;}
+         	const std::string& getSpeaker(void)
+            		{return this->speaker_;}
 
     protected:
-    	virtual const std::string& createNotificationMessage(void)
-                { return this->message_; }
-       // virtual const std::string& createNotificationSpeaker(void)
-        //		{ return this->speaker_; }
+    	virtual const std::string& createNotificationMessage(void);
+                
+       	
     private:
     		std::string message_;
-    	//	std::string speaker_;
+    		std::string speaker_;
+    		std::string dialogue_;
 
+    		void setSpeaker(const std::string& speaker)
+            	{ this->speaker_ = speaker;}
     		void setMessage(const std::string& message)
                 { this->message_ = message; }
-           // void setSpeaker(const std::string& speaker)
-            //	{ this->speaker_ = speaker;}
+            
         } ;       
 
 }




More information about the Orxonox-commit mailing list