mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-23 09:06:45 -05:00
Sync changes between connection list and map
This commit is contained in:
@@ -77,7 +77,7 @@ public:
|
||||
void setConnectionsVisibility(bool visible);
|
||||
void updateConnectionOffset(int offset);
|
||||
void addNewConnection();
|
||||
void removeCurrentConnection();
|
||||
void removeConnection(ConnectionPixmapItem* connectionItem);
|
||||
void addNewWildMonGroup(QWidget *window);
|
||||
void deleteWildMonGroup();
|
||||
void updateDiveMap(QString mapName);
|
||||
@@ -168,10 +168,11 @@ private:
|
||||
void setConnectionItemsVisible(bool);
|
||||
void setBorderItemsVisible(bool, qreal = 1);
|
||||
void setConnectionsEditable(bool);
|
||||
QPoint calculateConnectionPosition(const MapConnection *connection, const QPixmap &pixmap);
|
||||
void redrawConnection(ConnectionPixmapItem* connectionItem);
|
||||
void createConnectionItem(MapConnection* connection);
|
||||
void populateConnectionsList();
|
||||
void addConnectionToList(const MapConnection * connection);
|
||||
void addConnectionToList(ConnectionPixmapItem* connection);
|
||||
void updateDiveEmergeMap(QString mapName, QString direction);
|
||||
void onConnectionOffsetChanged(int newOffset);
|
||||
void removeMirroredConnection(MapConnection*);
|
||||
|
||||
@@ -8,9 +8,11 @@
|
||||
class ConnectionPixmapItem : public QObject, public QGraphicsPixmapItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConnectionPixmapItem(QPixmap pixmap, MapConnection* connection, int x, int y, int baseMapWidth, int baseMapHeight): QGraphicsPixmapItem(pixmap) {
|
||||
ConnectionPixmapItem(QPixmap pixmap, MapConnection* connection, int x, int y, int baseMapWidth, int baseMapHeight)
|
||||
: QGraphicsPixmapItem(pixmap),
|
||||
connection(connection)
|
||||
{
|
||||
this->basePixmap = pixmap;
|
||||
this->connection = connection;
|
||||
setFlag(ItemIsMovable);
|
||||
setFlag(ItemSendsGeometryChanges);
|
||||
this->initialX = x;
|
||||
@@ -20,7 +22,7 @@ public:
|
||||
this->baseMapHeight = baseMapHeight;
|
||||
}
|
||||
QPixmap basePixmap;
|
||||
MapConnection* connection;
|
||||
MapConnection* const connection;
|
||||
int initialX;
|
||||
int initialY;
|
||||
int initialOffset;
|
||||
|
||||
@@ -9,18 +9,27 @@ namespace Ui {
|
||||
class ConnectionsListItem;
|
||||
}
|
||||
|
||||
// We show the data for each map connection in the panel on the right side of the Connections tab.
|
||||
// An instance of this class is used for each item in that list.
|
||||
// It communicates with the ConnectionPixmapItem on the map through a shared MapConnection pointer,
|
||||
// and the two classes should signal one another when they change this data.
|
||||
class ConnectionsListItem : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConnectionsListItem(QWidget *parent, const QStringList &mapNames);
|
||||
explicit ConnectionsListItem(QWidget *parent, MapConnection * connection, const QStringList &mapNames);
|
||||
~ConnectionsListItem();
|
||||
|
||||
void populate(const MapConnection * connection);
|
||||
void updateUI();
|
||||
|
||||
public:
|
||||
private:
|
||||
Ui::ConnectionsListItem *ui;
|
||||
MapConnection * const connection;
|
||||
|
||||
signals:
|
||||
void edited();
|
||||
void deleted();
|
||||
|
||||
private slots:
|
||||
void on_comboBox_Direction_currentTextChanged(const QString &direction);
|
||||
|
||||
Reference in New Issue
Block a user