From: Garux Date: Wed, 2 Aug 2017 05:43:59 +0000 (+0300) Subject: Radiant: X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3ec33465b13ce35100e1557b499ffc335cd6e22c;p=xonotic%2Fnetradiant.git Radiant: 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' --- diff --git a/libs/scenelib.h b/libs/scenelib.h index 08566259..0785baec 100644 --- a/libs/scenelib.h +++ b/libs/scenelib.h @@ -739,6 +739,10 @@ bool parentSelected() const { } return m_parentSelected; } +Instance* parent() const +{ + return m_parent; +} }; } diff --git a/radiant/brush.h b/radiant/brush.h index 0fb6ffe2..93b3f636 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -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 { diff --git a/radiant/patch.h b/radiant/patch.h index b1a897be..66f53ef8 100644 --- a/radiant/patch.h +++ b/radiant/patch.h @@ -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(); diff --git a/radiant/renderer.h b/radiant/renderer.h index 62674d46..eabafb72 100644 --- a/radiant/renderer.h +++ b/radiant/renderer.h @@ -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 ) {