diff options
Diffstat (limited to 'game')
-rw-r--r-- | game/menus/ButtonSetMainMenuScript.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/game/menus/ButtonSetMainMenuScript.cpp b/game/menus/ButtonSetMainMenuScript.cpp index 12b7256..e9232b5 100644 --- a/game/menus/ButtonSetMainMenuScript.cpp +++ b/game/menus/ButtonSetMainMenuScript.cpp @@ -1,5 +1,7 @@ #include "ButtonSetMainMenuScript.h" #include "MenusConfig.h" +#include "api/AudioSource.h" +#include "types.h" using namespace crepe; using namespace std; @@ -10,6 +12,12 @@ void ButtonSetMainMenuScript::init(){ } bool ButtonSetMainMenuScript::on_button_press(const ButtonPressEvent& e){ + RefVector<AudioSource> audios = this->get_components_by_name<AudioSource>("background_music"); + + for (AudioSource & audio : audios) { + audio.stop(); + } + this->set_next_scene(MAINMENU_SCENE); return false; } |