1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

integrate campaign intro

This commit is contained in:
Laserlicht
2024-08-31 17:57:27 +02:00
parent 9c2a5f6baa
commit 46872b764b
8 changed files with 54 additions and 4 deletions

View File

@@ -63,16 +63,35 @@ CampaignIntroVideo::CampaignIntroVideo(VideoPath video, ImagePath rim, std::shar
: CWindowObject(BORDERED), bonusSel(bonusSel)
{
OBJECT_CONSTRUCTION;
videoPlayer = std::make_shared<VideoWidgetOnce>(Point(0, 0), video, true, [this](){ exit(); });
addUsedEvents(LCLICK | KEYBOARD);
pos = center(Rect(0, 0, 800, 600));
videoPlayer = std::make_shared<VideoWidgetOnce>(Point(80, 186), video, true, [this](){ exit(); });
setBackground(rim);
audioVol = CCS->musich->getVolume();
CCS->musich->setVolume(0);
}
void CampaignIntroVideo::exit()
{
close();
CCS->musich->setVolume(audioVol);
GH.windows().pushWindow(bonusSel);
}
void CampaignIntroVideo::clickPressed(const Point & cursorPosition)
{
exit();
}
void CampaignIntroVideo::keyPressed(EShortcut key)
{
exit();
}
std::shared_ptr<CampaignState> CBonusSelection::getCampaign()
{
return CSH->si->campState;