]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
radiant/xywindow: center background select error message on main window
authorThomas Debesse <dev@illwieckz.net>
Sat, 4 Apr 2020 07:50:54 +0000 (09:50 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sat, 4 Apr 2020 07:54:55 +0000 (09:54 +0200)
radiant/xywindow.cpp

index 54d121f3907975f9205bcc95a43e5e6f21f7264d..6788f04453b1c9271759973f82d8a02ea0d8b550 100644 (file)
@@ -1487,14 +1487,19 @@ void XYWnd::XY_DisableBackground( void ){
 
 void WXY_BackgroundSelect( void ){
        bool brushesSelected = Scene_countSelectedBrushes( GlobalSceneGraph() ) != 0;
+
+       ui::Window main_window = MainFrame_getWindow();
+
        if ( !brushesSelected ) {
-               ui::alert( ui::root, "You have to select some brushes to get the bounding box for.\n",
+               ui::alert( main_window, "You have to select some brushes to get the bounding box for.\n",
                                                "No selection", ui::alert_type::OK, ui::alert_icon::Error );
                return;
        }
 
-       const char *filename = MainFrame_getWindow().file_dialog( TRUE, "Background Image", NULL, NULL );
+       const char *filename = main_window.file_dialog( TRUE, "Background Image", NULL, NULL );
+
        g_pParentWnd->ActiveXY()->XY_DisableBackground();
+
        if ( filename ) {
                g_pParentWnd->ActiveXY()->XY_LoadBackgroundImage( filename );
        }