From: Garux Date: Wed, 2 Aug 2017 06:02:12 +0000 (+0300) Subject: ctrl+m2=clipper X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=09b97bb415e380e5eaf6e2f4acbdc7f740494b41;p=xonotic%2Fnetradiant.git ctrl+m2=clipper --- diff --git a/radiant/mainframe.h b/radiant/mainframe.h index 0b008a6b..921d3a14 100644 --- a/radiant/mainframe.h +++ b/radiant/mainframe.h @@ -232,6 +232,7 @@ void UpdateAllWindows(); void ClipperChangeNotify(); +void ClipperMode(); void DefaultMode(); diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index ad0495d9..b32fb78a 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -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 ) {