X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fselect.cpp;h=f92706b5bdb9ecc5156ce8f09bc0e7a63e772806;hb=02282bbec513816e422bccd2255e17f7cdd8a08d;hp=eb2cacbd8129ea80a5d76decef17c5a6aabf248a;hpb=0ae4329330f964c0e5af3742e365d71bb7d607fd;p=xonotic%2Fnetradiant.git diff --git a/radiant/select.cpp b/radiant/select.cpp index eb2cacbd..f92706b5 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -112,27 +112,33 @@ SelectByBounds( AABB* aabbs, Unsigned count ) } bool pre( const scene::Path& path, scene::Instance& instance ) const { - Selectable* selectable = Instance_getSelectable( instance ); + if( path.top().get().visible() ){ + Selectable* selectable = Instance_getSelectable( instance ); - // ignore worldspawn - Entity* entity = Node_getEntity( path.top() ); - if ( entity ) { - if ( string_equal( entity->getKeyValue( "classname" ), "worldspawn" ) ) { - return true; + // ignore worldspawn + Entity* entity = Node_getEntity( path.top() ); + if ( entity ) { + if ( string_equal( entity->getKeyValue( "classname" ), "worldspawn" ) ) { + return true; + } } - } - if ( ( path.size() > 1 ) && - ( !path.top().get().isRoot() ) && - ( selectable != 0 ) - ) { - for ( Unsigned i = 0; i < m_count; ++i ) - { - if ( policy.Evaluate( m_aabbs[i], instance ) ) { - selectable->setSelected( true ); + if ( ( path.size() > 1 ) && + ( !path.top().get().isRoot() ) && + ( selectable != 0 ) && + ( !node_is_group( path.top() ) ) + ) { + for ( Unsigned i = 0; i < m_count; ++i ) + { + if ( policy.Evaluate( m_aabbs[i], instance ) ) { + selectable->setSelected( true ); + } } } } + else{ + return false; + } return true; } @@ -277,6 +283,10 @@ InvertSelectionWalker( SelectionSystem::EMode mode ) : m_mode( mode ), m_selectable( 0 ){ } bool pre( const scene::Path& path, scene::Instance& instance ) const { + if( !path.top().get().visible() ){ + m_selectable = 0; + return false; + } Selectable* selectable = Instance_getSelectable( instance ); if ( selectable ) { switch ( m_mode ) @@ -610,6 +620,9 @@ EntityFindByPropertyValueWalker( const char *prop, const PropertyValues& propert : m_propertyvalues( propertyvalues ), m_prop( prop ){ } bool pre( const scene::Path& path, scene::Instance& instance ) const { + if( !path.top().get().visible() ){ + return false; + } Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 && propertyvalues_contain( m_propertyvalues, entity->getKeyValue( m_prop ) ) ) { @@ -694,24 +707,6 @@ void Select_FitTexture( float horizontal, float vertical ){ SceneChangeNotify(); } -void Select_FitTextureW( float horizontal, float vertical ){ - if ( GlobalSelectionSystem().Mode() != SelectionSystem::eComponent ) { - Scene_BrushFitTexture_SelectedW( GlobalSceneGraph(), horizontal, vertical ); - } - Scene_BrushFitTexture_Component_SelectedW( GlobalSceneGraph(), horizontal, vertical ); - - SceneChangeNotify(); -} - -void Select_FitTextureH( float horizontal, float vertical ){ - if ( GlobalSelectionSystem().Mode() != SelectionSystem::eComponent ) { - Scene_BrushFitTexture_SelectedH( GlobalSceneGraph(), horizontal, vertical ); - } - Scene_BrushFitTexture_Component_SelectedH( GlobalSceneGraph(), horizontal, vertical ); - - SceneChangeNotify(); -} - inline void hide_node( scene::Node& node, bool hide ){ hide ? node.enable( scene::Node::eHidden )