Changeset 11718
- Timestamp:
- Jan 7, 2018, 10:34:30 PM (7 years ago)
- Location:
- code/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/data/gui/layouts/Dialogue.layout
r11451 r11718 3 3 <GUILayout > 4 4 <Window Type="DefaultWindow" Name="orxonox/Dialogue/Background" > 5 5 <Property Name="InheritsAlpha" Value="False" /> 6 6 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 7 7 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> -
code/trunk/data/gui/layouts/SingleplayerMenu.layout
r10258 r11718 33 33 <Property Name="HorzScrollbar" Value="False" /> 34 34 <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.725,0},{0.9,0},{0.875,0}}" /> 35 35 <Property Name="HorzFormatting" Value="WordWrapLeftAligned" /> 36 36 </Window> 37 37 </Window> -
code/trunk/data/gui/scripts/HighscoreMenu.lua
r11356 r11718 12 12 13 13 function P.onLoad() 14 14 P.createLevelList() 15 15 end 16 16 17 17 function P.onShow() 18 19 20 21 22 18 19 -- reset tables 20 P.highscoreList = {} 21 P.tabList = {} 22 P.linesList = {} 23 23 24 25 26 27 28 29 30 24 -- fetch save scores and write it into the list 25 for i=orxonox.Highscore:getInstance():getNumberOfHighscores()-1,0,-1 do 26 table.insert(P.highscoreList, orxonox.Highscore:getInstance():getHighscore(i)) 27 28 end 29 30 -- read minigames out of the levelList 31 31 for k,v in pairs(P.levelList) do 32 32 if(v:getName() ~= "Hover level" and v:getName() ~= "Pong") then -- hover and pong dont contain relevant scores … … 38 38 function P.onHide() 39 39 40 41 42 43 40 -- delete old windows to reload them on show 41 local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl") 42 for k,v in pairs(P.tabList) do 43 local default = winMgr:getWindow(v) 44 44 tabControl:removeChildWindow(default) 45 45 winMgr:destroyWindow(default) 46 46 end 47 47 end … … 68 68 table.insert(P.tabList, tabName) 69 69 -- create new tab window with desired name 70 70 local default = (winMgr:createWindow("DefaultWindow", tabName)) 71 71 default:setText(name) 72 72 default:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}") … … 79 79 local offset = 2 80 80 for k,v in pairs(P.highscoreList) do 81 82 83 84 85 86 87 88 pane:addChildWindow(line)89 81 -- split the score ("Playername./.game./.score") 82 local splitlist = P.Split(v,"./.") 83 if(splitlist[2] == name)then 84 local line = P.createPickupEntry(tabName .. k,k,tag) 85 table.insert(P.linesList, line) 86 line:setYPosition(CEGUI.UDim(0,offset)) 87 offset = offset + line:getHeight():asAbsolute(1)+2 88 pane:addChildWindow(line) 89 end 90 90 91 91 end 92 92 93 94 93 local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl") 94 tabControl:addChildWindow(default) 95 95 96 96 … … 111 111 112 112 item:addChildWindow(player) 113 113 114 114 local score = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Score") 115 115 score:setText(splitlist[3]) -
code/trunk/data/overlays/HUDTemplates3.oxo
r11706 r11718 156 156 /> 157 157 158 159 name 160 background 161 material2D 162 material3DMiddle 163 material3DFront 164 material3DBack 165 correctaspect 166 size 167 position 168 pickpoint 169 rotation 170 sensitivity 171 halfDotSizeDistance 172 detectionLimit 173 maximumDotSize 174 maximumDotSize3D 175 mapAngle3D 158 <HUDRadar 159 name = "Radar" 160 background = "Orxonox/Radar3D" 161 material2D = "Orxonox/Radar" 162 material3DMiddle = "Orxonox/Radar3D" 163 material3DFront = "Orxonox/Radar3DFront" 164 material3DBack = "Orxonox/Radar3DBack" 165 correctaspect = true 166 size = "0.17, 0.17" 167 position = "1.0, 1.0" 168 pickpoint = "1.0, 1.0" 169 rotation = 0 170 sensitivity = 1.0 171 halfDotSizeDistance = 3000 172 detectionLimit = 10000.0 173 maximumDotSize = 0.1 174 maximumDotSize3D = 0.06 175 mapAngle3D = 0.6435011 176 176 /> 177 177 -
code/trunk/data/overlays/towerdefenseHUD.oxo
r10258 r11718 24 24 colour = "1.0, 1.0, 1.0, 1.0" 25 25 align = "left" 26 27 28 26 showlives = false 27 showcredits = true 28 showwaves = false 29 29 /> 30 30 … … 47 47 colour = "1.0, 1.0, 1.0, 1.0" 48 48 align = "left" 49 50 51 49 showlives = true 50 showcredits = false 51 showwaves = false 52 52 /> 53 53 … … 70 70 colour = "1.0, 1.0, 1.0, 1.0" 71 71 align = "left" 72 73 74 72 showlives = false 73 showcredits = false 74 showwaves = true 75 75 76 76 /> -
code/trunk/src/modules/dialogue/DialogueManager.cc
r11435 r11718 15 15 16 16 namespace orxonox { 17 ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false); 18 17 ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false); 18 19 DialogueManager::DialogueManager(){} 19 20 20 21 DialogueManager::DialogueManager(){} 22 21 void DialogueManager::registerquestion(NextQuestion* nq){ 22 if(allQuestions.size()==0) { 23 orxout(internal_info) << "At least one NextQuestion has to be set." << endl; 24 } 25 allQuestions.push_back(nq); 26 orxout(internal_info) << "qsize " << allQuestions.size(); 23 27 24 25 26 27 void DialogueManager::registerquestion(NextQuestion* nq){ 28 if(allQuestions.size()==0) { 29 orxout(internal_info) << "At least one NextQuestion has to be set." << endl; 30 } 31 allQuestions.push_back(nq); 32 orxout(internal_info) << "qsize " << allQuestions.size(); 33 34 } 28 } 35 29 36 30 void DialogueManager::setquestion(std::string q){ 37 question=q; 38 39 } 40 void DialogueManager::setCurrentQuestion(NextQuestion* nq){ 41 currentQuestion=nq; 42 43 } 31 question=q; 44 32 45 std::string DialogueManager::getquestion(void){ 46 return question; 47 } 33 } 34 void DialogueManager::setCurrentQuestion(NextQuestion* nq){ 35 currentQuestion=nq; 48 36 49 void DialogueManager::setanswers1(std::string a1){ 50 this->a1=a1; 51 } 37 } 52 38 53 void DialogueManager::setanswers2(std::string a2){54 this->a2=a2;55 39 std::string DialogueManager::getquestion(void){ 40 return question; 41 } 56 42 57 43 void DialogueManager::setanswers1(std::string a1){ 44 this->a1=a1; 45 } 58 46 59 std::string DialogueManager::getanswers1(void){60 return a1;61 47 void DialogueManager::setanswers2(std::string a2){ 48 this->a2=a2; 49 } 62 50 63 std::string DialogueManager::getanswers2(void){64 return a2;65 }66 51 67 void DialogueManager::a1clicked(void){68 69 currentQuestion = currentQuestion->possibleQuestions[0];70 update(currentQuestion);71 52 72 73 } 74 void DialogueManager::a2clicked(void){ 75 76 currentQuestion = currentQuestion->possibleQuestions[1]; 77 update(currentQuestion); 78 } 53 std::string DialogueManager::getanswers1(void){ 54 return a1; 55 } 79 56 80 void DialogueManager::update(NextQuestion* nq){ 81 this->setquestion(nq->getquestion()); 82 this->setanswers1(nq->getanswers1()); 83 this->setanswers2(nq->getanswers2()); 84 } 57 std::string DialogueManager::getanswers2(void){ 58 return a2; 59 } 85 60 86 bool DialogueManager::theEnd(){ 87 if((currentQuestion->possibleQuestions).empty()) { 88 return true;} 89 else return false; 90 } 61 void DialogueManager::a1clicked(void){ 62 63 currentQuestion = currentQuestion->possibleQuestions[0]; 64 update(currentQuestion); 65 66 67 } 68 void DialogueManager::a2clicked(void){ 69 70 currentQuestion = currentQuestion->possibleQuestions[1]; 71 update(currentQuestion); 72 } 73 74 void DialogueManager::update(NextQuestion* nq){ 75 this->setquestion(nq->getquestion()); 76 this->setanswers1(nq->getanswers1()); 77 this->setanswers2(nq->getanswers2()); 78 } 79 80 bool DialogueManager::theEnd(){ 81 if((currentQuestion->possibleQuestions).empty()) 82 return true; 83 else 84 return false; 85 } 91 86 92 87 } -
code/trunk/src/modules/dialogue/DialogueManager.h
r11699 r11718 24 24 25 25 {//tolua_export 26 class _DialogueExport DialogueManager //tolua_export 27 : public Singleton<DialogueManager> 28 {//tolua_export 29 friend class Singleton<DialogueManager>; 30 31 public: 32 33 DialogueManager(); 34 26 class _DialogueExport DialogueManager //tolua_export 27 : public Singleton<DialogueManager> 28 {//tolua_export 29 friend class Singleton<DialogueManager>; 35 30 36 static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } //tolua_export 37 31 public: 38 32 39 void setquestion(std::string question); //tolua_export 40 std::string getquestion(void); //tolua_export 41 42 43 void setanswers1(std::string a1); //tolua_export 44 std::string getanswers1(void); //tolua_export 45 46 void setanswers2(std::string a2); //tolua_export 47 std::string getanswers2(void); //tolua_export 48 49 void setCurrentQuestion(NextQuestion* q); 33 DialogueManager(); 50 34 51 //Sets the current Question to the question corresponding to the first/second answer52 void a1clicked(void); //tolua_export53 void a2clicked(void); //tolua_export54 55 //Checks whether there are any more Questions to come56 bool theEnd(); //tolua_export57 35 58 //Sets question and a1, a2 for new currentQuestion 59 void update(NextQuestion* nq); 36 static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } //tolua_export 60 37 61 //Is executed whenever a NextQuestion is created and pushes all NextQuestion into the allQuestion vector. 62 void registerquestion(NextQuestion* nq); 38 39 void setquestion(std::string question); //tolua_export 40 std::string getquestion(void); //tolua_export 41 42 43 void setanswers1(std::string a1); //tolua_export 44 std::string getanswers1(void); //tolua_export 45 46 void setanswers2(std::string a2); //tolua_export 47 std::string getanswers2(void); //tolua_export 48 49 void setCurrentQuestion(NextQuestion* q); 50 51 //Sets the current Question to the question corresponding to the first/second answer 52 void a1clicked(void); //tolua_export 53 void a2clicked(void); //tolua_export 54 55 //Checks whether there are any more Questions to come 56 bool theEnd(); //tolua_export 57 58 //Sets question and a1, a2 for new currentQuestion 59 void update(NextQuestion* nq); 60 61 //Is executed whenever a NextQuestion is created and pushes all NextQuestion into the allQuestion vector. 62 void registerquestion(NextQuestion* nq); 63 63 64 64 private: 65 66 67 68 69 70 65 NextQuestion* currentQuestion; //The Question which is currently displayed 66 std::vector<NextQuestion*> allQuestions; 67 std::string a1; //answer on first button 68 std::string a2; //answer on second button 69 std::string question; 70 static DialogueManager* singletonPtr_s; 71 71 72 72 };//tolua_export 73 73 }//tolua_export 74 74 #endif -
code/trunk/src/modules/dialogue/NextQuestion.cc
r11435 r11718 12 12 namespace orxonox{ 13 13 14 14 RegisterClass(NextQuestion); 15 15 16 16 NextQuestion::NextQuestion(Context* context) : BaseObject(context) 17 17 { 18 18 RegisterObject(NextQuestion); … … 24 24 } 25 25 26 27 28 26 void NextQuestion::setquestion(std::string question){ 27 this->question=question; 28 } 29 29 30 31 32 30 std::string NextQuestion::getquestion(void){ 31 return question; 32 } 33 33 34 35 bool NextQuestion::addposQuestion(NextQuestion* nq){36 37 possibleQuestions.push_back(nq);38 return true;39 }40 34 41 const NextQuestion* NextQuestion::getposQuestion(unsigned int i) const 35 bool NextQuestion::addposQuestion(NextQuestion* nq){ 36 37 possibleQuestions.push_back(nq); 38 return true; 39 } 40 41 const NextQuestion* NextQuestion::getposQuestion(unsigned int i) const 42 42 { 43 43 for (NextQuestion* effect : this->possibleQuestions) … … 49 49 return nullptr; 50 50 } 51 52 53 51 52 53 void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode) 54 54 { 55 55 SUPER(NextQuestion, XMLPort, xmlelement, mode); … … 61 61 62 62 } 63 63 bool NextQuestion::execute(bool bTriggered, BaseObject* trigger) 64 64 { 65 65 66 67 66 DialogueManager& m = DialogueManager::getInstance(); 67 68 68 m.setquestion(question); 69 69 m.setCurrentQuestion(this); … … 86 86 87 87 88 89 90 88 void NextQuestion::setanswers1(std::string a1){ 89 this->a1=a1; 90 } 91 91 92 void NextQuestion::setanswers2(std::string a2){ 93 this->a2=a2; 94 } 95 96 97 98 std::string NextQuestion::getanswers1(void){ 99 return a1; 100 } 101 102 std::string NextQuestion::getanswers2(void){ 103 return a2; 104 } 105 106 92 void NextQuestion::setanswers2(std::string a2){ 93 this->a2=a2; 94 } 107 95 108 96 109 97 98 std::string NextQuestion::getanswers1(void){ 99 return a1; 100 } 101 102 std::string NextQuestion::getanswers2(void){ 103 return a2; 104 } 110 105 111 106 } -
code/trunk/src/modules/dialogue/NextQuestion.h
r11699 r11718 13 13 14 14 namespace orxonox{ 15 class _DialogueExport NextQuestion : public BaseObject 16 { 17 18 //tolua_begin 19 public: 15 class _DialogueExport NextQuestion : public BaseObject 16 { 20 17 21 NextQuestion (Context* context); // tolua_export 22 18 //tolua_begin 19 public: 23 20 24 void setquestion(std::string question); 25 std::string getquestion(void); 26 27 void setanswers1(std::string a1); 28 void setanswers2(std::string a2); 29 std::string getanswers1(void); 30 std::string getanswers2(void); 31 32 33 34 35 //XMLEventPort for Event that first triggers the Dialogue 36 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 37 38 //XMLPort for setting questions and answers and the vector possibleQuestions 39 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 40 41 bool addposQuestion(NextQuestion* nq); 42 const NextQuestion* getposQuestion(unsigned int index) const; 43 44 //Sets very first currentQuestion in the DialogueManager when the event is triggered 45 bool execute(bool bTriggered, BaseObject* trigger); 46 47 std::vector<NextQuestion*> possibleQuestions; 48 49 private: 50 std::string a1; 51 std::string a2; 52 21 NextQuestion (Context* context); // tolua_export 53 22 54 23 55 std::string question;56 DialogueManager* m;24 void setquestion(std::string question); 25 std::string getquestion(void); 57 26 58 }; 59 27 void setanswers1(std::string a1); 28 void setanswers2(std::string a2); 29 std::string getanswers1(void); 30 std::string getanswers2(void); 31 32 33 34 35 //XMLEventPort for Event that first triggers the Dialogue 36 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 37 38 //XMLPort for setting questions and answers and the vector possibleQuestions 39 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 40 41 bool addposQuestion(NextQuestion* nq); 42 const NextQuestion* getposQuestion(unsigned int index) const; 43 44 //Sets very first currentQuestion in the DialogueManager when the event is triggered 45 bool execute(bool bTriggered, BaseObject* trigger); 46 47 std::vector<NextQuestion*> possibleQuestions; 48 49 private: 50 std::string a1; 51 std::string a2; 52 53 54 55 std::string question; 56 DialogueManager* m; 57 58 }; 59 60 60 } 61 61 #endif -
code/trunk/src/modules/gametypes/SpaceRaceBot.h
r11358 r11718 39 39 { 40 40 public: 41 41 SpaceRaceBot(Context* context); 42 42 virtual ~SpaceRaceBot(); 43 43
Note: See TracChangeset
for help on using the changeset viewer.