[Orxonox-commit 2238] r6954 - in code/branches/dynamicmatch: data/overlays src/modules/overlays/hud

jo at orxonox.net jo at orxonox.net
Fri May 21 12:41:31 CEST 2010


Author: jo
Date: 2010-05-21 12:41:31 +0200 (Fri, 21 May 2010)
New Revision: 6954

Added:
   code/branches/dynamicmatch/data/overlays/dynamicmatchhud.oxo
   code/branches/dynamicmatch/src/modules/overlays/hud/GametypeFadingMessage.cc
   code/branches/dynamicmatch/src/modules/overlays/hud/GametypeFadingMessage.h
   code/branches/dynamicmatch/src/modules/overlays/hud/GametypeStaticMessage.cc
   code/branches/dynamicmatch/src/modules/overlays/hud/GametypeStaticMessage.h
Log:
uploading new created files

Added: code/branches/dynamicmatch/data/overlays/dynamicmatchhud.oxo
===================================================================
--- code/branches/dynamicmatch/data/overlays/dynamicmatchhud.oxo	                        (rev 0)
+++ code/branches/dynamicmatch/data/overlays/dynamicmatchhud.oxo	2010-05-21 10:41:31 UTC (rev 6954)
@@ -0,0 +1,23 @@
+<Template name="DynamicmatchHUD">
+  <OverlayGroup name="DynamicmatcHUD" scale = "1, 1">
+   
+ <GametypeStaticMessage
+   name     = "staticmessage"
+   position = "0.5, 0.01"
+   font     = "VeraMono"
+   caption  = "Instructions"
+   textsize = 0.035
+   colour   = "1.0, 1.0, 0.5, 1.0"
+   align    = "center"
+  />
+
+<GametypeFadingMessage
+     name     = "fadingmessage"
+     position = "0.25, 0.5"
+     font     = "VeraMono"
+     textsize = 0.035
+     colour   = "1.0, 1.0, 0.5, 1.0"
+     align    = "center"
+    />
+  </OverlayGroup>
+</Template>

Added: code/branches/dynamicmatch/src/modules/overlays/hud/GametypeFadingMessage.cc
===================================================================
--- code/branches/dynamicmatch/src/modules/overlays/hud/GametypeFadingMessage.cc	                        (rev 0)
+++ code/branches/dynamicmatch/src/modules/overlays/hud/GametypeFadingMessage.cc	2010-05-21 10:41:31 UTC (rev 6954)
@@ -0,0 +1,62 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "GametypeFadingMessage.h"
+
+#include "core/CoreIncludes.h"
+#include "infos/PlayerInfo.h"
+
+namespace orxonox
+{
+    CreateFactory(GametypeFadingMessage);
+
+    GametypeFadingMessage::GametypeFadingMessage(BaseObject* creator) : FadeoutText(creator)
+    {
+        RegisterObject(GametypeFadingMessage);
+
+        this->owner_ = 0;
+        this->setDelay(2.0f);
+        this->setFadeouttime(0.5f);
+    }
+
+    GametypeFadingMessage::~GametypeFadingMessage()
+    {
+    }
+
+    void GametypeFadingMessage::fadingmessage(const GametypeInfo* gtinfo, const std::string& message)
+    {
+        if (this->owner_ && this->owner_->getGametypeInfo() == gtinfo)
+            this->setCaption(message);
+    }
+
+    void GametypeFadingMessage::changedOwner()
+    {
+        SUPER(GametypeFadingMessage, changedOwner);
+        this->owner_ = orxonox_cast<PlayerInfo*>(this->getOwner());
+    }
+}

Added: code/branches/dynamicmatch/src/modules/overlays/hud/GametypeFadingMessage.h
===================================================================
--- code/branches/dynamicmatch/src/modules/overlays/hud/GametypeFadingMessage.h	                        (rev 0)
+++ code/branches/dynamicmatch/src/modules/overlays/hud/GametypeFadingMessage.h	2010-05-21 10:41:31 UTC (rev 6954)
@@ -0,0 +1,53 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _GametypeInfoMessage_H__
+#define _GametypeInfoMessage_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include "interfaces/GametypeMessageListener.h"
+#include "overlays/FadeoutText.h"
+
+namespace orxonox
+{
+    class _OverlaysExport GametypeFadingMessage : public FadeoutText, GametypeMessageListener
+    {
+        public:
+            GametypeFadingMessage(BaseObject* creator);
+            virtual ~GametypeFadingMessage();
+
+            virtual void changedOwner();
+
+            void fadingmessage(const GametypeInfo* gtinfo, const std::string& message);
+                  
+        private:
+            PlayerInfo* owner_;
+    };
+}
+#endif /* _GametypeFadingMessage_H__ */

Added: code/branches/dynamicmatch/src/modules/overlays/hud/GametypeStaticMessage.cc
===================================================================
--- code/branches/dynamicmatch/src/modules/overlays/hud/GametypeStaticMessage.cc	                        (rev 0)
+++ code/branches/dynamicmatch/src/modules/overlays/hud/GametypeStaticMessage.cc	2010-05-21 10:41:31 UTC (rev 6954)
@@ -0,0 +1,63 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "GametypeStaticMessage.h"
+
+#include "core/CoreIncludes.h"
+#include "infos/GametypeInfo.h"
+#include "infos/PlayerInfo.h"
+
+
+namespace orxonox
+{
+    CreateFactory(GametypeStaticMessage);
+    
+    
+    GametypeStaticMessage::GametypeStaticMessage(BaseObject* creator) : OverlayText(creator)
+    {
+        RegisterObject(GametypeStaticMessage);
+        this->owner_ = 0;
+    }
+
+    GametypeStaticMessage::~GametypeStaticMessage()
+    {
+    }
+
+    void GametypeStaticMessage::staticmessage(const GametypeInfo* gtinfo, const std::string& message)
+    {
+    if (this->owner_ && this->owner_->getGametypeInfo() == gtinfo)
+        this->setCaption(message);
+    }
+
+    void GametypeStaticMessage::changedOwner()
+    {
+        SUPER(GametypeStaticMessage, changedOwner);
+        this->owner_ = orxonox_cast<PlayerInfo*>(this->getOwner());
+    }
+
+}

Added: code/branches/dynamicmatch/src/modules/overlays/hud/GametypeStaticMessage.h
===================================================================
--- code/branches/dynamicmatch/src/modules/overlays/hud/GametypeStaticMessage.h	                        (rev 0)
+++ code/branches/dynamicmatch/src/modules/overlays/hud/GametypeStaticMessage.h	2010-05-21 10:41:31 UTC (rev 6954)
@@ -0,0 +1,56 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _GametypeInfoMessage_H__
+#define _GametypeInfoMessage_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include "interfaces/GametypeMessageListener.h"
+#include "overlays/OverlayText.h"
+/*Goal: Every Gametype could add a hud-element that displays text in the gametype. For example instructions for newbies.
+-> you have to add a "GametypeInfoMessage"-object that displays text. How the message change has to be defined in the gametype.
+*/
+
+namespace orxonox
+{
+    class _OverlaysExport GametypeStaticMessage : public OverlayText, GametypeMessageListener
+    {
+        public:
+            GametypeStaticMessage(BaseObject* creator);
+            virtual ~GametypeStaticMessage();
+
+            virtual void changedOwner();
+
+            void staticmessage(const GametypeInfo* gtinfo, const std::string& message);
+            
+        private:
+            PlayerInfo* owner_;
+    };
+}
+#endif /* _GametypeInfoMessage_H__ */




More information about the Orxonox-commit mailing list