mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-10 07:11:54 +00:00
Added 'Always use Caulk for new brushes' to preferences
This commit is contained in:
parent
60a0f49052
commit
449340a95e
3 changed files with 26 additions and 1 deletions
|
@ -131,6 +131,7 @@
|
|||
#define DOSLEEP_KEY "SleepMode"
|
||||
#define SUBDIVISIONS_KEY "Subdivisions"
|
||||
#define DEFAULTTEXURESCALE_KEY "DefaultTextureScale"
|
||||
#define CAULKNEWBRUSHES_KEY "CaulkNewBrushes"
|
||||
#define CLIPCAULK_KEY "ClipCaulk"
|
||||
#define PATCHSHOWBOUNDS_KEY "PatchShowBounds"
|
||||
#define NATIVEGUI_KEY "NativeGUI"
|
||||
|
@ -2582,6 +2583,14 @@ void PrefsDlg::BuildDialog(){
|
|||
(GtkAttachOptions) ( 0 ), 0, 0 );
|
||||
AddDialogData( entry, &m_fDefTextureScale, DLG_ENTRY_FLOAT );
|
||||
|
||||
|
||||
// caulk new brushes
|
||||
check = gtk_check_button_new_with_label( _( "Always use caulk for new brushes" ) );
|
||||
gtk_widget_show( check );
|
||||
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
|
||||
g_object_set_data( G_OBJECT( dialog ), "check_caulkbrush", check );
|
||||
AddDialogData( check, &m_bCaulkNewBrushes, DLG_CHECK_BOOL );
|
||||
|
||||
// Add the page to the notebook
|
||||
gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
|
||||
|
||||
|
@ -3045,6 +3054,7 @@ void PrefsDlg::LoadPrefs(){
|
|||
mLocalPrefs.GetPref( SELECTMODELS_KEY, &m_bSelectModels, TRUE );
|
||||
mLocalPrefs.GetPref( SHADERLISTONLY_KEY, &m_bTexturesShaderlistOnly, FALSE );
|
||||
mLocalPrefs.GetPref( DEFAULTTEXURESCALE_KEY, &m_fDefTextureScale, g_pGameDescription->mTextureDefaultScale );
|
||||
mLocalPrefs.GetPref( CAULKNEWBRUSHES_KEY, &m_bCaulkNewBrushes, TRUE );
|
||||
mLocalPrefs.GetPref( SUBDIVISIONS_KEY, &m_nSubdivisions, SUBDIVISIONS_DEF );
|
||||
mLocalPrefs.GetPref( CLIPCAULK_KEY, &m_bClipCaulk, FALSE );
|
||||
mLocalPrefs.GetPref( SNAPTTOGRID_KEY, &m_bSnapTToGrid, FALSE );
|
||||
|
|
|
@ -641,6 +641,7 @@ bool m_bGLLighting;
|
|||
bool m_bTexturesShaderlistOnly;
|
||||
int m_nSubdivisions;
|
||||
float m_fDefTextureScale;
|
||||
bool m_bCaulkNewBrushes;
|
||||
bool m_bFloatingZ;
|
||||
bool m_bLatchedFloatingZ;
|
||||
// Gef: Kyro GL_POINT workaround
|
||||
|
|
|
@ -1596,7 +1596,21 @@ void XYWnd::NewBrushDrag( int x, int y ){
|
|||
}
|
||||
}
|
||||
|
||||
n = Brush_Create( mins, maxs, &g_qeglobals.d_texturewin.texdef );
|
||||
// Caulk the new brush
|
||||
if ( g_PrefsDlg.m_bCaulkNewBrushes == TRUE ) {
|
||||
texdef_t tex;
|
||||
IShader *shad = QERApp_Shader_ForName( "textures/common/caulk" );
|
||||
|
||||
tex.SetName( shad->getName() );
|
||||
tex.scale[0] = g_PrefsDlg.m_fDefTextureScale;
|
||||
tex.scale[1] = g_PrefsDlg.m_fDefTextureScale;
|
||||
tex.flags = shad->getFlags();
|
||||
|
||||
n = Brush_Create( mins, maxs, &tex );
|
||||
} else {
|
||||
n = Brush_Create( mins, maxs, &g_qeglobals.d_texturewin.texdef );
|
||||
}
|
||||
|
||||
if ( !n ) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue