From 7b36ce2e85aaf26bf6523e8364b0c5240ccd3a42 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 30 Jul 2014 14:39:19 +0200 Subject: [PATCH] Replace and delete image should be applied to the correct channel now. --- .../src/plugins/tile_editor/tile_editor_main_window.cpp | 4 ++-- code/studio/src/plugins/tile_editor/tile_item.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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 66a73cfd1..a2b2525ca 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 @@ -728,7 +728,7 @@ void TileEditorMainWindow::onActionDeleteImage( int tabId ) } TileItemNode *n = reinterpret_cast< TileItemNode* >( idx.internalPointer() ); - n->setTileFilename( TileModel::TileDiffuse, "" ); + n->setTileFilename( TileItemNode::displayChannel(), "" ); } void TileEditorMainWindow::onActionReplaceImage( int tabId ) @@ -752,7 +752,7 @@ void TileEditorMainWindow::onActionReplaceImage( int tabId ) return; TileItemNode *n = reinterpret_cast< TileItemNode* >( idx.internalPointer() ); - n->setTileFilename( TileModel::TileDiffuse, fileName ); + n->setTileFilename( TileItemNode::displayChannel(), fileName ); } void TileEditorMainWindow::onTileSetRemoved( const QString &set ) diff --git a/code/studio/src/plugins/tile_editor/tile_item.h b/code/studio/src/plugins/tile_editor/tile_item.h index 4e00c12c3..5c5f8017c 100644 --- a/code/studio/src/plugins/tile_editor/tile_item.h +++ b/code/studio/src/plugins/tile_editor/tile_item.h @@ -117,6 +117,7 @@ public: int id() const{ return m_tileId; } static void setDisplayChannel( TileModel::TTileChannel channel ){ s_displayChannel = channel; } + static TileModel::TTileChannel displayChannel(){ return s_displayChannel; } private: int m_tileId;