[Orxonox-commit 7500] r12106 - in code/branches/WorldMap_HS18: data/gui/layouts data/gui/scripts data/levels src/orxonox/controllers
linggj at orxonox.net
linggj at orxonox.net
Wed Nov 14 11:59:52 CET 2018
Author: linggj
Date: 2018-11-14 11:59:52 +0100 (Wed, 14 Nov 2018)
New Revision: 12106
Added:
code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc
code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h
Modified:
code/branches/WorldMap_HS18/data/gui/layouts/CampaignMenu.layout
code/branches/WorldMap_HS18/data/gui/scripts/CampaignMenu.lua
code/branches/WorldMap_HS18/data/levels/StoryModeMapDev.oxw
code/branches/WorldMap_HS18/src/orxonox/controllers/CMakeLists.txt
code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc
code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h
Log:
Story Mode Controller added again as a controllabel entitz
Modified: code/branches/WorldMap_HS18/data/gui/layouts/CampaignMenu.layout
===================================================================
--- code/branches/WorldMap_HS18/data/gui/layouts/CampaignMenu.layout 2018-11-14 10:58:59 UTC (rev 12105)
+++ code/branches/WorldMap_HS18/data/gui/layouts/CampaignMenu.layout 2018-11-14 10:59:52 UTC (rev 12106)
@@ -7,20 +7,28 @@
<Property name="Area" value="{{0,0},{0,0},{1.0,0},{1.0,0}}" />
<Property name="BackgroundEnabled" value="False" />
- <Window name="ForwardText" type="MenuWidgets/Button">
- <Property name="Text" value="Forward" />
- <Property name="Visible" value="True" />
- <Property name="Area" value="{{0.1,0},{0.6,0},{0.3,0},{0.65,0}}" />
- <Event function="CampaignMenu.forwardButton_clicked" name="Clicked" />
+
+ <Window name="RightButton" type="MenuWidgets/Button">
+ <Property name="Text" value="F" />
+ <Property name="MaxSize" value="{{1,0},{1,0}}" />
+ <Property name="Area" value="{{0.350,0},{0.9,0},{0.45,0},{0.95,0}}" />
+
</Window>
- <Window name="ForwardButton" type="MenuWidgets/JuuButton">
- <Property name="Visible" value="True" />
+ <Window name="LeftButton" type="MenuWidgets/Button">
+ <Property name="Text" value="B" />
<Property name="MaxSize" value="{{1,0},{1,0}}" />
- <Property name="Area" value="{{0.1,0},{0.75,0},{0.25,0},{0.95,0}}" />
- <Event function="CampaignMenu.forwardButton_clicked" name="Clicked" />
+ <Property name="Area" value="{{0.55,0},{0.9,0},{0.65,0},{0.95,0}}" />
+
</Window>
+ <Window name="SelectButton" type="MenuWidgets/Button">
+ <Property name="Text" value="Play" />
+ <Property name="MaxSize" value="{{1,0},{1,0}}" />
+ <Property name="Area" value="{{0.45,0},{0.9,0},{0.55,0},{0.95,0}}" />
+
+ </Window>
+
<Window name="Mission1Text" type="MenuWidgets/Button">
<Property name="Text" value="Mission One" />
<Property name="Visible" value="False" />
Modified: code/branches/WorldMap_HS18/data/gui/scripts/CampaignMenu.lua
===================================================================
--- code/branches/WorldMap_HS18/data/gui/scripts/CampaignMenu.lua 2018-11-14 10:58:59 UTC (rev 12105)
+++ code/branches/WorldMap_HS18/data/gui/scripts/CampaignMenu.lua 2018-11-14 10:59:52 UTC (rev 12106)
@@ -2,6 +2,7 @@
local P = createMenuSheet("CampaignMenu")
+
function P:onShow()
P:updateButtons()
end
@@ -74,10 +75,9 @@
return -1
end
-function P.forwardButton_clicked(e)
- P.loadMap()
-end
+
+
function P.Mission1Button_clicked(e)
P.loadLevel(P.FindLevel(0))
end
@@ -123,7 +123,8 @@
end
function P.loadMap()
- orxonox.execute("change Game NC_StoryModeLevel")
+ orxonox.execute("changeGame dynamicMatch.oxw")
+ hideAllMenuSheets()
end
function P.FindLevel(index)
Modified: code/branches/WorldMap_HS18/data/levels/StoryModeMapDev.oxw
===================================================================
--- code/branches/WorldMap_HS18/data/levels/StoryModeMapDev.oxw 2018-11-14 10:58:59 UTC (rev 12105)
+++ code/branches/WorldMap_HS18/data/levels/StoryModeMapDev.oxw 2018-11-14 10:59:52 UTC (rev 12106)
@@ -21,6 +21,15 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+
+ <Template name=selectertemplate>
+ <StoryModeController team=0>
+ <attache>
+ <Model position="550,300,0" mesh="assff.mesh" scale=20 visible="true" orientation="-0.015,0.091,0.038,-0.995"/>
+ </attache>
+ </StoryModeController>
+</Template>
+
<?lua include("includes/notifications.oxi") ?>
<?lua
include("templates/spaceshipEscort.oxt")
@@ -82,6 +91,7 @@
+
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
<SpawnPoint position="000.000, 000.000, 1000.000" orientation="0, 0, 0, -1" pawndesign=StoryMode />
Modified: code/branches/WorldMap_HS18/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/CMakeLists.txt 2018-11-14 10:58:59 UTC (rev 12105)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/CMakeLists.txt 2018-11-14 10:59:52 UTC (rev 12106)
@@ -1,5 +1,7 @@
ADD_SOURCE_FILES(ORXONOX_SRC_FILES
Controller.cc
+ StoryModeController.cc
+ SMCoord.cc
HumanController.cc
NewHumanController.cc
ArtificialController.cc
Added: code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc (rev 0)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc 2018-11-14 10:59:52 UTC (rev 12106)
@@ -0,0 +1,19 @@
+#include "SMCoord.h"
+
+namespace orxonox {
+ SMCoord::SMCoord() {
+ set(0);
+ }
+
+ SMCoord::SMCoord(int x) {
+ set(x);
+ }
+
+ void SMCoord::set(int index) {
+ this->index = index;
+ }
+
+ int SMCoord::getIndex() {
+ return this->index;
+ }
+}
\ No newline at end of file
Added: code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h (rev 0)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h 2018-11-14 10:59:52 UTC (rev 12106)
@@ -0,0 +1,24 @@
+#ifndef _SMCoord_H__
+#define _SMCoord_H__
+
+#include "core/CoreIncludes.h"
+#include "gametypes/Deathmatch.h"
+
+namespace orxonox
+{
+
+ class _OrxonoxExport SMCoord
+ {
+ public:
+ SMCoord();
+ SMCoord(int x);
+ virtual void set(int index);
+ virtual int getIndex();
+
+ private:
+ int index;
+ };
+
+
+}
+#endif
\ No newline at end of file
Modified: code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc 2018-11-14 10:58:59 UTC (rev 12105)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc 2018-11-14 10:59:52 UTC (rev 12106)
@@ -30,60 +30,60 @@
#include "core/CoreIncludes.h"
#include "worldentities/ControllableEntity.h"
+#include "SMCoord.h"
namespace orxonox
{
RegisterClass(StoryModeController);
- StoryModeController::StoryModeController(Context* context) : Pawn(context)
+ StoryModeController::StoryModeController(Context* context) : ControllableEntity(context)
{
RegisterObject(StoryModeController);
- moveRight_ = false;
- moveLeft_ = false;
- //this->setAccuracy(50);
+ float time_;
+ moveForward_=false;
+ moveBackward_=false;
+ boostPressed_=false;
+ setPosition(0);
+
}
StoryModeController::~StoryModeController()
{
- /*for (WorldEntity* waypoint : this->waypoints_)
- {
- if(waypoint)
- waypoint->destroy();
- }*/
+
}
+ void StoryModeController::updatePosition(){
+
+ }
+ void StoryModeController::setPosition(int index){
+
+ }
+
void StoryModeController::tick(float dt)
{
orxout(internal_error) << "Hi" << endl;
-
- /*if (!this->isActive())
- return;
-
- if (this->waypoints_.size() == 0 || !this->getControllableEntity())
- return;
-
- if (false /* this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_*///)
- //this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size();
-
- //this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition());
+ SUPER(StoryModeController, tick, dt);
+ time_ +=dt;
+
+
}
void StoryModeController::moveFrontBack(const Vector2& value)
{
- orxout(internal_error) << "FrontBack" << endl;
-
-
+
}
void StoryModeController::moveRightLeft(const Vector2& value)
{
orxout(internal_error) << "RightLeft" << endl;
if (value.x>0){
- moveRight_ =false;
- moveLeft_ =true;
+ moveForward_ =false;
+ moveBackward_ =true;
+ } else {
+ moveBackward_ = false;
+ moveForward_ = true;
+ }
- }
-
}
void StoryModeController::rotateYaw(const Vector2& value){}
@@ -91,5 +91,7 @@
void StoryModeController::rotateRoll(const Vector2& value){}
void StoryModeController::fire(unsigned int a){}
void StoryModeController::fired(unsigned int b){}
- void StoryModeController::boost(bool bBoost){}
+ void StoryModeController::boost(bool bBoost){
+ boostPressed_ = true;
+ }
}
Modified: code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h 2018-11-14 10:58:59 UTC (rev 12105)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h 2018-11-14 10:59:52 UTC (rev 12106)
@@ -38,7 +38,7 @@
namespace orxonox
{
- class _OrxonoxExport StoryModeController : public Pawn
+ class _OrxonoxExport StoryModeController : public ControllableEntity
{
public:
StoryModeController(Context* context);
@@ -53,9 +53,15 @@
void fire(unsigned int firemode);
virtual void fired(unsigned int firemode) override;
virtual void boost(bool bBoost) override;
+ virtual void setPosition(int index);
bool moveRight_ ;
bool moveLeft_ ;
- protected:
+ private:
+ virtual void updatePosition();
+ float time_;
+ bool moveForward_;
+ bool moveBackward_;
+ bool boostPressed_;
};
}
More information about the Orxonox-commit
mailing list