Changeset 6072 for code/branches/sound3/src/orxonox/gamestates
- Timestamp:
- Nov 15, 2009, 10:40:53 PM (15 years ago)
- Location:
- code/branches/sound3/src/orxonox/gamestates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.