mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-20 07:36:31 -05:00
Add stamp layer buttons
This commit is contained in:
@@ -156,6 +156,7 @@ public:
|
||||
void scaleMapView(int);
|
||||
void openInTextEditor(const QString &path, int lineNum = 0) const;
|
||||
bool eventLimitReached(Event::Type type);
|
||||
StampLayer getSelectedStampLayer();
|
||||
|
||||
public slots:
|
||||
void openMapScripts() const;
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
MapPixmapItem::Axis lockedAxis;
|
||||
QPoint selection_origin;
|
||||
QList<QPoint> selection;
|
||||
virtual void paint(QGraphicsSceneMouseEvent*);
|
||||
virtual void paint(QGraphicsSceneMouseEvent*, StampLayer stampLayer);
|
||||
virtual void floodFill(QGraphicsSceneMouseEvent*);
|
||||
virtual void magicFill(QGraphicsSceneMouseEvent*);
|
||||
void magicFill(int x, int y, uint16_t metatileId, bool fromScriptCall = false);
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
void shift(int xDelta, int yDelta, bool fromScriptCall = false);
|
||||
virtual void draw(bool ignoreCache = false);
|
||||
void updateMetatileSelection(QGraphicsSceneMouseEvent *event);
|
||||
void paintNormal(int x, int y, bool fromScriptCall = false);
|
||||
void paintNormal(int x, int y, StampLayer stampLayer, bool fromScriptCall = false);
|
||||
void lockNondominantAxis(QGraphicsSceneMouseEvent *event);
|
||||
QPoint adjustCoords(QPoint pos);
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
#include <QList>
|
||||
#include <QPoint>
|
||||
|
||||
enum StampLayer {
|
||||
STAMP_LAYER_BOTTOM,
|
||||
STAMP_LAYER_MIDDLE,
|
||||
STAMP_LAYER_TOP,
|
||||
};
|
||||
|
||||
struct MetatileSelectionItem
|
||||
{
|
||||
bool enabled;
|
||||
@@ -25,7 +31,7 @@ class PaintSelection
|
||||
{
|
||||
public:
|
||||
QPoint dimensions;
|
||||
virtual bool paintNormal(int, Block*, Map*, int layer) = 0;
|
||||
virtual bool paintNormal(int, Block*, Map*, StampLayer stampLayer) = 0;
|
||||
};
|
||||
|
||||
class MetatileSelection: public PaintSelection
|
||||
@@ -38,7 +44,7 @@ public:
|
||||
this->metatileItems = other.metatileItems;
|
||||
this->collisionItems = other.collisionItems;
|
||||
}
|
||||
bool paintNormal(int index, Block *block, Map*, int layer) override;
|
||||
bool paintNormal(int index, Block *block, Map*, StampLayer stampLayer) override;
|
||||
bool hasCollision = false;
|
||||
QList<MetatileSelectionItem> metatileItems;
|
||||
QList<CollisionSelectionItem> collisionItems;
|
||||
@@ -48,7 +54,7 @@ class StampSelection: public PaintSelection
|
||||
{
|
||||
public:
|
||||
StampSelection() {}
|
||||
bool paintNormal(int index, Block *block, Map*, int layer) override;
|
||||
bool paintNormal(int index, Block *block, Map*, StampLayer stampLayer) override;
|
||||
QList<uint16_t> stampIds;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user