mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-14 03:45:35 -05:00
Fix tile status not updating while painting on layer view
This commit is contained in:
@@ -12,12 +12,14 @@ public:
|
||||
MetatileLayersItem(Metatile *metatile,
|
||||
Tileset *primaryTileset,
|
||||
Tileset *secondaryTileset,
|
||||
Qt::Orientation orientation = Qt::Horizontal);
|
||||
void draw();
|
||||
Qt::Orientation orientation = Qt::Vertical);
|
||||
|
||||
void draw() override;
|
||||
void setTilesets(Tileset*, Tileset*);
|
||||
void setMetatile(Metatile*);
|
||||
void clearLastModifiedCoords();
|
||||
void clearLastHoveredCoords();
|
||||
|
||||
bool hasCursor() const { return this->cursorCellPos != QPoint(-1,-1); }
|
||||
Tile tileUnderCursor() const;
|
||||
|
||||
QPoint tileIndexToPos(int index) const { return this->tilePositions.value(index); }
|
||||
int posToTileIndex(const QPoint &pos) const { return this->tilePositions.indexOf(pos); }
|
||||
@@ -31,14 +33,14 @@ private:
|
||||
Tileset *primaryTileset;
|
||||
Tileset *secondaryTileset;
|
||||
Qt::Orientation orientation;
|
||||
QPoint prevChangedPos;
|
||||
QPoint prevHoveredPos;
|
||||
|
||||
QPoint cursorCellPos = QPoint(-1,-1);
|
||||
|
||||
QList<QPoint> tilePositions;
|
||||
|
||||
QPoint getBoundedPos(const QPointF &);
|
||||
void updateSelection();
|
||||
void hover(const QPoint &pos);
|
||||
bool setCursorCellPos(const QPoint &pos);
|
||||
signals:
|
||||
void tileChanged(const QPoint &pos);
|
||||
void paletteChanged(const QPoint &pos);
|
||||
@@ -46,11 +48,11 @@ signals:
|
||||
void hoveredTileChanged(const Tile &tile);
|
||||
void hoveredTileCleared();
|
||||
protected:
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent*);
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent*);
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
|
||||
void hoverMoveEvent(QGraphicsSceneHoverEvent*);
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent*);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent*) override;
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent*) override;
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override;
|
||||
void hoverMoveEvent(QGraphicsSceneHoverEvent*) override;
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent*) override;
|
||||
};
|
||||
|
||||
#endif // METATILELAYERSITEM_H
|
||||
|
||||
@@ -77,8 +77,6 @@ private slots:
|
||||
void onWindowActivated();
|
||||
void onHoveredMetatileChanged(uint16_t);
|
||||
void onHoveredMetatileCleared();
|
||||
void onHoveredTileChanged(const Tile&);
|
||||
void onHoveredTileChanged(uint16_t);
|
||||
void onHoveredTileCleared();
|
||||
void onMetatileLayerSelectionChanged(const QPoint&, const QSize&);
|
||||
void onPaletteEditorChangedPaletteColor();
|
||||
@@ -159,6 +157,9 @@ private:
|
||||
void applyMetatileSwapsToLayouts();
|
||||
void rebuildMetatilePropertiesFrame();
|
||||
void addWidgetToMetatileProperties(QWidget *w, int *row, int rowSpan);
|
||||
void updateLayerTileStatus();
|
||||
void showTileStatus(const Tile &tile);
|
||||
void showTileStatus(uint16_t tileId);
|
||||
|
||||
Ui::TilesetEditor *ui;
|
||||
History<MetatileHistoryItem*> metatileHistory;
|
||||
|
||||
Reference in New Issue
Block a user