1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

workaround for missing video

This commit is contained in:
Laserlicht 2023-09-23 16:28:28 +02:00 committed by GitHub
parent 06895e6733
commit ca96749c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -17,6 +17,7 @@
#include "../widgets/TextControls.h" #include "../widgets/TextControls.h"
#include "../widgets/Buttons.h" #include "../widgets/Buttons.h"
#include "../widgets/Images.h" #include "../widgets/Images.h"
#include "../widgets/MiscWidgets.h"
#include "../windows/InfoWindows.h" #include "../windows/InfoWindows.h"
#include "../render/Canvas.h" #include "../render/Canvas.h"
@ -234,6 +235,8 @@ CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc
pos = center(Rect(0, 0, 800, 600)); pos = center(Rect(0, 0, 800, 600));
updateShadow(); updateShadow();
background = std::make_shared<TransparentFilledRectangle>(Rect(0, 0, pos.w, pos.h), Colors::BLACK);
if(won) if(won)
{ {
int border = 100; int border = 100;
@ -321,7 +324,13 @@ void CHighScoreInputScreen::show(Canvas & to)
void CHighScoreInputScreen::activate() void CHighScoreInputScreen::activate()
{ {
CCS->videoh->open(VideoPath::builtin(video)); if(!CCS->videoh->open(VideoPath::builtin(video)))
{
if(!won)
close();
}
else
background = nullptr;
CIntObject::activate(); CIntObject::activate();
} }

View File

@ -16,6 +16,8 @@ class CMultiLineLabel;
class CAnimImage; class CAnimImage;
class CTextInput; class CTextInput;
class TransparentFilledRectangle;
class HighScoreParameter class HighScoreParameter
{ {
public: public:
@ -88,6 +90,7 @@ class CHighScoreInputScreen : public CWindowObject
{ {
std::vector<std::shared_ptr<CMultiLineLabel>> texts; std::vector<std::shared_ptr<CMultiLineLabel>> texts;
std::shared_ptr<CHighScoreInput> input; std::shared_ptr<CHighScoreInput> input;
std::shared_ptr<TransparentFilledRectangle> background;
std::string video; std::string video;
bool won; bool won;