From: Thomas Debesse Date: Sat, 4 Apr 2020 07:50:54 +0000 (+0200) Subject: radiant/xywindow: center background select error message on main window X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4850894c4bcdde654920195b7326cfa979ccd773;p=xonotic%2Fnetradiant.git radiant/xywindow: center background select error message on main window --- diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 54d121f3..6788f044 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -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 ); }