]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Reload textures in the currently selected directory when shaders are reloaded
authorMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 19 Jul 2015 10:42:16 +0000 (12:42 +0200)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 19 Jul 2015 10:42:16 +0000 (12:42 +0200)
radiant/texwindow.cpp

index 94717d0949bd75a9d9b913c62b72ef40ee42bdc3..142d3c49a7e06d37fa445a9acf0de5f7cad4b44d 100644 (file)
@@ -2310,6 +2310,23 @@ void RefreshShaders(){
        ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Shaders" );
        GlobalShaderSystem().refresh();
        UpdateAllWindows();
+       GtkTreeSelection* selection = gtk_tree_view_get_selection((GtkTreeView*)GlobalTextureBrowser().m_treeViewTree);
+       GtkTreeModel* model = NULL;
+       GtkTreeIter iter;
+       if ( gtk_tree_selection_get_selected (selection, &model, &iter) )
+       {
+               gchar dirName[1024];
+
+               gchar* buffer;
+               gtk_tree_model_get( model, &iter, 0, &buffer, -1 );
+               strcpy( dirName, buffer );
+               g_free( buffer );
+               if ( !TextureBrowser_showWads() ) {
+                       strcat( dirName, "/" );
+               }
+               TextureBrowser_ShowDirectory( GlobalTextureBrowser(), dirName );
+               TextureBrowser_queueDraw( GlobalTextureBrowser() );
+       }
 }
 
 void TextureBrowser_ToggleShowShaders(){