From c81e70b9b20014e2a801e324c736f01aea15cd84 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 24 Jul 2014 16:20:44 +0200 Subject: [PATCH] Implemented land removal. --- .../plugins/tile_editor/tile_editor_main_window.cpp | 10 ++++++++++ .../src/plugins/tile_editor/tile_editor_main_window.h | 1 + 2 files changed, 11 insertions(+) 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 1a7dc164b..26f92b6ae 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 @@ -95,6 +95,7 @@ TileEditorMainWindow::TileEditorMainWindow(QWidget *parent) connect(m_ui->tileSetDownTB, SIGNAL(clicked()), this, SLOT(onTileSetDown())); connect(m_ui->landAddTB, SIGNAL(clicked()), this, SLOT(onLandAdd())); + connect(m_ui->landRemoveTB, SIGNAL(clicked()), this, SLOT(onLandRemove())); connect(m_ui->tileSetLV->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), @@ -359,6 +360,15 @@ void TileEditorMainWindow::onLandAdd() m_ui->landLW->addItem( name ); } +void TileEditorMainWindow::onLandRemove() +{ + QListWidgetItem *item = m_ui->landLW->currentItem(); + if( item == NULL ) + return; + + delete item; +} + void TileEditorMainWindow::onActionAddTile(int tabId) { QFileDialog::Options options; 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 6d1aa82c7..cc7312b7d 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 @@ -55,6 +55,7 @@ public Q_SLOTS: void onTileSetDown(); void onLandAdd(); + void onLandRemove(); void changeActiveTileSet(const QModelIndex &newIndex, const QModelIndex &oldIndex); void onZoomFactor(int level);