diff --git a/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp b/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp index 0341502d5..62aea3fcb 100644 --- a/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp +++ b/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp @@ -264,7 +264,7 @@ void TileEditorMainWindow::open() { QString fn = QFileDialog::getOpenFileName( this, tr( "Loading tilebank" ), - "", + m_lastOpenDir, tr( "tilebank files (*.tilebank)" ) ); if( fn.isEmpty() ) @@ -284,6 +284,9 @@ void TileEditorMainWindow::open() onTileBankLoaded(); m_fileName = fn; + + int idx = fn.lastIndexOf( '/' ); + m_lastOpenDir = fn.left( idx ); } void TileEditorMainWindow::onZoomFactor(int level) diff --git a/code/studio/src/plugins/tile_editor/tile_editor_main_window.h b/code/studio/src/plugins/tile_editor/tile_editor_main_window.h index c9b96928c..550c6bb75 100644 --- a/code/studio/src/plugins/tile_editor/tile_editor_main_window.h +++ b/code/studio/src/plugins/tile_editor/tile_editor_main_window.h @@ -122,6 +122,7 @@ private: }; QString m_fileName; + QString m_lastOpenDir; }; #endif // TILE_EDITOR_MAIN_WINDOW_H