Changeset 6072 for code/branches/sound3/src/orxonox
- Timestamp:
- Nov 15, 2009, 10:40:53 PM (15 years ago)
- Location:
- code/branches/sound3/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound3/src/orxonox/MoodManager.cc
r6031 r6072 44 44 moodOld_ = "default"; 45 45 this->setConfigValues(); 46 46 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&MoodManager::setMood, this), "setMood")); 47 47 } 48 48 … … 58 58 } 59 59 60 60 /** 61 61 * Sets the mood 62 62 * @note TODO: Inform dependent classes of mood change 63 63 */ 64 void MoodManager::setMood(const std::string& mood) { 65 ModifyConfigValue(mood_, set, mood); 66 } 67 68 // gets the current mood 69 const std::string& MoodManager::getMood() { 70 return mood_; 71 } 64 void MoodManager::setMood(const std::string& mood) 65 { 66 ModifyConfigValue(mood_, set, mood); 67 } 68 69 // gets the current mood 70 const std::string& MoodManager::getMood() 71 { 72 return mood_; 73 } 72 74 73 75 void MoodManager::checkMoodValidity() -
code/branches/sound3/src/orxonox/MoodManager.h
r6031 r6072 53 53 void setConfigValues(); 54 54 55 56 55 void setMood(const std::string& mood); 56 const std::string& getMood(); 57 57 58 58 static MoodManager& getInstance() { return Singleton<MoodManager>::getInstance(); } // tolua_export 59 59 60 60 private: 61 61 62 62 // config values 63 63 std::string mood_; -
code/branches/sound3/src/orxonox/gamestates/GSMainMenu.cc
r6071 r6072 50 50 , inputState_(0) 51 51 { 52 52 RegisterRootObject(GSMainMenu); 53 53 inputState_ = InputManager::getInstance().createInputState("mainMenu"); 54 54 inputState_->setMouseMode(MouseMode::Nonexclusive); … … 93 93 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu), "startMainMenu")); 94 94 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startIOConsole), "startIOConsole")); 95 96 97 95 96 // create command to change sound path 97 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::setMainMenuSoundPath, this), "setMMSoundPath")); 98 98 99 99 KeyBinderManager::getInstance().setToDefault(); … … 106 106 } 107 107 108 108 this->setConfigValues(); 109 109 } 110 110 … … 126 126 } 127 127 128 128 void GSMainMenu::setConfigValues() 129 129 { 130 130 SetConfigValue(soundPathMain_, "mainmenu.wav") 131 131 .description("Contains the path to the main menu sound file.") 132 132 .callback(this, &GSMainMenu::reloadSound); 133 133 } 134 134 135 void GSMainMenu::reloadSound() { 136 if (GameMode::playsSound()) 135 void GSMainMenu::reloadSound() 136 { 137 if (GameMode::playsSound()) 137 138 { 138 139 this->ambient_->setAmbientSource(soundPathMain_); 139 140 140 } 141 } 141 142 142 const std::string& GSMainMenu::getMainMenuSoundPath() { 143 return soundPathMain_; 144 } 143 const std::string& GSMainMenu::getMainMenuSoundPath() 144 { 145 return soundPathMain_; 146 } 145 147 146 void GSMainMenu::setMainMenuSoundPath(const std::string& path) { 147 ModifyConfigValue(soundPathMain_, set, path); 148 } 148 void GSMainMenu::setMainMenuSoundPath(const std::string& path) 149 { 150 ModifyConfigValue(soundPathMain_, set, path); 151 } 149 152 150 153 void GSMainMenu::startStandalone() -
code/branches/sound3/src/orxonox/gamestates/GSMainMenu.h
r5956 r6072 48 48 void update(const Clock& time); 49 49 50 51 52 53 50 void setConfigValues(); 51 void reloadSound(); 52 const std::string& getMainMenuSoundPath(); 53 void setMainMenuSoundPath(const std::string& path); 54 54 55 55 static void startStandalone(); … … 67 67 // ambient sound for the main menu 68 68 AmbientSound* ambient_; 69 std::stringsoundPathMain_;69 std::string soundPathMain_; 70 70 }; 71 71 }
Note: See TracChangeset
for help on using the changeset viewer.