mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-26 17:16:20 +00:00
Oriented stuff.
--HG-- branch : gsoc2014-dfighter
This commit is contained in:
parent
688f6de090
commit
55c046252f
7 changed files with 39 additions and 14 deletions
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -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(){
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue