Changeset 4132 in orxonox.OLD for orxonox/trunk
- Timestamp:
- May 9, 2005, 9:59:25 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/gui/gui/gui.cc
r4092 r4132 53 53 { 54 54 Window* orxonoxGUI = NULL; 55 55 executable = NULL; 56 56 57 initGUI(argc, argv); 57 58 … … 94 95 orxonoxGUI->fill(windowBox); 95 96 } 97 98 96 99 // Reading Values from File 97 100 exec->setConfDir(GUI_DEFAULT_CONF_DIR); … … 116 119 } 117 120 #endif /* HAVE_CURL */ 121 } 118 122 123 /** 124 \brief starts the OrxonoxGUI 125 */ 126 void Gui::startGui(void) 127 { 119 128 mainloopGUI(); 129 120 130 #ifndef HAVE_GTK2 121 131 GuiExec::startOrxonox(NULL, exec); … … 123 133 } 124 134 135 void Gui::printHelp() 136 { 137 Window::mainWindow->walkThrough(Widget::printHelp, 1); 138 } 139 140 /** 141 \brief a bool that knows if orxonox should be started 142 */ 125 143 bool Gui::startOrxonox = false; 126 144 -
orxonox/trunk/src/lib/gui/gui/gui.h
r4056 r4132 26 26 ~Gui(void); 27 27 28 void startGui(void); 29 void printHelp(void); 30 28 31 static bool startOrxonox; 29 32 }; -
orxonox/trunk/src/lib/gui/gui/gui_audio.cc
r4091 r4132 47 47 enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO); 48 48 enableSound->setFlagName ("no-sound", 0); 49 enableSound->setDescription("Disables Sound", "Check this to disable Sound in Orxonox"); 50 enableSound->setDefaultValue(0); 49 51 enableSound->saveability(); 50 52 audioBox->fill(enableSound); … … 53 55 musicVolume = new Slider("Music Volume", 0, 100); 54 56 musicVolume->setFlagName("music-volume", "m", 80); 57 musicVolume->setDescription("Sets the volume of the ingame music"); 55 58 musicVolume->saveability(); 56 59 audioBox->fill (musicVolume); … … 59 62 effectsVolume = new Slider ("Effects Volume", 0, 100); 60 63 effectsVolume->setFlagName ("effects-volume", "e", 80); 64 effectsVolume->setDescription("Sets the volune of the ingame SoundEffects"); 61 65 effectsVolume->saveability(); 62 66 audioBox->fill (effectsVolume); -
orxonox/trunk/src/lib/gui/gui/gui_exec.cc
r4091 r4132 70 70 execBox->fill(this->saveSettings); 71 71 72 verboseMode = new Menu(CONFIG_NAME_VERBOSE_MODE, "nothing", "error", "warning", "info", "lastItem"); 72 #ifdef DEBUG 73 verboseMode = new Menu(CONFIG_NAME_VERBOSE_MODE, "nothing", 74 #if DEBUG >=1 75 "error", 76 #endif 77 #if DEBUG >=2 78 "warning", 79 #endif 80 #if DEBUG >=3 81 "info", 82 #endif 83 #if DEBUG >=4 84 "debug", 85 #endif 86 #if DEBUG >=5 87 "heavydebug", 88 #endif 89 "lastItem"); 73 90 verboseMode->setFlagName("verbose", "v", 2); 91 verboseMode->setDescription("Sets the Output Mode", "This Enables Outbug messages\n" 92 "0: nothing will be displayed, but stuff one cannot do without (eg.GUI)\n" 93 #if DEBUG >=1 94 "1: error: outputs all the above and errors" 95 #endif 96 #if DEBUG >=2 97 "2: warning: outputs all the above plus warnings" 98 #endif 99 #if DEBUG >=3 100 "3: info: outputs all the above plus Information" 101 #endif 102 #if DEBUG >=4 103 "4: debug: displays all the above plus debug information" 104 #endif 105 #if DEBUG >=5 106 "5: heavydebug: displays all the above plus heavy debug information: WARNING: the game will run very slow with this." 107 #endif 108 ); 74 109 verboseMode->saveability(); 75 110 execBox->fill(verboseMode); 111 #endif 76 112 77 113 alwaysShow = new CheckButton(CONFIG_NAME_ALWAYS_SHOW_GUI); 78 114 alwaysShow->setFlagName("gui", "g", 0); 115 alwaysShow->setDescription("shows the gui when starting orxonox"); 79 116 alwaysShow->saveability(); 80 117 execBox->fill(alwaysShow); -
orxonox/trunk/src/lib/gui/gui/gui_flags.cc
r4071 r4132 38 38 this->flagsBox->fill(flagsLabel); 39 39 this->shortFlags = new CheckButton("shortFlags"); 40 this->shortFlags->setDefaultValue(0); 40 41 this->flagsBox->fill(shortFlags); 41 42 -
orxonox/trunk/src/lib/gui/gui/gui_gtk.cc
r4089 r4132 312 312 313 313 /** 314 \brief This is for listing the options of "widget" 315 \param widget specifies the widget that should be listed 316 \param data A Counter, that always knows how many Options have been found yet. 317 */ 318 void Widget::printHelp(Widget* widget) 319 { 320 bool hasFlag = false; 321 322 if (widget->optionType > GUI_NOTHING) 323 { 324 Option* option = (Option*)widget; 325 if (option->flagName || option->flagNameShort) 326 { 327 PRINT(0)(" "); 328 if (option->flagNameShort) 329 { 330 PRINT(0)("-%s", option->flagNameShort); 331 hasFlag = true; 332 } 333 if (option->flagName) 334 { 335 if (hasFlag) 336 PRINT(0)("|"); 337 PRINT(0)("--%s:", option->flagName); 338 hasFlag = true; 339 } 340 if (option->shortDescription) 341 PRINT(0)("\t\t%s\n", option->shortDescription); 342 else 343 PRINT(0)("\n"); 344 } 345 } 346 } 347 348 /** 314 349 \brief Finds an Option by a given number(the n'th option found away from this Widget) 315 350 \param number The Count of options to wait(by reference) … … 595 630 } 596 631 else 597 PRINTF( 1)("You tried to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n");632 PRINTF(2)("You tried to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n"); 598 633 } 599 634 … … 1177 1212 if ((this->value = atoi(tmpChar))=!0) 1178 1213 this->value = 1; 1179 #endif /* HAVE_GTK2 */ 1214 1180 1215 PRINT(0)("%s set to: %d\n", this->title, this->value); 1216 #endif /* HAVE_GTK2 */ 1181 1217 } 1182 1218 … … 1262 1298 if (this->value <= this->start) 1263 1299 this->value = this->start; 1264 #endif /* HAVE_GTK2 */ 1300 1265 1301 PRINT(0)("%s set to: %d\n",this->title, this->value); 1302 #endif /* HAVE_GTK2 */ 1266 1303 } 1267 1304 … … 1370 1407 { 1371 1408 this->value = 0; 1372 PRINTF(2)(" Sorry, but%s has not been found in the Itemlist of %s\n", loadString, this->title);1409 PRINTF(2)("%s has not been found in the Itemlist of %s\n", loadString, this->title); 1373 1410 } 1374 1411 PRINTF(4)( "Loading %s: setting to %d\n", this->title, this->value); -
orxonox/trunk/src/lib/gui/gui/gui_gtk.h
r4091 r4132 71 71 static void listGroups(Widget* widget); 72 72 static void listGroups(Widget* widget, void* data); 73 static void printHelp(Widget* widget); 73 74 Widget* findGroupByNumber(int* number, unsigned int depth); 74 75 static void setOptions(Widget* widget); -
orxonox/trunk/src/lib/gui/gui/gui_update.cc
r4091 r4132 55 55 dataDirButton = new Button(CONFIG_NAME_DATADIR); 56 56 dataDirLabel = new OptionLabel(CONFIG_NAME_DATADIR, "unknown"); 57 dataDirLabel->setFlagName("-d", "--data-dir", 0); 58 dataDirLabel->setDescription("Sets the location of the orxonox' Data-Directory"); 57 59 dataDirLabel->saveability(); 58 60 dataDirDialog = new FileDialog("data-Repos-location"); … … 73 75 this->updateBox->fill(this->autoUpdate); 74 76 this->autoUpdate->setFlagName("update", "u", 0); 77 this->autoUpdate->setDescription("Updates orxonox", "When this option is selected orxonox automatically searches for updates, and if found installs them"); 75 78 this->autoUpdate->saveability(); 76 79 -
orxonox/trunk/src/lib/gui/gui/gui_video.cc
r4091 r4132 51 51 fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN); 52 52 fullscreen->setFlagName("windowed", "q", 1); 53 fullscreen->setDescription("Starts orxonox in windowed mode"); 53 54 fullscreen->saveability(); 54 55 videoBox->fill(fullscreen); … … 57 58 resolution->saveability(); 58 59 resolution->setFlagName("resolution", "r", 0); 60 resolution->setDescription("Sets the resolution of orxonox"); 59 61 videoBox->fill(resolution); 60 62 wireframe = new CheckButton(CONFIG_NAME_WIREFRAME); 61 63 wireframe->setFlagName("wireframe", "w", 0); 64 wireframe->setDescription("Starts orxonox in wireframe mode"); 62 65 wireframe->saveability(); 63 66 videoBox->fill(wireframe); … … 199 202 else{ 200 203 /* Print valid modes */ 201 PRINT( 4)("Available Modes\n");204 PRINT(5)("Available Modes\n"); 202 205 for(i = 0; modes[i] ;++i) 203 206 { 204 207 if (x != modes[i]->w || y != modes[i]->h) 205 208 { 206 PRINT (4)(" %d x %d\n", modes[i]->w, modes[i]->h);209 PRINTF(5)(" %d x %d\n", modes[i]->w, modes[i]->h); 207 210 sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h); 208 211 menu->addItem(tmpChar); -
orxonox/trunk/src/orxonox.cc
r4131 r4132 220 220 PRINT(3)("initializing TextEngine\n"); 221 221 TextEngine::getInstance(); 222 223 return 0; 222 224 } 223 225 … … 353 355 for(i = 1; i < argc; ++i) 354 356 { 355 if(! strcmp( "--help", argv[i])) return startHelp( );357 if(! strcmp( "--help", argv[i])) return startHelp(argc, argv); 356 358 else if(! strcmp( "--benchmark", argv[i])) return startBenchmarks(); 357 359 else if(! strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) showGui = true; … … 364 366 365 367 366 int startHelp( )368 int startHelp(int argc, char** argv) 367 369 { 368 370 PRINT(0)("orxonox: starts the orxonox game - rules\n"); … … 372 374 PRINT(0)(" --help \tshows this menu\n"); 373 375 PRINT(0)(" --gui/-g \tDisplays the Gui on startup\n"); 376 377 { 378 Gui* gui = new Gui(argc, argv); 379 gui->printHelp(); 380 delete gui; 381 } 374 382 } 375 383 … … 384 392 if (ResourceManager::isFile("~/.orxonox/orxonox.lock")) 385 393 ResourceManager::deleteFile("~/.orxonox/orxonox.lock"); 386 // char* guiExec = new char[strlen(argv[0])+20];387 // sprintf(guiExec,"%sGui --gui", argv[0]);394 395 // starting the GUI 388 396 Gui* gui = new Gui(argc, argv); 397 gui->startGui(); 398 389 399 if (! gui->startOrxonox) 390 400 return 0; -
orxonox/trunk/src/orxonox.h
r4131 r4132 75 75 }; 76 76 77 int startHelp( void);77 int startHelp(int argc, char** argv); 78 78 int startOrxonox(int argc, char** argv); 79 79
Note: See TracChangeset
for help on using the changeset viewer.