Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2008, 4:25:52 AM (17 years ago)
Author:
landauf
Message:

merged core3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/Core.cc

    r1535 r1747  
    9696    void Core::setConfigValues()
    9797    {
    98         SetConfigValue(softDebugLevelConsole_, 3).description("The maximal level of debug output shown in the console");
    99         SetConfigValue(softDebugLevelLogfile_, 3).description("The maximal level of debug output shown in the logfile");
    100         SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell");
    101 
     98        SetConfigValue(softDebugLevelConsole_, 3).description("The maximal level of debug output shown in the console").callback(this, &Core::debugLevelChanged);
     99        SetConfigValue(softDebugLevelLogfile_, 3).description("The maximal level of debug output shown in the logfile").callback(this, &Core::debugLevelChanged);
     100        SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell").callback(this, &Core::debugLevelChanged);
     101        SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text").callback(this, &Core::languageChanged);
     102    }
     103
     104    /**
     105        @brief Callback function if the debug level has changed.
     106    */
     107    void Core::debugLevelChanged()
     108    {
    102109        // softDebugLevel_ is the maximum of the 3 variables
    103110        this->softDebugLevel_ = this->softDebugLevelConsole_;
     
    107114            this->softDebugLevel_ = this->softDebugLevelShell_;
    108115
    109 
    110         std::string temp = this->language_;
    111         SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text");
    112 
    113         if (this->language_ != temp)
    114         {
    115             // Read the translation file after the language was configured
    116             Language::getLanguage().readTranslatedLanguageFile();
    117         }
     116        OutputHandler::setSoftDebugLevel(OutputHandler::LD_All,     this->softDebugLevel_);
     117        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Console, this->softDebugLevelConsole_);
     118        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Logfile, this->softDebugLevelLogfile_);
     119        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Shell,   this->softDebugLevelShell_);
     120    }
     121
     122    /**
     123        @brief Callback function if the language has changed.
     124    */
     125    void Core::languageChanged()
     126    {
     127        // Read the translation file after the language was configured
     128        Language::getLanguage().readTranslatedLanguageFile();
    118129    }
    119130
     
    158169            else if (device == OutputHandler::LD_Shell)
    159170                Core::getInstance().softDebugLevelShell_ = level;
     171
     172            OutputHandler::setSoftDebugLevel(device, level);
    160173        }
    161174     }
     
    199212    }
    200213}
    201 
    202 /**
    203     @brief Returns the soft debug level, stored in the only existing instance of the DebugLevel class, configured in the config-file.
    204     @return The soft debug level
    205 */
    206 int getSoftDebugLevel()
    207 {
    208     return orxonox::Core::getSoftDebugLevel();
    209 }
Note: See TracChangeset for help on using the changeset viewer.