Changeset 11356 for code/trunk
- Timestamp:
- Mar 9, 2017, 3:38:58 PM (8 years ago)
- Location:
- code/trunk
- Files:
-
- 12 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/Highscore_HS16 (added) merged: 11226,11233,11235,11245,11254,11265,11267,11304,11313,11315,11324,11326,11333
- Property svn:mergeinfo changed
-
code/trunk/data/gui/layouts/MainMenu.layout
r6746 r11356 11 11 <Property Name="Text" Value="Quickstart" /> 12 12 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 13 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.2 875,0},{0.6,0},{0.3375,0}}" />13 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.25,0},{0.6,0},{0.3,0}}" /> 14 14 <Event Name="Clicked" Function="MainMenu.QuickGameTestButton_clicked"/> 15 15 </Window> … … 17 17 <Property Name="Text" Value="Singleplayer" /> 18 18 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 19 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.3 625,0},{0.6,0},{0.4125,0}}" />19 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.325,0},{0.6,0},{0.375,0}}" /> 20 20 <Event Name="Clicked" Function="MainMenu.SingleplayerButton_clicked"/> 21 21 </Window> … … 23 23 <Property Name="Text" Value="Multiplayer" /> 24 24 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 25 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.4 375,0},{0.6,0},{0.4875,0}}" />25 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.4,0},{0.6,0},{0.45,0}}" /> 26 26 <Event Name="Clicked" Function="MainMenu.MultiplayerButton_clicked"/> 27 </Window> 28 <Window Type="MenuWidgets/Button" Name="orxonox/HighscoreButton" > 29 <Property Name="Text" Value="Highscore" /> 30 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 31 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.475,0},{0.6,0},{0.525,0}}" /> 32 <Event Name="Clicked" Function="MainMenu.HighscoreButton_clicked"/> 27 33 </Window> 28 34 <Window Type="MenuWidgets/Button" Name="orxonox/SettingsButton" > 29 35 <Property Name="Text" Value="Settings" /> 30 36 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 31 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.5 125,0},{0.6,0},{0.5625,0}}" />37 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.55,0},{0.6,0},{0.6,0}}" /> 32 38 <Event Name="Clicked" Function="MainMenu.SettingsButton_clicked"/> 33 39 </Window> … … 35 41 <Property Name="Text" Value="Credits" /> 36 42 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 37 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0. 5875,0},{0.6,0},{0.6375,0}}" />43 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.625,0},{0.6,0},{0.675,0}}" /> 38 44 <Event Name="Clicked" Function="MainMenu.CreditsButton_clicked"/> 39 45 </Window> … … 41 47 <Property Name="Text" Value="Exit" /> 42 48 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 43 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0. 6625,0},{0.6,0},{0.7125,0}}" />49 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.7,0},{0.6,0},{0.75,0}}" /> 44 50 <Event Name="Clicked" Function="MainMenu.ExitButton_clicked"/> 45 51 </Window> -
code/trunk/data/gui/scripts/MainMenu.lua
r8079 r11356 2 2 3 3 local P = createMenuSheet("MainMenu") 4 P.loadAlong = { "SingleplayerMenu", "MultiplayerMenu", " SettingsMenu", "CreditsMenu" }4 P.loadAlong = { "SingleplayerMenu", "MultiplayerMenu", "HighscoreMenu", "SettingsMenu", "CreditsMenu" } 5 5 6 6 function P.onLoad() … … 22 22 23 23 P:setButton(4, 1, { 24 ["button"] = winMgr:getWindow("orxonox/HighscoreButton"), 25 ["callback"] = P.MultiplayerButton_clicked 26 }) 27 28 P:setButton(5, 1, { 24 29 ["button"] = winMgr:getWindow("orxonox/SettingsButton"), 25 30 ["callback"] = P.SettingsButton_clicked 26 31 }) 27 32 28 P:setButton( 5, 1, {33 P:setButton(6, 1, { 29 34 ["button"] = winMgr:getWindow("orxonox/CreditsButton"), 30 35 ["callback"] = P.CreditsButton_clicked 31 36 }) 32 37 33 P:setButton( 6, 1, {38 P:setButton(7, 1, { 34 39 ["button"] = winMgr:getWindow("orxonox/ExitButton"), 35 40 ["callback"] = P.ExitButton_clicked … … 51 56 end 52 57 58 function P.HighscoreButton_clicked(e) 59 showMenuSheet("HighscoreMenu", true) 60 end 61 53 62 function P.SettingsButton_clicked(e) 54 63 showMenuSheet("SettingsMenu", true) -
code/trunk/data/gui/scripts/MiscConfigMenu.lua
r9977 r11356 18 18 19 19 P.commandList = {} 20 table.insert(P.commandList, "Highscore playerName_") 20 21 table.insert(P.commandList, "KeyBinder mouseSensitivity_") 21 22 table.insert(P.commandList, "KeyBinder mouseSensitivityDerived_") … … 43 44 44 45 P.nameList = {} 46 table.insert(P.nameList, "Playername") 45 47 table.insert(P.nameList, "Mouse sensitivity") 46 48 table.insert(P.nameList, "Mouse acceleration") -
code/trunk/src/modules/dodgerace/DodgeRace.cc
r11071 r11356 36 36 #include "DodgeRaceCube.h" 37 37 #include "core/CoreIncludes.h" 38 #include "Highscore.h" 38 39 39 40 namespace orxonox … … 224 225 // It will misteriously crash the game! 225 226 // Instead startMainMenu, this won't crash. 227 if (Highscore::exists()){ 228 int score = this->getPoints(); 229 if(score > Highscore::getInstance().getHighestScoreOfGame("Dodge Race")) 230 Highscore::getInstance().storeHighscore("Dodge Race",score); 231 232 } 226 233 GSLevel::startMainMenu(); 227 234 } -
code/trunk/src/modules/invader/Invader.cc
r11083 r11356 33 33 34 34 #include "Invader.h" 35 35 #include "Highscore.h" 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/EventIncludes.h" … … 189 189 // It will misteriously crash the game! 190 190 // Instead startMainMenu, this won't crash. 191 if (Highscore::exists()){ 192 int score = this->getPoints(); 193 if(score > Highscore::getInstance().getHighestScoreOfGame("Orxonox Arcade")) 194 Highscore::getInstance().storeHighscore("Orxonox Arcade",score); 195 196 } 191 197 GSLevel::startMainMenu(); 192 198 } -
code/trunk/src/modules/jump/Jump.cc
r11071 r11356 34 34 #include "Jump.h" 35 35 #include "core/CoreIncludes.h" 36 #include "Highscore.h" 36 37 37 38 #include "JumpCenterpoint.h" … … 311 312 cleanup(); 312 313 GSLevel::startMainMenu(); 313 314 if (Highscore::exists()){ 315 int score = this->getScore(this->getPlayer()); 316 if(score > Highscore::getInstance().getHighestScoreOfGame("Jump")) 317 Highscore::getInstance().storeHighscore("Jump",score); 318 319 } 314 320 Deathmatch::end(); 315 321 } -
code/trunk/src/modules/tetris/Tetris.cc
r11083 r11356 39 39 40 40 #include "Tetris.h" 41 #include "Highscore.h" 41 42 42 43 #include "core/CoreIncludes.h" … … 327 328 this->player_->stopControl(); 328 329 } 329 330 if (Highscore::exists()){ 331 int score = this->getScore(this->getPlayer()); 332 if(score > Highscore::getInstance().getHighestScoreOfGame("Tetris")) 333 Highscore::getInstance().storeHighscore("Tetris",score); 334 335 } 330 336 this->cleanup(); 331 337 -
code/trunk/src/modules/towerdefense/TowerDefense.cc
r11083 r11356 81 81 #include "chat/ChatManager.h" 82 82 #include "core/CoreIncludes.h" 83 #include "Highscore.h" 83 84 84 85 namespace orxonox … … 197 198 void TowerDefense::end() 198 199 { 199 200 if (Highscore::exists()){ 201 int score = this->getWaveNumber(); 202 if(score > Highscore::getInstance().getHighestScoreOfGame("Tower Defense")) 203 Highscore::getInstance().storeHighscore("Tower Defense",score); 204 205 } 200 206 TeamDeathmatch::end(); 201 207 ChatManager::message("Match is over! Gameover!"); -
code/trunk/src/orxonox/CMakeLists.txt
r11353 r11356 28 28 LevelInfo.cc 29 29 LevelManager.cc 30 Highscore.cc 30 31 Main.cc 31 32 MoodManager.cc … … 61 62 LevelInfo.h 62 63 LevelManager.h 64 Highscore.h 63 65 MoodManager.h 64 66 controllers/HumanController.h -
code/trunk/src/orxonox/LevelInfo.cc
r11099 r11356 151 151 } 152 152 153 bool LevelInfoItem::addHighscore(const std::string& name, const int score) 154 { 155 std::stringstream stream; 156 stream << name << "/:/" << score; 157 bool success = this->highscores_.insert(stream.str()).second; 158 if(success) 159 this->highscoresUpdated(); 160 return success; 161 } 162 153 163 /** 154 164 @brief … … 191 201 } 192 202 203 void LevelInfoItem::highscoresUpdated(void) 204 { 205 std::stringstream stream; 206 std::set<std::string>::iterator temp; 207 for(std::set<std::string>::iterator it = this->highscores_.begin(); it != this->highscores_.end(); ) 208 { 209 temp = it; 210 if(++it == this->highscores_.end()) // If this is the last tag we don't add a comma. 211 stream << *temp; 212 else 213 stream << *temp << ", "; 214 } 215 216 this->highscoresString_ = std::string(stream.str()); 217 } 193 218 /** 194 219 @brief -
code/trunk/src/orxonox/LevelInfo.h
r11099 r11356 118 118 inline bool hasTag(const std::string& tag) const { return this->tags_.find(tag) != this->tags_.end(); } // tolua_export 119 119 120 bool addHighscore(const std::string& name,const int score); 121 122 inline const std::string& getHighscores(void) const { return this->highscoresString_; } // tolua_export 123 120 124 void setStartingShips(const std::string& ships); //!< Set the starting ship models of the level 121 125 bool addStartingShip(const std::string& ship, bool update = true); //!< Add a model to shipselection … … 154 158 void startingshipsUpdated(void); //!< Updates the comma-seperated string of all possible starting ships. 155 159 void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed. 160 void highscoresUpdated(void); 156 161 static void initializeTags(void); //!< Initialize the set of allowed tags. 157 162 /** … … 170 175 std::string screenshot_; //!< The screenshot of the Level. 171 176 std::set<std::string> tags_; //!< The set of tags the Level is tagged with. 177 178 std::set<std::string> highscores_; 179 std::string highscoresString_; 180 172 181 std::string tagsString_; //!< The comma-seperated string of all the tags the Level is tagged with. 173 182 std::set<std::string> startingShips_; //!< The set of starting ship models the Level allows. … … 244 253 inline const std::string& getTags(void) const 245 254 { return this->LevelInfoItem::getTags(); } 255 256 inline const std::string& getHighscores(void) const 257 { return this->LevelInfoItem::getHighscores(); } 246 258 /** 247 259 @brief Set the starting ship models of the level
Note: See TracChangeset
for help on using the changeset viewer.