mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-09 09:25:36 -05:00
add EventMove command, fix extra signal call in map border resize
This commit is contained in:
@@ -2,10 +2,13 @@
|
||||
#define EDITCOMMANDS_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QList>
|
||||
|
||||
class MapPixmapItem;
|
||||
class Map;
|
||||
class Blockdata;
|
||||
class Event;
|
||||
class DraggablePixmapItem;
|
||||
|
||||
enum CommandId {
|
||||
ID_PaintMetatile, // - done
|
||||
@@ -14,10 +17,11 @@ enum CommandId {
|
||||
ID_ShiftMetatiles, // - done
|
||||
ID_ResizeMap, // - done
|
||||
ID_PaintBorder, // - done
|
||||
ID_EventMove, // -
|
||||
ID_EventMove, // - done
|
||||
ID_EventShift, // -
|
||||
ID_EventCreate, // -
|
||||
ID_EventDelete, // -
|
||||
ID_EventSetData, // -
|
||||
ID_EventSetData, // - ?
|
||||
// Tileset editor history commands
|
||||
// Region map editor history commands
|
||||
};
|
||||
@@ -165,4 +169,28 @@ private:
|
||||
Blockdata *oldBorder;
|
||||
};
|
||||
|
||||
|
||||
|
||||
///
|
||||
class EventMove : public QUndoCommand {
|
||||
public:
|
||||
EventMove(QList<Event *> events,
|
||||
int deltaX, int deltaY, unsigned actionId,
|
||||
QUndoCommand *parent = nullptr);
|
||||
~EventMove();
|
||||
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
bool mergeWith(const QUndoCommand *command) override;
|
||||
int id() const override { return CommandId::ID_EventMove; }
|
||||
|
||||
private:
|
||||
QList<Event *> events;
|
||||
int deltaX;
|
||||
int deltaY;
|
||||
|
||||
unsigned actionId;
|
||||
};
|
||||
|
||||
#endif // EDITCOMMANDS_H
|
||||
|
||||
@@ -22,6 +22,7 @@ public:
|
||||
static QString HealLocation;
|
||||
};
|
||||
|
||||
class DraggablePixmapItem;
|
||||
class Project;
|
||||
class Event
|
||||
{
|
||||
@@ -97,6 +98,9 @@ public:
|
||||
int frame = 0;
|
||||
bool hFlip = false;
|
||||
bool usingSprite;
|
||||
|
||||
DraggablePixmapItem *pixmapItem = nullptr;
|
||||
void setPixmapItem(DraggablePixmapItem *item) { pixmapItem = item; }
|
||||
};
|
||||
|
||||
#endif // EVENT_H
|
||||
|
||||
Reference in New Issue
Block a user