mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-19 23:25:09 -05:00
Fix some issues with map connections after layout split
This commit is contained in:
@@ -91,7 +91,7 @@ public:
|
||||
void removeConnection(MapConnection *);
|
||||
void addConnection(MapConnection *);
|
||||
void loadConnection(MapConnection *);
|
||||
QRect getConnectionRect(const QString &direction, Layout *fromLayout = nullptr);
|
||||
QRect getConnectionRect(const QString &direction, Layout *fromLayout = nullptr) const;
|
||||
QPixmap renderConnection(const QString &direction, Layout *fromLayout = nullptr);
|
||||
|
||||
QUndoStack* editHistory() const { return m_editHistory; }
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
|
||||
QList<QGraphicsPixmapItem*> borderItems;
|
||||
QGraphicsItemGroup *mapGrid = nullptr;
|
||||
MapRuler *map_ruler = nullptr;
|
||||
QPointer<MapRuler> map_ruler = nullptr;
|
||||
|
||||
MovableRect *playerViewRect = nullptr;
|
||||
CursorTileRect *cursorMapTileRect = nullptr;
|
||||
@@ -221,10 +221,7 @@ private:
|
||||
void clearMapGrid();
|
||||
void clearWildMonTables();
|
||||
void updateBorderVisibility();
|
||||
void disconnectMapConnection(MapConnection *connection);
|
||||
QPoint getConnectionOrigin(MapConnection *connection);
|
||||
void removeConnectionPixmap(MapConnection *connection);
|
||||
void updateConnectionPixmap(ConnectionPixmapItem *connectionItem);
|
||||
void displayConnection(MapConnection *connection);
|
||||
void displayDivingConnection(MapConnection *connection);
|
||||
void setDivingMapName(QString mapName, QString direction);
|
||||
|
||||
@@ -10,22 +10,20 @@
|
||||
class ConnectionPixmapItem : public QObject, public QGraphicsPixmapItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConnectionPixmapItem(MapConnection* connection, int originX, int originY);
|
||||
ConnectionPixmapItem(MapConnection* connection, QPoint origin);
|
||||
ConnectionPixmapItem(MapConnection* connection);
|
||||
|
||||
const QPointer<MapConnection> connection;
|
||||
|
||||
void setOrigin(int x, int y);
|
||||
void setOrigin(QPoint pos);
|
||||
|
||||
void setEditable(bool editable);
|
||||
bool getEditable();
|
||||
|
||||
void setSelected(bool selected);
|
||||
|
||||
void updatePos();
|
||||
void render(bool ignoreCache = false);
|
||||
|
||||
signals:
|
||||
void positionChanged(qreal x, qreal y);
|
||||
|
||||
private:
|
||||
QPixmap basePixmap;
|
||||
qreal originX;
|
||||
@@ -36,6 +34,10 @@ private:
|
||||
static const int mWidth = 16;
|
||||
static const int mHeight = 16;
|
||||
|
||||
void updatePos();
|
||||
void updateOrigin();
|
||||
void refresh();
|
||||
|
||||
protected:
|
||||
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
|
||||
virtual void mousePressEvent(QGraphicsSceneMouseEvent*) override;
|
||||
|
||||
@@ -23,7 +23,6 @@ public:
|
||||
explicit ConnectionsListItem(QWidget *parent, MapConnection *connection, const QStringList &mapNames);
|
||||
~ConnectionsListItem();
|
||||
|
||||
void updateUI();
|
||||
void setSelected(bool selected);
|
||||
|
||||
private:
|
||||
@@ -33,6 +32,8 @@ private:
|
||||
bool isSelected = false;
|
||||
unsigned actionId = 0;
|
||||
|
||||
void updateUI();
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent(QMouseEvent*) override;
|
||||
virtual void focusInEvent(QFocusEvent*) override;
|
||||
|
||||
Reference in New Issue
Block a user