1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-19 00:17:56 +02:00

code review

This commit is contained in:
Laserlicht
2023-09-11 14:44:07 +02:00
committed by GitHub
parent fa19ed4e7c
commit 994da3fcf2
5 changed files with 9 additions and 14 deletions

View File

@ -30,6 +30,11 @@ CPrologEpilogVideo::CPrologEpilogVideo(CampaignScenarioPrologEpilog _spe, std::f
CCS->videoh->open(spe.prologVideo);
CCS->musich->playMusic(spe.prologMusic, true, true);
voiceSoundHandle = CCS->soundh->playSound(spe.prologVoice);
auto onVoiceStop = [this]()
{
voiceStopped = true;
};
CCS->soundh->setCallback(voiceSoundHandle, onVoiceStop);
text = std::make_shared<CMultiLineLabel>(Rect(100, 500, 600, 100), EFonts::FONT_BIG, ETextAlignment::CENTER, Colors::METALLIC_GOLD, spe.prologText);
text->scrollTextTo(-100);
@ -50,7 +55,7 @@ void CPrologEpilogVideo::show(Canvas & to)
else
text->showAll(to); // blit text over video, if needed
if(text->textSize.y + 100 < positionCounter / 5 && !CCS->soundh->isSoundPlaying(voiceSoundHandle))
if(text->textSize.y + 100 < positionCounter / 5 && voiceStopped)
clickPressed(GH.getCursorPosition());
}