|
@@ -295,6 +295,31 @@ void MetatilesPixmapItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
295
|
295
|
mousePressEvent(event);
|
296
|
296
|
}
|
297
|
297
|
|
|
298
|
+void CollisionMetatilesPixmapItem::updateCurHoveredMetatile(QPointF pos) {
|
|
299
|
+ int x = ((int)pos.x()) / 16;
|
|
300
|
+ int y = ((int)pos.y()) / 16;
|
|
301
|
+ int width = pixmap().width() / 16;
|
|
302
|
+ int height = pixmap().height() / 16;
|
|
303
|
+ if (x < 0 || x >= width || y < 0 || y >= height) {
|
|
304
|
+ map->clearHoveredCollisionTile();
|
|
305
|
+ } else {
|
|
306
|
+ int collision = y * width + x;
|
|
307
|
+ map->hoveredCollisionTileChanged(collision);
|
|
308
|
+ }
|
|
309
|
+}
|
|
310
|
+
|
|
311
|
+void ElevationMetatilesPixmapItem::updateCurHoveredMetatile(QPointF pos) {
|
|
312
|
+ int x = ((int)pos.x()) / 16;
|
|
313
|
+ int y = ((int)pos.y()) / 16;
|
|
314
|
+ int width = pixmap().width() / 16;
|
|
315
|
+ int height = pixmap().height() / 16;
|
|
316
|
+ if (x < 0 || x >= width || y < 0 || y >= height) {
|
|
317
|
+ map->clearHoveredElevationTile();
|
|
318
|
+ } else {
|
|
319
|
+ int elevation = y * width + x;
|
|
320
|
+ map->hoveredElevationTileChanged(elevation);
|
|
321
|
+ }
|
|
322
|
+}
|
298
|
323
|
|
299
|
324
|
void MapPixmapItem::paint(QGraphicsSceneMouseEvent *event) {
|
300
|
325
|
if (map) {
|