mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-20 07:36:31 -05:00
Clicking on a prefab will make it the current selection for painting
This commit is contained in:
@@ -4,6 +4,23 @@
|
||||
#include <QGraphicsView>
|
||||
#include <QMouseEvent>
|
||||
|
||||
class ClickableGraphicsView : public QGraphicsView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ClickableGraphicsView() : QGraphicsView() {}
|
||||
ClickableGraphicsView(QWidget *parent) : QGraphicsView(parent) {}
|
||||
|
||||
public:
|
||||
void mousePressEvent(QMouseEvent *event) {
|
||||
QGraphicsView::mousePressEvent(event);
|
||||
emit this->clicked();
|
||||
}
|
||||
|
||||
signals:
|
||||
void clicked();
|
||||
};
|
||||
|
||||
class Editor;
|
||||
|
||||
class GraphicsView : public QGraphicsView
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
bool selectFromMap(uint16_t metatileId, uint16_t collision, uint16_t elevation);
|
||||
void setTilesets(Tileset*, Tileset*);
|
||||
MetatileSelection getMetatileSelection();
|
||||
void setDirectSelection(MetatileSelection selection);
|
||||
void setExternalSelection(int, int, QList<uint16_t>, QList<QPair<uint16_t, uint16_t>>);
|
||||
QPoint getMetatileIdCoordsOnWidget(uint16_t);
|
||||
void setMap(Map*);
|
||||
|
||||
@@ -18,7 +18,7 @@ struct PrefabItem
|
||||
class Prefab
|
||||
{
|
||||
public:
|
||||
void initPrefabUI(QWidget *prefabWidget, QLabel *emptyPrefabLabel, QString primaryTileset, QString secondaryTileset, Map *map);
|
||||
void initPrefabUI(MetatileSelector *selector, QWidget *prefabWidget, QLabel *emptyPrefabLabel, QString primaryTileset, QString secondaryTileset, Map *map);
|
||||
|
||||
private:
|
||||
QList<PrefabItem> items;
|
||||
|
||||
Reference in New Issue
Block a user