mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-14 11:19:07 +00:00
Implemented tile image replace.
This commit is contained in:
parent
10f757286b
commit
4c72aa85cf
2 changed files with 26 additions and 0 deletions
|
@ -220,6 +220,7 @@ void TileEditorMainWindow::onActionDeleteTile(bool triggered)
|
||||||
|
|
||||||
void TileEditorMainWindow::onActionReplaceImage(bool triggered)
|
void TileEditorMainWindow::onActionReplaceImage(bool triggered)
|
||||||
{
|
{
|
||||||
|
onActionReplaceImage(m_ui->tileViewTabWidget->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileEditorMainWindow::onActionDeleteImage(bool triggered)
|
void TileEditorMainWindow::onActionDeleteImage(bool triggered)
|
||||||
|
@ -619,6 +620,30 @@ void TileEditorMainWindow::onActionDeleteImage( int tabId )
|
||||||
n->setTileFilename( TileModel::TileDiffuse, "" );
|
n->setTileFilename( TileModel::TileDiffuse, "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TileEditorMainWindow::onActionReplaceImage( int tabId )
|
||||||
|
{
|
||||||
|
QListView *lv = getListViewByTab( tabId );
|
||||||
|
|
||||||
|
QModelIndex idx = lv->currentIndex();
|
||||||
|
if( !idx.isValid() )
|
||||||
|
{
|
||||||
|
QMessageBox::information( this,
|
||||||
|
tr( "Replacing tile image" ),
|
||||||
|
tr( "No tile selected!" ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString fileName = QFileDialog::getOpenFileName( this,
|
||||||
|
tr( "Select tile image" ),
|
||||||
|
"",
|
||||||
|
tr( "PNG files (*.png)" ) );
|
||||||
|
if( fileName.isEmpty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
TileItemNode *n = reinterpret_cast< TileItemNode* >( idx.internalPointer() );
|
||||||
|
n->setTileFilename( TileModel::TileDiffuse, fileName );
|
||||||
|
}
|
||||||
|
|
||||||
TileModel* TileEditorMainWindow::createTileModel()
|
TileModel* TileEditorMainWindow::createTileModel()
|
||||||
{
|
{
|
||||||
QStringList headers;
|
QStringList headers;
|
||||||
|
|
|
@ -71,6 +71,7 @@ private:
|
||||||
void onActionAddTile(int tabId);
|
void onActionAddTile(int tabId);
|
||||||
void onActionDeleteTile(int tabId);
|
void onActionDeleteTile(int tabId);
|
||||||
void onActionDeleteImage(int tabId);
|
void onActionDeleteImage(int tabId);
|
||||||
|
void onActionReplaceImage(int tabId);
|
||||||
|
|
||||||
|
|
||||||
TileModel* createTileModel();
|
TileModel* createTileModel();
|
||||||
|
|
Loading…
Reference in a new issue