1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/client/windows/CWindowObject.h

61 lines
1.6 KiB
C++
Raw Normal View History

/*
* CWindowObject.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include "../gui/CIntObject.h"
#include "../../lib/filesystem/ResourcePath.h"
2018-10-29 15:12:07 +02:00
class CGStatusBar;
class CWindowObject : public WindowBase
{
std::vector<std::shared_ptr<CPicture>> shadowParts;
void setShadow(bool on);
int options;
protected:
std::shared_ptr<CPicture> background;
//Used only if RCLICK_POPUP was set
bool isPopupWindow() const override;
//To display border
void updateShadow();
void setBackground(const ImagePath & filename);
2023-11-05 02:01:23 +02:00
std::shared_ptr<CPicture> createBg(const ImagePath & imageName, bool playerColored);
public:
enum EOptions
{
PLAYER_COLORED=1, //background will be player-colored
RCLICK_POPUP=2, // window will behave as right-click popup
BORDERED=4, // window will have border if current resolution is bigger than size of window
2023-10-31 23:05:22 +02:00
SHADOW_DISABLED=8, //this window won't display any shadow
NEEDS_ANIMATED_BACKGROUND=16 //there are videos in the background that have to be played
};
/*
* options - EOptions enum
* imageName - name for background image, can be empty
* centerAt - position of window center. Default - center of the screen
*/
CWindowObject(int options, const ImagePath & imageName, Point centerAt);
2024-04-23 15:21:45 +02:00
CWindowObject(int options = 0, const ImagePath & imageName = {});
~CWindowObject();
void showAll(Canvas & to) override;
};
2018-10-29 15:12:07 +02:00
2024-04-23 15:21:45 +02:00
class CStatusbarWindow : virtual public CWindowObject
2018-10-29 15:12:07 +02:00
{
protected:
std::shared_ptr<CGStatusBar> statusbar;
};