- Timestamp:
- Oct 14, 2009, 5:01:49 PM (15 years ago)
- Location:
- code/branches/sound3/src/orxonox
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound3/src/orxonox/CMakeLists.txt
r5929 r5956 28 28 LevelManager.cc 29 29 Main.cc 30 MoodManager.cc 30 31 PawnManager.cc 31 32 PlayerManager.cc … … 55 56 TOLUA_FILES 56 57 LevelManager.h 58 MoodManager.h 57 59 pickup/BaseItem.h 58 60 pickup/PickupInventory.h -
code/branches/sound3/src/orxonox/gamestates/GSMainMenu.cc
r5929 r5956 36 36 #include "core/Game.h" 37 37 #include "core/ConsoleCommand.h" 38 #include "core/ConfigValueIncludes.h" 38 39 #include "core/GraphicsManager.h" 39 40 #include "core/GUIManager.h" … … 49 50 , inputState_(0) 50 51 { 52 RegisterRootObject(GSMainMenu); 51 53 inputState_ = InputManager::getInstance().createInputState("mainMenu"); 52 54 inputState_->setMouseMode(MouseMode::Nonexclusive); … … 64 66 // Load sound 65 67 this->ambient_ = new AmbientSound(0); 66 this->ambient_->setSource("ambient/mainmenu.wav");67 68 } 68 69 } … … 92 93 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu), "startMainMenu")); 93 94 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startIOConsole), "startIOConsole")); 95 96 // create command to change sound path 97 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::setMainMenuSoundPath, this), "setMMSoundPath")); 94 98 95 99 KeyBinderManager::getInstance().setToDefault(); … … 99 103 { 100 104 this->ambient_->setLoop(true); 101 this->ambient_->play();105 this->ambient_->setPlayOnLoad(true); 102 106 } 107 108 this->setConfigValues(); 103 109 } 104 110 … … 119 125 { 120 126 } 127 128 void GSMainMenu::setConfigValues() 129 { 130 SetConfigValue(soundPathMain_, "ambient/mainmenu.wav") 131 .description("Contains the path to the main menu sound file.") 132 .callback(this, &GSMainMenu::reloadSound); 133 } 134 135 void GSMainMenu::reloadSound() { 136 if (GameMode::playsSound()) 137 { 138 this->ambient_->setSource(soundPathMain_); 139 } 140 } 141 142 const std::string& GSMainMenu::getMainMenuSoundPath() { 143 return soundPathMain_; 144 } 145 146 void GSMainMenu::setMainMenuSoundPath(const std::string& path) { 147 ModifyConfigValue(soundPathMain_, set, path); 148 } 121 149 122 150 void GSMainMenu::startStandalone() -
code/branches/sound3/src/orxonox/gamestates/GSMainMenu.h
r5929 r5956 34 34 #include "util/OgreForwardRefs.h" 35 35 #include "core/GameState.h" 36 #include "core/OrxonoxClass.h" 36 37 37 38 namespace orxonox 38 39 { 39 class _OrxonoxExport GSMainMenu : public GameState 40 class _OrxonoxExport GSMainMenu : public GameState, public OrxonoxClass 40 41 { 41 42 public: … … 46 47 void deactivate(); 47 48 void update(const Clock& time); 49 50 void setConfigValues(); 51 void reloadSound(); 52 const std::string& getMainMenuSoundPath(); 53 void setMainMenuSoundPath(const std::string& path); 48 54 49 55 static void startStandalone(); … … 61 67 // ambient sound for the main menu 62 68 AmbientSound* ambient_; 69 std::string soundPathMain_; 63 70 }; 64 71 }
Note: See TracChangeset
for help on using the changeset viewer.