Skip to content

Commit

Permalink
[BSLODTriShape] Enable slider only for appropriate NIFs
Browse files Browse the repository at this point in the history
Issue #22
  • Loading branch information
hexabits committed May 18, 2014
1 parent db256ae commit 8e5ce6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/gl/glmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,24 @@ void Mesh::update( const NifModel * nif, const QModelIndex & index )
if ( !iBlock.isValid() || !index.isValid() )
return;

bool hasBSLOD = false;
int n = 0;
while ( n < nif->getBlockCount() ) {
auto iBlock = nif->getBlock( n );
if ( nif->itemName( iBlock ) == "BSLODTriShape" ) {
hasBSLOD = true;
break;
}

n++;
}

for ( QWidget* widget : qApp->allWidgets() ) {
if ( widget->objectName() == "tLOD" ) {
widget->setEnabled( hasBSLOD );
}
}

upData |= ( iData == index ) || ( iTangentData == index );
upSkin |= ( iSkin == index );
upSkin |= ( iSkinData == index );
Expand Down
1 change: 1 addition & 0 deletions src/nifskope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ NifSkope::NifSkope()
lodSlider->setValue( lodLevel );

tLOD->addWidget( lodSlider );
tLOD->setEnabled( false );

connect( lodSlider, &QSlider::valueChanged, []( int value )
{
Expand Down

0 comments on commit 8e5ce6c

Please sign in to comment.