#ifndef SCENEINVENTORYPANEL_H #define SCENEINVENTORYPANEL_H #include #include "qw_abstractscenecontrol.h" /* SceneInventoryPanel * The view for inventory and all its items on the scene. */ class SceneInventoryPanel : public QWAbstractSceneControl, public std::enable_shared_from_this { Q_OBJECT 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 SceneInventoryPanel(); virtual ~SceneInventoryPanel() 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; signals: void signalOnInventory(); }; #endif // SCENEINVENTORYPANEL_H