Allow right-clicking border metatiles to select them

This commit is contained in:
GriffinR
2025-05-21 22:57:33 -04:00
parent 55bfcaec19
commit e4067bf088
2 changed files with 10 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ and this project somewhat adheres to [Semantic Versioning](https://semver.org/sp
- The max encounter rate is now read from the project, rather than assuming the default value from RSE.
- `MAP_OFFSET_W` and `MAP_OFFSET_H` (used to limit the maximum map size) are now read from the project.
- The rendered area of the map border is now limited to the maximum player view distance (prior to this it included two extra rows on the top and bottom).
- Right-clicking on the border metatiles image will now select that metatile.
- An error message will now be shown when Porymap is unable to save changes (e.g. if Porymap doesn't have write permissions for your project).
- Error and warning logs are now displayed in the status bar. This can be changed with a new setting.
- A project may now be opened even if it has no maps or map groups. A minimum of one map layout is required.

View File

@@ -5,8 +5,16 @@
#include <QPainter>
void BorderMetatilesPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
MetatileSelection selection = this->metatileSelector->getMetatileSelection();
QPoint pos = Metatile::coordFromPixmapCoord(event->pos());
if (event->buttons() & Qt::RightButton) {
// Selecting metatiles
this->metatileSelector->select(this->layout->getBorderMetatileId(pos.x(), pos.y()));
return;
}
// Painting metatiles
MetatileSelection selection = this->metatileSelector->getMetatileSelection();
int width = layout->getBorderWidth();
int height = layout->getBorderHeight();