You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB
C++

#ifndef SCENEDIALOGUEPANEL_H
#define SCENEDIALOGUEPANEL_H
#include <QPainter>
#include "qw_abstractscenecontrol.h"
/* SceneDialoguePanel
* The view for dialogue processes like text, thoughts, etc. */
class SceneDialoguePanel : public QWAbstractSceneControl, public std::enable_shared_from_this<SceneDialoguePanel>
{
private:
QPixmap pix_rect;
struct metadata
{
// path to panel pixmap
QString pixmap_path;
// rect when panel is hidden
QRect on_hid;
// rect when panel is shown
QRect on_shw;
} metadata;
protected:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *,
QWidget *) override
{
painter->fillRect(rect(), QBrush(pix_rect));
}
public:
explicit SceneDialoguePanel();
virtual ~SceneDialoguePanel() override {}
void onClick() override;
void onConnect(std::unique_ptr<GameFeatures> &game_features) override;
void onBuildingStateMachine(QWStateMachine *state_machine, std::unique_ptr<GameFeatures> &game_features) override;
////////////////////////
inline void setPixmap(const QPixmap &pix) noexcept;
inline QPixmap pixmap() const noexcept;
};
#endif // SCENEDIALOGUEPANEL_H