2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include <gdk/gdkkeysyms.h>
24 #include <glib/gi18n.h>
26 #include "surfdlg_plugin.h"
28 #include "surfaceflagsdialog_quake2.h"
32 GtkWidget *surface_lightbutton;
33 GtkWidget *surface_slickbutton;
34 GtkWidget *surface_skybutton;
35 GtkWidget *surface_warpbutton;
36 GtkWidget *surface_trans33button;
37 GtkWidget *surface_trans66button;
38 GtkWidget *surface_flowingbutton;
39 GtkWidget *surface_nodrawbutton;
40 GtkWidget *surface_hintbutton;
41 GtkWidget *surface_skipbutton;
43 GtkWidget *content_solidbutton;
44 GtkWidget *content_windowbutton;
45 GtkWidget *content_auxbutton;
46 GtkWidget *content_lavabutton;
47 GtkWidget *content_slimebutton;
48 GtkWidget *content_waterbutton;
49 GtkWidget *content_mistbutton;
50 GtkWidget *content_areaportalbutton;
51 GtkWidget *content_playerclipbutton;
52 GtkWidget *content_monsterclipbutton;
53 GtkWidget *content_current0button;
54 GtkWidget *content_current90button;
55 GtkWidget *content_current180button;
56 GtkWidget *content_current270button;
57 GtkWidget *content_currentUPbutton;
58 GtkWidget *content_currentDOWNbutton;
59 GtkWidget *content_originbutton;
60 GtkWidget *content_detailbutton;
61 GtkWidget *content_translucentbutton;
62 GtkWidget *content_ladderbutton;
64 GtkWidget *surfacebutton;
65 GtkWidget *contentbutton;
67 GtkWidget *value_entry;
68 gboolean setup_buttons = TRUE;
70 int working_surface_flags;
72 int working_content_flags;
76 inline void set_inconsistent( GtkWidget *toggle_button ){
77 gtk_toggle_button_set_inconsistent( GTK_TOGGLE_BUTTON( toggle_button ), TRUE );
80 inline void clear_inconsistent( GtkWidget *toggle_button ){
81 if ( gtk_toggle_button_get_inconsistent( GTK_TOGGLE_BUTTON( toggle_button ) ) ) {
82 gtk_toggle_button_set_inconsistent( GTK_TOGGLE_BUTTON( toggle_button ), FALSE );
86 void clear_all_inconsistent( void ){
87 clear_inconsistent( surface_lightbutton );
88 clear_inconsistent( surface_slickbutton );
89 clear_inconsistent( surface_skybutton );
90 clear_inconsistent( surface_warpbutton );
91 clear_inconsistent( surface_trans33button );
92 clear_inconsistent( surface_trans66button );
93 clear_inconsistent( surface_flowingbutton );
94 clear_inconsistent( surface_nodrawbutton );
95 clear_inconsistent( surface_hintbutton );
96 clear_inconsistent( surface_skipbutton );
98 clear_inconsistent( content_solidbutton );
99 clear_inconsistent( content_windowbutton );
100 clear_inconsistent( content_auxbutton );
101 clear_inconsistent( content_lavabutton );
102 clear_inconsistent( content_slimebutton );
103 clear_inconsistent( content_waterbutton );
104 clear_inconsistent( content_mistbutton );
105 clear_inconsistent( content_areaportalbutton );
106 clear_inconsistent( content_playerclipbutton );
107 clear_inconsistent( content_monsterclipbutton );
108 clear_inconsistent( content_current0button );
109 clear_inconsistent( content_current90button );
110 clear_inconsistent( content_current180button );
111 clear_inconsistent( content_current270button );
112 clear_inconsistent( content_currentUPbutton );
113 clear_inconsistent( content_currentDOWNbutton );
114 clear_inconsistent( content_originbutton );
115 clear_inconsistent( content_detailbutton );
116 clear_inconsistent( content_translucentbutton );
117 clear_inconsistent( content_ladderbutton );
120 void clear_all_buttons_and_values(){
121 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_lightbutton ), FALSE );
122 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_slickbutton ), FALSE );
123 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_skybutton ), FALSE );
124 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_warpbutton ), FALSE );
125 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans33button ), FALSE );
126 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans66button ), FALSE );
127 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_flowingbutton ), FALSE );
128 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_nodrawbutton ), FALSE );
129 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_hintbutton ), FALSE );
130 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_skipbutton ), FALSE );
132 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_solidbutton ), FALSE );
133 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_windowbutton ), FALSE );
134 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_auxbutton ), FALSE );
135 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_lavabutton ), FALSE );
136 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_slimebutton ), FALSE );
137 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_waterbutton ), FALSE );
138 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_mistbutton ), FALSE );
139 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_areaportalbutton ), FALSE );
140 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_playerclipbutton ), FALSE );
141 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_monsterclipbutton ), FALSE );
142 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current0button ), FALSE );
143 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current90button ), FALSE );
144 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current180button ), FALSE );
145 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current270button ), FALSE );
146 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentUPbutton ), FALSE );
147 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), FALSE );
148 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_originbutton ), FALSE );
149 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_detailbutton ), FALSE );
150 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_translucentbutton ), FALSE );
151 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_ladderbutton ), FALSE );
153 gtk_entry_set_text( (GtkEntry *)value_entry, "" );
156 void SetFlagButtons_Quake2( texdef_to_face_t *texdef_face_list, bool b_isListEmpty ){
160 int diff_contents = 0;
162 gboolean diff_value = FALSE;
164 texdef_t* tmp_texdef;
165 texdef_to_face_t* temp_texdef_face_list;
168 setup_buttons = TRUE;
169 working_surface_flags = 0;
171 working_content_flags = 0;
175 if ( !b_isListEmpty ) {
176 tmp_texdef = &texdef_face_list->texdef;
177 contents = tmp_texdef->contents;
178 flags = tmp_texdef->flags;
179 value = tmp_texdef->value;
181 Sys_Printf( "Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value );
182 Sys_Printf( "Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value );
184 for ( temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next )
186 tmp_texdef = &temp_texdef_face_list->texdef;
187 diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent
188 diff_flags |= flags ^ tmp_texdef->flags;
189 if ( tmp_texdef->value != value ) {
193 Sys_Printf( "Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value );
194 Sys_Printf( "Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value );
201 clear_all_inconsistent();
203 // If no faces/brushes are selected, clear everything and bail
204 if ( b_isListEmpty ) {
205 clear_all_buttons_and_values();
206 setup_buttons = FALSE;
210 // Set surface buttons to reflect brush/face flags, contents, and values
211 if ( diff_flags & QUAKE2_SURF_LIGHT ) {
212 set_inconsistent( surface_lightbutton );
214 else if ( flags & QUAKE2_SURF_LIGHT ) {
215 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_lightbutton ), TRUE );
218 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_lightbutton ), FALSE );
221 if ( diff_flags & QUAKE2_SURF_SLICK ) {
222 set_inconsistent( surface_slickbutton );
224 else if ( flags & QUAKE2_SURF_SLICK ) {
225 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_slickbutton ), TRUE );
228 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_slickbutton ), FALSE );
231 if ( diff_flags & QUAKE2_SURF_SKY ) {
232 set_inconsistent( surface_skybutton );
234 else if ( flags & QUAKE2_SURF_SKY ) {
235 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_skybutton ), TRUE );
238 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_skybutton ), FALSE );
241 if ( diff_flags & QUAKE2_SURF_WARP ) {
242 set_inconsistent( surface_warpbutton );
244 else if ( flags & QUAKE2_SURF_WARP ) {
245 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_warpbutton ), TRUE );
248 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_warpbutton ), FALSE );
251 if ( diff_flags & QUAKE2_SURF_TRANS33 ) {
252 set_inconsistent( surface_trans33button );
254 else if ( flags & QUAKE2_SURF_TRANS33 ) {
255 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans33button ), TRUE );
258 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans33button ), FALSE );
261 if ( diff_flags & QUAKE2_SURF_TRANS66 ) {
262 set_inconsistent( surface_trans66button );
264 else if ( flags & QUAKE2_SURF_TRANS66 ) {
265 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans66button ), TRUE );
268 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans66button ), FALSE );
271 if ( diff_flags & QUAKE2_SURF_FLOWING ) {
272 set_inconsistent( surface_flowingbutton );
274 else if ( flags & QUAKE2_SURF_FLOWING ) {
275 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_flowingbutton ), TRUE );
278 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_flowingbutton ), FALSE );
281 if ( diff_flags & QUAKE2_SURF_NODRAW ) {
282 set_inconsistent( surface_nodrawbutton );
284 else if ( flags & QUAKE2_SURF_NODRAW ) {
285 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_nodrawbutton ), TRUE );
288 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_nodrawbutton ), FALSE );
291 if ( diff_flags & QUAKE2_SURF_HINT ) {
292 set_inconsistent( surface_hintbutton );
294 else if ( flags & QUAKE2_SURF_HINT ) {
295 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_hintbutton ), TRUE );
298 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_hintbutton ), FALSE );
301 if ( diff_flags & QUAKE2_SURF_SKIP ) {
302 set_inconsistent( surface_skipbutton );
304 else if ( flags & QUAKE2_SURF_SKIP ) {
305 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_skipbutton ), TRUE );
308 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_skipbutton ), FALSE );
311 // Set content buttons to reflect brush values
312 if ( diff_contents & QUAKE2_CONTENTS_SOLID ) {
313 set_inconsistent( content_solidbutton );
315 else if ( contents & QUAKE2_CONTENTS_SOLID ) {
316 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_solidbutton ), TRUE );
319 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_solidbutton ), FALSE );
322 if ( diff_contents & QUAKE2_CONTENTS_WINDOW ) {
323 set_inconsistent( content_windowbutton );
325 else if ( contents & QUAKE2_CONTENTS_WINDOW ) {
326 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_windowbutton ), TRUE );
329 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_windowbutton ), FALSE );
332 if ( diff_contents & QUAKE2_CONTENTS_AUX ) {
333 set_inconsistent( content_auxbutton );
335 else if ( contents & QUAKE2_CONTENTS_AUX ) {
336 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_auxbutton ), TRUE );
339 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_auxbutton ), FALSE );
342 if ( diff_contents & QUAKE2_CONTENTS_LAVA ) {
343 set_inconsistent( content_lavabutton );
345 else if ( contents & QUAKE2_CONTENTS_LAVA ) {
346 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_lavabutton ), TRUE );
349 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_lavabutton ), FALSE );
352 if ( diff_contents & QUAKE2_CONTENTS_SLIME ) {
353 set_inconsistent( content_slimebutton );
355 else if ( contents & QUAKE2_CONTENTS_SLIME ) {
356 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_slimebutton ), TRUE );
359 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_slimebutton ), FALSE );
362 if ( diff_contents & QUAKE2_CONTENTS_WATER ) {
363 set_inconsistent( content_waterbutton );
365 else if ( contents & QUAKE2_CONTENTS_WATER ) {
366 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_waterbutton ), TRUE );
369 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_waterbutton ), FALSE );
372 if ( diff_contents & QUAKE2_CONTENTS_MIST ) {
373 set_inconsistent( content_mistbutton );
375 else if ( contents & QUAKE2_CONTENTS_MIST ) {
376 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_mistbutton ), TRUE );
379 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_mistbutton ), FALSE );
382 if ( diff_contents & QUAKE2_CONTENTS_AREAPORTAL ) {
383 set_inconsistent( content_areaportalbutton );
385 else if ( contents & QUAKE2_CONTENTS_AREAPORTAL ) {
386 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_areaportalbutton ), TRUE );
389 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_areaportalbutton ), FALSE );
392 if ( diff_contents & QUAKE2_CONTENTS_PLAYERCLIP ) {
393 set_inconsistent( content_playerclipbutton );
395 else if ( contents & QUAKE2_CONTENTS_PLAYERCLIP ) {
396 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_playerclipbutton ), TRUE );
399 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_playerclipbutton ), FALSE );
402 if ( diff_contents & QUAKE2_CONTENTS_MONSTERCLIP ) {
403 set_inconsistent( content_monsterclipbutton );
405 else if ( contents & QUAKE2_CONTENTS_MONSTERCLIP ) {
406 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_monsterclipbutton ), TRUE );
409 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_monsterclipbutton ), FALSE );
412 if ( diff_contents & QUAKE2_CONTENTS_CURRENT_0 ) {
413 set_inconsistent( content_current0button );
415 else if ( contents & QUAKE2_CONTENTS_CURRENT_0 ) {
416 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current0button ), TRUE );
419 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current0button ), FALSE );
422 if ( diff_contents & QUAKE2_CONTENTS_CURRENT_90 ) {
423 set_inconsistent( content_current90button );
425 else if ( contents & QUAKE2_CONTENTS_CURRENT_90 ) {
426 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current90button ), TRUE );
429 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current90button ), FALSE );
432 if ( diff_contents & QUAKE2_CONTENTS_CURRENT_180 ) {
433 set_inconsistent( content_current180button );
435 else if ( contents & QUAKE2_CONTENTS_CURRENT_180 ) {
436 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current180button ), TRUE );
439 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current180button ), FALSE );
442 if ( diff_contents & QUAKE2_CONTENTS_CURRENT_270 ) {
443 set_inconsistent( content_current270button );
445 else if ( contents & QUAKE2_CONTENTS_CURRENT_270 ) {
446 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current270button ), TRUE );
449 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current270button ), FALSE );
452 if ( diff_contents & QUAKE2_CONTENTS_CURRENT_UP ) {
453 set_inconsistent( content_currentUPbutton );
455 else if ( contents & QUAKE2_CONTENTS_CURRENT_UP ) {
456 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentUPbutton ), TRUE );
459 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentUPbutton ), FALSE );
462 if ( diff_contents & QUAKE2_CONTENTS_CURRENT_DOWN ) {
463 set_inconsistent( content_currentDOWNbutton );
465 else if ( contents & QUAKE2_CONTENTS_CURRENT_DOWN ) {
466 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), TRUE );
469 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), FALSE );
472 if ( diff_contents & QUAKE2_CONTENTS_ORIGIN ) {
473 set_inconsistent( content_originbutton );
475 else if ( contents & QUAKE2_CONTENTS_ORIGIN ) {
476 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_originbutton ), TRUE );
479 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_originbutton ), FALSE );
482 if ( diff_contents & QUAKE2_CONTENTS_DETAIL ) {
483 set_inconsistent( content_detailbutton );
485 else if ( contents & QUAKE2_CONTENTS_DETAIL ) {
486 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_detailbutton ), TRUE );
489 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_detailbutton ), FALSE );
492 if ( diff_contents & QUAKE2_CONTENTS_TRANSLUCENT ) {
493 set_inconsistent( content_translucentbutton );
495 else if ( contents & QUAKE2_CONTENTS_TRANSLUCENT ) {
496 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_translucentbutton ), TRUE );
499 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_translucentbutton ), FALSE );
502 if ( diff_contents & QUAKE2_CONTENTS_LADDER ) {
503 set_inconsistent( content_ladderbutton );
505 else if ( contents & QUAKE2_CONTENTS_LADDER ) {
506 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_ladderbutton ), TRUE );
509 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_ladderbutton ), FALSE );
514 gtk_entry_set_text( (GtkEntry *)value_entry, "" );
518 working_value = value;
519 sprintf( tex_buff, "%d", value );
520 gtk_entry_set_text( (GtkEntry *)value_entry, tex_buff );
523 setup_buttons = FALSE;
526 void SetChangeInFlags_Face_Quake2( texdef_to_face_t *texdef_face_list ){
527 texdef_to_face_t *temp_texdef_face_list;
528 texdef_t *tmp_texdef;
530 for ( temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next )
532 tmp_texdef = &temp_texdef_face_list->texdef;
533 tmp_texdef->flags = ( tmp_texdef->flags & ~surface_mask ) | working_surface_flags;
534 tmp_texdef->contents = ( tmp_texdef->contents & ~content_mask ) | working_content_flags;
535 tmp_texdef->value = working_value;
536 Sys_Printf( "content_flag: %d content_mask: %d\n",working_content_flags,content_mask );
537 Sys_Printf( "content: %d\n",tmp_texdef->contents );
541 inline void change_surfaceflag( GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to ){
543 if ( !setup_buttons ) { // If we're setting up the buttons, we really don't need to
544 // set flags that are already set
546 if ( gtk_toggle_button_get_inconsistent( GTK_TOGGLE_BUTTON( togglebutton ) ) ) { // Clear out inconsistent, if set
547 clear_inconsistent( GTK_WIDGET( togglebutton ) );
550 surface_mask |= sur_flag;
552 if ( change_flag_to ) {
553 working_surface_flags |= sur_flag;
556 working_surface_flags &= ~sur_flag;
561 inline void change_contentflag( GtkWidget *togglebutton, int content_flag, gboolean change_flag_to ){
563 if ( ( !setup_buttons ) ) { // If we're setting up the buttons, we really don't need to
564 // set flags that are already set
566 if ( gtk_toggle_button_get_inconsistent( GTK_TOGGLE_BUTTON( togglebutton ) ) ) {
567 clear_inconsistent( togglebutton );
569 //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces.
571 content_mask |= content_flag;
573 if ( change_flag_to ) {
574 working_content_flags |= content_flag;
577 working_content_flags &= ~content_flag;
580 Sys_Printf( "content_flag: %d content_mask: %d\n",content_flag,content_mask );
584 // Surface Flags Callbacks
586 on_surface_lightbutton_toggled( GtkToggleButton *togglebutton,
587 gpointer user_data ){
588 change_surfaceflag( surface_lightbutton, QUAKE2_SURF_LIGHT, ( GTK_TOGGLE_BUTTON( surface_lightbutton )->active ) );
593 on_surface_slickbutton_toggled( GtkToggleButton *togglebutton,
594 gpointer user_data ){
595 change_surfaceflag( surface_slickbutton, QUAKE2_SURF_SLICK, ( GTK_TOGGLE_BUTTON( surface_slickbutton )->active ) );
600 on_surface_skybutton_toggled( GtkToggleButton *togglebutton,
601 gpointer user_data ){
602 change_surfaceflag( surface_skybutton, QUAKE2_SURF_SKY, ( GTK_TOGGLE_BUTTON( surface_skybutton )->active ) );
606 on_surface_warpbutton_toggled( GtkToggleButton *togglebutton,
607 gpointer user_data ){
608 change_surfaceflag( surface_warpbutton, QUAKE2_SURF_WARP, ( GTK_TOGGLE_BUTTON( surface_warpbutton )->active ) );
612 on_surface_trans33button_toggled( GtkToggleButton *togglebutton,
613 gpointer user_data ){
614 change_surfaceflag( surface_trans33button, QUAKE2_SURF_TRANS33, ( GTK_TOGGLE_BUTTON( surface_trans33button )->active ) );
618 on_surface_trans66button_toggled( GtkToggleButton *togglebutton,
619 gpointer user_data ){
620 change_surfaceflag( surface_trans66button, QUAKE2_SURF_TRANS66, ( GTK_TOGGLE_BUTTON( surface_trans66button )->active ) );
624 on_surface_flowingbutton_toggled( GtkToggleButton *togglebutton,
625 gpointer user_data ){
626 change_surfaceflag( surface_flowingbutton, QUAKE2_SURF_FLOWING, ( GTK_TOGGLE_BUTTON( surface_flowingbutton )->active ) );
630 on_surface_nodrawbutton_toggled( GtkToggleButton *togglebutton,
631 gpointer user_data ){
632 change_surfaceflag( surface_nodrawbutton, QUAKE2_SURF_NODRAW, ( GTK_TOGGLE_BUTTON( surface_nodrawbutton )->active ) );
636 on_surface_hintbutton_toggled( GtkToggleButton *togglebutton,
637 gpointer user_data ){
638 change_surfaceflag( surface_hintbutton, QUAKE2_SURF_HINT, ( GTK_TOGGLE_BUTTON( surface_hintbutton )->active ) );
642 on_surface_skipbutton_toggled( GtkToggleButton *togglebutton,
643 gpointer user_data ){
644 change_surfaceflag( surface_skipbutton, QUAKE2_SURF_SKIP, ( GTK_TOGGLE_BUTTON( surface_skipbutton )->active ) );
647 // Content Flags Callbacks
649 on_content_solidbutton_toggled( GtkToggleButton *togglebutton,
650 gpointer user_data ){
651 change_contentflag( content_solidbutton, QUAKE2_CONTENTS_SOLID, ( GTK_TOGGLE_BUTTON( content_solidbutton )->active ) );
655 on_content_windowbutton_toggled( GtkToggleButton *togglebutton,
656 gpointer user_data ){
657 change_contentflag( content_windowbutton, QUAKE2_CONTENTS_WINDOW, ( GTK_TOGGLE_BUTTON( content_windowbutton )->active ) );
661 on_content_auxbutton_toggled( GtkToggleButton *togglebutton,
662 gpointer user_data ){
663 change_contentflag( content_auxbutton, QUAKE2_CONTENTS_AUX, ( GTK_TOGGLE_BUTTON( content_auxbutton )->active ) );
667 on_content_lavabutton_toggled( GtkToggleButton *togglebutton,
668 gpointer user_data ){
669 change_contentflag( content_lavabutton, QUAKE2_CONTENTS_LAVA, ( GTK_TOGGLE_BUTTON( content_lavabutton )->active ) );
673 on_content_slimebutton_toggled( GtkToggleButton *togglebutton,
674 gpointer user_data ){
675 change_contentflag( content_slimebutton, QUAKE2_CONTENTS_SLIME, ( GTK_TOGGLE_BUTTON( content_slimebutton )->active ) );
679 on_content_waterbutton_toggled( GtkToggleButton *togglebutton,
680 gpointer user_data ){
681 change_contentflag( content_waterbutton, QUAKE2_CONTENTS_WATER, ( GTK_TOGGLE_BUTTON( content_waterbutton )->active ) );
685 on_content_mistbutton_toggled( GtkToggleButton *togglebutton,
686 gpointer user_data ){
687 change_contentflag( content_mistbutton, QUAKE2_CONTENTS_MIST, ( GTK_TOGGLE_BUTTON( content_mistbutton )->active ) );
691 on_content_areaportalbutton_toggled( GtkToggleButton *togglebutton,
692 gpointer user_data ){
693 change_contentflag( content_areaportalbutton, QUAKE2_CONTENTS_AREAPORTAL, ( GTK_TOGGLE_BUTTON( content_areaportalbutton )->active ) );
697 on_content_playerclipbutton_toggled( GtkToggleButton *togglebutton,
698 gpointer user_data ){
699 change_contentflag( content_playerclipbutton, QUAKE2_CONTENTS_PLAYERCLIP, ( GTK_TOGGLE_BUTTON( content_playerclipbutton )->active ) );
703 on_content_monsterclipbutton_toggled( GtkToggleButton *togglebutton,
704 gpointer user_data ){
705 change_contentflag( content_monsterclipbutton, QUAKE2_CONTENTS_MONSTERCLIP, ( GTK_TOGGLE_BUTTON( content_monsterclipbutton )->active ) );
709 on_content_current0button_toggled( GtkToggleButton *togglebutton,
710 gpointer user_data ){
711 change_contentflag( content_current0button, QUAKE2_CONTENTS_CURRENT_0, ( GTK_TOGGLE_BUTTON( content_current0button )->active ) );
715 on_content_current90button_toggled( GtkToggleButton *togglebutton,
716 gpointer user_data ){
717 change_contentflag( content_current90button, QUAKE2_CONTENTS_CURRENT_90, ( GTK_TOGGLE_BUTTON( content_current90button )->active ) );
721 on_content_current180button_toggled( GtkToggleButton *togglebutton,
722 gpointer user_data ){
723 change_contentflag( content_current180button, QUAKE2_CONTENTS_CURRENT_180, ( GTK_TOGGLE_BUTTON( content_current180button )->active ) );
727 on_content_current270button_toggled( GtkToggleButton *togglebutton,
728 gpointer user_data ){
729 change_contentflag( content_current270button, QUAKE2_CONTENTS_CURRENT_270, ( GTK_TOGGLE_BUTTON( content_current270button )->active ) );
733 on_content_currentUPbutton_toggled( GtkToggleButton *togglebutton,
734 gpointer user_data ){
735 change_contentflag( content_currentUPbutton, QUAKE2_CONTENTS_CURRENT_UP, ( GTK_TOGGLE_BUTTON( content_currentUPbutton )->active ) );
739 on_content_currentDOWNbutton_toggled( GtkToggleButton *togglebutton,
740 gpointer user_data ){
741 change_contentflag( content_currentDOWNbutton, QUAKE2_CONTENTS_CURRENT_DOWN, ( GTK_TOGGLE_BUTTON( content_currentDOWNbutton )->active ) );
745 on_content_originbutton_toggled( GtkToggleButton *togglebutton,
746 gpointer user_data ){
747 change_contentflag( content_originbutton, QUAKE2_CONTENTS_ORIGIN, ( GTK_TOGGLE_BUTTON( content_originbutton )->active ) );
751 on_content_detailbutton_toggled( GtkToggleButton *togglebutton,
752 gpointer user_data ){
753 change_contentflag( content_detailbutton, QUAKE2_CONTENTS_DETAIL, ( GTK_TOGGLE_BUTTON( content_detailbutton )->active ) );
757 on_content_translucentbutton_toggled( GtkToggleButton *togglebutton,
758 gpointer user_data ){
759 change_contentflag( content_translucentbutton, QUAKE2_CONTENTS_TRANSLUCENT, ( GTK_TOGGLE_BUTTON( content_translucentbutton )->active ) );
763 on_content_ladderbutton_toggled( GtkToggleButton *togglebutton,
764 gpointer user_data ){
765 change_contentflag( content_ladderbutton, QUAKE2_CONTENTS_LADDER, ( GTK_TOGGLE_BUTTON( content_ladderbutton )->active ) );
768 // Value Entry Callback
770 on_value_entry_changed( GtkEditable *editable,
771 gpointer user_data ){
772 if ( ( !setup_buttons ) ) { // If we're setting up the buttons, don't change value
773 working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable ) );
778 on_value_entry_insert_text( GtkEditable *editable,
780 gint new_text_length,
782 gpointer user_data ){
786 // Limit input to digits, throwing out anything else
787 // Modified from Gtk FAQ for text filtering of GtkEntry
788 result = g_new( gchar, new_text_length );
790 for ( i = 0; i < new_text_length; i++ ) {
791 if ( !isdigit( new_text[i] ) ) {
794 result[count++] = new_text[i];
798 gtk_signal_handler_block_by_func( GTK_OBJECT( editable ),
799 GTK_SIGNAL_FUNC( on_value_entry_insert_text ),
801 gtk_editable_insert_text( editable, result, count, position );
802 gtk_signal_handler_unblock_by_func( GTK_OBJECT( editable ),
803 GTK_SIGNAL_FUNC( on_value_entry_insert_text ),
806 gtk_signal_emit_stop_by_name( GTK_OBJECT( editable ), "insert_text" );
812 on_surfacebutton_clicked( GtkButton *button,
813 gpointer user_data ){
814 gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ), 0 );
818 on_contentbutton_clicked( GtkButton *button,
819 gpointer user_data ){
820 gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ), 1 );
824 #define QUAKE2_FLAG_BUTTON_BORDER 3
826 GtkWidget* Create_Quake2FlagsDialog( GtkWidget* surfacedialog_widget ){
835 GtkWidget *hseparator1;
836 GtkWidget *value_label;
841 frame1 = gtk_frame_new( _( "Flags" ) );
842 gtk_widget_show( frame1 );
843 gtk_container_add( GTK_CONTAINER( surfacedialog_widget ), frame1 );
845 vbox1 = gtk_vbox_new( FALSE, 0 );
846 gtk_widget_show( vbox1 );
847 gtk_container_add( GTK_CONTAINER( frame1 ), vbox1 );
849 notebook1 = gtk_notebook_new();
850 gtk_widget_show( notebook1 );
851 gtk_box_pack_start( GTK_BOX( vbox1 ), notebook1, TRUE, TRUE, 0 );
852 gtk_notebook_set_show_tabs( GTK_NOTEBOOK( notebook1 ), TRUE );
853 gtk_container_set_border_width( GTK_CONTAINER( notebook1 ), 5 );
855 vbox2 = gtk_vbox_new( FALSE, 0 );
856 gtk_widget_show( vbox2 );
857 gtk_container_add( GTK_CONTAINER( notebook1 ), vbox2 );
859 table4 = gtk_table_new( 3, 4, FALSE );
860 gtk_widget_show( table4 );
861 gtk_box_pack_start( GTK_BOX( vbox2 ), table4, TRUE, TRUE, 0 );
863 surface_lightbutton = gtk_toggle_button_new_with_label( _( "Light" ) );
864 gtk_signal_connect( GTK_OBJECT( surface_lightbutton ), "toggled",
865 GTK_SIGNAL_FUNC( on_surface_lightbutton_toggled ),
867 gtk_widget_show( surface_lightbutton );
868 gtk_table_attach( GTK_TABLE( table4 ), surface_lightbutton, 0, 1, 0, 1,
869 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
870 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
871 gtk_container_set_border_width( GTK_CONTAINER( surface_lightbutton ), QUAKE2_FLAG_BUTTON_BORDER );
873 surface_slickbutton = gtk_toggle_button_new_with_label( _( "Slick" ) );
874 gtk_signal_connect( GTK_OBJECT( surface_slickbutton ), "toggled",
875 GTK_SIGNAL_FUNC( on_surface_slickbutton_toggled ),
877 gtk_widget_show( surface_slickbutton );
878 gtk_table_attach( GTK_TABLE( table4 ), surface_slickbutton, 1, 2, 0, 1,
879 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
880 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
881 gtk_container_set_border_width( GTK_CONTAINER( surface_slickbutton ), QUAKE2_FLAG_BUTTON_BORDER );
883 surface_skybutton = gtk_toggle_button_new_with_label( _( "Sky" ) );
884 gtk_signal_connect( GTK_OBJECT( surface_skybutton ), "toggled",
885 GTK_SIGNAL_FUNC( on_surface_skybutton_toggled ),
887 gtk_widget_show( surface_skybutton );
888 gtk_table_attach( GTK_TABLE( table4 ), surface_skybutton, 2, 3, 0, 1,
889 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
890 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
891 gtk_container_set_border_width( GTK_CONTAINER( surface_skybutton ), QUAKE2_FLAG_BUTTON_BORDER );
893 surface_warpbutton = gtk_toggle_button_new_with_label( _( "Warp" ) );
894 gtk_signal_connect( GTK_OBJECT( surface_warpbutton ), "toggled",
895 GTK_SIGNAL_FUNC( on_surface_warpbutton_toggled ),
897 gtk_widget_show( surface_warpbutton );
898 gtk_table_attach( GTK_TABLE( table4 ), surface_warpbutton, 3, 4, 0, 1,
899 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
900 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
901 gtk_container_set_border_width( GTK_CONTAINER( surface_warpbutton ), QUAKE2_FLAG_BUTTON_BORDER );
903 surface_trans33button = gtk_toggle_button_new_with_label( _( "Trans 33" ) );
904 gtk_signal_connect( GTK_OBJECT( surface_trans33button ), "toggled",
905 GTK_SIGNAL_FUNC( on_surface_trans33button_toggled ),
907 gtk_widget_show( surface_trans33button );
908 gtk_table_attach( GTK_TABLE( table4 ), surface_trans33button, 0, 1, 1, 2,
909 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
910 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
911 gtk_container_set_border_width( GTK_CONTAINER( surface_trans33button ), QUAKE2_FLAG_BUTTON_BORDER );
913 surface_trans66button = gtk_toggle_button_new_with_label( _( "Trans 66" ) );
914 gtk_signal_connect( GTK_OBJECT( surface_trans66button ), "toggled",
915 GTK_SIGNAL_FUNC( on_surface_trans66button_toggled ),
917 gtk_widget_show( surface_trans66button );
918 gtk_table_attach( GTK_TABLE( table4 ), surface_trans66button, 1, 2, 1, 2,
919 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
920 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
921 gtk_container_set_border_width( GTK_CONTAINER( surface_trans66button ), QUAKE2_FLAG_BUTTON_BORDER );
923 surface_flowingbutton = gtk_toggle_button_new_with_label( _( "Flowing" ) );
924 gtk_signal_connect( GTK_OBJECT( surface_flowingbutton ), "toggled",
925 GTK_SIGNAL_FUNC( on_surface_flowingbutton_toggled ),
927 gtk_widget_show( surface_flowingbutton );
928 gtk_table_attach( GTK_TABLE( table4 ), surface_flowingbutton, 2, 3, 1, 2,
929 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
930 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
931 gtk_container_set_border_width( GTK_CONTAINER( surface_flowingbutton ), QUAKE2_FLAG_BUTTON_BORDER );
933 surface_nodrawbutton = gtk_toggle_button_new_with_label( _( "NoDraw" ) );
934 gtk_signal_connect( GTK_OBJECT( surface_nodrawbutton ), "toggled",
935 GTK_SIGNAL_FUNC( on_surface_nodrawbutton_toggled ),
937 gtk_widget_show( surface_nodrawbutton );
938 gtk_table_attach( GTK_TABLE( table4 ), surface_nodrawbutton, 3, 4, 1, 2,
939 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
940 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
941 gtk_container_set_border_width( GTK_CONTAINER( surface_nodrawbutton ), QUAKE2_FLAG_BUTTON_BORDER );
943 surface_hintbutton = gtk_toggle_button_new_with_label( _( "Hint" ) );
944 gtk_signal_connect( GTK_OBJECT( surface_hintbutton ), "toggled",
945 GTK_SIGNAL_FUNC( on_surface_hintbutton_toggled ),
947 gtk_widget_show( surface_hintbutton );
948 gtk_table_attach( GTK_TABLE( table4 ), surface_hintbutton, 0, 1, 2, 3,
949 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
950 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
951 gtk_container_set_border_width( GTK_CONTAINER( surface_hintbutton ), QUAKE2_FLAG_BUTTON_BORDER );
953 surface_skipbutton = gtk_toggle_button_new_with_label( _( "Skip" ) );
954 gtk_signal_connect( GTK_OBJECT( surface_skipbutton ), "toggled",
955 GTK_SIGNAL_FUNC( on_surface_skipbutton_toggled ),
957 gtk_widget_show( surface_skipbutton );
958 gtk_table_attach( GTK_TABLE( table4 ), surface_skipbutton, 3, 4, 2, 3,
959 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
960 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
961 gtk_container_set_border_width( GTK_CONTAINER( surface_skipbutton ), QUAKE2_FLAG_BUTTON_BORDER );
963 hseparator1 = gtk_hseparator_new();
964 gtk_widget_show( hseparator1 );
965 gtk_box_pack_start( GTK_BOX( vbox2 ), hseparator1, FALSE, FALSE, 0 );
966 gtk_widget_set_usize( hseparator1, -2, 5 );
968 hbox2 = gtk_hbox_new( FALSE, 0 );
969 gtk_widget_show( hbox2 );
970 gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, FALSE, FALSE, 0 );
972 hbox3 = gtk_hbox_new( FALSE, 0 );
973 gtk_widget_show( hbox3 );
974 gtk_box_pack_start( GTK_BOX( hbox2 ), hbox3, TRUE, TRUE, 0 );
976 vbox4 = gtk_vbox_new( FALSE, 0 );
977 gtk_widget_show( vbox4 );
978 gtk_box_pack_start( GTK_BOX( hbox3 ), vbox4, TRUE, TRUE, 0 );
980 value_label = gtk_label_new( _( "Value: " ) );
981 gtk_widget_show( value_label );
982 gtk_box_pack_start( GTK_BOX( hbox3 ), value_label, FALSE, FALSE, 0 );
984 value_entry = gtk_entry_new();
985 gtk_signal_connect( GTK_OBJECT( value_entry ), "changed",
986 GTK_SIGNAL_FUNC( on_value_entry_changed ),
988 gtk_signal_connect( GTK_OBJECT( value_entry ), "insert_text",
989 GTK_SIGNAL_FUNC( on_value_entry_insert_text ),
991 gtk_entry_set_max_length( (GtkEntry *)value_entry, 11 );
992 gtk_widget_show( value_entry );
993 gtk_box_pack_start( GTK_BOX( hbox3 ), value_entry, TRUE, TRUE, 0 );
995 vbox3 = gtk_vbox_new( FALSE, 0 );
996 gtk_widget_show( vbox3 );
997 gtk_box_pack_start( GTK_BOX( hbox3 ), vbox3, TRUE, TRUE, 0 );
999 label5 = gtk_label_new( _( "Surface Flags" ) );
1000 gtk_widget_show( label5 );
1001 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ), gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ), 0 ), label5 );
1003 table3 = gtk_table_new( 5, 4, FALSE );
1004 gtk_widget_show( table3 );
1005 gtk_container_add( GTK_CONTAINER( notebook1 ), table3 );
1007 content_solidbutton = gtk_toggle_button_new_with_label( _( "Solid" ) );
1008 gtk_signal_connect( GTK_OBJECT( content_solidbutton ), "toggled",
1009 GTK_SIGNAL_FUNC( on_content_solidbutton_toggled ),
1011 gtk_widget_show( content_solidbutton );
1012 gtk_table_attach( GTK_TABLE( table3 ), content_solidbutton, 0, 1, 0, 1,
1013 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1014 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1015 gtk_container_set_border_width( GTK_CONTAINER( content_solidbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1017 content_windowbutton = gtk_toggle_button_new_with_label( _( "Window" ) );
1018 gtk_signal_connect( GTK_OBJECT( content_windowbutton ), "toggled",
1019 GTK_SIGNAL_FUNC( on_content_windowbutton_toggled ),
1021 gtk_widget_show( content_windowbutton );
1022 gtk_table_attach( GTK_TABLE( table3 ), content_windowbutton, 1, 2, 0, 1,
1023 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1024 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1025 gtk_container_set_border_width( GTK_CONTAINER( content_windowbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1027 content_auxbutton = gtk_toggle_button_new_with_label( _( "Aux" ) );
1028 gtk_signal_connect( GTK_OBJECT( content_auxbutton ), "toggled",
1029 GTK_SIGNAL_FUNC( on_content_auxbutton_toggled ),
1031 gtk_widget_show( content_auxbutton );
1032 gtk_table_attach( GTK_TABLE( table3 ), content_auxbutton, 2, 3, 0, 1,
1033 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1034 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1035 gtk_container_set_border_width( GTK_CONTAINER( content_auxbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1037 content_lavabutton = gtk_toggle_button_new_with_label( _( "Lava" ) );
1038 gtk_signal_connect( GTK_OBJECT( content_lavabutton ), "toggled",
1039 GTK_SIGNAL_FUNC( on_content_lavabutton_toggled ),
1041 gtk_widget_show( content_lavabutton );
1042 gtk_table_attach( GTK_TABLE( table3 ), content_lavabutton, 3, 4, 0, 1,
1043 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1044 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1045 gtk_container_set_border_width( GTK_CONTAINER( content_lavabutton ), QUAKE2_FLAG_BUTTON_BORDER );
1047 content_slimebutton = gtk_toggle_button_new_with_label( _( "Slime" ) );
1048 gtk_signal_connect( GTK_OBJECT( content_slimebutton ), "toggled",
1049 GTK_SIGNAL_FUNC( on_content_slimebutton_toggled ),
1051 gtk_widget_show( content_slimebutton );
1052 gtk_table_attach( GTK_TABLE( table3 ), content_slimebutton, 0, 1, 1, 2,
1053 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1054 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1055 gtk_container_set_border_width( GTK_CONTAINER( content_slimebutton ), QUAKE2_FLAG_BUTTON_BORDER );
1057 content_waterbutton = gtk_toggle_button_new_with_label( _( "Water" ) );
1058 gtk_signal_connect( GTK_OBJECT( content_waterbutton ), "toggled",
1059 GTK_SIGNAL_FUNC( on_content_waterbutton_toggled ),
1061 gtk_widget_show( content_waterbutton );
1062 gtk_table_attach( GTK_TABLE( table3 ), content_waterbutton, 1, 2, 1, 2,
1063 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1064 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1065 gtk_container_set_border_width( GTK_CONTAINER( content_waterbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1067 content_mistbutton = gtk_toggle_button_new_with_label( _( "Mist" ) );
1068 gtk_signal_connect( GTK_OBJECT( content_mistbutton ), "toggled",
1069 GTK_SIGNAL_FUNC( on_content_mistbutton_toggled ),
1071 gtk_widget_show( content_mistbutton );
1072 gtk_table_attach( GTK_TABLE( table3 ), content_mistbutton, 2, 3, 1, 2,
1073 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1074 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1075 gtk_container_set_border_width( GTK_CONTAINER( content_mistbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1077 content_areaportalbutton = gtk_toggle_button_new_with_label( _( "AreaPortal" ) );
1078 gtk_signal_connect( GTK_OBJECT( content_areaportalbutton ), "toggled",
1079 GTK_SIGNAL_FUNC( on_content_areaportalbutton_toggled ),
1081 gtk_widget_show( content_areaportalbutton );
1082 gtk_table_attach( GTK_TABLE( table3 ), content_areaportalbutton, 3, 4, 1, 2,
1083 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1084 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1085 gtk_container_set_border_width( GTK_CONTAINER( content_areaportalbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1087 content_playerclipbutton = gtk_toggle_button_new_with_label( _( "PlayerClip" ) );
1088 gtk_signal_connect( GTK_OBJECT( content_playerclipbutton ), "toggled",
1089 GTK_SIGNAL_FUNC( on_content_playerclipbutton_toggled ),
1091 gtk_widget_show( content_playerclipbutton );
1092 gtk_table_attach( GTK_TABLE( table3 ), content_playerclipbutton, 0, 1, 2, 3,
1093 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1094 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1095 gtk_container_set_border_width( GTK_CONTAINER( content_playerclipbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1097 content_monsterclipbutton = gtk_toggle_button_new_with_label( _( "MonsterClip" ) );
1098 gtk_signal_connect( GTK_OBJECT( content_monsterclipbutton ), "toggled",
1099 GTK_SIGNAL_FUNC( on_content_monsterclipbutton_toggled ),
1101 gtk_widget_show( content_monsterclipbutton );
1102 gtk_table_attach( GTK_TABLE( table3 ), content_monsterclipbutton, 1, 2, 2, 3,
1103 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1104 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1105 gtk_container_set_border_width( GTK_CONTAINER( content_monsterclipbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1107 content_current0button = gtk_toggle_button_new_with_label( _( "Current 0" ) );
1108 gtk_signal_connect( GTK_OBJECT( content_current0button ), "toggled",
1109 GTK_SIGNAL_FUNC( on_content_current0button_toggled ),
1111 gtk_widget_show( content_current0button );
1112 gtk_table_attach( GTK_TABLE( table3 ), content_current0button, 2, 3, 2, 3,
1113 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1114 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1115 gtk_container_set_border_width( GTK_CONTAINER( content_current0button ), QUAKE2_FLAG_BUTTON_BORDER );
1117 content_current90button = gtk_toggle_button_new_with_label( _( "Current 90" ) );
1118 gtk_signal_connect( GTK_OBJECT( content_current90button ), "toggled",
1119 GTK_SIGNAL_FUNC( on_content_current90button_toggled ),
1121 gtk_widget_show( content_current90button );
1122 gtk_table_attach( GTK_TABLE( table3 ), content_current90button, 3, 4, 2, 3,
1123 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1124 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1125 gtk_container_set_border_width( GTK_CONTAINER( content_current90button ), QUAKE2_FLAG_BUTTON_BORDER );
1127 content_current180button = gtk_toggle_button_new_with_label( _( "Current 180" ) );
1128 gtk_signal_connect( GTK_OBJECT( content_current180button ), "toggled",
1129 GTK_SIGNAL_FUNC( on_content_current180button_toggled ),
1131 gtk_widget_show( content_current180button );
1132 gtk_table_attach( GTK_TABLE( table3 ), content_current180button, 0, 1, 3, 4,
1133 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1134 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1135 gtk_container_set_border_width( GTK_CONTAINER( content_current180button ), QUAKE2_FLAG_BUTTON_BORDER );
1137 content_current270button = gtk_toggle_button_new_with_label( _( "Current 270" ) );
1138 gtk_signal_connect( GTK_OBJECT( content_current270button ), "toggled",
1139 GTK_SIGNAL_FUNC( on_content_current270button_toggled ),
1141 gtk_widget_show( content_current270button );
1142 gtk_table_attach( GTK_TABLE( table3 ), content_current270button, 1, 2, 3, 4,
1143 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1144 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1145 gtk_container_set_border_width( GTK_CONTAINER( content_current270button ), QUAKE2_FLAG_BUTTON_BORDER );
1147 content_currentUPbutton = gtk_toggle_button_new_with_label( _( "Current UP" ) );
1148 gtk_signal_connect( GTK_OBJECT( content_currentUPbutton ), "toggled",
1149 GTK_SIGNAL_FUNC( on_content_currentUPbutton_toggled ),
1151 gtk_widget_show( content_currentUPbutton );
1152 gtk_table_attach( GTK_TABLE( table3 ), content_currentUPbutton, 2, 3, 3, 4,
1153 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1154 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1155 gtk_container_set_border_width( GTK_CONTAINER( content_currentUPbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1157 content_currentDOWNbutton = gtk_toggle_button_new_with_label( _( "Current DOWN" ) );
1158 gtk_signal_connect( GTK_OBJECT( content_currentDOWNbutton ), "toggled",
1159 GTK_SIGNAL_FUNC( on_content_currentDOWNbutton_toggled ),
1161 gtk_widget_show( content_currentDOWNbutton );
1162 gtk_table_attach( GTK_TABLE( table3 ), content_currentDOWNbutton, 3, 4, 3, 4,
1163 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1164 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1165 gtk_container_set_border_width( GTK_CONTAINER( content_currentDOWNbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1167 content_originbutton = gtk_toggle_button_new_with_label( _( "Origin" ) );
1168 gtk_signal_connect( GTK_OBJECT( content_originbutton ), "toggled",
1169 GTK_SIGNAL_FUNC( on_content_originbutton_toggled ),
1171 gtk_widget_show( content_originbutton );
1172 gtk_table_attach( GTK_TABLE( table3 ), content_originbutton, 0, 1, 4, 5,
1173 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1174 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1175 gtk_container_set_border_width( GTK_CONTAINER( content_originbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1177 content_detailbutton = gtk_toggle_button_new_with_label( _( "Detail" ) );
1178 gtk_signal_connect( GTK_OBJECT( content_detailbutton ), "toggled",
1179 GTK_SIGNAL_FUNC( on_content_detailbutton_toggled ),
1181 gtk_widget_show( content_detailbutton );
1182 gtk_table_attach( GTK_TABLE( table3 ), content_detailbutton, 1, 2, 4, 5,
1183 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1184 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1185 gtk_container_set_border_width( GTK_CONTAINER( content_detailbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1187 content_translucentbutton = gtk_toggle_button_new_with_label( _( "Translucent" ) );
1188 gtk_signal_connect( GTK_OBJECT( content_translucentbutton ), "toggled",
1189 GTK_SIGNAL_FUNC( on_content_translucentbutton_toggled ),
1191 gtk_widget_show( content_translucentbutton );
1192 gtk_table_attach( GTK_TABLE( table3 ), content_translucentbutton, 2, 3, 4, 5,
1193 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1194 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1195 gtk_container_set_border_width( GTK_CONTAINER( content_translucentbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1197 content_ladderbutton = gtk_toggle_button_new_with_label( _( "Ladder" ) );
1198 gtk_signal_connect( GTK_OBJECT( content_ladderbutton ), "toggled",
1199 GTK_SIGNAL_FUNC( on_content_ladderbutton_toggled ),
1201 gtk_widget_show( content_ladderbutton );
1202 gtk_table_attach( GTK_TABLE( table3 ), content_ladderbutton, 3, 4, 4, 5,
1203 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1204 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1205 gtk_container_set_border_width( GTK_CONTAINER( content_ladderbutton ), QUAKE2_FLAG_BUTTON_BORDER );
1207 label6 = gtk_label_new( _( "Content Flags" ) );
1208 gtk_widget_show( label6 );
1209 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ), gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ), 1 ), label6 );