Changeset 8051 for code/branches/tutorial/src/orxonox
- Timestamp:
- Mar 9, 2011, 11:27:05 AM (14 years ago)
- Location:
- code/branches/tutorial
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutorial
- Property svn:mergeinfo changed
/code/branches/usability merged: 8018-8041
- Property svn:mergeinfo changed
-
code/branches/tutorial/src/orxonox/ChatInputHandler.cc
r8000 r8051 28 28 29 29 #include "ChatInputHandler.h" 30 31 #include <cassert> 32 #include <string> 33 #include <CEGUIWindow.h> 34 #include <CEGUIWindowManager.h> 35 #include <elements/CEGUIListbox.h> 36 #include <elements/CEGUIListboxItem.h> 37 #include <elements/CEGUIListboxTextItem.h> 38 30 39 #include "util/ScopedSingletonManager.h" 31 40 #include "core/CoreIncludes.h" 32 41 #include "core/GUIManager.h" 33 #include "core/CorePrereqs.h"34 42 #include "core/command/ConsoleCommand.h" 35 #include <CEGUIWindow.h> 36 #include <elements/CEGUIListbox.h> 37 #include <elements/CEGUIListboxItem.h> 38 #include <elements/CEGUIListboxTextItem.h> 39 #include <CEGUIWindowManager.h> 40 #include <string> 43 #include "core/input/InputBuffer.h" 44 #include "core/input/InputManager.h" 45 #include "core/input/InputState.h" 46 #include "network/Host.h" 47 48 #include "PlayerManager.h" 49 #include "infos/PlayerInfo.h" 41 50 42 51 namespace orxonox -
code/branches/tutorial/src/orxonox/ChatInputHandler.h
r8000 r8051 30 30 #define _ChatInputHandler_H__ 31 31 32 /* std includes */ 33 #include <deque> 32 #include <OrxonoxPrereqs.h> 33 34 34 #include <string> 35 #include <fstream>36 #include <iostream>37 #include <cassert>38 35 #include <CEGUIForwardRefs.h> 39 36 #include <CEGUIcolour.h> 40 37 41 /* project includes */ 42 #include <OrxonoxPrereqs.h> 43 #include <core/BaseObject.h> 44 #include <core/PathConfig.h> 45 46 #include "core/input/InputBuffer.h" 47 #include "core/input/InputManager.h" 48 #include "core/input/InputState.h" 49 50 #include <network/ChatListener.h> 51 #include <PlayerManager.h> 52 #include <infos/PlayerInfo.h> 53 54 #include "../libraries/network/Host.h" 55 #include <util/Singleton.h> 38 #include "util/Singleton.h" 39 #include "network/ChatListener.h" 56 40 57 41 namespace orxonox // tolua_export -
code/branches/tutorial/src/orxonox/LevelInfo.h
r7804 r8051 109 109 @return Returns the XML-filename (including *.oxw extension) of the Level. 110 110 */ 111 inline const std::string& getXMLFilename(void) { return this->xmlfilename_; } // tolua_export111 inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export 112 112 113 113 protected: … … 212 212 { 213 213 bool operator() (const LevelInfoItem* lhs, const LevelInfoItem* rhs) const 214 { return getLowercase(lhs->getName()).compare(getLowercase(rhs->getName())) < 0; } 214 { 215 if(getLowercase(lhs->getName()).compare(getLowercase(rhs->getName())) == 0) 216 return getLowercase(lhs->getXMLFilename()).compare(getLowercase(rhs->getXMLFilename())) < 0; 217 return getLowercase(lhs->getName()).compare(getLowercase(rhs->getName())) < 0; 218 } 215 219 }; 216 220 -
code/branches/tutorial/src/orxonox/LevelManager.cc
r7999 r8051 251 251 // Iterate over all the found *.oxw files 252 252 COUT(3) << "Loading LevelInfos..." << std::endl; 253 std::set<std::string> names; 253 254 for (Ogre::StringVector::const_iterator it = levels->begin(); it != levels->end(); ++it) 254 255 { … … 277 278 } 278 279 280 // Warn about levels with the same name. 281 if(!names.insert(info->getName()).second) 282 COUT(2) << "Warning: Multiple levels (" << info->getXMLFilename() << ") with name '" << info->getName() << "' found!" << std::endl; 283 279 284 // Warn about multiple items so that it gets fixed quickly 280 285 if(availableLevels_.find(info) != availableLevels_.end()) 281 286 { 282 COUT(2) << "Warning: Multiple levels with name '" << info->getName() << "' found!" << std::endl;287 COUT(2) << "Warning: Multiple levels (" << info->getXMLFilename() << ") with same name '" << info->getName() << "' and filename found! Exluding..." << std::endl; 283 288 // Delete LevelInfoItem to avoid a dangling pointer 284 289 delete info; -
code/branches/tutorial/src/orxonox/LevelManager.h
r7804 r8051 112 112 // Helpers to allow fast access to the availableLevels list. 113 113 unsigned int nextIndex_; //! The next expected index to be accessed. 114 std::set<LevelInfoItem*, LevelInfoCompare>::iterator nextLevel_; //! The nex expected Level to be accessed.114 std::set<LevelInfoItem*, LevelInfoCompare>::iterator nextLevel_; //! The next expected Level to be accessed. 115 115 116 116 // config values -
code/branches/tutorial/src/orxonox/gamestates/GSLevel.cc
r7978 r8051 46 46 #include "LevelManager.h" 47 47 #include "PlayerManager.h" 48 #include "GSRoot.h" 48 49 49 50 namespace orxonox … … 156 157 COUT(0) << "Loading level..." << std::endl; 157 158 startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel()); 158 Loader::open(startFile_);159 bool loaded = Loader::open(startFile_); 159 160 160 161 Core::getInstance().updateLastLevelTimestamp(); 162 if(!loaded) 163 GSRoot::delayedStartMainMenu(); 161 164 } 162 165 -
code/branches/tutorial/src/orxonox/gamestates/GSMainMenu.cc
r7978 r8051 68 68 RegisterRootObject(GSMainMenu); 69 69 70 InputManager::getInstance().createInputState("MainMenuHackery" , true, true)->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());70 InputManager::getInstance().createInputState("MainMenuHackery")->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler()); 71 71 72 72 // create an empty Scene -
code/branches/tutorial/src/orxonox/gamestates/GSRoot.cc
r7935 r8051 38 38 #include "tools/interfaces/Tickable.h" 39 39 40 #include "GSLevel.h" 41 40 42 namespace orxonox 41 43 { … … 45 47 static const std::string __CC_setPause_name = "setPause"; 46 48 static const std::string __CC_pause_name = "pause"; 49 50 /*static*/ bool GSRoot::startMainMenu_s = false; 47 51 48 52 SetConsoleCommand("printObjects", &GSRoot::printObjects).hide(); … … 98 102 void GSRoot::update(const Clock& time) 99 103 { 104 if(startMainMenu_s) 105 { 106 delayedStartMainMenu(); 107 startMainMenu_s = false; 108 } 109 100 110 for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; ) 101 111 { … … 175 185 callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, CLIENTID_UNKNOWN, factor_new); 176 186 } 187 188 /*static*/ void GSRoot::delayedStartMainMenu(void) 189 { 190 if(!startMainMenu_s) 191 startMainMenu_s = true; 192 else 193 GSLevel::startMainMenu(); 194 } 195 177 196 } -
code/branches/tutorial/src/orxonox/gamestates/GSRoot.h
r7935 r8051 54 54 void pause(); 55 55 56 static void delayedStartMainMenu(void); 57 56 58 protected: 57 59 virtual void changedTimeFactor(float factor_new, float factor_old); … … 60 62 bool bPaused_; 61 63 float timeFactorPauseBackup_; 64 static bool startMainMenu_s; 62 65 }; 63 66 } -
code/branches/tutorial/src/orxonox/gametypes/Gametype.cc
r7801 r8051 30 30 31 31 #include "util/Math.h" 32 #include "core/Core.h" 32 33 #include "core/CoreIncludes.h" 33 34 #include "core/ConfigValueIncludes.h" … … 386 387 if (allplayersready && hashumanplayers) 387 388 { 388 this->gtinfo_->startCountdown_ = this->initialStartCountdown_; 389 // If in developer's mode, there is no start countdown. 390 if(Core::getInstance().inDevMode()) 391 this->gtinfo_->startCountdown_ = 0; 392 else 393 this->gtinfo_->startCountdown_ = this->initialStartCountdown_; 389 394 this->gtinfo_->bStartCountdownRunning_ = true; 390 395 } -
code/branches/tutorial/src/orxonox/graphics/Model.cc
r7183 r8051 60 60 void Model::setConfigValues() 61 61 { 62 SetConfigValueExternal(bGlobalEnableLod_, "GraphicsSettings", "enableM odelLoD", true)62 SetConfigValueExternal(bGlobalEnableLod_, "GraphicsSettings", "enableMeshLoD", true) 63 63 .description("Enable level of detail for models"); 64 64 } -
code/branches/tutorial/src/orxonox/overlays/InGameConsole.cc
r8015 r8051 49 49 #include "core/ConfigValueIncludes.h" 50 50 #include "core/command/ConsoleCommand.h" 51 #include "core/GUIManager.h"52 51 #include "core/input/InputManager.h" 53 52 #include "core/input/InputState.h" … … 60 59 const float CHAR_WIDTH = 7.45f; // fix this please - determine the char-width dynamically 61 60 62 SetConsoleCommand("InGameConsole", "openConsole", &InGameConsole::openConsole) .addShortcut();63 SetConsoleCommand("InGameConsole", "closeConsole", &InGameConsole::closeConsole) .addShortcut();61 SetConsoleCommand("InGameConsole", "openConsole", &InGameConsole::openConsole); 62 SetConsoleCommand("InGameConsole", "closeConsole", &InGameConsole::closeConsole); 64 63 65 64 ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false); … … 534 533 { 535 534 this->bActive_ = false; 536 GUIManager::getInstance().getLuaState()->doString("inGameConsoleClosed()"); // Notify the SheetManager in lua, that the console has been closed.537 535 InputManager::getInstance().leaveState("console"); 538 536 this->shell_->unregisterListener(this); … … 611 609 /*static*/ void InGameConsole::closeConsole() 612 610 { 613 GUIManager::getInstance().getLuaState()->doString("inGameConsoleClosed()"); // Notify the SheetManager in lua, that the console has been closed, but not by ESC.614 611 InGameConsole::getInstance().deactivate(); 615 612 }
Note: See TracChangeset
for help on using the changeset viewer.