]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
ctrl+m2=clipper
authorGarux <garux@mail.ru>
Wed, 2 Aug 2017 06:02:12 +0000 (09:02 +0300)
committerGarux <garux@mail.ru>
Wed, 2 Aug 2017 06:02:12 +0000 (09:02 +0300)
radiant/mainframe.h
radiant/xywindow.cpp

index 0b008a6b4625ff38c0829ebfb6b4c55796aa7874..921d3a1442bdd81c42d002f92256fb1975bfeeab 100644 (file)
@@ -232,6 +232,7 @@ void UpdateAllWindows();
 
 
 void ClipperChangeNotify();
+void ClipperMode();
 
 void DefaultMode();
 
index ad0495d9a1ec17a75cdd9e5881cdaf31902d1dfe..b32fb78a6a30dc3544e302e2b86324977e750452 100644 (file)
@@ -110,6 +110,7 @@ void Draw( const char *label, float scale );
 VIEWTYPE g_clip_viewtype;
 bool g_bSwitch = true;
 bool g_clip_useCaulk = false;
+bool g_quick_clipper = false;
 ClipPoint g_Clip1;
 ClipPoint g_Clip2;
 ClipPoint g_Clip3;
@@ -258,6 +259,10 @@ void Clip(){
                g_Clip3.Reset();
                Clip_Update();
                ClipperChangeNotify();
+               if( g_quick_clipper ){
+                       g_quick_clipper = false;
+                       ClipperMode();
+               }
        }
 }
 
@@ -272,6 +277,10 @@ void SplitClip(){
                g_Clip3.Reset();
                Clip_Update();
                ClipperChangeNotify();
+               if( g_quick_clipper ){
+                       g_quick_clipper = false;
+                       ClipperMode();
+               }
        }
 }
 
@@ -923,6 +932,10 @@ unsigned int Clipper_buttons(){
        return RAD_LBUTTON;
 }
 
+unsigned int Clipper_quick_buttons(){
+       return RAD_RBUTTON | RAD_CONTROL;
+}
+
 void XYWnd::DropClipPoint( int pointx, int pointy ){
        Vector3 point;
 
@@ -1298,7 +1311,12 @@ void XYWnd::XY_MouseDown( int x, int y, unsigned int buttons ){
        else if ( buttons == Zoom_buttons() ) {
                Zoom_Begin();
        }
-       else if ( ClipMode() && buttons == Clipper_buttons() ) {
+       else if ( ClipMode() && ( buttons == Clipper_buttons() || buttons == Clipper_quick_buttons() ) ) {
+               Clipper_OnLButtonDown( x, y );
+       }
+       else if ( !ClipMode() && buttons == Clipper_quick_buttons() ) {
+               ClipperMode();
+               g_quick_clipper = true;
                Clipper_OnLButtonDown( x, y );
        }
        else if ( buttons == NewBrushDrag_buttons() && GlobalSelectionSystem().countSelected() == 0 ) {
@@ -1326,7 +1344,7 @@ void XYWnd::XY_MouseUp( int x, int y, unsigned int buttons ){
        else if ( m_zoom_started ) {
                Zoom_End();
        }
-       else if ( ClipMode() && buttons == Clipper_buttons() ) {
+       else if ( ClipMode() && ( buttons == Clipper_buttons() || buttons == Clipper_quick_buttons() ) ) {
                Clipper_OnLButtonUp( x, y );
        }
        else if ( m_bNewBrushDrag ) {