|
@@ -58,54 +58,6 @@
|
|
|
|
|
|
#include "../../lib/mapObjects/CGHeroInstance.h"
|
|
|
|
|
|
-
|
|
|
-CampaignRimVideo::CampaignRimVideo(VideoPath video, ImagePath rim, bool showBackground, float scaleFactor, std::function<void(bool skipped)> closeCb)
|
|
|
- : CWindowObject(BORDERED | NEEDS_ANIMATED_BACKGROUND), closeCb(closeCb)
|
|
|
-{
|
|
|
- OBJECT_CONSTRUCTION;
|
|
|
-
|
|
|
- addUsedEvents(LCLICK | KEYBOARD);
|
|
|
-
|
|
|
- if(!rim.empty())
|
|
|
- {
|
|
|
- videoPlayer = std::make_shared<VideoWidgetOnce>(Point(80, 186), video, true, [this](){ exit(false); });
|
|
|
- pos = center(Rect(0, 0, 800, 600));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- videoPlayer = std::make_shared<VideoWidgetOnce>(Point(0, 0), video, true, scaleFactor, [this](){ exit(false); });
|
|
|
- pos = center(Rect(0, 0, videoPlayer->pos.w, videoPlayer->pos.h));
|
|
|
- }
|
|
|
-
|
|
|
- if(showBackground)
|
|
|
- backgroundAroundWindow = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), Rect(-pos.x, -pos.y, GH.screenDimensions().x, GH.screenDimensions().y));
|
|
|
-
|
|
|
- if(!rim.empty())
|
|
|
- setBackground(rim);
|
|
|
-}
|
|
|
-
|
|
|
-void CampaignRimVideo::exit(bool skipped)
|
|
|
-{
|
|
|
- close();
|
|
|
- if(closeCb)
|
|
|
- closeCb(skipped);
|
|
|
-}
|
|
|
-
|
|
|
-void CampaignRimVideo::clickPressed(const Point & cursorPosition)
|
|
|
-{
|
|
|
- exit(true);
|
|
|
-}
|
|
|
-
|
|
|
-void CampaignRimVideo::keyPressed(EShortcut key)
|
|
|
-{
|
|
|
- exit(true);
|
|
|
-}
|
|
|
-
|
|
|
-bool CampaignRimVideo::receiveEvent(const Point & position, int eventType) const
|
|
|
-{
|
|
|
- return true; // capture click also outside of window
|
|
|
-}
|
|
|
-
|
|
|
std::shared_ptr<CampaignState> CBonusSelection::getCampaign()
|
|
|
{
|
|
|
return CSH->si->campState;
|