diff --git a/include/mainwindow.h b/include/mainwindow.h index 93f0d265..83eea1f5 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -339,9 +339,6 @@ private: bool isProgrammaticEventTabChange; bool projectHasUnsavedChanges; bool newMapDefaultsSet = false; - - MapSortOrder mapSortOrder; - bool tilesetNeedsRedraw = false; bool setMap(QString, bool scrollTreeView = false); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 37f45f20..8595fbcc 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -390,7 +390,7 @@ void MainWindow::initMapSortOrder() { connect(mapSortOrderActionGroup, &QActionGroup::triggered, this, &MainWindow::mapSortOrder_changed); - QAction* sortOrder = ui->toolButton_MapSortOrder->menu()->actions()[mapSortOrder]; + QAction* sortOrder = ui->toolButton_MapSortOrder->menu()->actions()[porymapConfig.mapSortOrder]; ui->toolButton_MapSortOrder->setIcon(sortOrder->icon()); sortOrder->setChecked(true); } @@ -424,7 +424,7 @@ void MainWindow::mapSortOrder_changed(QAction *action) } } - if (i != mapSortOrder) + if (i != porymapConfig.mapSortOrder) { ui->toolButton_MapSortOrder->setIcon(action->icon()); porymapConfig.mapSortOrder = static_cast(i); @@ -462,7 +462,6 @@ void MainWindow::loadUserSettings() { this->editor->settings->cursorTileRectEnabled = porymapConfig.showCursorTile; ui->checkBox_ToggleBorder->setChecked(porymapConfig.showBorder); ui->checkBox_ToggleGrid->setChecked(porymapConfig.showGrid); - mapSortOrder = porymapConfig.mapSortOrder; ui->horizontalSlider_CollisionTransparency->blockSignals(true); this->editor->collisionOpacity = static_cast(porymapConfig.collisionOpacity) / 100; ui->horizontalSlider_CollisionTransparency->setValue(porymapConfig.collisionOpacity); @@ -1092,7 +1091,7 @@ void MainWindow::sortMapList() { mapGroupItemsList->clear(); QStandardItem *root = mapListModel->invisibleRootItem(); - switch (mapSortOrder) + switch (porymapConfig.mapSortOrder) { case MapSortOrder::Group: for (int i = 0; i < project->groupNames.length(); i++) {