Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 12, 2008, 10:53:51 PM (16 years ago)
Author:
landauf
Message:
  • added feature to add a callback function to configvalues. they get called if the value changes. an examples is in Core.cc.
  • changed the SetConfigValue macro and the Identifier::updateConfigValues() function to work properly with inherited classes in both possible cases: 1) they overwrite the config-value or 2) they don't. an example is ParticleProjectile that defines it's own speed_ configvalue.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/orxonox/Settings.cc

    r1535 r1596  
    6868  void Settings::setConfigValues()
    6969  {
    70     SetConfigValue(dataPath_, "../../Media/").description("Relative path to the game data.");
     70    SetConfigValue(dataPath_, "../../Media/").description("Relative path to the game data.").callback(&Settings::dataPathChanged);
     71  }
     72
     73  /**
     74    @brief Callback function if the datapath has changed.
     75  */
     76  void Settings::dataPathChanged()
     77  {
    7178    if (dataPath_ != "" && dataPath_[dataPath_.size() - 1] != '/')
    7279    {
Note: See TracChangeset for help on using the changeset viewer.