Merge pull request #1246 from BeamNG/fix_obj_editor_lod

Fix GuiTreeViewCtrl::getParentItem incorrent use in ShapeEditor script files.
This commit is contained in:
Daniel Buckmaster 2015-03-09 11:32:27 +11:00
commit 67e9119101
2 changed files with 8 additions and 8 deletions

View file

@ -1132,7 +1132,7 @@ function ShapeEdNodes::onDeleteNode( %this )
function ShapeEdNodeTreeView::getChildIndexByName( %this, %name ) function ShapeEdNodeTreeView::getChildIndexByName( %this, %name )
{ {
%id = %this.findItemByName( %name ); %id = %this.findItemByName( %name );
%parentId = %this.getParent( %id ); %parentId = %this.getParentItem( %id );
%childId = %this.getChild( %parentId ); %childId = %this.getChild( %parentId );
if ( %childId <= 0 ) if ( %childId <= 0 )
return 0; // bad! return 0; // bad!
@ -2399,7 +2399,7 @@ function ShapeEdDetailTree::onDefineIcons(%this)
// a mesh) // a mesh)
function ShapeEdDetailTree::isDetailItem( %this, %id ) function ShapeEdDetailTree::isDetailItem( %this, %id )
{ {
return ( %this.getParent( %id ) == 1 ); return ( %this.getParentItem( %id ) == 1 );
} }
// Get the detail level index from the ID of an item in the details tree view // Get the detail level index from the ID of an item in the details tree view
@ -2409,7 +2409,7 @@ function ShapeEdDetailTree::getDetailLevelFromItem( %this, %id )
%detSize = %this.getItemValue( %id ); %detSize = %this.getItemValue( %id );
else else
%detSize = %this.getItemValue( %this.getParent( %id ) ); %detSize = %this.getItemValue( %this.getParentItem( %id ) );
return ShapeEditor.shape.getDetailLevelIndex( %detSize ); return ShapeEditor.shape.getDetailLevelIndex( %detSize );
} }
@ -2443,7 +2443,7 @@ function ShapeEdDetailTree::removeMeshEntry( %this, %name, %size )
if ( ShapeEditor.shape.getDetailLevelIndex( %size ) < 0 ) if ( ShapeEditor.shape.getDetailLevelIndex( %size ) < 0 )
{ {
// Last mesh of a detail level has been removed => remove the detail level // Last mesh of a detail level has been removed => remove the detail level
%this.removeItem( %this.getParent( %id ) ); %this.removeItem( %this.getParentItem( %id ) );
ShapeEdDetails.update_onDetailsChanged(); ShapeEdDetails.update_onDetailsChanged();
} }
else else

View file

@ -1132,7 +1132,7 @@ function ShapeEdNodes::onDeleteNode( %this )
function ShapeEdNodeTreeView::getChildIndexByName( %this, %name ) function ShapeEdNodeTreeView::getChildIndexByName( %this, %name )
{ {
%id = %this.findItemByName( %name ); %id = %this.findItemByName( %name );
%parentId = %this.getParent( %id ); %parentId = %this.getParentItem( %id );
%childId = %this.getChild( %parentId ); %childId = %this.getChild( %parentId );
if ( %childId <= 0 ) if ( %childId <= 0 )
return 0; // bad! return 0; // bad!
@ -2399,7 +2399,7 @@ function ShapeEdDetailTree::onDefineIcons(%this)
// a mesh) // a mesh)
function ShapeEdDetailTree::isDetailItem( %this, %id ) function ShapeEdDetailTree::isDetailItem( %this, %id )
{ {
return ( %this.getParent( %id ) == 1 ); return ( %this.getParentItem( %id ) == 1 );
} }
// Get the detail level index from the ID of an item in the details tree view // Get the detail level index from the ID of an item in the details tree view
@ -2409,7 +2409,7 @@ function ShapeEdDetailTree::getDetailLevelFromItem( %this, %id )
%detSize = %this.getItemValue( %id ); %detSize = %this.getItemValue( %id );
else else
%detSize = %this.getItemValue( %this.getParent( %id ) ); %detSize = %this.getItemValue( %this.getParentItem( %id ) );
return ShapeEditor.shape.getDetailLevelIndex( %detSize ); return ShapeEditor.shape.getDetailLevelIndex( %detSize );
} }
@ -2443,7 +2443,7 @@ function ShapeEdDetailTree::removeMeshEntry( %this, %name, %size )
if ( ShapeEditor.shape.getDetailLevelIndex( %size ) < 0 ) if ( ShapeEditor.shape.getDetailLevelIndex( %size ) < 0 )
{ {
// Last mesh of a detail level has been removed => remove the detail level // Last mesh of a detail level has been removed => remove the detail level
%this.removeItem( %this.getParent( %id ) ); %this.removeItem( %this.getParentItem( %id ) );
ShapeEdDetails.update_onDetailsChanged(); ShapeEdDetails.update_onDetailsChanged();
} }
else else