Changeset 880
- Timestamp:
- 02/28/10 23:41:33 (5 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 modified
-
client/client.vcproj (modified) (1 diff)
-
client/Game2/GameApp.cpp (modified) (8 diffs)
-
client/Game2/GameApp.h (modified) (2 diffs)
-
client/Game2/main.cpp (modified) (3 diffs)
-
client/Game2/SysConsole.cpp (added)
-
client/Game2/SysConsole.h (added)
-
engine/Util/Config.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/client.vcproj
r877 r880 459 459 </File> 460 460 <File 461 RelativePath=".\Game2\SysConsole.cpp" 462 > 463 </File> 464 <File 465 RelativePath=".\Game2\SysConsole.h" 466 > 467 </File> 468 <File 461 469 RelativePath=".\Game2\TrackDownloadDialog.cpp" 462 470 > -
trunk/client/Game2/GameApp.cpp
r879 r880 36 36 #include "IntroMovie.h" 37 37 #include "Rulebook.h" 38 #include "SysConsole.h" 38 39 #include "TrackSelect.h" 39 40 #include "TrackDownloadDialog.h" … … 100 101 #define MRM_RETURN2WINDOWMODE 1 101 102 #define MRM_EXIT_MENU_LOOP 2 103 104 #define MR_WM_ON_INIT (WM_APP + 0x0042) 102 105 103 106 #ifdef WITH_OPENAL … … 566 569 567 570 MR_GameApp::MR_GameApp(HINSTANCE pInstance, bool safeMode) : 568 introMovie(NULL) 571 introMovie(NULL), sysConsole(NULL) 569 572 { 570 573 This = this; … … 606 609 MR_GameApp::~MR_GameApp() 607 610 { 611 if (sysConsole != NULL) { 612 delete sysConsole; 613 sysConsole = NULL; 614 } 615 608 616 delete controller; 609 617 … … 1097 1105 BOOL lReturnValue = TRUE; 1098 1106 Config *cfg = Config::GetInstance(); 1107 std::string &initScript = cfg->runtime.initScript; 1099 1108 1100 1109 InitCommonControls(); // Allow some special and complex controls … … 1183 1192 1184 1193 // play the opening movie 1185 if(lReturnValue && cfg->misc.introMovie ) {1194 if(lReturnValue && cfg->misc.introMovie && initScript.empty()) { 1186 1195 introMovie = new IntroMovie(mMainWindow, mInstance); 1187 1196 introMovie->Play(); … … 1201 1210 1202 1211 // show "click OK to play on the internet" dialog 1203 if(lReturnValue && cfg->misc.displayFirstScreen ) {1212 if(lReturnValue && cfg->misc.displayFirstScreen && initScript.empty()) { 1204 1213 if (FirstChoiceDialog().ShowModal(mInstance, mMainWindow)) 1205 1214 SendMessage(mMainWindow, WM_COMMAND, ID_GAME_NETWORK_INTERNET, 0); 1215 } 1216 1217 // Create the system console and execute the init script. 1218 sysConsole = new SysConsole(); 1219 sysConsole->Init(); 1220 if (!initScript.empty()) { 1221 sysConsole->RunScript(initScript); 1206 1222 } 1207 1223 … … 1982 1998 break; 1983 1999 */ 2000 case WM_CREATE: 2001 // Trigger the scripting "on_init" call later. 2002 PostMessage(pWindow, MR_WM_ON_INIT, 0, 0); 2003 break; 2004 2005 case MR_WM_ON_INIT: 2006 This->sysConsole->OnInit(); 2007 break; 1984 2008 1985 2009 case WM_DISPLAYCHANGE: -
trunk/client/Game2/GameApp.h
r878 r880 36 36 class Rulebook; 37 37 typedef boost::shared_ptr<Rulebook> RulebookPtr; 38 class SysConsole; 38 39 } 39 40 } … … 82 83 HoverRace::Client::IntroMovie *introMovie; 83 84 HoverRace::Client::FullscreenTest *fullscreenTest; 85 HoverRace::Client::SysConsole *sysConsole; 84 86 MR_ClientSession *mCurrentSession; 85 87 MR_GameThread *mGameThread; -
trunk/client/Game2/main.cpp
r871 r880 46 46 using HoverRace::Util::OS; 47 47 48 static std::string initScript; 48 49 static bool debugMode = false; 49 50 static bool safeMode = false; … … 80 81 if (strcmp("-D", arg) == 0) { 81 82 debugMode = true; 83 } 84 else if (strcmp("--exec", arg) == 0) { 85 if (i < argc) { 86 initScript = argv[i++]; 87 } 88 else { 89 ShowMessage("Expected: --exec (script filename)"); 90 return false; 91 } 82 92 } 83 93 else if (strcmp("-L", arg) == 0) { … … 204 214 cfg->runtime.aieeee = experimentalMode; 205 215 cfg->runtime.showFramerate = showFramerate; 216 cfg->runtime.initScript = initScript; 206 217 207 218 #ifdef ENABLE_NLS -
trunk/engine/Util/Config.h
r828 r880 220 220 bool showFramerate; 221 221 bool enableConsole; 222 std::string initScript; 222 223 } runtime; 223 224 };
