Implemented tilebank texture path setting.

--HG--
branch : gsoc2014-dfighter
This commit is contained in:
dfighter1985 2014-07-24 23:41:42 +02:00
parent df7307583b
commit 78f4654063
3 changed files with 38 additions and 18 deletions

View file

@ -99,6 +99,8 @@ TileEditorMainWindow::TileEditorMainWindow(QWidget *parent)
connect(m_ui->chooseVegetPushButton, SIGNAL(clicked()), this, SLOT(onChooseVegetation())); connect(m_ui->chooseVegetPushButton, SIGNAL(clicked()), this, SLOT(onChooseVegetation()));
connect(m_ui->resetVegetPushButton, SIGNAL(clicked()), this, SLOT(onResetVegetation())); connect(m_ui->resetVegetPushButton, SIGNAL(clicked()), this, SLOT(onResetVegetation()));
connect(m_ui->tileBankTexturePathPB, SIGNAL(clicked()), this, SLOT(onChooseTexturePath()));
// 128x128 List View // 128x128 List View
//m_ui->listView128->setItemDelegate(m_tileItemDelegate); //m_ui->listView128->setItemDelegate(m_tileItemDelegate);
m_ui->listView128->addAction(m_ui->actionAddTile); m_ui->listView128->addAction(m_ui->actionAddTile);
@ -502,6 +504,27 @@ void TileEditorMainWindow::onResetVegetation()
node->setVegetSet( "" ); node->setVegetSet( "" );
} }
void TileEditorMainWindow::onChooseTexturePath()
{
QString path = QFileDialog::getExistingDirectory( this,
tr("Choose tilebank absolute texture path "),
"" );
if( path.isEmpty() )
return;
int reply = QMessageBox::question( this,
tr("tilebank texture path"),
tr("Are you sure you want to make '%1' the tilebank absolute texture path?").arg( path ),
QMessageBox::Yes | QMessageBox::Cancel );
if( reply != QMessageBox::Yes )
return;
m_texturePath = path;
m_ui->tileBankTexturePathPB->setText( path );
}
void TileEditorMainWindow::onActionAddTile(int tabId) void TileEditorMainWindow::onActionAddTile(int tabId)
{ {
QFileDialog::Options options; QFileDialog::Options options;

View file

@ -62,6 +62,8 @@ public Q_SLOTS:
void onResetVegetation(); void onResetVegetation();
void onChooseVegetation(); void onChooseVegetation();
void onChooseTexturePath();
void changeActiveTileSet(const QModelIndex &newIndex, const QModelIndex &oldIndex); void changeActiveTileSet(const QModelIndex &newIndex, const QModelIndex &oldIndex);
void onZoomFactor(int level); void onZoomFactor(int level);
@ -84,6 +86,8 @@ private:
TileItemDelegate *m_tileItemDelegate; TileItemDelegate *m_tileItemDelegate;
QList< TileModel* > m_tileModels; QList< TileModel* > m_tileModels;
QString m_texturePath;
}; };
#endif // TILE_EDITOR_MAIN_WINDOW_H #endif // TILE_EDITOR_MAIN_WINDOW_H

View file

@ -541,24 +541,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QPushButton" name="tileBankTexturePathPB">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tileBankTexturePathTB">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0" colspan="2"> <item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
@ -569,6 +551,17 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QListView" name="tileSetLV"/> <widget class="QListView" name="tileSetLV"/>
</item> </item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QPushButton" name="tileBankTexturePathPB">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>