From: Thomas Debesse Date: Tue, 21 Jun 2022 04:29:46 +0000 (+0200) Subject: Merge commit '54a2bda443aace9c00a1615af10cc1dc8b1f0cd1' into master-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a4f0ed00cccaa61ef5094dfaea610dcc62b55a6b;p=xonotic%2Fnetradiant.git Merge commit '54a2bda443aace9c00a1615af10cc1dc8b1f0cd1' into master-merge --- a4f0ed00cccaa61ef5094dfaea610dcc62b55a6b diff --cc radiant/mainframe.cpp index be017b02,4e4efa67..9148ab0a --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@@ -625,12 -600,28 +625,28 @@@ ui::Window BuildDialog() auto vbox2 = create_dialog_vbox( 0, 4 ); frame.add(vbox2); + const char* engine; + #if defined( WIN32 ) + engine = g_pGameDescription->getRequiredKeyValue( "engine_win32" ); + #elif defined( __linux__ ) || defined ( __FreeBSD__ ) + engine = g_pGameDescription->getRequiredKeyValue( "engine_linux" ); + #elif defined( __APPLE__ ) + engine = g_pGameDescription->getRequiredKeyValue( "engine_macos" ); + #else + #error "unsupported platform" + #endif + StringOutputStream text( 256 ); + text << "Select directory, where game executable sits (typically \"" << engine << "\")\n"; + GtkLabel* label = GTK_LABEL( gtk_label_new( text.c_str() ) ); + gtk_widget_show( GTK_WIDGET( label ) ); + gtk_container_add( GTK_CONTAINER( vbox2 ), GTK_WIDGET( label ) ); + { - PreferencesPage preferencesPage( *this, vbox2 ); - Paths_constructPreferences( preferencesPage ); + PreferencesPage page( *this, vbox2 ); + Paths_constructBasicPreferences( page ); } - return ui::Window(create_simple_modal_dialog_window( "Engine Path Not Found", m_modal, frame )); + return ui::Window(create_simple_modal_dialog_window( "Engine Path Configuration", m_modal, frame )); } }; diff --cc radiant/preferences.cpp index efff8a08,4c19f55d..53e3fa80 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@@ -953,29 -897,18 +953,29 @@@ void PreferencesDialog_restartRequired g_restart_required.push_back( staticName ); } -void PreferencesDialog_showDialog(){ - //if ( ConfirmModified( "Edit Preferences" ) && g_Preferences.DoModal() == eIDOK ) { - if ( g_Preferences.DoModal() == eIDOK ) { +bool PreferencesDialog_isRestartRequired(){ + return !g_restart_required.empty(); +} + +void PreferencesDialog_restartIfRequired(){ - if ( !g_restart_required.empty() ) { - StringOutputStream message( 256 ); + if ( !g_restart_required.empty() ) { + StringOutputStream message( 256 ); - message << "Preference changes require a restart:\n"; + message << "Preference changes require a restart:\n\n"; + - for ( std::vector::iterator i = g_restart_required.begin(); i != g_restart_required.end(); ++i ) - { - message << ( *i ) << '\n'; - } + for ( std::vector::iterator i = g_restart_required.begin(); i != g_restart_required.end(); ++i ) + { + message << ( *i ) << '\n'; + } - ui::alert( MainFrame_getWindow(), message.c_str() ); + + message << "\nRestart now?"; + + auto ret = ui::alert( MainFrame_getWindow(), message.c_str(), "Restart " RADIANT_NAME "?", ui::alert_type::YESNO, ui::alert_icon::Question ); + - g_restart_required.clear(); + g_restart_required.clear(); + + if ( ret == ui::alert_response::YES ) { + g_GamesDialog.m_bSkipGamePromptOnce = true; + Radiant_Restart(); } } } diff --cc radiant/preferences.h index a7739d4d,9051097b..7ce4943a --- a/radiant/preferences.h +++ b/radiant/preferences.h @@@ -270,8 -252,7 +270,8 @@@ std::list mGames CGameDialog() : m_sGameFile( "" ), - m_bGamePrompt( true ), + m_bGamePrompt( false ), + m_bSkipGamePromptOnce( false ), m_bForceLogConsole( false ){ } virtual ~CGameDialog(); @@@ -357,14 -338,10 +357,14 @@@ public ui::Widget m_notebook{ui::null}; - virtual ~PrefsDlg() { + virtual ~PrefsDlg(){ + if (m_rc_path) { - g_string_free( m_rc_path, true ); + g_string_free( m_rc_path, true ); + } + if (m_inipath) { - g_string_free( m_inipath, true ); - } + g_string_free( m_inipath, true ); + } +} /*! path for global settings diff --cc radiant/texwindow.cpp index 282ae0e7,00969834..11ea9cb8 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@@ -888,23 -868,12 +888,24 @@@ void visit( const char* minor, const _Q }; void TextureBrowser_ShowDirectory( TextureBrowser& textureBrowser, const char* directory ){ + textureBrowser.m_searchedTags = false; if ( TextureBrowser_showWads() ) { + g_TextureBrowser_currentDirectory = directory; + TextureBrowser_heightChanged( textureBrowser ); + Archive* archive = GlobalFileSystem().getArchive( directory ); - ASSERT_NOTNULL( archive ); + if ( archive != nullptr ) + { LoadShaderVisitor visitor; archive->forEachFile( Archive::VisitorFunc( visitor, Archive::eFiles, 0 ), "textures/" ); + + // Doom3-like dds/ prefix (used by DarkPlaces). + archive->forEachFile( Archive::VisitorFunc( visitor, Archive::eFiles, 0 ), "dds/textures/" ); + } + else if ( extension_equal_i( path_get_extension( directory ), "wad" ) ) + { + globalErrorStream() << "Failed to load " << directory << "\n"; + } } else { @@@ -1535,8 -1478,9 +1536,9 @@@ void BuildStoreAvailableTags( ui::Lis gboolean TextureBrowser_button_press( ui::Widget widget, GdkEventButton* event, TextureBrowser* textureBrowser ){ if ( event->type == GDK_BUTTON_PRESS ) { + gtk_widget_grab_focus( widget ); if ( event->button == 3 ) { - if ( GlobalTextureBrowser().m_tags ) { + if ( textureBrowser->m_tags ) { textureBrowser->m_rmbSelected = true; TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast( event->x ), static_cast( event->y ) );