mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-10 09:55:41 -05:00
fix multi event deletion crash, allow spinboxes to commit move history
This commit is contained in:
@@ -23,13 +23,12 @@ enum CommandId {
|
||||
ID_EventCreate, // - done
|
||||
ID_EventDelete, // - done
|
||||
ID_EventSetData, // - ?
|
||||
// Tileset editor history commands
|
||||
// Region map editor history commands
|
||||
};
|
||||
|
||||
|
||||
|
||||
/// TODO
|
||||
///
|
||||
class PaintMetatile : public QUndoCommand {
|
||||
public:
|
||||
PaintMetatile(Map *map,
|
||||
@@ -233,7 +232,7 @@ private:
|
||||
///
|
||||
class EventDelete : public QUndoCommand {
|
||||
public:
|
||||
EventDelete(Editor *editor, Map *map, Event *event,
|
||||
EventDelete(Editor *editor, Map *map, QList<Event *> selectedEvents,
|
||||
QUndoCommand *parent = nullptr);
|
||||
~EventDelete();
|
||||
|
||||
@@ -245,7 +244,7 @@ public:
|
||||
|
||||
private:
|
||||
Map *map;
|
||||
Event *event;
|
||||
QList<Event *> selectedEvents; // allow multiple deletion of events
|
||||
Editor *editor;
|
||||
};
|
||||
|
||||
|
||||
@@ -99,15 +99,8 @@ public:
|
||||
bool hFlip = false;
|
||||
bool usingSprite;
|
||||
|
||||
void activate() { active = true; }
|
||||
void deactivate() { active = false; }
|
||||
bool isActive() { return active; }
|
||||
|
||||
DraggablePixmapItem *pixmapItem = nullptr;
|
||||
void setPixmapItem(DraggablePixmapItem *item) { pixmapItem = item; }
|
||||
|
||||
private:
|
||||
bool active = true;
|
||||
};
|
||||
|
||||
#endif // EVENT_H
|
||||
|
||||
@@ -10,6 +10,9 @@ class NoScrollSpinBox : public QSpinBox
|
||||
public:
|
||||
explicit NoScrollSpinBox(QWidget *parent = nullptr);
|
||||
void wheelEvent(QWheelEvent *event);
|
||||
void focusOutEvent(QFocusEvent *event) override;
|
||||
|
||||
unsigned getActionId();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user