mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-20 07:36:31 -05:00
Better handling of generic PaintSelection, and accurate selection cursor size
This commit is contained in:
@@ -164,6 +164,8 @@ public slots:
|
||||
void maskNonVisibleConnectionTiles();
|
||||
void onBorderMetatilesChanged();
|
||||
void selectedEventIndexChanged(int index, Event::Group eventGroup);
|
||||
void onSelectedMetatilesChanged();
|
||||
void onSelectedStampsChanged();
|
||||
|
||||
private:
|
||||
void setConnectionItemsVisible(bool);
|
||||
@@ -207,7 +209,6 @@ private slots:
|
||||
void onHoveredMapMetatileCleared();
|
||||
void onHoveredMapMovementPermissionChanged(int, int);
|
||||
void onHoveredMapMovementPermissionCleared();
|
||||
void onSelectedMetatilesChanged();
|
||||
void onWheelZoom(int);
|
||||
void onToggleGridClicked(bool);
|
||||
|
||||
|
||||
@@ -18,6 +18,6 @@ public:
|
||||
void setMap(Map *map) { this->map = map; }
|
||||
};
|
||||
|
||||
QPixmap drawMetatileSelection(MetatileSelection selection, Map *map);
|
||||
QPixmap drawMetatileSelection(MetatileSelection *selection, Map *map);
|
||||
|
||||
#endif // CURRENTSELECTEDMETATILESPIXMAPITEM_H
|
||||
|
||||
@@ -91,6 +91,7 @@ public:
|
||||
QPoint adjustCoords(QPoint pos);
|
||||
|
||||
private:
|
||||
PaintSelection* getActiveSelection();
|
||||
void paintSmartPath(int x, int y, bool fromScriptCall = false);
|
||||
static QList<int> smartPathTable;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
this->map = map;
|
||||
this->primaryTileset = map->layout->tileset_primary;
|
||||
this->secondaryTileset = map->layout->tileset_secondary;
|
||||
this->selection = MetatileSelection();
|
||||
this->selection = new MetatileSelection();
|
||||
setAcceptHoverEvents(true);
|
||||
}
|
||||
QPoint getSelectionDimensions();
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
bool select(uint16_t metatile);
|
||||
bool selectFromMap(uint16_t metatileId, uint16_t collision, uint16_t elevation);
|
||||
void setTilesets(Tileset*, Tileset*);
|
||||
MetatileSelection getMetatileSelection();
|
||||
MetatileSelection* getMetatileSelection();
|
||||
void setPrefabSelection(MetatileSelection selection);
|
||||
void setExternalSelection(int, int, QList<uint16_t>, QList<QPair<uint16_t, uint16_t>>);
|
||||
QPoint getMetatileIdCoordsOnWidget(uint16_t);
|
||||
@@ -47,7 +47,7 @@ private:
|
||||
int externalSelectionWidth;
|
||||
int externalSelectionHeight;
|
||||
QList<uint16_t> externalSelectedMetatiles;
|
||||
MetatileSelection selection;
|
||||
MetatileSelection *selection;
|
||||
|
||||
void updateSelectedMetatiles();
|
||||
void updateExternalSelectedMetatiles();
|
||||
|
||||
@@ -31,6 +31,12 @@ class MetatileSelection: public PaintSelection
|
||||
{
|
||||
public:
|
||||
MetatileSelection() {}
|
||||
void clone(MetatileSelection other) {
|
||||
this->dimensions = other.dimensions;
|
||||
this->hasCollision = other.hasCollision;
|
||||
this->metatileItems = other.metatileItems;
|
||||
this->collisionItems = other.collisionItems;
|
||||
}
|
||||
bool paintNormal(int index, Block *block) override;
|
||||
bool hasCollision = false;
|
||||
QList<MetatileSelectionItem> metatileItems;
|
||||
|
||||
@@ -21,7 +21,7 @@ class Prefab
|
||||
{
|
||||
public:
|
||||
void initPrefabUI(MetatileSelector *selector, QWidget *prefabWidget, QLabel *emptyPrefabLabel, Map *map);
|
||||
void addPrefab(MetatileSelection selection, Map *map, QString name);
|
||||
void addPrefab(MetatileSelection *selection, Map *map, QString name);
|
||||
void updatePrefabUi(Map *map);
|
||||
void tryImportDefaultPrefabs(Map *map);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
private:
|
||||
Map *map;
|
||||
Ui::PrefabCreationDialog *ui;
|
||||
MetatileSelection selection;
|
||||
MetatileSelection *selection;
|
||||
};
|
||||
|
||||
#endif // PREFABCREATIONDIALOG_H
|
||||
|
||||
@@ -15,13 +15,13 @@ public:
|
||||
this->map = map;
|
||||
this->primaryTileset = map->layout->tileset_primary;
|
||||
this->secondaryTileset = map->layout->tileset_secondary;
|
||||
this->selection = StampSelection{};
|
||||
this->selection = new StampSelection();
|
||||
}
|
||||
QPoint getSelectionDimensions();
|
||||
void draw();
|
||||
bool select(uint16_t stampId);
|
||||
void setTilesets(Tileset*, Tileset*);
|
||||
StampSelection getStampSelection();
|
||||
StampSelection* getStampSelection();
|
||||
QPoint getStampIdCoordsOnWidget(uint16_t);
|
||||
void setMap(Map*);
|
||||
Tileset *primaryTileset;
|
||||
@@ -33,7 +33,7 @@ protected:
|
||||
private:
|
||||
int numStampsWide;
|
||||
Map *map;
|
||||
StampSelection selection;
|
||||
StampSelection *selection;
|
||||
|
||||
void updateSelectedStamps();
|
||||
uint16_t getStampId(int x, int y);
|
||||
|
||||
Reference in New Issue
Block a user