From: Mattia Basaglia Date: Sun, 19 Jul 2015 10:42:16 +0000 (+0200) Subject: Reload textures in the currently selected directory when shaders are reloaded X-Git-Tag: xonotic-v0.8.1~1^2~4^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ac5c07b82cc35cda5d821957f3f046623d2e33e5;p=xonotic%2Fnetradiant.git Reload textures in the currently selected directory when shaders are reloaded --- diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 94717d09..142d3c49 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -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(){