Call onMapResized for script changes to map size
This commit is contained in:
parent
a6395eefbb
commit
d00cba3382
2 changed files with 6 additions and 4 deletions
|
@ -310,6 +310,12 @@ void Map::setDimensions(int newWidth, int newHeight, bool setNewBlockdata) {
|
||||||
setNewDimensionsBlockdata(newWidth, newHeight);
|
setNewDimensionsBlockdata(newWidth, newHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int oldWidth = layout->width.toInt();
|
||||||
|
int oldHeight = layout->height.toInt();
|
||||||
|
if (oldWidth != newWidth || oldHeight != newHeight) {
|
||||||
|
Scripting::cb_MapResized(oldWidth, oldHeight, newWidth, newHeight);
|
||||||
|
}
|
||||||
|
|
||||||
layout->width = QString::number(newWidth);
|
layout->width = QString::number(newWidth);
|
||||||
layout->height = QString::number(newHeight);
|
layout->height = QString::number(newHeight);
|
||||||
|
|
||||||
|
|
|
@ -2969,10 +2969,6 @@ void MainWindow::on_pushButton_ChangeDimensions_clicked()
|
||||||
oldBorder, map->layout->border
|
oldBorder, map->layout->border
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if (oldMapDimensions != newMapDimensions) {
|
|
||||||
Scripting::cb_MapResized(oldMapDimensions.width(), oldMapDimensions.height(),
|
|
||||||
newMapDimensions.width(), newMapDimensions.height());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue