[Orxonox-commit 6654] r11292 - in code/branches/Dialog_HS16: data/levels data/overlays src/modules/notifications/dispatchers src/modules/overlays/hud

dmoritz at orxonox.net dmoritz at orxonox.net
Mon Nov 14 16:08:56 CET 2016


Author: dmoritz
Date: 2016-11-14 16:08:55 +0100 (Mon, 14 Nov 2016)
New Revision: 11292

Added:
   code/branches/Dialog_HS16/src/modules/notifications/dispatchers/DialogueManager.cc
   code/branches/Dialog_HS16/src/modules/notifications/dispatchers/DialogueManager.h
   code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.cc
   code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.h
Modified:
   code/branches/Dialog_HS16/data/levels/missionOne.oxw
   code/branches/Dialog_HS16/data/overlays/HUDTemplates3.oxo
   code/branches/Dialog_HS16/src/modules/notifications/dispatchers/CMakeLists.txt
   code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h
   code/branches/Dialog_HS16/src/modules/overlays/hud/CMakeLists.txt
Log:
New DialogueManager Class

Modified: code/branches/Dialog_HS16/data/levels/missionOne.oxw
===================================================================
--- code/branches/Dialog_HS16/data/levels/missionOne.oxw	2016-11-14 15:07:34 UTC (rev 11291)
+++ code/branches/Dialog_HS16/data/levels/missionOne.oxw	2016-11-14 15:08:55 UTC (rev 11292)
@@ -31,7 +31,7 @@
   <NotificationQueueCEGUI
     name="narrative"
     targets="simpleNotification,dialogue"
-    size=3,1
+    size=3
     displayTime=3.9
     position="0.2, 0, 0.1, 0"
     fontSize="23"

Modified: code/branches/Dialog_HS16/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/branches/Dialog_HS16/data/overlays/HUDTemplates3.oxo	2016-11-14 15:07:34 UTC (rev 11291)
+++ code/branches/Dialog_HS16/data/overlays/HUDTemplates3.oxo	2016-11-14 15:08:55 UTC (rev 11292)
@@ -183,6 +183,16 @@
      visible                = "true"
      weaponModeHUDSize      = "0.09, 0.03"
     />
+
+    <HUDDialogue
+     name     = "Dialogue"
+     position = "0.5, 0.85"
+     font     = "VeraMono"
+     textsize = 0.1
+     colour   = "1.0, 1.0, 0.0, 0.8"
+     align    = "center"
+    />
+
     
     <HUDTimer
      name     = "Timer"

Modified: code/branches/Dialog_HS16/src/modules/notifications/dispatchers/CMakeLists.txt
===================================================================
--- code/branches/Dialog_HS16/src/modules/notifications/dispatchers/CMakeLists.txt	2016-11-14 15:07:34 UTC (rev 11291)
+++ code/branches/Dialog_HS16/src/modules/notifications/dispatchers/CMakeLists.txt	2016-11-14 15:08:55 UTC (rev 11292)
@@ -2,4 +2,5 @@
   CommandNotification.cc
   SimpleNotification.cc
   Dialogue.cc
+  DialogueManager.cc
 )

Modified: code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h
===================================================================
--- code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h	2016-11-14 15:07:34 UTC (rev 11291)
+++ code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h	2016-11-14 15:08:55 UTC (rev 11292)
@@ -22,7 +22,6 @@
                 { return this->message_; }
          	const std::string& getSpeaker(void)
             		{return this->speaker_;}
-
     protected:
     	virtual const std::string& createNotificationMessage(void);
                 
@@ -36,7 +35,6 @@
             	{ this->speaker_ = speaker;}
     		void setMessage(const std::string& message)
                 { this->message_ = message; }
-            
         } ;       
 
 }

Added: code/branches/Dialog_HS16/src/modules/notifications/dispatchers/DialogueManager.cc
===================================================================
--- code/branches/Dialog_HS16/src/modules/notifications/dispatchers/DialogueManager.cc	                        (rev 0)
+++ code/branches/Dialog_HS16/src/modules/notifications/dispatchers/DialogueManager.cc	2016-11-14 15:08:55 UTC (rev 11292)
@@ -0,0 +1,29 @@
+
+
+#include "DialogueManager.h"
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+#include "core/XMLPort.h"
+
+
+
+
+namespace orxonox{
+
+
+	RegisterClass(DialogueManager);
+
+	DialogueManager::DialogueManager(Context* context):NotificationDispatcher(context)
+	{
+		RegisterObject(DialogueManager);
+
+	}
+	DialogueManager::~DialogueManager()
+    {
+
+    }
+    void DialogueManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(DialogueManager, XMLPort, xmlelement, mode);
+    }
+}
\ No newline at end of file

Added: code/branches/Dialog_HS16/src/modules/notifications/dispatchers/DialogueManager.h
===================================================================
--- code/branches/Dialog_HS16/src/modules/notifications/dispatchers/DialogueManager.h	                        (rev 0)
+++ code/branches/Dialog_HS16/src/modules/notifications/dispatchers/DialogueManager.h	2016-11-14 15:08:55 UTC (rev 11292)
@@ -0,0 +1,24 @@
+
+
+#ifndef _DialogueManager_H__
+#define _DialogueManager_H__
+
+#include "notifications/NotificationsPrereqs.h"
+
+#include "notifications/NotificationDispatcher.h"
+
+namespace orxonox{
+
+
+	class _NotificationsExport DialogueManager: public NotificationDispatcher{
+
+	public:
+            DialogueManager(Context* context); //!< Default Constructor.
+            virtual ~DialogueManager(); //!< Destructor.
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+        };
+}
+
+#endif 
\ No newline at end of file

Modified: code/branches/Dialog_HS16/src/modules/overlays/hud/CMakeLists.txt
===================================================================
--- code/branches/Dialog_HS16/src/modules/overlays/hud/CMakeLists.txt	2016-11-14 15:07:34 UTC (rev 11291)
+++ code/branches/Dialog_HS16/src/modules/overlays/hud/CMakeLists.txt	2016-11-14 15:08:55 UTC (rev 11292)
@@ -24,4 +24,5 @@
   PauseNotice.cc
   LastTeamStandingInfos.cc
   CountDown.cc
+  HUDDialogue.cc
 )

Added: code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.cc
===================================================================
--- code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.cc	                        (rev 0)
+++ code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.cc	2016-11-14 15:08:55 UTC (rev 11292)
@@ -0,0 +1,53 @@
+
+
+
+
+
+#include "HUDDialogue.h"
+
+#include "core/XMLPort.h"
+
+#include <OgreCamera.h>
+#include <OgreFontManager.h>
+#include <OgreOverlayManager.h>
+#include <OgreTextAreaOverlayElement.h>
+#include <OgrePanelOverlayElement.h>
+
+namespace orxonox
+{
+
+	 RegisterClass (HUDDialogue);
+
+	 HUDDialogue::HUDDialogue(Context* context) :
+        OrxonoxOverlay(context)
+    {
+        RegisterObject(HUDDialogue);
+
+        overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Dialogue" + getUniqueNumberString()));
+        overlayElementIcon_->setPosition(0.0f,0.0f);
+        overlayElementIcon_->setDimensions(1.0f,1.0f);
+        this->background_->addChild(overlayElementIcon_);
+
+        overlayElementIcon_->setMaterialName("Orxonox/DialogueHUD_Person");
+
+	   }     
+
+        void HUDDialogue::tick(float dt)
+    {
+        SUPER(HUDDialogue, tick, dt);
+
+
+    }
+
+	 HUDDialogue::~HUDDialogue()
+	 {
+
+
+	 }
+
+	 void HUDDialogue::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+	 {
+	 	SUPER(HUDDialogue, XMLPort, xmlelement, mode);
+	 }
+
+}
\ No newline at end of file

Added: code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.h
===================================================================
--- code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.h	                        (rev 0)
+++ code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.h	2016-11-14 15:08:55 UTC (rev 11292)
@@ -0,0 +1,37 @@
+
+
+
+
+
+#ifndef _HUDDialogue_H__
+#define _HUDDialogue_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include <map>
+#include <string>
+
+#include "util/OgreForwardRefs.h"
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OrxonoxOverlay.h"
+
+namespace orxonox
+{
+	class _OverlaysExport HUDDialogue : public OrxonoxOverlay, public Tickable
+    {
+    	public:
+            HUDDialogue(Context* context);
+            virtual ~HUDDialogue();
+
+            virtual void tick(float dt) override;
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+
+
+
+      private:
+      			Ogre::PanelOverlayElement* overlayElementIcon_;
+    };
+}
+
+#endif
\ No newline at end of file




More information about the Orxonox-commit mailing list