]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/select.cpp
Merge commit 'b25e4389ba4d089fc94cc3860774c8510b843042' into master-merge
[xonotic/netradiant.git] / radiant / select.cpp
index eb2cacbd8129ea80a5d76decef17c5a6aabf248a..f92706b5bdb9ecc5156ce8f09bc0e7a63e772806 100644 (file)
@@ -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 )