[Orxonox-commit 7101] r11718 - in code/trunk: data/gui/layouts data/gui/scripts data/overlays src/modules/dialogue src/modules/gametypes
landauf at orxonox.net
landauf at orxonox.net
Sun Jan 7 22:34:30 CET 2018
Author: landauf
Date: 2018-01-07 22:34:30 +0100 (Sun, 07 Jan 2018)
New Revision: 11718
Modified:
code/trunk/data/gui/layouts/Dialogue.layout
code/trunk/data/gui/layouts/SingleplayerMenu.layout
code/trunk/data/gui/scripts/HighscoreMenu.lua
code/trunk/data/overlays/HUDTemplates3.oxo
code/trunk/data/overlays/towerdefenseHUD.oxo
code/trunk/src/modules/dialogue/DialogueManager.cc
code/trunk/src/modules/dialogue/DialogueManager.h
code/trunk/src/modules/dialogue/NextQuestion.cc
code/trunk/src/modules/dialogue/NextQuestion.h
code/trunk/src/modules/gametypes/SpaceRaceBot.h
Log:
tabs -> spaces
Modified: code/trunk/data/gui/layouts/Dialogue.layout
===================================================================
--- code/trunk/data/gui/layouts/Dialogue.layout 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/data/gui/layouts/Dialogue.layout 2018-01-07 21:34:30 UTC (rev 11718)
@@ -2,7 +2,7 @@
<GUILayout >
<Window Type="DefaultWindow" Name="orxonox/Dialogue/Background" >
- <Property Name="InheritsAlpha" Value="False" />
+ <Property Name="InheritsAlpha" Value="False" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
<Window Type="MenuWidgets/StaticText" Name="orxonox/Dialogue/Inventory" >
Modified: code/trunk/data/gui/layouts/SingleplayerMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/SingleplayerMenu.layout 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/data/gui/layouts/SingleplayerMenu.layout 2018-01-07 21:34:30 UTC (rev 11718)
@@ -32,7 +32,7 @@
<Property Name="VertScrollbar" Value="True" />
<Property Name="HorzScrollbar" Value="False" />
<Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.725,0},{0.9,0},{0.875,0}}" />
- <Property Name="HorzFormatting" Value="WordWrapLeftAligned" />
+ <Property Name="HorzFormatting" Value="WordWrapLeftAligned" />
</Window>
</Window>
<Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerStartButton" >
Modified: code/trunk/data/gui/scripts/HighscoreMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/HighscoreMenu.lua 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/data/gui/scripts/HighscoreMenu.lua 2018-01-07 21:34:30 UTC (rev 11718)
@@ -11,23 +11,23 @@
P.imageHeight = 50
function P.onLoad()
- P.createLevelList()
+ P.createLevelList()
end
function P.onShow()
-
- -- reset tables
- P.highscoreList = {}
- P.tabList = {}
- P.linesList = {}
+
+ -- reset tables
+ P.highscoreList = {}
+ P.tabList = {}
+ P.linesList = {}
- -- fetch save scores and write it into the list
- for i=orxonox.Highscore:getInstance():getNumberOfHighscores()-1,0,-1 do
- table.insert(P.highscoreList, orxonox.Highscore:getInstance():getHighscore(i))
-
- end
-
- -- read minigames out of the levelList
+ -- fetch save scores and write it into the list
+ for i=orxonox.Highscore:getInstance():getNumberOfHighscores()-1,0,-1 do
+ table.insert(P.highscoreList, orxonox.Highscore:getInstance():getHighscore(i))
+
+ end
+
+ -- read minigames out of the levelList
for k,v in pairs(P.levelList) do
if(v:getName() ~= "Hover level" and v:getName() ~= "Pong") then -- hover and pong dont contain relevant scores
P.createFilterTab(v:getName(), v:getName())
@@ -37,12 +37,12 @@
end
function P.onHide()
- -- delete old windows to reload them on show
- local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
- for k,v in pairs(P.tabList) do
- local default = winMgr:getWindow(v)
+ -- delete old windows to reload them on show
+ local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
+ for k,v in pairs(P.tabList) do
+ local default = winMgr:getWindow(v)
tabControl:removeChildWindow(default)
- winMgr:destroyWindow(default)
+ winMgr:destroyWindow(default)
end
end
function P.createLevelList()
@@ -67,7 +67,7 @@
table.insert(P.tabList, tabName)
-- create new tab window with desired name
- local default = (winMgr:createWindow("DefaultWindow", tabName))
+ local default = (winMgr:createWindow("DefaultWindow", tabName))
default:setText(name)
default:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
default:setProperty("UnifiedAreaRect", "{{0,0},{0,0},{1,0},{1,0}}")
@@ -78,20 +78,20 @@
local offset = 2
for k,v in pairs(P.highscoreList) do
- -- split the score ("Playername./.game./.score")
- local splitlist = P.Split(v,"./.")
- if(splitlist[2] == name)then
- local line = P.createPickupEntry(tabName .. k,k,tag)
- table.insert(P.linesList, line)
- line:setYPosition(CEGUI.UDim(0,offset))
- offset = offset + line:getHeight():asAbsolute(1)+2
- pane:addChildWindow(line)
- end
+ -- split the score ("Playername./.game./.score")
+ local splitlist = P.Split(v,"./.")
+ if(splitlist[2] == name)then
+ local line = P.createPickupEntry(tabName .. k,k,tag)
+ table.insert(P.linesList, line)
+ line:setYPosition(CEGUI.UDim(0,offset))
+ offset = offset + line:getHeight():asAbsolute(1)+2
+ pane:addChildWindow(line)
+ end
end
- local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
- tabControl:addChildWindow(default)
+ local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
+ tabControl:addChildWindow(default)
@@ -110,7 +110,7 @@
player:setSize(CEGUI.UVector2(CEGUI.UDim(0.49, 0), CEGUI.UDim(0, P.imageHeight)))
item:addChildWindow(player)
-
+
local score = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Score")
score:setText(splitlist[3])
score:setPosition(CEGUI.UVector2(CEGUI.UDim(0.5,0), CEGUI.UDim(0,0)))
Modified: code/trunk/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/trunk/data/overlays/HUDTemplates3.oxo 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/data/overlays/HUDTemplates3.oxo 2018-01-07 21:34:30 UTC (rev 11718)
@@ -155,24 +155,24 @@
aimMarkerSize = 0.02
/>
- <HUDRadar
- name = "Radar"
- background = "Orxonox/Radar3D"
- material2D = "Orxonox/Radar"
- material3DMiddle = "Orxonox/Radar3D"
- material3DFront = "Orxonox/Radar3DFront"
- material3DBack = "Orxonox/Radar3DBack"
- correctaspect = true
- size = "0.17, 0.17"
- position = "1.0, 1.0"
- pickpoint = "1.0, 1.0"
- rotation = 0
- sensitivity = 1.0
- halfDotSizeDistance = 3000
- detectionLimit = 10000.0
- maximumDotSize = 0.1
- maximumDotSize3D = 0.06
- mapAngle3D = 0.6435011
+ <HUDRadar
+ name = "Radar"
+ background = "Orxonox/Radar3D"
+ material2D = "Orxonox/Radar"
+ material3DMiddle = "Orxonox/Radar3D"
+ material3DFront = "Orxonox/Radar3DFront"
+ material3DBack = "Orxonox/Radar3DBack"
+ correctaspect = true
+ size = "0.17, 0.17"
+ position = "1.0, 1.0"
+ pickpoint = "1.0, 1.0"
+ rotation = 0
+ sensitivity = 1.0
+ halfDotSizeDistance = 3000
+ detectionLimit = 10000.0
+ maximumDotSize = 0.1
+ maximumDotSize3D = 0.06
+ mapAngle3D = 0.6435011
/>
<HUDWeaponSystem
Modified: code/trunk/data/overlays/towerdefenseHUD.oxo
===================================================================
--- code/trunk/data/overlays/towerdefenseHUD.oxo 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/data/overlays/towerdefenseHUD.oxo 2018-01-07 21:34:30 UTC (rev 11718)
@@ -23,9 +23,9 @@
textsize = 0.05
colour = "1.0, 1.0, 1.0, 1.0"
align = "left"
- showlives = false
- showcredits = true
- showwaves = false
+ showlives = false
+ showcredits = true
+ showwaves = false
/>
<OverlayText
@@ -46,9 +46,9 @@
textsize = 0.05
colour = "1.0, 1.0, 1.0, 1.0"
align = "left"
- showlives = true
- showcredits = false
- showwaves = false
+ showlives = true
+ showcredits = false
+ showwaves = false
/>
<OverlayText
@@ -69,9 +69,9 @@
textsize = 0.05
colour = "1.0, 1.0, 1.0, 1.0"
align = "left"
- showlives = false
- showcredits = false
- showwaves = true
+ showlives = false
+ showcredits = false
+ showwaves = true
/>
Modified: code/trunk/src/modules/dialogue/DialogueManager.cc
===================================================================
--- code/trunk/src/modules/dialogue/DialogueManager.cc 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/src/modules/dialogue/DialogueManager.cc 2018-01-07 21:34:30 UTC (rev 11718)
@@ -14,79 +14,74 @@
namespace orxonox {
- ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);
-
-
-
- DialogueManager::DialogueManager(){}
-
-
-
+ ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);
+ DialogueManager::DialogueManager(){}
- void DialogueManager::registerquestion(NextQuestion* nq){
- if(allQuestions.size()==0) {
- orxout(internal_info) << "At least one NextQuestion has to be set." << endl;
- }
- allQuestions.push_back(nq);
- orxout(internal_info) << "qsize " << allQuestions.size();
+ void DialogueManager::registerquestion(NextQuestion* nq){
+ if(allQuestions.size()==0) {
+ orxout(internal_info) << "At least one NextQuestion has to be set." << endl;
+ }
+ allQuestions.push_back(nq);
+ orxout(internal_info) << "qsize " << allQuestions.size();
- }
+ }
void DialogueManager::setquestion(std::string q){
- question=q;
-
- }
- void DialogueManager::setCurrentQuestion(NextQuestion* nq){
- currentQuestion=nq;
-
- }
+ question=q;
- std::string DialogueManager::getquestion(void){
- return question;
- }
+ }
+ void DialogueManager::setCurrentQuestion(NextQuestion* nq){
+ currentQuestion=nq;
- void DialogueManager::setanswers1(std::string a1){
- this->a1=a1;
- }
+ }
- void DialogueManager::setanswers2(std::string a2){
- this->a2=a2;
- }
+ std::string DialogueManager::getquestion(void){
+ return question;
+ }
-
+ void DialogueManager::setanswers1(std::string a1){
+ this->a1=a1;
+ }
- std::string DialogueManager::getanswers1(void){
- return a1;
- }
+ void DialogueManager::setanswers2(std::string a2){
+ this->a2=a2;
+ }
- std::string DialogueManager::getanswers2(void){
- return a2;
- }
- void DialogueManager::a1clicked(void){
-
- currentQuestion = currentQuestion->possibleQuestions[0];
- update(currentQuestion);
-
- }
- void DialogueManager::a2clicked(void){
-
- currentQuestion = currentQuestion->possibleQuestions[1];
- update(currentQuestion);
- }
+ std::string DialogueManager::getanswers1(void){
+ return a1;
+ }
- void DialogueManager::update(NextQuestion* nq){
- this->setquestion(nq->getquestion());
- this->setanswers1(nq->getanswers1());
- this->setanswers2(nq->getanswers2());
- }
+ std::string DialogueManager::getanswers2(void){
+ return a2;
+ }
- bool DialogueManager::theEnd(){
- if((currentQuestion->possibleQuestions).empty()) {
- return true;}
- else return false;
- }
+ void DialogueManager::a1clicked(void){
-}
\ No newline at end of file
+ currentQuestion = currentQuestion->possibleQuestions[0];
+ update(currentQuestion);
+
+
+ }
+ void DialogueManager::a2clicked(void){
+
+ currentQuestion = currentQuestion->possibleQuestions[1];
+ update(currentQuestion);
+ }
+
+ void DialogueManager::update(NextQuestion* nq){
+ this->setquestion(nq->getquestion());
+ this->setanswers1(nq->getanswers1());
+ this->setanswers2(nq->getanswers2());
+ }
+
+ bool DialogueManager::theEnd(){
+ if((currentQuestion->possibleQuestions).empty())
+ return true;
+ else
+ return false;
+ }
+
+}
Modified: code/trunk/src/modules/dialogue/DialogueManager.h
===================================================================
--- code/trunk/src/modules/dialogue/DialogueManager.h 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/src/modules/dialogue/DialogueManager.h 2018-01-07 21:34:30 UTC (rev 11718)
@@ -23,52 +23,52 @@
namespace orxonox //tolua_export
{//tolua_export
- class _DialogueExport DialogueManager //tolua_export
- : public Singleton<DialogueManager>
- {//tolua_export
- friend class Singleton<DialogueManager>;
-
- public:
-
- DialogueManager();
-
+ class _DialogueExport DialogueManager //tolua_export
+ : public Singleton<DialogueManager>
+ {//tolua_export
+ friend class Singleton<DialogueManager>;
- static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } //tolua_export
-
+ public:
- void setquestion(std::string question); //tolua_export
- std::string getquestion(void); //tolua_export
-
-
- void setanswers1(std::string a1); //tolua_export
- std::string getanswers1(void); //tolua_export
-
- void setanswers2(std::string a2); //tolua_export
- std::string getanswers2(void); //tolua_export
-
- void setCurrentQuestion(NextQuestion* q);
+ DialogueManager();
- //Sets the current Question to the question corresponding to the first/second answer
- void a1clicked(void); //tolua_export
- void a2clicked(void); //tolua_export
-
- //Checks whether there are any more Questions to come
- bool theEnd(); //tolua_export
- //Sets question and a1, a2 for new currentQuestion
- void update(NextQuestion* nq);
+ static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } //tolua_export
- //Is executed whenever a NextQuestion is created and pushes all NextQuestion into the allQuestion vector.
- void registerquestion(NextQuestion* nq);
+ void setquestion(std::string question); //tolua_export
+ std::string getquestion(void); //tolua_export
+
+
+ void setanswers1(std::string a1); //tolua_export
+ std::string getanswers1(void); //tolua_export
+
+ void setanswers2(std::string a2); //tolua_export
+ std::string getanswers2(void); //tolua_export
+
+ void setCurrentQuestion(NextQuestion* q);
+
+ //Sets the current Question to the question corresponding to the first/second answer
+ void a1clicked(void); //tolua_export
+ void a2clicked(void); //tolua_export
+
+ //Checks whether there are any more Questions to come
+ bool theEnd(); //tolua_export
+
+ //Sets question and a1, a2 for new currentQuestion
+ void update(NextQuestion* nq);
+
+ //Is executed whenever a NextQuestion is created and pushes all NextQuestion into the allQuestion vector.
+ void registerquestion(NextQuestion* nq);
+
private:
- NextQuestion* currentQuestion; //The Question which is currently displayed
- std::vector<NextQuestion*> allQuestions;
- std::string a1; //answer on first button
- std::string a2; //answer on second button
- std::string question;
- static DialogueManager* singletonPtr_s;
+ NextQuestion* currentQuestion; //The Question which is currently displayed
+ std::vector<NextQuestion*> allQuestions;
+ std::string a1; //answer on first button
+ std::string a2; //answer on second button
+ std::string question;
+ static DialogueManager* singletonPtr_s;
- };//tolua_export
+ };//tolua_export
}//tolua_export
#endif
Modified: code/trunk/src/modules/dialogue/NextQuestion.cc
===================================================================
--- code/trunk/src/modules/dialogue/NextQuestion.cc 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/src/modules/dialogue/NextQuestion.cc 2018-01-07 21:34:30 UTC (rev 11718)
@@ -11,9 +11,9 @@
namespace orxonox{
- RegisterClass(NextQuestion);
+ RegisterClass(NextQuestion);
- NextQuestion::NextQuestion(Context* context) : BaseObject(context)
+ NextQuestion::NextQuestion(Context* context) : BaseObject(context)
{
RegisterObject(NextQuestion);
@@ -23,22 +23,22 @@
}
- void NextQuestion::setquestion(std::string question){
- this->question=question;
- }
+ void NextQuestion::setquestion(std::string question){
+ this->question=question;
+ }
- std::string NextQuestion::getquestion(void){
- return question;
- }
+ std::string NextQuestion::getquestion(void){
+ return question;
+ }
-
- bool NextQuestion::addposQuestion(NextQuestion* nq){
-
- possibleQuestions.push_back(nq);
- return true;
- }
- const NextQuestion* NextQuestion::getposQuestion(unsigned int i) const
+ bool NextQuestion::addposQuestion(NextQuestion* nq){
+
+ possibleQuestions.push_back(nq);
+ return true;
+ }
+
+ const NextQuestion* NextQuestion::getposQuestion(unsigned int i) const
{
for (NextQuestion* effect : this->possibleQuestions)
{
@@ -48,9 +48,9 @@
}
return nullptr;
}
-
-
- void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+
+
+ void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(NextQuestion, XMLPort, xmlelement, mode);
@@ -60,11 +60,11 @@
XMLPortObject(NextQuestion, NextQuestion, "possibleQuestions", addposQuestion, getposQuestion, xmlelement, mode);
}
- bool NextQuestion::execute(bool bTriggered, BaseObject* trigger)
+ bool NextQuestion::execute(bool bTriggered, BaseObject* trigger)
{
- DialogueManager& m = DialogueManager::getInstance();
-
+ DialogueManager& m = DialogueManager::getInstance();
+
m.setquestion(question);
m.setCurrentQuestion(this);
m.setanswers1(a1);
@@ -85,27 +85,22 @@
}
- void NextQuestion::setanswers1(std::string a1){
- this->a1=a1;
- }
+ void NextQuestion::setanswers1(std::string a1){
+ this->a1=a1;
+ }
- void NextQuestion::setanswers2(std::string a2){
- this->a2=a2;
- }
+ void NextQuestion::setanswers2(std::string a2){
+ this->a2=a2;
+ }
-
- std::string NextQuestion::getanswers1(void){
- return a1;
- }
- std::string NextQuestion::getanswers2(void){
- return a2;
- }
+ std::string NextQuestion::getanswers1(void){
+ return a1;
+ }
-
+ std::string NextQuestion::getanswers2(void){
+ return a2;
+ }
-
-
-
-}
\ No newline at end of file
+}
Modified: code/trunk/src/modules/dialogue/NextQuestion.h
===================================================================
--- code/trunk/src/modules/dialogue/NextQuestion.h 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/src/modules/dialogue/NextQuestion.h 2018-01-07 21:34:30 UTC (rev 11718)
@@ -12,50 +12,50 @@
namespace orxonox{
- class _DialogueExport NextQuestion : public BaseObject
- {
-
- //tolua_begin
- public:
+ class _DialogueExport NextQuestion : public BaseObject
+ {
- NextQuestion (Context* context); // tolua_export
-
+ //tolua_begin
+ public:
- void setquestion(std::string question);
- std::string getquestion(void);
+ NextQuestion (Context* context); // tolua_export
- void setanswers1(std::string a1);
- void setanswers2(std::string a2);
- std::string getanswers1(void);
- std::string getanswers2(void);
-
-
+ void setquestion(std::string question);
+ std::string getquestion(void);
- //XMLEventPort for Event that first triggers the Dialogue
- virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+ void setanswers1(std::string a1);
+ void setanswers2(std::string a2);
+ std::string getanswers1(void);
+ std::string getanswers2(void);
- //XMLPort for setting questions and answers and the vector possibleQuestions
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- bool addposQuestion(NextQuestion* nq);
- const NextQuestion* getposQuestion(unsigned int index) const;
- //Sets very first currentQuestion in the DialogueManager when the event is triggered
- bool execute(bool bTriggered, BaseObject* trigger);
- std::vector<NextQuestion*> possibleQuestions;
-
- private:
- std::string a1;
- std::string a2;
-
+ //XMLEventPort for Event that first triggers the Dialogue
+ virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+ //XMLPort for setting questions and answers and the vector possibleQuestions
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- std::string question;
- DialogueManager* m;
+ bool addposQuestion(NextQuestion* nq);
+ const NextQuestion* getposQuestion(unsigned int index) const;
- };
-
+ //Sets very first currentQuestion in the DialogueManager when the event is triggered
+ bool execute(bool bTriggered, BaseObject* trigger);
+
+ std::vector<NextQuestion*> possibleQuestions;
+
+ private:
+ std::string a1;
+ std::string a2;
+
+
+
+ std::string question;
+ DialogueManager* m;
+
+ };
+
}
#endif
Modified: code/trunk/src/modules/gametypes/SpaceRaceBot.h
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceBot.h 2018-01-07 21:01:00 UTC (rev 11717)
+++ code/trunk/src/modules/gametypes/SpaceRaceBot.h 2018-01-07 21:34:30 UTC (rev 11718)
@@ -38,7 +38,7 @@
class _GametypesExport SpaceRaceBot: public Bot
{
public:
- SpaceRaceBot(Context* context);
+ SpaceRaceBot(Context* context);
virtual ~SpaceRaceBot();
void setConfigValues();
More information about the Orxonox-commit
mailing list