]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'b7e5662d0c9342cc42501de697386ef5a96277e6' into master-merge
authorThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 02:01:29 +0000 (04:01 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 02:01:29 +0000 (04:01 +0200)
radiant/selection.cpp
radiant/xywindow.cpp

index df18daa9c5ef23a908cc40e83b84b62eb09617c9..2fe57fdfa11d285b041e2ead2978df58a56600e1 100644 (file)
@@ -2541,7 +2541,9 @@ EManipulatorMode m_manipulator_mode;
 Manipulator* m_manipulator;
 
 // state
+public:
 bool m_undo_begun;
+private:
 EMode m_mode;
 EComponentMode m_componentmode;
 
@@ -3449,6 +3451,7 @@ Single<MouseEventCallback> g_mouseUpCallback;
 
 #if 1
 const ButtonIdentifier c_button_select = c_buttonLeft;
+const ButtonIdentifier c_button_select2 = c_buttonRight;
 const ModifierFlags c_modifier_manipulator = c_modifierNone;
 const ModifierFlags c_modifier_toggle = c_modifierShift;
 const ModifierFlags c_modifier_replace = c_modifierShift | c_modifierAlt;
@@ -3530,6 +3533,20 @@ void testSelect( DeviceVector position ){
        draw_area();
 }
 
+void testSelect_simpleM1( DeviceVector position ){
+       RadiantSelectionSystem::EModifier modifier = RadiantSelectionSystem::eReplace;
+       if ( m_unmoved_replaces++ > 0 ) {
+               if( GlobalSelectionSystem().countSelected() != 0 ){
+                       modifier = RadiantSelectionSystem::eCycle;
+               }
+               else{
+                       m_unmoved_replaces = 0;
+               }
+       }
+       getSelectionSystem().SelectPoint( *m_view, &position[0], &m_epsilon[0], modifier, false );
+}
+
+
 bool selecting() const {
        return m_state != c_modifier_manipulator;
 }
@@ -3677,6 +3694,11 @@ void onMouseUp( const WindowVector& position, ButtonIdentifier button, ModifierF
 
                g_mouseUpCallback.get() ( window_to_normalised_device( position, m_width, m_height ) );
        }
+       //L button w/o scene changed = tunnel selection
+       if( !getSelectionSystem().m_undo_begun && modifiers == c_modifierNone && button == c_button_select && GlobalSelectionSystem().Mode() != SelectionSystem::eComponent ){
+               m_selector.testSelect_simpleM1( window_to_normalised_device( position, m_width, m_height ) );
+       }
+       getSelectionSystem().m_undo_begun = false;
 }
 void onModifierDown( ModifierFlags type ){
        m_selector.modifierEnable( type );
index 0d8625fa03ca5834f13d8f40248a826ee76688df..32713fa168c5893e03c9bde7e1ebf64911e97a6d 100644 (file)
@@ -1346,6 +1346,10 @@ void XYWnd::XY_MouseUp( int x, int y, unsigned int buttons ){
        else if ( m_bNewBrushDrag ) {
                m_bNewBrushDrag = false;
                NewBrushDrag_End( x, y );
+               if ( m_NewBrushDrag == 0 ) {
+                       //L button w/o created brush = tunnel selection
+                       m_window_observer->onMouseUp( WindowVector_forInteger( x, y ), button_for_flags( buttons ), modifiers_for_flags( buttons ) );
+               }
        }
        else
        {