1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-06 22:23:15 +02:00

Merge pull request #5122 from Laserlicht/fix_music

[1.6.1] fix music
This commit is contained in:
Ivan Savenko
2024-12-21 15:45:33 +02:00
committed by GitHub
2 changed files with 10 additions and 3 deletions

View File

@ -216,9 +216,15 @@ CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc
} }
} }
void CHighScoreInputScreen::stopMusicAndClose()
{
CMM->playMusic();
close();
}
void CHighScoreInputScreen::onVideoPlaybackFinished() void CHighScoreInputScreen::onVideoPlaybackFinished()
{ {
close(); stopMusicAndClose();
} }
int CHighScoreInputScreen::addEntry(std::string text) { int CHighScoreInputScreen::addEntry(std::string text) {
@ -275,7 +281,7 @@ void CHighScoreInputScreen::clickPressed(const Point & cursorPosition)
if(!won) if(!won)
{ {
close(); stopMusicAndClose();
return; return;
} }
@ -291,7 +297,7 @@ void CHighScoreInputScreen::clickPressed(const Point & cursorPosition)
GH.windows().createAndPushWindow<CHighScoreScreen>(calc.isCampaign ? CHighScoreScreen::HighScorePage::CAMPAIGN : CHighScoreScreen::HighScorePage::SCENARIO, pos); GH.windows().createAndPushWindow<CHighScoreScreen>(calc.isCampaign ? CHighScoreScreen::HighScorePage::CAMPAIGN : CHighScoreScreen::HighScorePage::SCENARIO, pos);
} }
else else
close(); stopMusicAndClose();
}); });
} }
} }

View File

@ -85,6 +85,7 @@ class CHighScoreInputScreen : public CWindowObject, public IVideoHolder
HighScoreCalculation calc; HighScoreCalculation calc;
StatisticDataSet stat; StatisticDataSet stat;
void stopMusicAndClose();
void onVideoPlaybackFinished() override; void onVideoPlaybackFinished() override;
public: public:
CHighScoreInputScreen(bool won, HighScoreCalculation calc, const StatisticDataSet & statistic); CHighScoreInputScreen(bool won, HighScoreCalculation calc, const StatisticDataSet & statistic);