mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-28 03:25:30 -05:00
Call on_block_changed from more places
This commit is contained in:
@@ -395,7 +395,7 @@ void Map::_floodFillCollisionElevation(int x, int y, uint16_t collision, uint16_
|
||||
|
||||
block->collision = collision;
|
||||
block->elevation = elevation;
|
||||
setBlock(x, y, *block);
|
||||
setBlock(x, y, *block, true);
|
||||
if ((block = getBlock(x + 1, y)) && block->collision == old_coll && block->elevation == old_elev) {
|
||||
todo.append(QPoint(x + 1, y));
|
||||
}
|
||||
@@ -520,7 +520,7 @@ void Map::magicFillCollisionElevation(int initialX, int initialY, uint16_t colli
|
||||
if (block && block->collision == old_coll && block->elevation == old_elev) {
|
||||
block->collision = collision;
|
||||
block->elevation = elevation;
|
||||
setBlock(x, y, *block);
|
||||
setBlock(x, y, *block, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ void CollisionPixmapItem::paint(QGraphicsSceneMouseEvent *event) {
|
||||
if (block) {
|
||||
block->collision = this->movementPermissionsSelector->getSelectedCollision();
|
||||
block->elevation = this->movementPermissionsSelector->getSelectedElevation();
|
||||
map->setBlock(x, y, *block);
|
||||
map->setBlock(x, y, *block, true);
|
||||
}
|
||||
if (event->type() == QEvent::GraphicsSceneMouseRelease) {
|
||||
map->commit();
|
||||
|
||||
@@ -131,7 +131,7 @@ QList<int> MapPixmapItem::smartPathTable = QList<int>({
|
||||
|
||||
#define IS_SMART_PATH_TILE(block) (selectedMetatiles->contains(block->tile))
|
||||
|
||||
void MapPixmapItem::paintSmartPath(int x, int y) {
|
||||
void MapPixmapItem::paintSmartPath(int x, int y, bool fromScriptCall) {
|
||||
QPoint selectionDimensions = this->metatileSelector->getSelectionDimensions();
|
||||
QList<uint16_t> *selectedMetatiles = this->metatileSelector->getSelectedMetatiles();
|
||||
QList<QPair<uint16_t, uint16_t>> *selectedCollisions = this->metatileSelector->getSelectedCollisions();
|
||||
@@ -165,7 +165,7 @@ void MapPixmapItem::paintSmartPath(int x, int y) {
|
||||
block->collision = openTileCollision;
|
||||
block->elevation = openTileElevation;
|
||||
}
|
||||
map->setBlock(actualX, actualY, *block);
|
||||
map->setBlock(actualX, actualY, *block, !fromScriptCall);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ void MapPixmapItem::paintSmartPath(int x, int y) {
|
||||
block->collision = selectedCollisions->at(smartPathTable[id]).first;
|
||||
block->elevation = selectedCollisions->at(smartPathTable[id]).second;
|
||||
}
|
||||
map->setBlock(actualX, actualY, *block);
|
||||
map->setBlock(actualX, actualY, *block, !fromScriptCall);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ void MapPixmapItem::floodFill(
|
||||
delete[] visited;
|
||||
}
|
||||
|
||||
void MapPixmapItem::floodFillSmartPath(int initialX, int initialY) {
|
||||
void MapPixmapItem::floodFillSmartPath(int initialX, int initialY, bool fromScriptCall) {
|
||||
QPoint selectionDimensions = this->metatileSelector->getSelectionDimensions();
|
||||
QList<uint16_t> *selectedMetatiles = this->metatileSelector->getSelectedMetatiles();
|
||||
QList<QPair<uint16_t, uint16_t>> *selectedCollisions = this->metatileSelector->getSelectedCollisions();
|
||||
@@ -467,7 +467,7 @@ void MapPixmapItem::floodFillSmartPath(int initialX, int initialY) {
|
||||
block->collision = openTileCollision;
|
||||
block->elevation = openTileElevation;
|
||||
}
|
||||
map->setBlock(x, y, *block);
|
||||
map->setBlock(x, y, *block, !fromScriptCall);
|
||||
if ((block = map->getBlock(x + 1, y)) && block->tile == old_tile) {
|
||||
todo.append(QPoint(x + 1, y));
|
||||
}
|
||||
@@ -522,7 +522,7 @@ void MapPixmapItem::floodFillSmartPath(int initialX, int initialY) {
|
||||
block->collision = selectedCollisions->at(smartPathTable[id]).first;
|
||||
block->elevation = selectedCollisions->at(smartPathTable[id]).second;
|
||||
}
|
||||
map->setBlock(x, y, *block);
|
||||
map->setBlock(x, y, *block, !fromScriptCall);
|
||||
|
||||
// Visit neighbors if they are smart-path tiles, and don't revisit any.
|
||||
if (!visited[x + 1 + y * map->getWidth()] && (block = map->getBlock(x + 1, y)) && IS_SMART_PATH_TILE(block)) {
|
||||
|
||||
Reference in New Issue
Block a user