1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

fix music

This commit is contained in:
Laserlicht 2024-12-21 01:38:29 +01:00
parent 0a30e86f10
commit 38c0cd138b
2 changed files with 10 additions and 3 deletions

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

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