diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 815a90ba..94dd724c 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -2716,18 +2716,24 @@ void MainFrame::Create(){ m_pTexWnd = new TexWnd(); { GtkWidget* frame = create_framed_texwnd( m_pTexWnd ); - gint pos = 0; - GtkWidget* texDirList = create_texdirlist_widget( &pos ); + if( g_PrefsDlg.m_bShowTexDirList ) + { + gint pos = 0; + GtkWidget* texDirList = create_texdirlist_widget( &pos ); - GtkWidget* texSplit = gtk_paned_new( GTK_ORIENTATION_HORIZONTAL ); + GtkWidget* texSplit = gtk_paned_new( GTK_ORIENTATION_HORIZONTAL ); - gtk_paned_pack2( GTK_PANED( vsplit2 ), texSplit, TRUE, FALSE ); - gtk_paned_add1( GTK_PANED( texSplit ), texDirList ); - gtk_paned_add2( GTK_PANED( texSplit ), frame ); + gtk_paned_pack2( GTK_PANED( vsplit2 ), texSplit, TRUE, FALSE ); + gtk_paned_add1( GTK_PANED( texSplit ), texDirList ); + gtk_paned_add2( GTK_PANED( texSplit ), frame ); - gtk_paned_set_position( GTK_PANED( texSplit ), pos ); + gtk_paned_set_position( GTK_PANED( texSplit ), pos ); - gtk_widget_show( texSplit ); + gtk_widget_show( texSplit ); + } else + { + gtk_paned_pack2( GTK_PANED( vsplit2 ), frame, TRUE, TRUE ); + } } // console @@ -4680,6 +4686,7 @@ void MainFrame::OnPrefs() { bool bPluginToolbar = g_PrefsDlg.m_bPluginToolbar; bool bDetachableMenus = g_PrefsDlg.m_bDetachableMenus; bool bFloatingZ = g_PrefsDlg.m_bFloatingZ; + bool bShowTexDirList = g_PrefsDlg.m_bShowTexDirList; g_PrefsDlg.LoadPrefs(); @@ -4691,7 +4698,8 @@ void MainFrame::OnPrefs() { (g_PrefsDlg.m_bLatchedPluginToolbar != bPluginToolbar ) || (g_PrefsDlg.m_nLatchedShader != nShader ) || (g_PrefsDlg.m_nLatchedTextureQuality != nTextureQuality ) || - (g_PrefsDlg.m_bLatchedFloatingZ != bFloatingZ)) { + (g_PrefsDlg.m_bLatchedFloatingZ != bFloatingZ ) || + (g_PrefsDlg.m_bShowTexDirList != bShowTexDirList)) { gtk_MessageBoxNew(m_pWidget, "You must restart Radiant for the " "changes to take effect.", "Restart Radiant", MB_OK | MB_ICONINFORMATION); diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 916a4682..52ab68c7 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -119,6 +119,7 @@ #define SHADERTEST_KEY "ShaderTest" #define GLLIGHTING_KEY "UseGLLighting" #define LOADSHADERS_KEY "LoadShaders" +#define SHOWTEXDIRLIST_KEY "ShowTextureDirectoryList" #define NOSTIPPLE_KEY "NoStipple" #define UNDOLEVELS_KEY "UndoLevels" #define VERTEXMODE_KEY "VertexSplit" @@ -1695,6 +1696,11 @@ void PrefsDlg::BuildDialog(){ gtk_tree_store_append( store, &tab, &group ); gtk_tree_store_set( store, &tab, 0, _( "Texture Settings" ), 1, (gpointer)PTAB_TEXTURE, -1 ); } + { + GtkTreeIter tab; + gtk_tree_store_append( store, &tab, &group ); + gtk_tree_store_set( store, &tab, 0, _( "Texture Directory List" ), 1, (gpointer)PTAB_TEXTURE_DIR, -1 ); + } } { @@ -2126,6 +2132,28 @@ void PrefsDlg::BuildDialog(){ // Add the page to the notebook gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel ); + + /******** Texture dir list group *********/ + preflabel = gtk_label_new( _( "Texture directory list" ) ); + gtk_widget_show( preflabel ); + pageframe = gtk_frame_new( _( "Texture directory list" ) ); + gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 ); + gtk_widget_show( pageframe ); + vbox = gtk_box_new( GTK_ORIENTATION_VERTICAL, 5 ); + gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 ); + gtk_container_add( GTK_CONTAINER( pageframe ), vbox ); + gtk_widget_show( vbox ); + + check = gtk_check_button_new_with_label( _( "Show Texture Directory List" ) ); + gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); + gtk_widget_show( check ); + AddDialogData( check, &m_bShowTexDirList, DLG_CHECK_BOOL ); + + + // Add the page to the notebook + gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel ); + + /******** Layout group *********/ preflabel = gtk_label_new( _( "Layout" ) ); gtk_widget_show( preflabel ); @@ -2988,6 +3016,9 @@ void PrefsDlg::LoadPrefs(){ mLocalPrefs.GetPref( LOADSHADERS_KEY, &m_nLatchedShader, 0 ); m_nShader = m_nLatchedShader; + + mLocalPrefs.GetPref( SHOWTEXDIRLIST_KEY, &m_bShowTexDirList, TRUE ); + mLocalPrefs.GetPref( NOCLAMP_KEY, &m_bNoClamp, FALSE ); mLocalPrefs.GetPref( SNAP_KEY, &m_bSnap, TRUE ); mLocalPrefs.GetPref( USERINI_KEY, &m_strUserPath, "" ); diff --git a/radiant/preferences.h b/radiant/preferences.h index 975c59ad..ff560da9 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -509,7 +509,7 @@ enum {SHADER_NONE = 0, SHADER_COMMON, SHADER_ALL}; // Gef: updated preferences dialog /*! Preference notebook page numbers */ -enum {PTAB_FRONT = 0, PTAB_GAME_SETTINGS, PTAB_2D, PTAB_CAMERA, PTAB_TEXTURE, PTAB_LAYOUT, PTAB_MOUSE, +enum {PTAB_FRONT = 0, PTAB_GAME_SETTINGS, PTAB_2D, PTAB_CAMERA, PTAB_TEXTURE, PTAB_TEXTURE_DIR, PTAB_LAYOUT, PTAB_MOUSE, PTAB_EDITING, PTAB_STARTUP, PTAB_PATHS, PTAB_BRUSH, PTAB_MISC, PTAB_BSPMONITOR} pref_tabs; GtkWidget *notebook; @@ -723,6 +723,8 @@ int m_nLatchedTextureQuality; // texture compression format int m_nTextureCompressionFormat; +bool m_bShowTexDirList; + int m_nLightRadiuses; bool m_bQ3Map2Texturing;