]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Radiant:
authorGarux <garux@mail.ru>
Wed, 2 Aug 2017 06:15:07 +0000 (09:15 +0300)
committerGarux <garux@mail.ru>
Wed, 2 Aug 2017 06:15:07 +0000 (09:15 +0300)
misc...
* fix: update projections on prev/nextleakspot
* use active projection for prev/nextleakspot tracking
* fix of: no redo available after ( nothing selected + M1 click ) in 2D
* fix: nudge left, right, up, down commands work in scale, rotate, clipper manipulator modes
* deprecated 'Disable system menu on popup windows' preference, was doing nothing
* preference: Nudge selected after duplication (def = no)
* preference: Left mouse click tunnel selector (def = yes)

radiant/mainframe.cpp
radiant/multimon.cpp
radiant/points.cpp
radiant/selection.cpp
radiant/xywindow.cpp

index 2f3db714163feb41135e3a85d0bd08c075bc399e..68fb2b618f3c2711f994ec7e3a8ce27ede4ec322 100644 (file)
@@ -1232,6 +1232,12 @@ Vector3 AxisBase_axisForDirection( const AxisBase& axes, ENudgeDirection directi
        return Vector3( 0, 0, 0 );
 }
 
+bool g_bNudgeAfterClone = false;
+
+void Nudge_constructPreferences( PreferencesPage& page ){
+       page.appendCheckBox( "", "Nudge selected after duplication", g_bNudgeAfterClone );
+}
+
 void NudgeSelection( ENudgeDirection direction, float fAmount, VIEWTYPE viewtype ){
        AxisBase axes( AxisBase_forViewType( viewtype ) );
        Vector3 view_direction( vector3_negated( axes.z ) );
@@ -1245,8 +1251,10 @@ void Selection_Clone(){
 
                Scene_Clone_Selected( GlobalSceneGraph(), false );
 
-               //NudgeSelection(eNudgeRight, GetGridSize(), GlobalXYWnd_getCurrentViewType());
-               //NudgeSelection(eNudgeDown, GetGridSize(), GlobalXYWnd_getCurrentViewType());
+               if( g_bNudgeAfterClone ){
+                       NudgeSelection(eNudgeRight, GetGridSize(), GlobalXYWnd_getCurrentViewType());
+                       NudgeSelection(eNudgeDown, GetGridSize(), GlobalXYWnd_getCurrentViewType());
+               }
        }
 }
 
@@ -1256,8 +1264,10 @@ void Selection_Clone_MakeUnique(){
 
                Scene_Clone_Selected( GlobalSceneGraph(), true );
 
-               //NudgeSelection(eNudgeRight, GetGridSize(), GlobalXYWnd_getCurrentViewType());
-               //NudgeSelection(eNudgeDown, GetGridSize(), GlobalXYWnd_getCurrentViewType());
+               if( g_bNudgeAfterClone ){
+                       NudgeSelection(eNudgeRight, GetGridSize(), GlobalXYWnd_getCurrentViewType());
+                       NudgeSelection(eNudgeDown, GetGridSize(), GlobalXYWnd_getCurrentViewType());
+               }
        }
 }
 
@@ -1848,7 +1858,7 @@ GtkMenuItem* create_file_menu(){
 //     menu_separator( menu );
        create_menu_item_with_mnemonic( menu, "Pro_ject settings...", "ProjectSettings" );
        //menu_separator( menu );
-       create_menu_item_with_mnemonic( menu, "_Pointfile...", "TogglePointfile" );
+       create_menu_item_with_mnemonic( menu, "_Pointfile", "TogglePointfile" );
        menu_separator( menu );
        MRU_constructMenu( menu );
        menu_separator( menu );
@@ -3513,6 +3523,8 @@ void MainFrame_Construct(){
        GlobalPreferenceSystem().registerPreference( "XZWnd", WindowPositionTrackerImportStringCaller( g_posXZWnd ), WindowPositionTrackerExportStringCaller( g_posXZWnd ) );
 
        GlobalPreferenceSystem().registerPreference( "EnginePath", CopiedStringImportStringCaller( g_strEnginePath ), CopiedStringExportStringCaller( g_strEnginePath ) );
+
+       GlobalPreferenceSystem().registerPreference( "NudgeAfterClone", BoolImportStringCaller( g_bNudgeAfterClone ), BoolExportStringCaller( g_bNudgeAfterClone ) );
        if ( g_strEnginePath.empty() )
        {
                g_strEnginePath_was_empty_1st_start = true;
@@ -3544,6 +3556,7 @@ void MainFrame_Construct(){
 
        Layout_registerPreferencesPage();
        Paths_registerPreferencesPage();
+       PreferencesDialog_addSettingsPreferences( FreeCaller1<PreferencesPage&, Nudge_constructPreferences>() );
 
        g_brushCount.setCountChangedCallback( FreeCaller<QE_brushCountChanged>() );
        g_entityCount.setCountChangedCallback( FreeCaller<QE_entityCountChanged>() );
index 04407591778e78f36bab95aa356dde4d8ffb26e9..33ae89f128c3508647389a45b0ebd21adee31b36 100644 (file)
 
 multimon_globals_t g_multimon_globals;
 
-LatchedBool g_Multimon_enableSysMenuPopups( false, "Floating windows sysmenu icons" );
+//LatchedBool g_Multimon_enableSysMenuPopups( false, "Floating windows sysmenu icons" );
 
 void MultiMonitor_constructPreferences( PreferencesPage& page ){
        GtkWidget* primary_monitor = page.appendCheckBox( "Multi Monitor", "Start on Primary Monitor", g_multimon_globals.m_bStartOnPrimMon );
-       GtkWidget* popup = page.appendCheckBox(
-               "", "Disable system menu on popup windows",
-               LatchedBoolImportCaller( g_Multimon_enableSysMenuPopups ),
-               BoolExportCaller( g_Multimon_enableSysMenuPopups.m_latched )
-               );
-       Widget_connectToggleDependency( popup, primary_monitor );
+//     GtkWidget* popup = page.appendCheckBox(
+//             "", "Disable system menu on popup windows",
+//             LatchedBoolImportCaller( g_Multimon_enableSysMenuPopups ),
+//             BoolExportCaller( g_Multimon_enableSysMenuPopups.m_latched )
+//             );
+//     Widget_connectToggleDependency( popup, primary_monitor );
 }
 
 #include "preferencesystem.h"
@@ -88,9 +88,9 @@ void MultiMon_Construct(){
        }
 
        GlobalPreferenceSystem().registerPreference( "StartOnPrimMon", BoolImportStringCaller( g_multimon_globals.m_bStartOnPrimMon ), BoolExportStringCaller( g_multimon_globals.m_bStartOnPrimMon ) );
-       GlobalPreferenceSystem().registerPreference( "NoSysMenuPopups", BoolImportStringCaller( g_Multimon_enableSysMenuPopups.m_latched ), BoolExportStringCaller( g_Multimon_enableSysMenuPopups.m_latched ) );
+//     GlobalPreferenceSystem().registerPreference( "NoSysMenuPopups", BoolImportStringCaller( g_Multimon_enableSysMenuPopups.m_latched ), BoolExportStringCaller( g_Multimon_enableSysMenuPopups.m_latched ) );
 
-       g_Multimon_enableSysMenuPopups.useLatched();
+//     g_Multimon_enableSysMenuPopups.useLatched();
 
        PreferencesDialog_addInterfacePreferences( FreeCaller1<PreferencesPage&, MultiMonitor_constructPreferences>() );
 }
index 342c5be0fc09ed999fb3b4437574499d1831734b..0a0c3c0fca4331a019501eca7ca06a5715bad2a9 100644 (file)
@@ -193,7 +193,8 @@ void Pointfile_Next( void ){
 
        CamWnd& camwnd = *g_pParentWnd->GetCamWnd();
        Camera_setOrigin( camwnd, *i );
-       g_pParentWnd->GetXYWnd()->SetOrigin( *i );
+       g_pParentWnd->ActiveXY()->SetOrigin( *i );
+       g_pParentWnd->ActiveXY()->queueDraw();
        {
                Vector3 dir( vector3_normalised( vector3_subtracted( *( ++i ), Camera_getOrigin( camwnd ) ) ) );
                Vector3 angles( Camera_getAngles( camwnd ) );
@@ -218,7 +219,8 @@ void Pointfile_Prev( void ){
 
        CamWnd& camwnd = *g_pParentWnd->GetCamWnd();
        Camera_setOrigin( camwnd, *i );
-       g_pParentWnd->GetXYWnd()->SetOrigin( *i );
+       g_pParentWnd->ActiveXY()->SetOrigin( *i );
+       g_pParentWnd->ActiveXY()->queueDraw();
        {
                Vector3 dir( vector3_normalised( vector3_subtracted( *( ++i ), Camera_getOrigin( camwnd ) ) ) );
                Vector3 angles( Camera_getAngles( camwnd ) );
index 96cde65b57c916edd3b47f6763360d5dd96b9377..805b6ed7007f5f5d3bd9dabbb8359a951c6c4718 100644 (file)
@@ -3466,9 +3466,9 @@ void MoveSelected( const View& view, const float device_point[2], bool snap, boo
 
 /// \todo Support view-dependent nudge.
 void NudgeManipulator( const Vector3& nudge, const Vector3& view ){
-       if ( ManipulatorMode() == eTranslate || ManipulatorMode() == eDrag ) {
+//     if ( ManipulatorMode() == eTranslate || ManipulatorMode() == eDrag ) {
                translateSelected( nudge );
-       }
+//     }
 }
 
 void endMove();
@@ -3959,8 +3959,11 @@ void RadiantSelectionSystem::renderSolid( Renderer& renderer, const VolumeTest&
 #include "preferencesystem.h"
 #include "preferences.h"
 
+bool g_bLeftMouseClickSelector = true;
+
 void SelectionSystem_constructPreferences( PreferencesPage& page ){
        page.appendCheckBox( "", "Prefer point entities in 2D", getSelectionSystem().m_bPreferPointEntsIn2D );
+       page.appendCheckBox( "", "Left mouse click tunnel selector", g_bLeftMouseClickSelector );
 }
 void SelectionSystem_constructPage( PreferenceGroup& group ){
        PreferencesPage page( group.createPage( "Selection", "Selection System Settings" ) );
@@ -3988,6 +3991,7 @@ void SelectionSystem_Construct(){
        GlobalShaderCache().attachRenderable( getSelectionSystem() );
 
        GlobalPreferenceSystem().registerPreference( "PreferPointEntsIn2D", BoolImportStringCaller( getSelectionSystem().m_bPreferPointEntsIn2D ), BoolExportStringCaller( getSelectionSystem().m_bPreferPointEntsIn2D ) );
+       GlobalPreferenceSystem().registerPreference( "LeftMouseClickSelector", BoolImportStringCaller( g_bLeftMouseClickSelector ), BoolExportStringCaller( g_bLeftMouseClickSelector ) );
        SelectionSystem_registerPreferencesPage();
 }
 
@@ -4131,7 +4135,9 @@ void testSelect_simpleM1( DeviceVector position ){
                modifier = RadiantSelectionSystem::eCycle;
        }
        getSelectionSystem().SelectPoint( *m_view, &position[0], &m_epsilon[0], modifier, false );*/
-       getSelectionSystem().SelectPoint( *m_view, &position[0], &m_epsilon[0], m_mouseMoved ? RadiantSelectionSystem::eReplace : RadiantSelectionSystem::eCycle, false );
+       if( g_bLeftMouseClickSelector ){
+               getSelectionSystem().SelectPoint( *m_view, &position[0], &m_epsilon[0], m_mouseMoved ? RadiantSelectionSystem::eReplace : RadiantSelectionSystem::eCycle, false );
+       }
        m_start = m_current = device_constrained( position );
 }
 
@@ -4287,12 +4293,7 @@ void onMouseDown( const WindowVector& position, ButtonIdentifier button, Modifie
                }
                else
                {
-                       if ( button == c_button_select ) {
-                               m_selector.m_mouse2 = false;
-                       }
-                       else{
-                               m_selector.m_mouse2 = true;
-                       }
+                       m_selector.m_mouse2 = ( button == c_button_select ) ? false : true;
                        m_selector.mouseDown( devicePosition );
                        g_mouseMovedCallback.insert( MouseEventCallback( Selector_::MouseMovedCaller( m_selector ) ) );
                        g_mouseUpCallback.insert( MouseEventCallback( Selector_::MouseUpCaller( m_selector ) ) );
index bab35a07b354c088e48fa37fa87a27eecd095981..f82ab0d2b7ec962c17700889e153d8950b2eceed 100644 (file)
@@ -1090,7 +1090,6 @@ void XYWnd::NewBrushDrag_Begin( int x, int y ){
        m_nNewBrushPressy = y;
 
        m_bNewBrushDrag = true;
-       GlobalUndoSystem().start();
 }
 
 void XYWnd::NewBrushDrag_End( int x, int y ){
@@ -1128,6 +1127,7 @@ void XYWnd::NewBrushDrag( int x, int y ){
        }
 
        if ( m_NewBrushDrag == 0 ) {
+               GlobalUndoSystem().start();
                NodeSmartReference node( GlobalBrushCreator().createBrush() );
                Node_getTraversable( Map_FindOrInsertWorldspawn( g_map ) )->insert( node );