Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7147


Ignore:
Timestamp:
Jun 12, 2010, 12:39:14 PM (14 years ago)
Author:
youngk
Message:

MoodManager works fine now.

Location:
code/branches/presentation3/src/orxonox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/orxonox/MoodManager.cc

    r7127 r7147  
    4646        this->setConfigValues();
    4747
     48        // Need to use a variable to store old data because ResetConfigValues() doesn't seem to work.
     49        oldMood_ = MoodManager::defaultMood_;
     50       
    4851        // Checking for the existence of the folder for the default mood
    49         /* Note: Currently Resource::exists(path) will always return false when the path field points to a folder.
    50            MoodManager::checkMoodValidity() performs the same check. Please help.
    51         */
    52         const std::string& path = "ambient/" + MoodManager::defaultMood_ + '/';
     52        const std::string& path = "ambient/" + MoodManager::defaultMood_ + "/.";
    5353        if (!Resource::exists(path))
    5454        {
     
    6969    void MoodManager::setMood(const std::string& mood)
    7070    {
     71        oldMood_ = mood_;
    7172        ModifyConfigValue(mood_, set, mood);
    7273    }
     
    7576    {
    7677        //  Generic mood validation
    77         const std::string& path = "ambient/" + mood_ + '/';
     78        const std::string& path = "ambient/" + mood_ + "/.";
    7879        if (!Resource::exists(path))
    7980        {
    8081            COUT(3) << "Mood " << mood_ << " does not exist. Will not change." << std::endl;
    81             ResetConfigValue(mood_);
     82            this->setMood(oldMood_);
    8283        }
    8384        else
  • code/branches/presentation3/src/orxonox/MoodManager.h

    r7121 r7147  
    8282            // config values
    8383            std::string mood_;
     84            std::string oldMood_;
    8485            static const std::string defaultMood_;
    8586
Note: See TracChangeset for help on using the changeset viewer.