mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 17:46:18 +00:00
Implemented tilebank texture path setting.
This commit is contained in:
parent
f8a826f853
commit
3e44d16242
3 changed files with 38 additions and 18 deletions
|
@ -99,6 +99,8 @@ TileEditorMainWindow::TileEditorMainWindow(QWidget *parent)
|
|||
connect(m_ui->chooseVegetPushButton, SIGNAL(clicked()), this, SLOT(onChooseVegetation()));
|
||||
connect(m_ui->resetVegetPushButton, SIGNAL(clicked()), this, SLOT(onResetVegetation()));
|
||||
|
||||
connect(m_ui->tileBankTexturePathPB, SIGNAL(clicked()), this, SLOT(onChooseTexturePath()));
|
||||
|
||||
// 128x128 List View
|
||||
//m_ui->listView128->setItemDelegate(m_tileItemDelegate);
|
||||
m_ui->listView128->addAction(m_ui->actionAddTile);
|
||||
|
@ -502,6 +504,27 @@ void TileEditorMainWindow::onResetVegetation()
|
|||
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)
|
||||
{
|
||||
QFileDialog::Options options;
|
||||
|
|
|
@ -62,6 +62,8 @@ public Q_SLOTS:
|
|||
void onResetVegetation();
|
||||
void onChooseVegetation();
|
||||
|
||||
void onChooseTexturePath();
|
||||
|
||||
void changeActiveTileSet(const QModelIndex &newIndex, const QModelIndex &oldIndex);
|
||||
void onZoomFactor(int level);
|
||||
|
||||
|
@ -84,6 +86,8 @@ private:
|
|||
TileItemDelegate *m_tileItemDelegate;
|
||||
|
||||
QList< TileModel* > m_tileModels;
|
||||
|
||||
QString m_texturePath;
|
||||
};
|
||||
|
||||
#endif // TILE_EDITOR_MAIN_WINDOW_H
|
||||
|
|
|
@ -541,24 +541,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</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">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
|
@ -569,6 +551,17 @@
|
|||
<item row="0" column="0">
|
||||
<widget class="QListView" name="tileSetLV"/>
|
||||
</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>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in a new issue