]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Radiant:
authorGarux <garux@mail.ru>
Wed, 2 Aug 2017 05:43:59 +0000 (08:43 +0300)
committerGarux <garux@mail.ru>
Wed, 2 Aug 2017 05:43:59 +0000 (08:43 +0300)
misc...
* fix: deselecting particular primitives, invert selection work for expanded group entity selection (these are deselecting parent node)
* do not render entities selection in components mode; fixes 'invisible components for expanded group entity selection'

libs/scenelib.h
radiant/brush.h
radiant/patch.h
radiant/renderer.h

index 08566259a4b9c0621dabec060b12b0daf4855071..0785baec869a1ec044d9a26eaeb1d493cf28a4d1 100644 (file)
@@ -739,6 +739,10 @@ bool parentSelected() const {
        }
        return m_parentSelected;
 }
+Instance* parent() const
+{
+       return m_parent;
+}
 };
 }
 
index 0fb6ffe225c2b0d3dbe45d0a8b3d5fb08a07079f..93b3f6367449bdd47d6bbe00a4e569557224184d 100644 (file)
@@ -3197,6 +3197,11 @@ bool isSelected() const {
 }
 void setSelected( bool select ){
        m_selectable.setSelected( select );
+       if ( !select && parent() ){
+               Selectable* sel_parent = Instance_getSelectable( *parent() );
+               if ( sel_parent && sel_parent->isSelected() )
+                       sel_parent->setSelected( false );
+       }
 }
 
 void update_selected() const {
index b1a897be5a3eb9e191c8e43c9714a278668ee5ba..66f53ef8c8d7f5ea3cc92e342c97175f08e203f4 100644 (file)
@@ -1422,6 +1422,11 @@ void allocate( std::size_t size ){
 
 void setSelected( bool select ){
        m_selectable.setSelected( select );
+       if ( !select && parent() ){
+               Selectable* sel_parent = Instance_getSelectable( *parent() );
+               if ( sel_parent && sel_parent->isSelected() )
+                       sel_parent->setSelected( false );
+       }
 }
 bool isSelected() const {
        return m_selectable.isSelected();
index 62674d4624c739ac5a8d53b53d91c835b317443c..eabafb7206a7b9e5b2818aa84cc9812eed91621e 100644 (file)
@@ -149,7 +149,10 @@ bool pre( const scene::Path& path, scene::Instance& instance, VolumeIntersection
                        else if ( renderable ) {
                                renderable->renderComponents( m_renderer, m_volume );
                        }
-                       m_renderer.Highlight( Renderer::ePrimitive );
+                       //if( !(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent && path.size() == 2) )
+                       //if( !( GlobalSelectionSystem().Mode() == SelectionSystem::eComponent && node_is_group( path.top() ) ) )
+                       if( !( GlobalSelectionSystem().Mode() == SelectionSystem::eComponent && Node_isEntity( path.top() ) ) )
+                               m_renderer.Highlight( Renderer::ePrimitive );
                }
 
                if ( renderable ) {