Oriented stuff.

This commit is contained in:
dfighter1985 2014-08-04 21:41:33 +02:00
parent de15faa5d2
commit bcfcb5bb83
7 changed files with 39 additions and 14 deletions

View file

@ -412,3 +412,21 @@ QString TileBank::getVegetation( int tileSet ) const
return set->getTileVegetableDescFileName().c_str(); return set->getTileVegetableDescFileName().c_str();
} }
void TileBank::setOriented( int tileSet, bool b )
{
NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet );
if( set == NULL )
return;
set->setOriented( b );
}
bool TileBank::getOriented( int tileSet ) const
{
NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet );
if( set == NULL )
return false;
return set->getOriented();
}

View file

@ -33,6 +33,9 @@ public:
void setVegetation( int tileSet, const QString &vegetation ); void setVegetation( int tileSet, const QString &vegetation );
QString getVegetation( int tileSet ) const; QString getVegetation( int tileSet ) const;
void setOriented( int tileSet, bool b );
bool getOriented( int tileSet ) const;
bool hasError() const{ return m_hasError; } bool hasError() const{ return m_hasError; }
QString getLastError() const{ return m_lastError; } QString getLastError() const{ return m_lastError; }
void resetError(){ void resetError(){

View file

@ -590,12 +590,12 @@ void TileEditorMainWindow::onOrientedStateChanged( int state )
if( !idx.isValid() ) if( !idx.isValid() )
return; return;
TileSetNode *node = reinterpret_cast< TileSetNode* >( idx.internalPointer() ); int row = idx.row();
if( state == Qt::Checked ) if( state == Qt::Checked )
node->setOriented( true ); m_tileModel->setOriented( row, true );
else else
node->setOriented( false ); m_tileModel->setOriented( row, false );
} }
void TileEditorMainWindow::onDiffuseToggled( bool b ) void TileEditorMainWindow::onDiffuseToggled( bool b )
@ -867,7 +867,7 @@ void TileEditorMainWindow::changeActiveTileSet(const QModelIndex &newIndex, cons
else else
m_ui->chooseVegetPushButton->setText( "..." ); m_ui->chooseVegetPushButton->setText( "..." );
m_ui->orientedCheckBox->setChecked( newNode->isOriented() ); m_ui->orientedCheckBox->setChecked( m_tileModel->getOriented( newIndex.row() ) );
} }
else else
{ {

View file

@ -173,7 +173,6 @@ void Node::clear()
TileSetNode::TileSetNode(QString tileSetName, Node *parent) : m_tileSetName(tileSetName) TileSetNode::TileSetNode(QString tileSetName, Node *parent) : m_tileSetName(tileSetName)
{ {
m_parentItem = parent; m_parentItem = parent;
m_oriented = false;
} }
TileSetNode::~TileSetNode() TileSetNode::~TileSetNode()

View file

@ -79,16 +79,8 @@ public:
const QString &getTileSetName(){ return m_tileSetName; } const QString &getTileSetName(){ return m_tileSetName; }
void setTileSetName( const QString &name ){ m_tileSetName = name; } void setTileSetName( const QString &name ){ m_tileSetName = name; }
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: private:
QString m_tileSetName; QString m_tileSetName;
QString m_vegetSet;
bool m_oriented;
}; };
class TileTypeNode : public Node class TileTypeNode : public Node

View file

@ -406,6 +406,16 @@ QString TileModel::getVegetation( int tileSet ) const
return m_tileBank->getVegetation( tileSet ); return m_tileBank->getVegetation( tileSet );
} }
void TileModel::setOriented( int tileSet, bool b )
{
m_tileBank->setOriented( tileSet, b );
}
bool TileModel::getOriented( int tileSet ) const
{
return m_tileBank->getOriented( tileSet );
}
QString TileModel::getLastError() const{ QString TileModel::getLastError() const{
return m_tileBank->getLastError(); return m_tileBank->getLastError();
} }

View file

@ -101,6 +101,9 @@ public:
void setVegetation( int tileSet, const QString &vegetation ); void setVegetation( int tileSet, const QString &vegetation );
QString getVegetation( int tileSet ) const; QString getVegetation( int tileSet ) const;
void setOriented( int tileSet, bool b );
bool getOriented( int tileSet ) const;
QString getLastError() const; QString getLastError() const;
bool hasError() const; bool hasError() const;