mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-10 17:29:06 +00:00
Oriented stuff.
This commit is contained in:
parent
2f0acf32cb
commit
342cca7751
7 changed files with 39 additions and 14 deletions
|
@ -412,3 +412,21 @@ QString TileBank::getVegetation( int tileSet ) const
|
|||
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();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,9 @@ public:
|
|||
|
||||
void setVegetation( int tileSet, const QString &vegetation );
|
||||
QString getVegetation( int tileSet ) const;
|
||||
|
||||
void setOriented( int tileSet, bool b );
|
||||
bool getOriented( int tileSet ) const;
|
||||
|
||||
bool hasError() const{ return m_hasError; }
|
||||
QString getLastError() const{ return m_lastError; }
|
||||
|
|
|
@ -590,12 +590,12 @@ void TileEditorMainWindow::onOrientedStateChanged( int state )
|
|||
if( !idx.isValid() )
|
||||
return;
|
||||
|
||||
TileSetNode *node = reinterpret_cast< TileSetNode* >( idx.internalPointer() );
|
||||
|
||||
int row = idx.row();
|
||||
|
||||
if( state == Qt::Checked )
|
||||
node->setOriented( true );
|
||||
m_tileModel->setOriented( row, true );
|
||||
else
|
||||
node->setOriented( false );
|
||||
m_tileModel->setOriented( row, false );
|
||||
}
|
||||
|
||||
void TileEditorMainWindow::onDiffuseToggled( bool b )
|
||||
|
@ -867,7 +867,7 @@ void TileEditorMainWindow::changeActiveTileSet(const QModelIndex &newIndex, cons
|
|||
else
|
||||
m_ui->chooseVegetPushButton->setText( "..." );
|
||||
|
||||
m_ui->orientedCheckBox->setChecked( newNode->isOriented() );
|
||||
m_ui->orientedCheckBox->setChecked( m_tileModel->getOriented( newIndex.row() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -173,7 +173,6 @@ void Node::clear()
|
|||
TileSetNode::TileSetNode(QString tileSetName, Node *parent) : m_tileSetName(tileSetName)
|
||||
{
|
||||
m_parentItem = parent;
|
||||
m_oriented = false;
|
||||
}
|
||||
|
||||
TileSetNode::~TileSetNode()
|
||||
|
|
|
@ -79,16 +79,8 @@ public:
|
|||
const QString &getTileSetName(){ return m_tileSetName; }
|
||||
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:
|
||||
QString m_tileSetName;
|
||||
QString m_vegetSet;
|
||||
bool m_oriented;
|
||||
};
|
||||
|
||||
class TileTypeNode : public Node
|
||||
|
|
|
@ -406,6 +406,16 @@ QString TileModel::getVegetation( int tileSet ) const
|
|||
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{
|
||||
return m_tileBank->getLastError();
|
||||
}
|
||||
|
|
|
@ -101,6 +101,9 @@ public:
|
|||
void setVegetation( int tileSet, const QString &vegetation );
|
||||
QString getVegetation( int tileSet ) const;
|
||||
|
||||
void setOriented( int tileSet, bool b );
|
||||
bool getOriented( int tileSet ) const;
|
||||
|
||||
QString getLastError() const;
|
||||
bool hasError() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue