]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit '54a2bda443aace9c00a1615af10cc1dc8b1f0cd1' into master-merge
authorThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 04:29:46 +0000 (06:29 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 04:29:46 +0000 (06:29 +0200)
1  2 
libs/picomodel/pm_mdc.c
radiant/camwindow.cpp
radiant/mainframe.cpp
radiant/preferences.cpp
radiant/preferences.h
radiant/texwindow.cpp
radiant/xywindow.cpp
tools/quake3/common/scriplib.c
tools/quake3/q3map2/portals.c

Simple merge
Simple merge
index be017b027119e952e32cce299e7c27f03a25526a,4e4efa67fb9ac9cee605ad1d2ef517eaeaef29b9..9148ab0a3b80556119b64707573208736691420c
@@@ -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 ));
  }
  };
  
index efff8a087d8cf594ee033d142fcf42d45e55f6ab,4c19f55dcd787db315f45372271408f33cf78900..53e3fa80c1f0d35a429d5e32f972cdd5f7de43e5
@@@ -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<const char*>::iterator i = g_restart_required.begin(); i != g_restart_required.end(); ++i )
-               {
-                       message << ( *i ) << '\n';
-               }
+                       for ( std::vector<const char*>::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();
                }
        }
  }
index a7739d4dce474fa6bdae9165e85422097c68d153,9051097b9deab44b8b8c9ee504c2827172e42ec9..7ce4943ad26b3e46d5a528ff01b8f1cfe37208e1
@@@ -270,8 -252,7 +270,8 @@@ std::list<CGameDescription*> 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
index 282ae0e7993bd7662108ffd904f90cebf16d3002,00969834e90e47146e3a65723589043bb39c1885..11ea9cb8aefc372ea52446b24bb0aa6334903640
@@@ -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<int>( event->x ), static_cast<int>( event->y ) );
  
Simple merge
Simple merge
Simple merge