]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/mainframe.cpp
Merge commit '1644eeece07040927ced5628e3922774576c64c9' into master-merge
[xonotic/netradiant.git] / radiant / mainframe.cpp
index 6aa3e9f7bde6c5ad370bbd686a560b989daec6ec..5fc764591e9fd16f02996301cb928288996c70fe 100644 (file)
@@ -1454,6 +1454,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 ) );
@@ -1467,8 +1473,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());
+               }
        }
 }
 
@@ -1478,8 +1486,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());
+               }
        }
 }
 
@@ -2075,7 +2085,7 @@ ui::MenuItem 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 );
@@ -2976,6 +2986,13 @@ ui::Window create_splash(){
        image.show();
        window.add(image);
 
+       if( gtk_image_get_storage_type( image ) == GTK_IMAGE_PIXBUF ){
+               GdkBitmap* mask;
+               GdkPixbuf* pix = gtk_image_get_pixbuf( image );
+               gdk_pixbuf_render_pixmap_and_mask( pix, NULL, &mask, 255 );
+               gtk_widget_shape_combine_mask ( GTK_WIDGET( window ), mask, 0, 0 );
+       }
+
        window.dimensions(-1, -1);
        window.show();
 
@@ -3823,6 +3840,8 @@ void MainFrame_Construct(){
        GlobalPreferenceSystem().registerPreference( "XZWnd", make_property<WindowPositionTracker_String>(g_posXZWnd) );
 
        GlobalPreferenceSystem().registerPreference( "EnginePath", make_property_string( g_strEnginePath ) );
+
+       GlobalPreferenceSystem().registerPreference( "NudgeAfterClone", make_property_string( g_bNudgeAfterClone ) );
        if ( g_strEnginePath.empty() )
        {
                g_strEnginePath_was_empty_1st_start = true;
@@ -3862,6 +3881,7 @@ void MainFrame_Construct(){
 
        Layout_registerPreferencesPage();
        Paths_registerPreferencesPage();
+       PreferencesDialog_addSettingsPreferences( FreeCaller<void(PreferencesPage&), Nudge_constructPreferences>() );
 
        g_brushCount.setCountChangedCallback( makeCallbackF(QE_brushCountChanged) );
        g_entityCount.setCountChangedCallback( makeCallbackF(QE_entityCountChanged) );