2014-07-15 10:14:49 +03:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
2017-07-13 10:26:03 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../gui/CIntObject.h"
|
2023-08-23 14:07:50 +02:00
|
|
|
#include "../../lib/filesystem/ResourcePath.h"
|
2014-07-15 10:14:49 +03:00
|
|
|
|
2018-10-29 15:12:07 +02:00
|
|
|
class CGStatusBar;
|
|
|
|
|
2018-07-25 00:36:48 +02:00
|
|
|
class CWindowObject : public WindowBase
|
2014-07-15 10:14:49 +03:00
|
|
|
{
|
2018-07-25 00:36:48 +02:00
|
|
|
std::vector<std::shared_ptr<CPicture>> shadowParts;
|
|
|
|
|
2014-07-15 10:14:49 +03:00
|
|
|
void setShadow(bool on);
|
|
|
|
|
|
|
|
int options;
|
|
|
|
|
|
|
|
protected:
|
2018-04-07 13:34:11 +02:00
|
|
|
std::shared_ptr<CPicture> background;
|
2014-07-15 10:14:49 +03:00
|
|
|
|
|
|
|
//Used only if RCLICK_POPUP was set
|
2023-06-11 19:38:42 +02:00
|
|
|
bool isPopupWindow() const override;
|
2014-07-15 10:14:49 +03:00
|
|
|
//To display border
|
|
|
|
void updateShadow();
|
2023-08-23 14:07:50 +02:00
|
|
|
void setBackground(const ImagePath & filename);
|
2023-11-05 02:01:23 +02:00
|
|
|
std::shared_ptr<CPicture> createBg(const ImagePath & imageName, bool playerColored);
|
2014-07-15 10:14:49 +03:00
|
|
|
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
|
2014-07-15 10:14:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* options - EOpions enum
|
|
|
|
* imageName - name for background image, can be empty
|
|
|
|
* centerAt - position of window center. Default - center of the screen
|
|
|
|
*/
|
2023-08-23 14:07:50 +02:00
|
|
|
CWindowObject(int options, const ImagePath & imageName, Point centerAt);
|
2024-04-23 15:21:45 +02:00
|
|
|
CWindowObject(int options = 0, const ImagePath & imageName = {});
|
2014-07-15 10:14:49 +03:00
|
|
|
~CWindowObject();
|
2018-04-07 13:34:11 +02:00
|
|
|
|
2023-06-02 15:42:18 +02:00
|
|
|
void showAll(Canvas & to) override;
|
2014-07-15 10:14:49 +03:00
|
|
|
};
|
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;
|
|
|
|
};
|