Connected the oriented combobox and now saving it's value to the tilebank.

This commit is contained in:
dfighter1985 2014-07-30 01:50:01 +02:00
parent a513af355d
commit 240844c1cd
5 changed files with 25 additions and 0 deletions

View file

@ -162,6 +162,8 @@ TileEditorMainWindow::TileEditorMainWindow(QWidget *parent)
connect( m_ui->actionSaveTileBank, SIGNAL( triggered() ), this, SLOT( save() ) );
connect( m_ui->actionSaveTileBankAs, SIGNAL( triggered() ), this, SLOT( saveAs() ) );
connect( m_ui->orientedCheckBox, SIGNAL( stateChanged( int ) ), this, SLOT( onOrientedStateChanged( int ) ) );
}
TileEditorMainWindow::~TileEditorMainWindow()
@ -556,6 +558,20 @@ void TileEditorMainWindow::onChooseTexturePath()
m_ui->tileBankTexturePathPB->setText( path );
}
void TileEditorMainWindow::onOrientedStateChanged( int state )
{
QModelIndex idx = m_ui->tileSetLV->currentIndex();
if( !idx.isValid() )
return;
TileSetNode *node = reinterpret_cast< TileSetNode* >( idx.internalPointer() );
if( state == Qt::Checked )
node->setOriented( true );
else
node->setOriented( false );
}
void TileEditorMainWindow::onActionAddTile(int tabId)
{
QModelIndex idx = m_ui->tileSetLV->currentIndex();

View file

@ -69,6 +69,8 @@ private Q_SLOTS:
void onChooseTexturePath();
void onOrientedStateChanged( int state );
void changeActiveTileSet(const QModelIndex &newIndex, const QModelIndex &oldIndex);
void onZoomFactor(int level);

View file

@ -167,6 +167,7 @@ void Node::swapRows( int a, int b )
TileSetNode::TileSetNode(QString tileSetName, Node *parent) : m_tileSetName(tileSetName)
{
m_parentItem = parent;
m_oriented = false;
}
TileSetNode::~TileSetNode()

View file

@ -75,9 +75,13 @@ public:
void setVegetSet( const QString &s ){ m_vegetSet = s; }
QString vegetSet() const{ return m_vegetSet; }
bool isOriented() const{ return m_oriented; }
void setOriented( bool b ){ m_oriented = b; }
private:
QString m_tileSetName;
QString m_vegetSet;
bool m_oriented;
};
class TileTypeNode : public Node

View file

@ -187,6 +187,8 @@ public:
addTilesToSet( set, n );
setupTransitionTiles( set, n );
setupDisplacementTiles( set, n );
set->setOriented( n->isOriented() );
}
// Add tilesets to lands