Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4132 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 9, 2005, 9:59:25 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: orxonox —help now shows something more usefull… still cleaning up the GUI

Location:
orxonox/trunk/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/gui/gui/gui.cc

    r4092 r4132  
    5353{
    5454  Window* orxonoxGUI = NULL;
    55 
     55  executable = NULL;
     56 
    5657  initGUI(argc, argv);
    5758
     
    9495    orxonoxGUI->fill(windowBox);
    9596  }
     97
     98
    9699  // Reading Values from File
    97100  exec->setConfDir(GUI_DEFAULT_CONF_DIR);
     
    116119    }
    117120#endif /* HAVE_CURL */
     121}
    118122
     123/**
     124   \brief starts the OrxonoxGUI
     125*/
     126void Gui::startGui(void)
     127{
    119128  mainloopGUI();
     129 
    120130#ifndef HAVE_GTK2
    121131  GuiExec::startOrxonox(NULL, exec);
     
    123133}
    124134
     135void 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*/
    125143bool Gui::startOrxonox = false;
    126144
  • orxonox/trunk/src/lib/gui/gui/gui.h

    r4056 r4132  
    2626  ~Gui(void);
    2727
     28  void startGui(void);
     29  void printHelp(void);
     30
    2831  static bool startOrxonox;
    2932};
  • orxonox/trunk/src/lib/gui/gui/gui_audio.cc

    r4091 r4132  
    4747      enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO);
    4848      enableSound->setFlagName ("no-sound", 0);
     49      enableSound->setDescription("Disables Sound", "Check this to disable Sound in Orxonox");
     50      enableSound->setDefaultValue(0);
    4951      enableSound->saveability();
    5052      audioBox->fill(enableSound);
     
    5355      musicVolume = new Slider("Music Volume", 0, 100);
    5456      musicVolume->setFlagName("music-volume", "m", 80);
     57      musicVolume->setDescription("Sets the volume of the ingame music");
    5558      musicVolume->saveability();
    5659      audioBox->fill (musicVolume);
     
    5962      effectsVolume = new Slider ("Effects Volume", 0, 100);
    6063      effectsVolume->setFlagName ("effects-volume", "e", 80);
     64      effectsVolume->setDescription("Sets the volune of the ingame SoundEffects");
    6165      effectsVolume->saveability();
    6266      audioBox->fill (effectsVolume);
  • orxonox/trunk/src/lib/gui/gui/gui_exec.cc

    r4091 r4132  
    7070      execBox->fill(this->saveSettings);
    7171
    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");
    7390      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                                  );
    74109      verboseMode->saveability();
    75110      execBox->fill(verboseMode);
     111#endif
    76112
    77113      alwaysShow = new CheckButton(CONFIG_NAME_ALWAYS_SHOW_GUI);
    78114      alwaysShow->setFlagName("gui", "g", 0);
     115      alwaysShow->setDescription("shows the gui when starting orxonox");
    79116      alwaysShow->saveability();
    80117      execBox->fill(alwaysShow);
  • orxonox/trunk/src/lib/gui/gui/gui_flags.cc

    r4071 r4132  
    3838  this->flagsBox->fill(flagsLabel);
    3939  this->shortFlags = new CheckButton("shortFlags");
     40  this->shortFlags->setDefaultValue(0);
    4041  this->flagsBox->fill(shortFlags);
    4142
  • orxonox/trunk/src/lib/gui/gui/gui_gtk.cc

    r4089 r4132  
    312312
    313313/**
     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*/
     318void 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/**
    314349    \brief Finds an Option by a given number(the n'th option found away from this Widget)
    315350    \param number The Count of options to wait(by reference)
     
    595630    }
    596631  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");
    598633}
    599634
     
    11771212  if ((this->value = atoi(tmpChar))=!0)
    11781213    this->value = 1;
    1179 #endif /* HAVE_GTK2 */
     1214
    11801215  PRINT(0)("%s set to: %d\n", this->title, this->value);
     1216#endif /* HAVE_GTK2 */
    11811217}
    11821218
     
    12621298  if (this->value <= this->start)
    12631299    this->value = this->start;
    1264 #endif /* HAVE_GTK2 */
     1300
    12651301  PRINT(0)("%s set to: %d\n",this->title, this->value);
     1302#endif /* HAVE_GTK2 */
    12661303}
    12671304
     
    13701407    {
    13711408      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);
    13731410    }
    13741411  PRINTF(4)( "Loading %s: setting to %d\n", this->title, this->value);
  • orxonox/trunk/src/lib/gui/gui/gui_gtk.h

    r4091 r4132  
    7171   static void listGroups(Widget* widget);
    7272   static void listGroups(Widget* widget, void* data);
     73   static void printHelp(Widget* widget);
    7374   Widget* findGroupByNumber(int* number, unsigned int depth);
    7475   static void setOptions(Widget* widget);
  • orxonox/trunk/src/lib/gui/gui/gui_update.cc

    r4091 r4132  
    5555  dataDirButton = new Button(CONFIG_NAME_DATADIR);
    5656  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");
    5759  dataDirLabel->saveability();
    5860  dataDirDialog = new FileDialog("data-Repos-location");
     
    7375  this->updateBox->fill(this->autoUpdate);
    7476  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");
    7578  this->autoUpdate->saveability();
    7679
  • orxonox/trunk/src/lib/gui/gui/gui_video.cc

    r4091 r4132  
    5151      fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN);
    5252      fullscreen->setFlagName("windowed", "q", 1);
     53      fullscreen->setDescription("Starts orxonox in windowed mode");
    5354      fullscreen->saveability();
    5455      videoBox->fill(fullscreen);
     
    5758      resolution->saveability();
    5859      resolution->setFlagName("resolution", "r", 0);
     60      resolution->setDescription("Sets the resolution of orxonox");
    5961      videoBox->fill(resolution);
    6062      wireframe = new CheckButton(CONFIG_NAME_WIREFRAME);
    6163      wireframe->setFlagName("wireframe", "w", 0);
     64      wireframe->setDescription("Starts orxonox in wireframe mode");
    6265      wireframe->saveability();
    6366      videoBox->fill(wireframe);
     
    199202  else{
    200203    /* Print valid modes */
    201     PRINT(4)("Available Modes\n");
     204    PRINT(5)("Available Modes\n");
    202205    for(i = 0; modes[i] ;++i)
    203206      {
    204207        if (x != modes[i]->w || y != modes[i]->h)
    205208          {
    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);
    207210            sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h);
    208211            menu->addItem(tmpChar);
  • orxonox/trunk/src/orxonox.cc

    r4131 r4132  
    220220  PRINT(3)("initializing TextEngine\n");
    221221  TextEngine::getInstance();
     222
     223  return 0;
    222224}
    223225
     
    353355  for(i = 1; i < argc; ++i)
    354356    {
    355       if(! strcmp( "--help", argv[i])) return startHelp();
     357      if(! strcmp( "--help", argv[i])) return startHelp(argc, argv);
    356358      else if(! strcmp( "--benchmark", argv[i])) return startBenchmarks();
    357359      else if(! strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) showGui = true;
     
    364366
    365367
    366 int startHelp()
     368int startHelp(int argc, char** argv)
    367369{
    368370  PRINT(0)("orxonox: starts the orxonox game - rules\n");
     
    372374  PRINT(0)(" --help \tshows this menu\n");
    373375  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  }
    374382}
    375383
     
    384392      if (ResourceManager::isFile("~/.orxonox/orxonox.lock"))
    385393        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
    388396      Gui* gui = new Gui(argc, argv);
     397      gui->startGui();
     398
    389399      if (! gui->startOrxonox)
    390400        return 0;
  • orxonox/trunk/src/orxonox.h

    r4131 r4132  
    7575};
    7676
    77 int startHelp(void);
     77int startHelp(int argc, char** argv);
    7878int startOrxonox(int argc, char** argv);
    7979
Note: See TracChangeset for help on using the changeset viewer.