mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
workaround for missing video
This commit is contained in:
parent
06895e6733
commit
ca96749c45
@ -17,6 +17,7 @@
|
||||
#include "../widgets/TextControls.h"
|
||||
#include "../widgets/Buttons.h"
|
||||
#include "../widgets/Images.h"
|
||||
#include "../widgets/MiscWidgets.h"
|
||||
#include "../windows/InfoWindows.h"
|
||||
#include "../render/Canvas.h"
|
||||
|
||||
@ -234,6 +235,8 @@ CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc
|
||||
pos = center(Rect(0, 0, 800, 600));
|
||||
updateShadow();
|
||||
|
||||
background = std::make_shared<TransparentFilledRectangle>(Rect(0, 0, pos.w, pos.h), Colors::BLACK);
|
||||
|
||||
if(won)
|
||||
{
|
||||
int border = 100;
|
||||
@ -321,7 +324,13 @@ void CHighScoreInputScreen::show(Canvas & to)
|
||||
|
||||
void CHighScoreInputScreen::activate()
|
||||
{
|
||||
CCS->videoh->open(VideoPath::builtin(video));
|
||||
if(!CCS->videoh->open(VideoPath::builtin(video)))
|
||||
{
|
||||
if(!won)
|
||||
close();
|
||||
}
|
||||
else
|
||||
background = nullptr;
|
||||
CIntObject::activate();
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,8 @@ class CMultiLineLabel;
|
||||
class CAnimImage;
|
||||
class CTextInput;
|
||||
|
||||
class TransparentFilledRectangle;
|
||||
|
||||
class HighScoreParameter
|
||||
{
|
||||
public:
|
||||
@ -88,6 +90,7 @@ class CHighScoreInputScreen : public CWindowObject
|
||||
{
|
||||
std::vector<std::shared_ptr<CMultiLineLabel>> texts;
|
||||
std::shared_ptr<CHighScoreInput> input;
|
||||
std::shared_ptr<TransparentFilledRectangle> background;
|
||||
|
||||
std::string video;
|
||||
bool won;
|
||||
|
Loading…
Reference in New Issue
Block a user