mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
background for multiple windows
This commit is contained in:
parent
1f1e693a5b
commit
fc50482b43
@ -21,6 +21,7 @@
|
||||
#include "../windows/InfoWindows.h"
|
||||
#include "../widgets/TextControls.h"
|
||||
#include "../render/Canvas.h"
|
||||
#include "../render/IRenderHandler.h"
|
||||
|
||||
#include "../CGameInfo.h"
|
||||
#include "../CVideoHandler.h"
|
||||
@ -81,7 +82,8 @@ CHighScoreScreen::CHighScoreScreen(HighScorePage highscorepage, int highlighted)
|
||||
|
||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||
pos = center(Rect(0, 0, 800, 600));
|
||||
updateShadow();
|
||||
|
||||
backgroundAroundMenu = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), Rect(-pos.x, -pos.y, GH.screenDimensions().x, GH.screenDimensions().y));
|
||||
|
||||
addHighScores();
|
||||
addButtons();
|
||||
@ -222,8 +224,8 @@ CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc
|
||||
|
||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||
pos = center(Rect(0, 0, 800, 600));
|
||||
updateShadow();
|
||||
|
||||
backgroundAroundMenu = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), Rect(-pos.x, -pos.y, GH.screenDimensions().x, GH.screenDimensions().y));
|
||||
background = std::make_shared<TransparentFilledRectangle>(Rect(0, 0, pos.w, pos.h), Colors::BLACK);
|
||||
|
||||
if(won)
|
||||
@ -289,6 +291,9 @@ int CHighScoreInputScreen::addEntry(std::string text) {
|
||||
|
||||
void CHighScoreInputScreen::show(Canvas & to)
|
||||
{
|
||||
if(background)
|
||||
background->redraw();
|
||||
|
||||
CCS->videoh->update(pos.x, pos.y, to.getInternalSurface(), true, false,
|
||||
[&]()
|
||||
{
|
||||
@ -303,7 +308,14 @@ void CHighScoreInputScreen::show(Canvas & to)
|
||||
else
|
||||
close();
|
||||
});
|
||||
redraw();
|
||||
|
||||
if(input)
|
||||
input->redraw();
|
||||
for(auto & text : texts)
|
||||
{
|
||||
text->setRedrawParent(false);
|
||||
text->redraw();
|
||||
}
|
||||
|
||||
CIntObject::show(to);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ class CLabel;
|
||||
class CMultiLineLabel;
|
||||
class CAnimImage;
|
||||
class CTextInput;
|
||||
class CFilledTexture;
|
||||
|
||||
class TransparentFilledRectangle;
|
||||
|
||||
@ -61,6 +62,7 @@ private:
|
||||
HighScorePage highscorepage;
|
||||
|
||||
std::shared_ptr<CPicture> background;
|
||||
std::shared_ptr<CFilledTexture> backgroundAroundMenu;
|
||||
std::vector<std::shared_ptr<CButton>> buttons;
|
||||
std::vector<std::shared_ptr<CLabel>> texts;
|
||||
std::vector<std::shared_ptr<CAnimImage>> images;
|
||||
@ -93,6 +95,7 @@ class CHighScoreInputScreen : public CWindowObject
|
||||
std::vector<std::shared_ptr<CMultiLineLabel>> texts;
|
||||
std::shared_ptr<CHighScoreInput> input;
|
||||
std::shared_ptr<TransparentFilledRectangle> background;
|
||||
std::shared_ptr<CFilledTexture> backgroundAroundMenu;
|
||||
|
||||
std::string video;
|
||||
int videoSoundHandle;
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "../gui/CGuiHandler.h"
|
||||
#include "../gui/FramerateManager.h"
|
||||
#include "../widgets/TextControls.h"
|
||||
#include "../widgets/Images.h"
|
||||
#include "../render/Canvas.h"
|
||||
|
||||
|
||||
@ -27,7 +28,8 @@ CPrologEpilogVideo::CPrologEpilogVideo(CampaignScenarioPrologEpilog _spe, std::f
|
||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||
addUsedEvents(LCLICK | TIME);
|
||||
pos = center(Rect(0, 0, 800, 600));
|
||||
updateShadow();
|
||||
|
||||
backgroundAroundMenu = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), Rect(-pos.x, -pos.y, GH.screenDimensions().x, GH.screenDimensions().y));
|
||||
|
||||
auto audioData = CCS->videoh->getAudio(spe.prologVideo);
|
||||
videoSoundHandle = CCS->soundh->playSound(audioData, -1);
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "../../lib/campaign/CampaignScenarioPrologEpilog.h"
|
||||
|
||||
class CMultiLineLabel;
|
||||
class CFilledTexture;
|
||||
|
||||
class CPrologEpilogVideo : public CWindowObject
|
||||
{
|
||||
@ -25,6 +26,7 @@ class CPrologEpilogVideo : public CWindowObject
|
||||
std::function<void()> exitCb;
|
||||
|
||||
std::shared_ptr<CMultiLineLabel> text;
|
||||
std::shared_ptr<CFilledTexture> backgroundAroundMenu;
|
||||
|
||||
bool voiceStopped = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user