[Orxonox-commit 7554] r12157 - in code/branches/wagnis_HS18: data/overlays src/modules/wagnis

kunzro at orxonox.net kunzro at orxonox.net
Wed Dec 5 12:43:36 CET 2018


Author: kunzro
Date: 2018-12-05 12:43:35 +0100 (Wed, 05 Dec 2018)
New Revision: 12157

Added:
   code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.cc
   code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.h
Modified:
   code/branches/wagnis_HS18/data/overlays/WagnisHUD.oxo
   code/branches/wagnis_HS18/src/modules/wagnis/CMakeLists.txt
   code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.h
   code/branches/wagnis_HS18/src/modules/wagnis/WagnisPrereqs.h
Log:
WagnisHUDinfo added

Modified: code/branches/wagnis_HS18/data/overlays/WagnisHUD.oxo
===================================================================
--- code/branches/wagnis_HS18/data/overlays/WagnisHUD.oxo	2018-12-05 11:34:31 UTC (rev 12156)
+++ code/branches/wagnis_HS18/data/overlays/WagnisHUD.oxo	2018-12-05 11:43:35 UTC (rev 12157)
@@ -12,5 +12,15 @@
      healthLevelMarkerSize = 0
     />
 
+      <WagnisHUDinfo
+       name      = "descr1"
+       position  = "0.1, 0.20"
+       pickpoint = "0, 1"
+       font      = "Monofur"
+       caption   = "player name"
+       colour    = "1, 1, 1, 1"
+       textsize  = 0.04
+      />
+
   </OverlayGroup>
 </Template>
\ No newline at end of file

Modified: code/branches/wagnis_HS18/src/modules/wagnis/CMakeLists.txt
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/CMakeLists.txt	2018-12-05 11:34:31 UTC (rev 12156)
+++ code/branches/wagnis_HS18/src/modules/wagnis/CMakeLists.txt	2018-12-05 11:43:35 UTC (rev 12157)
@@ -4,6 +4,7 @@
   WagnisPlayer.cc
   Wagnis.cc
   WagnisHUD.cc
+  WagnisHUDinfo.cc
 )
 
 ORXONOX_ADD_LIBRARY(wagnis

Modified: code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.h
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.h	2018-12-05 11:34:31 UTC (rev 12156)
+++ code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.h	2018-12-05 11:43:35 UTC (rev 12157)
@@ -43,7 +43,6 @@
 
         WagnisGameboard* gameBoard;
 
-        private:
         int active_player;
         int initial_reinforcements_left;
         int empty_provinces_left;

Added: code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.cc
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.cc	                        (rev 0)
+++ code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.cc	2018-12-05 11:43:35 UTC (rev 12157)
@@ -0,0 +1,68 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *
+ */
+
+#include "WagnisHUDinfo.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+#include <string>
+
+namespace orxonox
+{
+    RegisterClass(WagnisHUDinfo);
+
+    WagnisHUDinfo::WagnisHUDinfo(Context* context) : OverlayText(context)
+    {
+        RegisterObject(WagnisHUDinfo);
+
+        this->wagnisgame = nullptr;
+        this->bShow_ = false;
+    }
+
+    void WagnisHUDinfo::tick(float dt)
+    {
+        SUPER(WagnisHUDinfo, tick, dt);
+        if(wagnisgame==nullptr){
+            findWagnis();
+        }
+        std::stringstream ss;
+        switch(wagnisgame->gameStage){
+            case CHOOSE_PROVINCE_STAGE: {
+                ss<<"Player"<<wagnisgame->active_player;
+                setCaption( ss.str() );
+                break;
+            }
+        }
+    }
+    void WagnisHUDinfo::findWagnis(){
+    for (Wagnis* gb : ObjectList<Wagnis>()){
+        this->wagnisgame = gb;
+        orxout()<<"Wagnis pointer found and added"<<endl;
+        return;
+    }
+}
+}

Added: code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.h
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.h	                        (rev 0)
+++ code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.h	2018-12-05 11:43:35 UTC (rev 12157)
@@ -0,0 +1,49 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *
+ */
+
+#ifndef _WagnisHUDinfo_H__
+#define _WagnisHUDinfo_H__
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+#include "WagnisPrereqs.h"
+#include "Wagnis.h"
+
+namespace orxonox
+{
+    class WagnisHUDinfo : public OverlayText, public Tickable
+    {
+        public:
+            WagnisHUDinfo(Context* context);
+
+            virtual void tick(float dt) override;
+            void findWagnis();
+        private:
+            Wagnis* wagnisgame;
+            bool bShow_;
+    };
+}
+#endif /* _WagnisHUDinfo_H__ */

Modified: code/branches/wagnis_HS18/src/modules/wagnis/WagnisPrereqs.h
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/WagnisPrereqs.h	2018-12-05 11:34:31 UTC (rev 12156)
+++ code/branches/wagnis_HS18/src/modules/wagnis/WagnisPrereqs.h	2018-12-05 11:43:35 UTC (rev 12157)
@@ -69,6 +69,8 @@
     class WagnisProvince;
     class WagnisGameboard;
     class WagnisPlayer;
+    class WagnisHUD;
+    class WagnisHUDinfo;
     enum GameStage { NOT_READY, CHOOSE_PROVINCE_STAGE, REINFORCEMENT_STAGE, ATTACK_STAGE, MOVE_STAGE };
     enum MoveType { ATTACK, MOVE, SET_TROOPS, SET_TROOPS_INITIAL };
 



More information about the Orxonox-commit mailing list