mirror of
https://github.com/huderlem/porymap.git
synced 2026-11-10 19:08:22 -06:00
Merge branch 'master' of https://github.com/huderlem/porymap into connections
This commit is contained in:
@@ -295,7 +295,7 @@ int MainWindow::getBorderHeight() {
|
||||
}
|
||||
|
||||
void MainWindow::setBorderDimensions(int width, int height) {
|
||||
if (!this->editor || !this->editor->map || !projectConfig.getUseCustomBorderSize())
|
||||
if (!this->editor || !this->editor->map || !projectConfig.useCustomBorderSize)
|
||||
return;
|
||||
if (width < 1 || height < 1 || width > MAX_BORDER_WIDTH || height > MAX_BORDER_HEIGHT)
|
||||
return;
|
||||
@@ -305,7 +305,7 @@ void MainWindow::setBorderDimensions(int width, int height) {
|
||||
}
|
||||
|
||||
void MainWindow::setBorderWidth(int width) {
|
||||
if (!this->editor || !this->editor->map || !projectConfig.getUseCustomBorderSize())
|
||||
if (!this->editor || !this->editor->map || !projectConfig.useCustomBorderSize)
|
||||
return;
|
||||
if (width < 1 || width > MAX_BORDER_WIDTH)
|
||||
return;
|
||||
@@ -315,7 +315,7 @@ void MainWindow::setBorderWidth(int width) {
|
||||
}
|
||||
|
||||
void MainWindow::setBorderHeight(int height) {
|
||||
if (!this->editor || !this->editor->map || !projectConfig.getUseCustomBorderSize())
|
||||
if (!this->editor || !this->editor->map || !projectConfig.useCustomBorderSize)
|
||||
return;
|
||||
if (height < 1 || height > MAX_BORDER_HEIGHT)
|
||||
return;
|
||||
|
||||
@@ -21,14 +21,19 @@ QMap<CallbackType, QString> callbackFunctions = {
|
||||
|
||||
Scripting *instance = nullptr;
|
||||
|
||||
void Scripting::stop() {
|
||||
if (!instance) return;
|
||||
instance->engine->setInterrupted(true);
|
||||
instance->scriptUtility->clearActions();
|
||||
qDeleteAll(instance->imageCache);
|
||||
delete instance;
|
||||
instance = nullptr;
|
||||
}
|
||||
|
||||
void Scripting::init(MainWindow *mainWindow) {
|
||||
mainWindow->ui->graphicsView_Map->clearOverlayMap();
|
||||
if (instance) {
|
||||
instance->engine->setInterrupted(true);
|
||||
instance->scriptUtility->clearActions();
|
||||
qDeleteAll(instance->imageCache);
|
||||
delete instance;
|
||||
}
|
||||
if (mainWindow->ui->graphicsView_Map)
|
||||
mainWindow->ui->graphicsView_Map->clearOverlayMap();
|
||||
Scripting::stop();
|
||||
instance = new Scripting(mainWindow);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user