From f25200c9666e57fcdfa2ce2ec45caebd3a243917 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 30 Jul 2014 07:43:02 +0200 Subject: [PATCH] Add the already selected tilesets to the land when editing. --- .../src/plugins/tile_editor/land_edit_dialog.cpp | 11 +++++++++++ .../studio/src/plugins/tile_editor/land_edit_dialog.h | 2 ++ .../plugins/tile_editor/tile_editor_main_window.cpp | 1 + 3 files changed, 14 insertions(+) diff --git a/code/studio/src/plugins/tile_editor/land_edit_dialog.cpp b/code/studio/src/plugins/tile_editor/land_edit_dialog.cpp index f7f5c5ce6..87c66aa9c 100644 --- a/code/studio/src/plugins/tile_editor/land_edit_dialog.cpp +++ b/code/studio/src/plugins/tile_editor/land_edit_dialog.cpp @@ -20,6 +20,17 @@ void LandEditDialog::getSelectedTileSets( QStringList &l ) const } } +void LandEditDialog::setSelectedTileSets( QStringList &l ) +{ + tilesetLV->clear(); + + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + tilesetLV->addItem( itr.next() ); + } +} + void LandEditDialog::setTileSets( const QStringList &l ) { tilesetCB->clear(); diff --git a/code/studio/src/plugins/tile_editor/land_edit_dialog.h b/code/studio/src/plugins/tile_editor/land_edit_dialog.h index 9b86a2d06..1ada1c23e 100644 --- a/code/studio/src/plugins/tile_editor/land_edit_dialog.h +++ b/code/studio/src/plugins/tile_editor/land_edit_dialog.h @@ -13,6 +13,8 @@ public: ~LandEditDialog(); void getSelectedTileSets( QStringList &l ) const; + void setSelectedTileSets( QStringList &l ); + void setTileSets( const QStringList &l ); private: 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 a8219f6eb..1e43fa003 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 @@ -483,6 +483,7 @@ void TileEditorMainWindow::onLandEdit() Land &l = m_lands[ r ]; LandEditDialog d; + d.setSelectedTileSets( l.tilesets ); d.setTileSets( ts ); int result = d.exec();