add edit command for event pastes

This commit is contained in:
garak
2021-04-15 01:14:09 -04:00
parent 296d697df0
commit 47887aca4d
3 changed files with 39 additions and 13 deletions

View File

@@ -30,6 +30,7 @@ enum CommandId {
ID_EventCreate,
ID_EventDelete,
ID_EventDuplicate,
ID_EventPaste,
};
#define IDMask_EventType_Object (1 << 8)
@@ -322,7 +323,7 @@ public:
bool mergeWith(const QUndoCommand *) override { return false; }
int id() const override;
private:
protected:
Map *map;
QList<Event *> selectedEvents; // allow multiple deletion of events
Editor *editor;
@@ -330,6 +331,17 @@ private:
/// Implements a command to commit Event pastes from clipboard.
class EventPaste : public EventDuplicate {
public:
EventPaste(Editor *editor, Map *map, QList<Event *> pastedEvents,
QUndoCommand *parent = nullptr);
int id() const override;
};
/// Implements a command to commit map edits from the scripting API.
/// The scripting api can edit metatiles and map dimensions.
class ScriptEditMap : public QUndoCommand {