mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-14 03:45:35 -05:00
Merge branch 'dev' of https://github.com/huderlem/porymap into local-id
This commit is contained in:
@@ -47,6 +47,13 @@ enum CommandId {
|
||||
#define IDMask_EventType_Trigger (1 << 11)
|
||||
#define IDMask_EventType_Heal (1 << 12)
|
||||
|
||||
#define IDMask_ConnectionDirection_Up (1 << 8)
|
||||
#define IDMask_ConnectionDirection_Down (1 << 9)
|
||||
#define IDMask_ConnectionDirection_Left (1 << 10)
|
||||
#define IDMask_ConnectionDirection_Right (1 << 11)
|
||||
#define IDMask_ConnectionDirection_Dive (1 << 12)
|
||||
#define IDMask_ConnectionDirection_Emerge (1 << 13)
|
||||
|
||||
/// Implements a command to commit metatile paint actions
|
||||
/// onto the map using the pencil tool.
|
||||
class PaintMetatile : public QUndoCommand {
|
||||
@@ -400,7 +407,7 @@ public:
|
||||
void redo() override;
|
||||
|
||||
bool mergeWith(const QUndoCommand *command) override;
|
||||
int id() const override { return CommandId::ID_MapConnectionMove; }
|
||||
int id() const override;
|
||||
|
||||
private:
|
||||
MapConnection *connection;
|
||||
@@ -421,7 +428,7 @@ public:
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
int id() const override { return CommandId::ID_MapConnectionChangeDirection; }
|
||||
int id() const override;
|
||||
|
||||
private:
|
||||
QPointer<MapConnection> connection;
|
||||
@@ -443,7 +450,7 @@ public:
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
int id() const override { return CommandId::ID_MapConnectionChangeMap; }
|
||||
int id() const override;
|
||||
|
||||
private:
|
||||
QPointer<MapConnection> connection;
|
||||
@@ -465,7 +472,7 @@ public:
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
int id() const override { return CommandId::ID_MapConnectionAdd; }
|
||||
int id() const override;
|
||||
|
||||
private:
|
||||
Map *map = nullptr;
|
||||
@@ -485,7 +492,7 @@ public:
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
int id() const override { return CommandId::ID_MapConnectionRemove; }
|
||||
int id() const override;
|
||||
|
||||
private:
|
||||
Map *map = nullptr;
|
||||
|
||||
@@ -170,6 +170,7 @@ public:
|
||||
static QString typeToJsonKey(Event::Type type);
|
||||
static Event::Type typeFromJsonKey(QString type);
|
||||
static QList<Event::Type> types();
|
||||
static QList<Event::Group> groups();
|
||||
|
||||
// protected attributes
|
||||
protected:
|
||||
@@ -340,10 +341,12 @@ public:
|
||||
QString getDestinationWarpID() const { return this->destinationWarpID; }
|
||||
|
||||
void setWarningEnabled(bool enabled);
|
||||
bool getWarningEnabled() const { return this->warningEnabled; }
|
||||
|
||||
private:
|
||||
QString destinationMap;
|
||||
QString destinationWarpID;
|
||||
bool warningEnabled = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -622,6 +625,10 @@ private:
|
||||
};
|
||||
|
||||
|
||||
inline uint qHash(const Event::Group &key, uint seed = 0) {
|
||||
return qHash(static_cast<int>(key), seed);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Keeps track of scripts
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
bool hasEvent(Event *) const;
|
||||
|
||||
void deleteConnections();
|
||||
QList<MapConnection*> getConnections() const;
|
||||
QList<MapConnection*> getConnections() const { return m_connections; }
|
||||
void removeConnection(MapConnection *);
|
||||
void addConnection(MapConnection *);
|
||||
void loadConnection(MapConnection *);
|
||||
|
||||
@@ -27,6 +27,11 @@ public:
|
||||
QString direction() const { return m_direction; }
|
||||
void setDirection(const QString &direction, bool mirror = true);
|
||||
|
||||
bool isCardinal() const { return isCardinal(m_direction); }
|
||||
bool isHorizontal() const { return isHorizontal(m_direction); }
|
||||
bool isVertical() const { return isVertical(m_direction); }
|
||||
bool isDiving() const { return isDiving(m_direction); }
|
||||
|
||||
int offset() const { return m_offset; }
|
||||
void setOffset(int offset, bool mirror = true);
|
||||
|
||||
@@ -36,7 +41,8 @@ public:
|
||||
MapConnection* findMirror();
|
||||
MapConnection* createMirror();
|
||||
|
||||
QPixmap getPixmap();
|
||||
QPixmap render() const;
|
||||
QPoint relativePos(bool clipped = false) const;
|
||||
|
||||
static QPointer<Project> project;
|
||||
static const QMap<QString, QString> oppositeDirections;
|
||||
|
||||
@@ -96,9 +96,12 @@ public:
|
||||
int getHeight() const { return height; }
|
||||
int getBorderWidth() const { return border_width; }
|
||||
int getBorderHeight() const { return border_height; }
|
||||
int getBorderDrawWidth() const;
|
||||
int getBorderDrawHeight() const;
|
||||
|
||||
bool isWithinBounds(int x, int y);
|
||||
bool isWithinBorderBounds(int x, int y);
|
||||
bool isWithinBounds(int x, int y) const;
|
||||
bool isWithinBounds(const QRect &rect) const;
|
||||
bool isWithinBorderBounds(int x, int y) const;
|
||||
|
||||
bool getBlock(int x, int y, Block *out);
|
||||
void setBlock(int x, int y, Block block, bool enableScriptCallback = false);
|
||||
@@ -141,6 +144,8 @@ private:
|
||||
void setNewDimensionsBlockdata(int newWidth, int newHeight);
|
||||
void setNewBorderDimensionsBlockdata(int newWidth, int newHeight);
|
||||
|
||||
static int getBorderDrawDistance(int dimension, qreal minimum);
|
||||
|
||||
signals:
|
||||
void dimensionsChanged(const QSize &size);
|
||||
void needsRedrawing();
|
||||
|
||||
Reference in New Issue
Block a user