mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-24 02:11:20 +00:00
Added a toggle button to the main toolbar for creating Structural/Detail brushes
This commit is contained in:
parent
449340a95e
commit
949547b125
6 changed files with 51 additions and 3 deletions
|
@ -874,6 +874,8 @@ typedef struct
|
||||||
// set to true after OpenGL has been initialized and extensions have been tested
|
// set to true after OpenGL has been initialized and extensions have been tested
|
||||||
bool m_bOpenGLReady;
|
bool m_bOpenGLReady;
|
||||||
|
|
||||||
|
// set this to true and any new brushes will be detail by default (else they are structural)
|
||||||
|
bool m_bMakeDetail;
|
||||||
} QEGlobals_t;
|
} QEGlobals_t;
|
||||||
|
|
||||||
#endif // _QERTYPES_H_
|
#endif // _QERTYPES_H_
|
||||||
|
|
BIN
install/bitmaps/toggle_detail.png
Normal file
BIN
install/bitmaps/toggle_detail.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
BIN
install/bitmaps/toggle_struct.png
Normal file
BIN
install/bitmaps/toggle_struct.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
|
@ -690,6 +690,7 @@ gint HandleCommand( GtkWidget *widget, gpointer data ){
|
||||||
case ID_SELECT_SNAPTOGRID: g_pParentWnd->OnSnapToGrid(); break;
|
case ID_SELECT_SNAPTOGRID: g_pParentWnd->OnSnapToGrid(); break;
|
||||||
case ID_SELECT_ALL: g_pParentWnd->OnSelectAll(); break;
|
case ID_SELECT_ALL: g_pParentWnd->OnSelectAll(); break;
|
||||||
case ID_SELECTION_INVERT: g_pParentWnd->OnSelectionInvert(); break;
|
case ID_SELECTION_INVERT: g_pParentWnd->OnSelectionInvert(); break;
|
||||||
|
case ID_TOGGLE_DETAIL: g_pParentWnd->OnToggleDetail(); break;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1756,6 +1757,11 @@ void MainFrame::create_main_toolbar( GtkWidget *window, GtkWidget *vbox ){
|
||||||
g_object_set_data( G_OBJECT( window ), "tb_view_clipper", w );
|
g_object_set_data( G_OBJECT( window ), "tb_view_clipper", w );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w = gtk_toolbar_append_element( GTK_TOOLBAR( toolbar ), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
|
||||||
|
"", _( "Make Detail Brushes" ), "", new_image_icon("toggle_struct.png"),
|
||||||
|
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_TOGGLE_DETAIL ) );
|
||||||
|
g_object_set_data( G_OBJECT( window ), "tb_toggle_detail", w );
|
||||||
|
|
||||||
gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
|
gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
|
||||||
|
|
||||||
w = gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), "", _( "Change views" ), "",
|
w = gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), "", _( "Change views" ), "",
|
||||||
|
@ -5454,6 +5460,31 @@ void MainFrame::OnClipSelected(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainFrame::OnToggleDetail(){
|
||||||
|
GtkWidget *w = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "tb_toggle_detail" ) );
|
||||||
|
g_bIgnoreCommands++;
|
||||||
|
|
||||||
|
if ( g_qeglobals.m_bMakeDetail == TRUE ) {
|
||||||
|
g_qeglobals.m_bMakeDetail = FALSE;
|
||||||
|
Sys_Printf( "Structural Brush mode activated\n" );
|
||||||
|
|
||||||
|
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), FALSE );
|
||||||
|
gtk_button_set_image( GTK_BUTTON( w ),new_image_icon( "toggle_struct.png" ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_qeglobals.m_bMakeDetail = TRUE;
|
||||||
|
Sys_Printf( "Detail Brush mode activated\n" );
|
||||||
|
|
||||||
|
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), TRUE );
|
||||||
|
gtk_button_set_image( GTK_BUTTON( w ), new_image_icon( "toggle_detail.png" ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
g_bIgnoreCommands--;
|
||||||
|
}
|
||||||
|
|
||||||
void MainFrame::OnSplitSelected(){
|
void MainFrame::OnSplitSelected(){
|
||||||
if ( m_pActiveXY ) {
|
if ( m_pActiveXY ) {
|
||||||
Undo_Start( "split selected" );
|
Undo_Start( "split selected" );
|
||||||
|
|
|
@ -427,6 +427,8 @@ struct SKeyInfo
|
||||||
#define ID_TEXTUREWINDOW_SCALEUP 40321
|
#define ID_TEXTUREWINDOW_SCALEUP 40321
|
||||||
#define ID_TEXTUREWINDOW_SCALEDOWN 40322
|
#define ID_TEXTUREWINDOW_SCALEDOWN 40322
|
||||||
|
|
||||||
|
#define ID_TOGGLE_DETAIL 40323
|
||||||
|
|
||||||
class CSynapseClientRadiant : public CSynapseClient
|
class CSynapseClientRadiant : public CSynapseClient
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -695,6 +697,7 @@ void OnHelp();
|
||||||
void OnHelpLinks();
|
void OnHelpLinks();
|
||||||
void OnHelpBugreport();
|
void OnHelpBugreport();
|
||||||
void OnViewClipper();
|
void OnViewClipper();
|
||||||
|
void OnToggleDetail();
|
||||||
void OnCameraAngledown();
|
void OnCameraAngledown();
|
||||||
void OnCameraAngleup();
|
void OnCameraAngleup();
|
||||||
void OnCameraBack( bool keydown );
|
void OnCameraBack( bool keydown );
|
||||||
|
|
|
@ -1615,6 +1615,18 @@ void XYWnd::NewBrushDrag( int x, int y ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// structural or detail?
|
||||||
|
face_t *f;
|
||||||
|
|
||||||
|
for ( f = n->brush_faces ; f ; f = f->next ) {
|
||||||
|
if ( g_qeglobals.m_bMakeDetail == TRUE ) {
|
||||||
|
f->texdef.contents |= CONTENTS_DETAIL;
|
||||||
|
} else {
|
||||||
|
f->texdef.contents &= ~CONTENTS_DETAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
|
||||||
vec3_t vSize;
|
vec3_t vSize;
|
||||||
VectorSubtract( maxs, mins, vSize );
|
VectorSubtract( maxs, mins, vSize );
|
||||||
g_strStatus.Format( "Size X:: %.1f Y:: %.1f Z:: %.1f", vSize[0], vSize[1], vSize[2] );
|
g_strStatus.Format( "Size X:: %.1f Y:: %.1f Z:: %.1f", vSize[0], vSize[1], vSize[2] );
|
||||||
|
|
Loading…
Reference in a new issue