1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +02:00

Merge pull request #4776 from Laserlicht/audio_playback

fix: audio playback after using Back button
This commit is contained in:
Ivan Savenko
2024-10-15 18:00:44 +03:00
committed by GitHub

View File

@@ -38,6 +38,7 @@
#include "../gui/CGuiHandler.h" #include "../gui/CGuiHandler.h"
#include "../gui/Shortcut.h" #include "../gui/Shortcut.h"
#include "../gui/WindowHandler.h" #include "../gui/WindowHandler.h"
#include "../adventureMap/AdventureMapInterface.h"
#include "../../lib/CConfigHandler.h" #include "../../lib/CConfigHandler.h"
#include "../../lib/CCreatureHandler.h" #include "../../lib/CCreatureHandler.h"
@@ -389,10 +390,13 @@ void CBonusSelection::goBack()
if(CSH->getState() != EClientState::GAMEPLAY) if(CSH->getState() != EClientState::GAMEPLAY)
{ {
GH.windows().popWindows(2); GH.windows().popWindows(2);
CMM->playMusic();
} }
else else
{ {
close(); close();
if(adventureInt)
adventureInt->onAudioResumed();
} }
// TODO: we can actually only pop bonus selection interface for custom campaigns // TODO: we can actually only pop bonus selection interface for custom campaigns
// Though this would require clearing CLobbyScreen::bonusSel pointer when poping this interface // Though this would require clearing CLobbyScreen::bonusSel pointer when poping this interface
@@ -403,7 +407,6 @@ void CBonusSelection::goBack()
CSH->state = EClientState::LOBBY; CSH->state = EClientState::LOBBY;
} }
*/ */
CMM->playMusic();
} }
void CBonusSelection::startMap() void CBonusSelection::startMap()