#ifndef SCENEDIALOGUEPANEL_H #define SCENEDIALOGUEPANEL_H #include #include "qw_abstractscenecontrol.h" /* SceneDialoguePanel * The view for dialogue processes like text, thoughts, etc. */ class SceneDialoguePanel : public QWAbstractSceneControl, public std::enable_shared_from_this { 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 &game_features) override; void onBuildingStateMachine(QWStateMachine *state_machine, std::unique_ptr &game_features) override; //////////////////////// inline void setPixmap(const QPixmap &pix) noexcept; inline QPixmap pixmap() const noexcept; }; #endif // SCENEDIALOGUEPANEL_H