DraggaglePixmapItem -> EventPixmapItem

This commit is contained in:
GriffinR
2025-04-08 12:42:23 -04:00
parent c53e9fcb28
commit 714cce670f
12 changed files with 41 additions and 41 deletions

View File

@@ -14,7 +14,7 @@ class Map;
class Layout;
class Blockdata;
class Event;
class DraggablePixmapItem;
class EventPixmapItem;
class Editor;
enum CommandId {

View File

@@ -19,7 +19,7 @@ class EventFrame;
class ObjectFrame;
class CloneObjectFrame;
class WarpFrame;
class DraggablePixmapItem;
class EventPixmapItem;
class Event;
class ObjectEvent;
@@ -154,8 +154,8 @@ public:
void setPixmap(QPixmap newPixmap) { this->pixmap = newPixmap; }
QPixmap getPixmap() const { return this->pixmap; }
void setPixmapItem(DraggablePixmapItem *item);
DraggablePixmapItem *getPixmapItem() const { return this->pixmapItem; }
void setPixmapItem(EventPixmapItem *item);
EventPixmapItem *getPixmapItem() const { return this->pixmapItem; }
void setUsesDefaultPixmap(bool newUsesDefaultPixmap) { this->usesDefaultPixmap = newUsesDefaultPixmap; }
bool getUsesDefaultPixmap() const { return this->usesDefaultPixmap; }
@@ -194,7 +194,7 @@ protected:
QJsonObject customAttributes;
QPixmap pixmap;
DraggablePixmapItem *pixmapItem = nullptr;
EventPixmapItem *pixmapItem = nullptr;
QPointer<EventFrame> eventFrame;

View File

@@ -30,7 +30,7 @@
#include "mapruler.h"
#include "encountertablemodel.h"
class DraggablePixmapItem;
class EventPixmapItem;
class MetatilesPixmapItem;
class Editor : public QObject
@@ -107,7 +107,7 @@ public:
void toggleBorderVisibility(bool visible, bool enableScriptCallback = true);
void updateCustomMapAttributes();
DraggablePixmapItem *addEventPixmapItem(Event *event);
EventPixmapItem *addEventPixmapItem(Event *event);
void removeEventPixmapItem(Event *event);
bool canAddEvents(const QList<Event*> &events);
void selectMapEvent(Event *event, bool toggle = false);
@@ -116,7 +116,7 @@ public:
void duplicateSelectedEvents();
void redrawAllEvents();
void redrawEvents(const QList<Event*> &events);
void redrawEventPixmapItem(DraggablePixmapItem *item);
void redrawEventPixmapItem(EventPixmapItem *item);
qreal getEventOpacity(const Event *event) const;
void updateCursorRectPos(int x, int y);

View File

@@ -1,5 +1,5 @@
#ifndef DRAGGABLEPIXMAPITEM_H
#define DRAGGABLEPIXMAPITEM_H
#ifndef EVENTPIXMAPITEM_H
#define EVENTPIXMAPITEM_H
#include <QString>
#include <QGraphicsItemGroup>
@@ -12,12 +12,12 @@
class Editor;
class DraggablePixmapItem : public QObject, public QGraphicsPixmapItem {
class EventPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
public:
DraggablePixmapItem(QPixmap pixmap): QGraphicsPixmapItem(pixmap) {}
EventPixmapItem(QPixmap pixmap): QGraphicsPixmapItem(pixmap) {}
DraggablePixmapItem(Event *event, Editor *editor) : QGraphicsPixmapItem(event->getPixmap()) {
EventPixmapItem(Event *event, Editor *editor) : QGraphicsPixmapItem(event->getPixmap()) {
this->event = event;
event->setPixmapItem(this);
this->editor = editor;
@@ -52,4 +52,4 @@ protected:
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*) override { emit doubleClicked(this->event); }
};
#endif // DRAGGABLEPIXMAPITEM_H
#endif // EVENTPIXMAPITEM_H