mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-16 13:48:01 -05:00
Change filter clearing logic
This commit is contained in:
@@ -263,16 +263,19 @@ void MainWindow::setMap(QString map_name, bool scrollTreeView) {
|
||||
if (editor->map != nullptr && !editor->map->name.isNull()) {
|
||||
ui->mapList->setExpanded(mapListProxyModel->mapFromSource(mapListIndexes.value(editor->map->name)), false);
|
||||
}
|
||||
ui->mapList->setExpanded(mapListProxyModel->mapFromSource(mapListIndexes.value(map_name)), true);
|
||||
editor->setMap(map_name);
|
||||
redrawMapScene();
|
||||
displayMapProperties();
|
||||
|
||||
if (scrollTreeView) {
|
||||
// Make sure we clear the filter first so we actually have a scroll target
|
||||
mapListProxyModel->setFilterRegExp(QString::null);
|
||||
ui->mapList->setCurrentIndex(mapListProxyModel->mapFromSource(mapListIndexes.value(map_name)));
|
||||
ui->mapList->scrollTo(ui->mapList->currentIndex(), QAbstractItemView::PositionAtCenter);
|
||||
}
|
||||
|
||||
ui->mapList->setExpanded(mapListProxyModel->mapFromSource(mapListIndexes.value(map_name)), true);
|
||||
|
||||
setWindowTitle(map_name + " - " + editor->project->getProjectTitle());
|
||||
|
||||
connect(editor->map, SIGNAL(mapChanged(Map*)), this, SLOT(onMapChanged(Map *)));
|
||||
@@ -338,7 +341,6 @@ void MainWindow::openWarpMap(QString map_name, QString warp_num) {
|
||||
}
|
||||
|
||||
// Open the destination map, and select the target warp event.
|
||||
mapListProxyModel->setFilterRegExp(QString::null);
|
||||
setMap(map_name, true);
|
||||
QList<Event*> warp_events = editor->map->events["warp_event_group"];
|
||||
if (warp_events.length() > warpNum) {
|
||||
|
||||
Reference in New Issue
Block a user