Skip to content

Commit

Permalink
Maps: Remembering last active map on map save only
Browse files Browse the repository at this point in the history
The last active map is remembered only if the map is saved. This stops
unnecessary writes into RPG_RT.lmt. This change should fix issue #129.
  • Loading branch information
rueter37 committed Dec 11, 2021
1 parent 6fe62bd commit f719a59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/ui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,12 +1057,6 @@ void MainWindow::on_treeMap_currentItemChanged(QTreeWidgetItem* current, QTreeWi
ui->actionMapDelete->setEnabled(false);
return;
}
int id = current->data(1, Qt::DisplayRole).toInt();
ui->actionMapCopy->setEnabled(id != 0);
ui->actionMapDelete->setEnabled(id != 0);
if (id != 0) {
core().project()->treeMap().active_node = id;
}
}

void MainWindow::on_actionMapCopy_triggered()
Expand Down
2 changes: 2 additions & 0 deletions src/ui/map/map_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ void MapScene::Save(bool properties_changed)
treeMap.maps[i] = n_mapInfo; //Apply info changes
break;
}
// Remember last active map
treeMap.active_node = n_mapInfo.ID;
// FIXME: ProjectData.Project is Const
core().project()->saveTreeMap();
QString file = QString("Map%1.emu")
Expand Down

0 comments on commit f719a59

Please sign in to comment.