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_heretic2.h"
30 GtkWidget *surface_lightbutton;
31 GtkWidget *surface_slickbutton;
32 GtkWidget *surface_skybutton;
33 GtkWidget *surface_warpbutton;
34 GtkWidget *surface_trans33button;
35 GtkWidget *surface_trans66button;
36 GtkWidget *surface_flowingbutton;
37 GtkWidget *surface_nodrawbutton;
38 GtkWidget *surface_tallwallbutton;
39 GtkWidget *surface_alphatexbutton;
40 GtkWidget *surface_animspeedbutton;
41 GtkWidget *surface_undulatebutton;
43 GtkWidget *surf_gravel_radiobutton;
44 GSList *surf_gravel_radiobutton_group = NULL;
45 GtkWidget *surf_metal_radiobutton;
46 GtkWidget *surf_stone_radiobutton;
47 GtkWidget *surf_wood_radiobutton;
49 GtkWidget *surf_value_entry;
53 GtkWidget *content_solidbutton;
54 GtkWidget *content_windowbutton;
55 GtkWidget *content_illusbutton;
56 GtkWidget *content_lavabutton;
57 GtkWidget *content_slimebutton;
58 GtkWidget *content_waterbutton;
59 GtkWidget *content_mistbutton;
60 GtkWidget *content_areaportalbutton;
61 GtkWidget *content_playerclipbutton;
62 GtkWidget *content_monsterclipbutton;
63 GtkWidget *content_current0button;
64 GtkWidget *content_current90button;
65 GtkWidget *content_current180button;
66 GtkWidget *content_current270button;
67 GtkWidget *content_currentUPbutton;
68 GtkWidget *content_currentDOWNbutton;
69 GtkWidget *content_originbutton;
70 GtkWidget *content_detailbutton;
71 GtkWidget *content_ladderbutton;
72 GtkWidget *content_camnoblockbutton;
75 gboolean setup_buttons = TRUE;
77 int working_surface_flags;
79 int working_content_flags;
82 gboolean surface_material_inconsistant = FALSE;
84 inline void set_inconsistent( GtkWidget *toggle_button ){
85 gtk_toggle_button_set_inconsistent( GTK_TOGGLE_BUTTON( toggle_button ), TRUE );
88 inline void clear_inconsistent( GtkWidget *toggle_button ){
89 if ( gtk_toggle_button_get_inconsistent( GTK_TOGGLE_BUTTON( toggle_button ) ) ) {
90 gtk_toggle_button_set_inconsistent( GTK_TOGGLE_BUTTON( toggle_button ), FALSE );
95 void clear_all_inconsistent( void ){
96 clear_inconsistent( surface_lightbutton );
97 clear_inconsistent( surface_slickbutton );
98 clear_inconsistent( surface_skybutton );
99 clear_inconsistent( surface_warpbutton );
100 clear_inconsistent( surface_trans33button );
101 clear_inconsistent( surface_trans66button );
102 clear_inconsistent( surface_flowingbutton );
103 clear_inconsistent( surface_nodrawbutton );
104 clear_inconsistent( surface_tallwallbutton );
105 clear_inconsistent( surface_alphatexbutton );
106 clear_inconsistent( surface_animspeedbutton );
107 clear_inconsistent( surface_undulatebutton );
109 clear_inconsistent( surf_gravel_radiobutton );
110 clear_inconsistent( surf_metal_radiobutton );
111 clear_inconsistent( surf_stone_radiobutton );
112 clear_inconsistent( surf_wood_radiobutton );
114 clear_inconsistent( content_solidbutton );
115 clear_inconsistent( content_windowbutton );
116 clear_inconsistent( content_illusbutton );
117 clear_inconsistent( content_lavabutton );
118 clear_inconsistent( content_slimebutton );
119 clear_inconsistent( content_waterbutton );
120 clear_inconsistent( content_mistbutton );
121 clear_inconsistent( content_areaportalbutton );
122 clear_inconsistent( content_playerclipbutton );
123 clear_inconsistent( content_monsterclipbutton );
124 clear_inconsistent( content_current0button );
125 clear_inconsistent( content_current90button );
126 clear_inconsistent( content_current180button );
127 clear_inconsistent( content_current270button );
128 clear_inconsistent( content_currentUPbutton );
129 clear_inconsistent( content_currentDOWNbutton );
130 clear_inconsistent( content_originbutton );
131 clear_inconsistent( content_detailbutton );
132 clear_inconsistent( content_ladderbutton );
133 clear_inconsistent( content_camnoblockbutton );
136 void clear_all_buttons_and_values(){
137 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_lightbutton ), FALSE );
138 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_slickbutton ), FALSE );
139 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_skybutton ), FALSE );
140 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_warpbutton ), FALSE );
141 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans33button ), FALSE );
142 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans66button ), FALSE );
143 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_flowingbutton ), FALSE );
144 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_nodrawbutton ), FALSE );
145 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_tallwallbutton ), FALSE );
146 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_alphatexbutton ), FALSE );
147 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_animspeedbutton ), FALSE );
148 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_undulatebutton ), FALSE );
150 // surface_material_inconsistant = TRUE;
152 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_gravel_radiobutton ), FALSE );
153 set_inconsistent( surf_gravel_radiobutton );
155 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_metal_radiobutton ), FALSE );
156 set_inconsistent( surf_metal_radiobutton );
158 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_stone_radiobutton ), FALSE );
159 set_inconsistent( surf_stone_radiobutton );
161 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_wood_radiobutton ), FALSE );
162 set_inconsistent( surf_wood_radiobutton );
164 gtk_entry_set_text( (GtkEntry *)surf_value_entry, "" );
166 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_solidbutton ), FALSE );
167 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_windowbutton ), FALSE );
168 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_illusbutton ), FALSE );
169 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_lavabutton ), FALSE );
170 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_slimebutton ), FALSE );
171 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_waterbutton ), FALSE );
172 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_mistbutton ), FALSE );
173 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_areaportalbutton ), FALSE );
174 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_playerclipbutton ), FALSE );
175 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_monsterclipbutton ), FALSE );
176 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current0button ), FALSE );
177 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current90button ), FALSE );
178 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current180button ), FALSE );
179 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current270button ), FALSE );
180 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentUPbutton ), FALSE );
181 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), FALSE );
182 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_originbutton ), FALSE );
183 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_detailbutton ), FALSE );
184 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_ladderbutton ), FALSE );
185 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_camnoblockbutton ), FALSE );
189 void SetFlagButtons_Heretic2( texdef_to_face_t *texdef_face_list, bool b_isListEmpty ){
193 int diff_contents = 0;
195 gboolean diff_value = FALSE;
197 texdef_t* tmp_texdef;
198 texdef_to_face_t* temp_texdef_face_list;
199 gboolean surface_which_material_inconsistant[4];
200 int surface_iterator;
202 setup_buttons = TRUE;
203 working_surface_flags = 0;
205 working_content_flags = 0;
208 surface_material_inconsistant = FALSE;
209 surface_which_material_inconsistant[0] = FALSE;
210 surface_which_material_inconsistant[1] = FALSE;
211 surface_which_material_inconsistant[2] = FALSE;
212 surface_which_material_inconsistant[3] = FALSE;
214 if ( !b_isListEmpty ) {
215 tmp_texdef = &texdef_face_list->texdef;
216 contents = tmp_texdef->contents;
217 flags = tmp_texdef->flags;
218 value = tmp_texdef->value;
220 surface_iterator = ( tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK ) >> 24; // Inconsistant Material?
221 surface_which_material_inconsistant[surface_iterator] = TRUE;
223 for ( temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next )
225 tmp_texdef = &temp_texdef_face_list->texdef;
226 diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent
227 diff_flags |= flags ^ tmp_texdef->flags;
228 if ( tmp_texdef->value != value ) {
232 surface_iterator = ( tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK ) >> 24; // Inconsistant Material?
233 surface_which_material_inconsistant[surface_iterator] = TRUE;
235 Sys_Printf( "Diff_Flags: %d\t Surf_Iter: %d\n",diff_flags, surface_iterator );
241 clear_all_inconsistent();
243 // If no faces/brushes are selected, clear everything and bail
244 if ( b_isListEmpty ) {
245 clear_all_buttons_and_values();
246 setup_buttons = FALSE;
250 // Set surface buttons to reflect brush/face flags, contents, and values
251 if ( diff_flags & HERETIC2_SURF_LIGHT ) {
252 set_inconsistent( surface_lightbutton );
255 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_lightbutton ), ( flags & HERETIC2_SURF_LIGHT ) );
258 if ( diff_flags & HERETIC2_SURF_SLICK ) {
259 set_inconsistent( surface_slickbutton );
261 else if ( flags & HERETIC2_SURF_SLICK ) {
262 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_slickbutton ), TRUE );
265 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_slickbutton ), FALSE );
268 if ( diff_flags & HERETIC2_SURF_SKY ) {
269 set_inconsistent( surface_skybutton );
271 else if ( flags & HERETIC2_SURF_SKY ) {
272 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_skybutton ), TRUE );
275 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_skybutton ), FALSE );
278 if ( diff_flags & HERETIC2_SURF_WARP ) {
279 set_inconsistent( surface_warpbutton );
281 else if ( flags & HERETIC2_SURF_WARP ) {
282 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_warpbutton ), TRUE );
285 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_warpbutton ), FALSE );
288 if ( diff_flags & HERETIC2_SURF_TRANS33 ) {
289 set_inconsistent( surface_trans33button );
291 else if ( flags & HERETIC2_SURF_TRANS33 ) {
292 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans33button ), TRUE );
295 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans33button ), FALSE );
298 if ( diff_flags & HERETIC2_SURF_TRANS66 ) {
299 set_inconsistent( surface_trans66button );
301 else if ( flags & HERETIC2_SURF_TRANS66 ) {
302 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans66button ), TRUE );
305 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_trans66button ), FALSE );
308 if ( diff_flags & HERETIC2_SURF_FLOWING ) {
309 set_inconsistent( surface_flowingbutton );
311 else if ( flags & HERETIC2_SURF_FLOWING ) {
312 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_flowingbutton ), TRUE );
315 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_flowingbutton ), FALSE );
318 if ( diff_flags & HERETIC2_SURF_NODRAW ) {
319 set_inconsistent( surface_nodrawbutton );
321 else if ( flags & HERETIC2_SURF_NODRAW ) {
322 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_nodrawbutton ), TRUE );
325 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_nodrawbutton ), FALSE );
328 if ( diff_flags & HERETIC2_SURF_TALL_WALL ) {
329 set_inconsistent( surface_tallwallbutton );
331 else if ( flags & HERETIC2_SURF_TALL_WALL ) {
332 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_tallwallbutton ), TRUE );
335 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_tallwallbutton ), FALSE );
338 if ( diff_flags & HERETIC2_SURF_ALPHA_TEXTURE ) {
339 set_inconsistent( surface_alphatexbutton );
341 else if ( flags & HERETIC2_SURF_ALPHA_TEXTURE ) {
342 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_alphatexbutton ), TRUE );
345 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_alphatexbutton ), FALSE );
348 if ( diff_flags & HERETIC2_SURF_ANIMSPEED ) {
349 set_inconsistent( surface_animspeedbutton );
351 else if ( flags & HERETIC2_SURF_ANIMSPEED ) {
352 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_animspeedbutton ), TRUE );
355 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_animspeedbutton ), FALSE );
358 if ( diff_flags & HERETIC2_SURF_UNDULATE ) {
359 set_inconsistent( surface_undulatebutton );
361 else if ( flags & HERETIC2_SURF_UNDULATE ) {
362 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_undulatebutton ), TRUE );
365 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_undulatebutton ), FALSE );
368 if ( diff_flags & ~HERETIC2_SURF_MATERIAL_MASK ) {
369 Sys_Printf( "--> %d\n", ( diff_flags & ~HERETIC2_SURF_MATERIAL_MASK ) );
370 Sys_Printf( "%d\t%d\t%d\t%d\n", surface_which_material_inconsistant[0], surface_which_material_inconsistant[1], surface_which_material_inconsistant[2], surface_which_material_inconsistant[3] );
372 if ( surface_which_material_inconsistant[0] ) {
373 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_gravel_radiobutton ), FALSE );
374 surface_material_inconsistant = TRUE;
375 set_inconsistent( surf_gravel_radiobutton );
377 if ( surface_which_material_inconsistant[1] ) {
378 //if (!surface_material_inconsistant)
380 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_metal_radiobutton ), FALSE );
381 surface_material_inconsistant = TRUE;
383 set_inconsistent( surf_metal_radiobutton );
385 if ( surface_which_material_inconsistant[2] ) {
386 //if (!surface_material_inconsistant)
388 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_stone_radiobutton ), FALSE );
389 surface_material_inconsistant = TRUE;
391 set_inconsistent( surf_stone_radiobutton );
393 if ( surface_which_material_inconsistant[3] ) {
394 //if (!surface_material_inconsistant)
396 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_wood_radiobutton ), FALSE );
397 surface_material_inconsistant = TRUE;
399 set_inconsistent( surf_wood_radiobutton );
404 if ( flags & ~HERETIC2_SURF_MATERIAL_MASK ) {
405 surface_iterator = ( flags & ~HERETIC2_SURF_MATERIAL_MASK ) >> 24;
406 if ( surface_iterator == 1 ) {
407 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_metal_radiobutton ), TRUE );
409 else if ( surface_iterator == 2 ) {
410 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_stone_radiobutton ), TRUE );
412 else if ( surface_iterator == 3 ) {
413 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_wood_radiobutton ), TRUE );
418 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surf_gravel_radiobutton ), TRUE );
422 // Set content buttons to reflect brush values
423 if ( diff_contents & HERETIC2_CONTENTS_SOLID ) {
424 set_inconsistent( content_solidbutton );
426 else if ( contents & HERETIC2_CONTENTS_SOLID ) {
427 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_solidbutton ), TRUE );
430 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_solidbutton ), FALSE );
433 if ( diff_contents & HERETIC2_CONTENTS_WINDOW ) {
434 set_inconsistent( content_windowbutton );
436 else if ( contents & HERETIC2_CONTENTS_WINDOW ) {
437 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_windowbutton ), TRUE );
440 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_windowbutton ), FALSE );
443 if ( diff_contents & HERETIC2_CONTENTS_ILLUSIONARY ) {
444 set_inconsistent( content_illusbutton );
446 else if ( contents & HERETIC2_CONTENTS_ILLUSIONARY ) {
447 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_illusbutton ), TRUE );
450 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_illusbutton ), FALSE );
453 if ( diff_contents & HERETIC2_CONTENTS_LAVA ) {
454 set_inconsistent( content_lavabutton );
456 else if ( contents & HERETIC2_CONTENTS_LAVA ) {
457 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_lavabutton ), TRUE );
460 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_lavabutton ), FALSE );
463 if ( diff_contents & HERETIC2_CONTENTS_SLIME ) {
464 set_inconsistent( content_slimebutton );
466 else if ( contents & HERETIC2_CONTENTS_SLIME ) {
467 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_slimebutton ), TRUE );
470 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_slimebutton ), FALSE );
473 if ( diff_contents & HERETIC2_CONTENTS_WATER ) {
474 set_inconsistent( content_waterbutton );
476 else if ( contents & HERETIC2_CONTENTS_WATER ) {
477 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_waterbutton ), TRUE );
480 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_waterbutton ), FALSE );
483 if ( diff_contents & HERETIC2_CONTENTS_MIST ) {
484 set_inconsistent( content_mistbutton );
486 else if ( contents & HERETIC2_CONTENTS_MIST ) {
487 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_mistbutton ), TRUE );
490 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_mistbutton ), FALSE );
493 if ( diff_contents & HERETIC2_CONTENTS_AREAPORTAL ) {
494 set_inconsistent( content_areaportalbutton );
496 else if ( contents & HERETIC2_CONTENTS_AREAPORTAL ) {
497 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_areaportalbutton ), TRUE );
500 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_areaportalbutton ), FALSE );
503 if ( diff_contents & HERETIC2_CONTENTS_PLAYERCLIP ) {
504 set_inconsistent( content_playerclipbutton );
506 else if ( contents & HERETIC2_CONTENTS_PLAYERCLIP ) {
507 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_playerclipbutton ), TRUE );
510 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_playerclipbutton ), FALSE );
513 if ( diff_contents & HERETIC2_CONTENTS_MONSTERCLIP ) {
514 set_inconsistent( content_monsterclipbutton );
516 else if ( contents & HERETIC2_CONTENTS_MONSTERCLIP ) {
517 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_monsterclipbutton ), TRUE );
520 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_monsterclipbutton ), FALSE );
523 if ( diff_contents & HERETIC2_CONTENTS_CURRENT_0 ) {
524 set_inconsistent( content_current0button );
526 else if ( contents & HERETIC2_CONTENTS_CURRENT_0 ) {
527 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current0button ), TRUE );
530 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current0button ), FALSE );
533 if ( diff_contents & HERETIC2_CONTENTS_CURRENT_90 ) {
534 set_inconsistent( content_current90button );
536 else if ( contents & HERETIC2_CONTENTS_CURRENT_90 ) {
537 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current90button ), TRUE );
540 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current90button ), FALSE );
543 if ( diff_contents & HERETIC2_CONTENTS_CURRENT_180 ) {
544 set_inconsistent( content_current180button );
546 else if ( contents & HERETIC2_CONTENTS_CURRENT_180 ) {
547 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current180button ), TRUE );
550 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current180button ), FALSE );
553 if ( diff_contents & HERETIC2_CONTENTS_CURRENT_270 ) {
554 set_inconsistent( content_current270button );
556 else if ( contents & HERETIC2_CONTENTS_CURRENT_270 ) {
557 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current270button ), TRUE );
560 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_current270button ), FALSE );
563 if ( diff_contents & HERETIC2_CONTENTS_CURRENT_UP ) {
564 set_inconsistent( content_currentUPbutton );
566 else if ( contents & HERETIC2_CONTENTS_CURRENT_UP ) {
567 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentUPbutton ), TRUE );
570 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentUPbutton ), FALSE );
573 if ( diff_contents & HERETIC2_CONTENTS_CURRENT_DOWN ) {
574 set_inconsistent( content_currentDOWNbutton );
576 else if ( contents & HERETIC2_CONTENTS_CURRENT_DOWN ) {
577 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), TRUE );
580 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), FALSE );
583 if ( diff_contents & HERETIC2_CONTENTS_ORIGIN ) {
584 set_inconsistent( content_originbutton );
586 else if ( contents & HERETIC2_CONTENTS_ORIGIN ) {
587 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_originbutton ), TRUE );
590 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_originbutton ), FALSE );
593 if ( diff_contents & HERETIC2_CONTENTS_DETAIL ) {
594 set_inconsistent( content_detailbutton );
596 else if ( contents & HERETIC2_CONTENTS_DETAIL ) {
597 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_detailbutton ), TRUE );
600 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_detailbutton ), FALSE );
603 if ( diff_contents & HERETIC2_CONTENTS_LADDER ) {
604 set_inconsistent( content_ladderbutton );
606 else if ( contents & HERETIC2_CONTENTS_LADDER ) {
607 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_ladderbutton ), TRUE );
610 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_ladderbutton ), FALSE );
613 if ( diff_contents & HERETIC2_CONTENTS_CAMERANOBLOCK ) {
614 set_inconsistent( content_camnoblockbutton );
616 else if ( contents & HERETIC2_CONTENTS_CAMERANOBLOCK ) {
617 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_camnoblockbutton ), TRUE );
620 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_camnoblockbutton ), FALSE );
625 gtk_entry_set_text( (GtkEntry *)surf_value_entry, "" );
629 working_value = value;
630 sprintf( tex_buff, "%d", value );
631 gtk_entry_set_text( (GtkEntry *)surf_value_entry, tex_buff );
634 setup_buttons = FALSE;
637 void SetChangeInFlags_Face_Heretic2( texdef_to_face_t *texdef_face_list ){
638 texdef_to_face_t *temp_texdef_face_list;
639 texdef_t *tmp_texdef;
641 for ( temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next )
643 tmp_texdef = &temp_texdef_face_list->texdef;
644 tmp_texdef->flags = ( tmp_texdef->flags & ~surface_mask ) | working_surface_flags;
645 tmp_texdef->contents = ( tmp_texdef->contents & ~content_mask ) | working_content_flags;
646 tmp_texdef->value = working_value;
647 Sys_Printf( "content_flag: %d content_mask: %d\n",working_content_flags,content_mask );
648 Sys_Printf( "content: %d\n",tmp_texdef->contents );
652 inline void change_surfaceflag( GtkWidget *togglebutton, int sur_flag ){ // For Material
653 if ( !setup_buttons ) { // If we're setting up the buttons, we really don't need to
654 // set flags that are already set
655 if ( surface_material_inconsistant ) {
656 clear_inconsistent( surf_gravel_radiobutton );
657 clear_inconsistent( surf_metal_radiobutton );
658 clear_inconsistent( surf_stone_radiobutton );
659 clear_inconsistent( surf_wood_radiobutton );
661 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
662 working_surface_flags = ( working_surface_flags & HERETIC2_SURF_MATERIAL_MASK ) | sur_flag;
666 inline void change_material( GtkWidget *togglebutton ){
667 if ( !setup_buttons ) { // If we're setting up the buttons, we really don't need to
668 // set flags that are already set
669 if ( surface_material_inconsistant ) {
670 clear_inconsistent( surf_gravel_radiobutton );
671 clear_inconsistent( surf_metal_radiobutton );
672 clear_inconsistent( surf_stone_radiobutton );
673 clear_inconsistent( surf_wood_radiobutton );
675 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( surf_gravel_radiobutton ) ) ) {
676 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
677 working_surface_flags = ( working_surface_flags & HERETIC2_SURF_MATERIAL_MASK ) | HERETIC2_SURF_TYPE_GRAVEL;
679 else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( surf_metal_radiobutton ) ) ) {
680 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
681 working_surface_flags = ( working_surface_flags & HERETIC2_SURF_MATERIAL_MASK ) | HERETIC2_SURF_TYPE_METAL;
683 else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( surf_stone_radiobutton ) ) ) {
684 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
685 working_surface_flags = ( working_surface_flags & HERETIC2_SURF_MATERIAL_MASK ) | HERETIC2_SURF_TYPE_STONE;
687 else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( surf_wood_radiobutton ) ) ) {
688 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
689 working_surface_flags = ( working_surface_flags & HERETIC2_SURF_MATERIAL_MASK ) | HERETIC2_SURF_TYPE_WOOD;
694 inline void change_surfaceflag( GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to ){
696 if ( !setup_buttons ) { // If we're setting up the buttons, we really don't need to
697 // set flags that are already set
698 if ( gtk_toggle_button_get_inconsistent( GTK_TOGGLE_BUTTON( togglebutton ) ) ) { // Clear out inconsistent, if set
699 clear_inconsistent( GTK_WIDGET( togglebutton ) );
702 surface_mask |= sur_flag;
704 if ( change_flag_to ) {
705 working_surface_flags |= sur_flag;
708 working_surface_flags &= ~sur_flag;
713 inline void change_contentflag( GtkWidget *togglebutton, int content_flag, gboolean change_flag_to ){
715 if ( ( !setup_buttons ) ) { // If we're setting up the buttons, we really don't need to
716 // set flags that are already set
718 if ( gtk_toggle_button_get_inconsistent( GTK_TOGGLE_BUTTON( togglebutton ) ) ) {
719 clear_inconsistent( togglebutton );
721 //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces.
723 content_mask |= content_flag;
725 if ( change_flag_to ) {
726 working_content_flags |= content_flag;
729 working_content_flags &= ~content_flag;
735 // Surface Flags Callbacks
737 on_surface_lightbutton_toggled( GtkToggleButton *togglebutton,
738 gpointer user_data ){
739 change_surfaceflag( surface_lightbutton, HERETIC2_SURF_LIGHT, ( GTK_TOGGLE_BUTTON( surface_lightbutton )->active ) );
744 on_surface_slickbutton_toggled( GtkToggleButton *togglebutton,
745 gpointer user_data ){
746 change_surfaceflag( surface_slickbutton, HERETIC2_SURF_SLICK, ( GTK_TOGGLE_BUTTON( surface_slickbutton )->active ) );
751 on_surface_skybutton_toggled( GtkToggleButton *togglebutton,
752 gpointer user_data ){
753 change_surfaceflag( surface_skybutton, HERETIC2_SURF_SKY, ( GTK_TOGGLE_BUTTON( surface_skybutton )->active ) );
758 on_surface_warpbutton_toggled( GtkToggleButton *togglebutton,
759 gpointer user_data ){
760 change_surfaceflag( surface_warpbutton, HERETIC2_SURF_WARP, ( GTK_TOGGLE_BUTTON( surface_warpbutton )->active ) );
765 on_surface_trans33button_toggled( GtkToggleButton *togglebutton,
766 gpointer user_data ){
767 change_surfaceflag( surface_trans33button, HERETIC2_SURF_TRANS33, ( GTK_TOGGLE_BUTTON( surface_trans33button )->active ) );
772 on_surface_trans66button_toggled( GtkToggleButton *togglebutton,
773 gpointer user_data ){
774 change_surfaceflag( surface_trans66button, HERETIC2_SURF_TRANS66, ( GTK_TOGGLE_BUTTON( surface_trans66button )->active ) );
779 on_surface_flowingbutton_toggled( GtkToggleButton *togglebutton,
780 gpointer user_data ){
781 change_surfaceflag( surface_flowingbutton, HERETIC2_SURF_FLOWING, ( GTK_TOGGLE_BUTTON( surface_flowingbutton )->active ) );
786 on_surface_nodrawbutton_toggled( GtkToggleButton *togglebutton,
787 gpointer user_data ){
788 change_surfaceflag( surface_nodrawbutton, HERETIC2_SURF_NODRAW, ( GTK_TOGGLE_BUTTON( surface_nodrawbutton )->active ) );
793 on_surface_tallwallbutton_toggled( GtkToggleButton *togglebutton,
794 gpointer user_data ){
795 change_surfaceflag( surface_tallwallbutton, HERETIC2_SURF_TALL_WALL, ( GTK_TOGGLE_BUTTON( surface_tallwallbutton )->active ) );
800 on_surface_alphatexbutton_toggled( GtkToggleButton *togglebutton,
801 gpointer user_data ){
802 change_surfaceflag( surface_alphatexbutton, HERETIC2_SURF_ALPHA_TEXTURE, ( GTK_TOGGLE_BUTTON( surface_alphatexbutton )->active ) );
807 on_surface_animspeedbutton_toggled( GtkToggleButton *togglebutton,
808 gpointer user_data ){
809 change_surfaceflag( surface_animspeedbutton, HERETIC2_SURF_ANIMSPEED, ( GTK_TOGGLE_BUTTON( surface_animspeedbutton )->active ) );
814 on_surface_undulatebutton_toggled( GtkToggleButton *togglebutton,
815 gpointer user_data ){
816 change_surfaceflag( surface_undulatebutton, HERETIC2_SURF_UNDULATE, ( GTK_TOGGLE_BUTTON( surface_undulatebutton )->active ) );
821 on_surf_gravel_radiobutton_toggled( GtkToggleButton *togglebutton,
822 gpointer user_data ){
823 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( surf_gravel_radiobutton ) ) ) {
824 change_material( GTK_WIDGET( togglebutton ) );
829 on_surf_metal_radiobutton_toggled( GtkToggleButton *togglebutton,
830 gpointer user_data ){
831 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( surf_metal_radiobutton ) ) ) {
832 change_material( GTK_WIDGET( togglebutton ) );
837 on_surf_stone_radiobutton_toggled( GtkToggleButton *togglebutton,
838 gpointer user_data ){
839 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( surf_stone_radiobutton ) ) ) {
840 change_material( GTK_WIDGET( togglebutton ) );
845 on_surf_wood_radiobutton_toggled( GtkToggleButton *togglebutton,
846 gpointer user_data ){
847 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( surf_wood_radiobutton ) ) ) {
848 change_material( GTK_WIDGET( togglebutton ) );
852 // Content Flags Callbacks
854 on_content_solidbutton_toggled( GtkToggleButton *togglebutton,
855 gpointer user_data ){
856 change_contentflag( content_solidbutton, HERETIC2_CONTENTS_SOLID, ( GTK_TOGGLE_BUTTON( content_solidbutton )->active ) );
861 on_content_windowbutton_toggled( GtkToggleButton *togglebutton,
862 gpointer user_data ){
863 change_contentflag( content_windowbutton, HERETIC2_CONTENTS_WINDOW, ( GTK_TOGGLE_BUTTON( content_windowbutton )->active ) );
868 on_content_illusbutton_toggled( GtkToggleButton *togglebutton,
869 gpointer user_data ){
870 change_contentflag( content_illusbutton, HERETIC2_CONTENTS_ILLUSIONARY, ( GTK_TOGGLE_BUTTON( content_illusbutton )->active ) );
875 on_content_lavabutton_toggled( GtkToggleButton *togglebutton,
876 gpointer user_data ){
877 change_contentflag( content_lavabutton, HERETIC2_CONTENTS_LAVA, ( GTK_TOGGLE_BUTTON( content_lavabutton )->active ) );
882 on_content_slimebutton_toggled( GtkToggleButton *togglebutton,
883 gpointer user_data ){
884 change_contentflag( content_slimebutton, HERETIC2_CONTENTS_SLIME, ( GTK_TOGGLE_BUTTON( content_slimebutton )->active ) );
889 on_content_waterbutton_toggled( GtkToggleButton *togglebutton,
890 gpointer user_data ){
891 change_contentflag( content_waterbutton, HERETIC2_CONTENTS_WATER, ( GTK_TOGGLE_BUTTON( content_waterbutton )->active ) );
896 on_content_mistbutton_toggled( GtkToggleButton *togglebutton,
897 gpointer user_data ){
898 change_contentflag( content_mistbutton, HERETIC2_CONTENTS_MIST, ( GTK_TOGGLE_BUTTON( content_mistbutton )->active ) );
903 on_content_areaportalbutton_toggled( GtkToggleButton *togglebutton,
904 gpointer user_data ){
905 change_contentflag( content_areaportalbutton, HERETIC2_CONTENTS_AREAPORTAL, ( GTK_TOGGLE_BUTTON( content_areaportalbutton )->active ) );
910 on_content_playerclipbutton_toggled( GtkToggleButton *togglebutton,
911 gpointer user_data ){
912 change_contentflag( content_playerclipbutton, HERETIC2_CONTENTS_PLAYERCLIP, ( GTK_TOGGLE_BUTTON( content_playerclipbutton )->active ) );
917 on_content_monsterclipbutton_toggled( GtkToggleButton *togglebutton,
918 gpointer user_data ){
919 change_contentflag( content_monsterclipbutton, HERETIC2_CONTENTS_MONSTERCLIP, ( GTK_TOGGLE_BUTTON( content_monsterclipbutton )->active ) );
924 on_content_current0button_toggled( GtkToggleButton *togglebutton,
925 gpointer user_data ){
926 change_contentflag( content_current0button, HERETIC2_CONTENTS_CURRENT_0, ( GTK_TOGGLE_BUTTON( content_current0button )->active ) );
931 on_content_current90button_toggled( GtkToggleButton *togglebutton,
932 gpointer user_data ){
933 change_contentflag( content_current90button, HERETIC2_CONTENTS_CURRENT_90, ( GTK_TOGGLE_BUTTON( content_current90button )->active ) );
938 on_content_current180button_toggled( GtkToggleButton *togglebutton,
939 gpointer user_data ){
940 change_contentflag( content_current180button, HERETIC2_CONTENTS_CURRENT_180, ( GTK_TOGGLE_BUTTON( content_current180button )->active ) );
945 on_content_current270button_toggled( GtkToggleButton *togglebutton,
946 gpointer user_data ){
947 change_contentflag( content_current270button, HERETIC2_CONTENTS_CURRENT_270, ( GTK_TOGGLE_BUTTON( content_current270button )->active ) );
952 on_content_currentUPbutton_toggled( GtkToggleButton *togglebutton,
953 gpointer user_data ){
954 change_contentflag( content_currentUPbutton, HERETIC2_CONTENTS_CURRENT_UP, ( GTK_TOGGLE_BUTTON( content_currentUPbutton )->active ) );
959 on_content_currentDOWNbutton_toggled( GtkToggleButton *togglebutton,
960 gpointer user_data ){
961 change_contentflag( content_currentDOWNbutton, HERETIC2_CONTENTS_CURRENT_DOWN, ( GTK_TOGGLE_BUTTON( content_currentDOWNbutton )->active ) );
966 on_content_originbutton_toggled( GtkToggleButton *togglebutton,
967 gpointer user_data ){
968 change_contentflag( content_originbutton, HERETIC2_CONTENTS_ORIGIN, ( GTK_TOGGLE_BUTTON( content_originbutton )->active ) );
973 on_content_detailbutton_toggled( GtkToggleButton *togglebutton,
974 gpointer user_data ){
975 change_contentflag( content_detailbutton, HERETIC2_CONTENTS_DETAIL, ( GTK_TOGGLE_BUTTON( content_detailbutton )->active ) );
980 on_content_ladderbutton_toggled( GtkToggleButton *togglebutton,
981 gpointer user_data ){
982 change_contentflag( content_ladderbutton, HERETIC2_CONTENTS_LADDER, ( GTK_TOGGLE_BUTTON( content_ladderbutton )->active ) );
987 on_content_camnoblockbutton_toggled( GtkToggleButton *togglebutton,
988 gpointer user_data ){
989 change_contentflag( content_camnoblockbutton, HERETIC2_CONTENTS_CAMERANOBLOCK, ( GTK_TOGGLE_BUTTON( content_camnoblockbutton )->active ) );
992 // Value Entry Callback
994 on_surf_value_entry_changed( GtkEditable *editable,
995 gpointer user_data ){
996 if ( ( !setup_buttons ) ) { // If we're setting up the buttons, don't change value
997 working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable ) );
1002 on_surf_value_entry_insert_text( GtkEditable *editable,
1004 gint new_text_length,
1006 gpointer user_data ){
1010 // Limit input to digits, throwing out anything else
1011 // Modified from Gtk FAQ for text filtering of GtkEntry
1012 result = g_new( gchar, new_text_length );
1014 for ( i = 0; i < new_text_length; i++ ) {
1015 if ( !isdigit( new_text[i] ) ) {
1018 result[count++] = new_text[i];
1022 gtk_signal_handler_block_by_func( GTK_OBJECT( editable ),
1023 GTK_SIGNAL_FUNC( on_surf_value_entry_insert_text ),
1025 gtk_editable_insert_text( editable, result, count, position );
1026 gtk_signal_handler_unblock_by_func( GTK_OBJECT( editable ),
1027 GTK_SIGNAL_FUNC( on_surf_value_entry_insert_text ),
1030 gtk_signal_emit_stop_by_name( GTK_OBJECT( editable ), "insert_text" );
1035 #define HERETIC2_FLAG_BUTTON_BORDER 3
1037 GtkWidget* Create_Heretic2FlagsDialog( GtkWidget* surfacedialog_widget ){
1039 GtkWidget *notebook1;
1055 frame1 = gtk_frame_new( _( "Brush/Face Flags" ) );
1056 gtk_widget_show( frame1 );
1057 gtk_container_add( GTK_CONTAINER( surfacedialog_widget ), frame1 );
1059 notebook1 = gtk_notebook_new();
1060 gtk_widget_show( notebook1 );
1061 gtk_container_add( GTK_CONTAINER( frame1 ), notebook1 );
1063 vbox3 = gtk_vbox_new( FALSE, 0 );
1064 gtk_widget_show( vbox3 );
1065 gtk_container_add( GTK_CONTAINER( notebook1 ), vbox3 );
1067 table1 = gtk_table_new( 3, 4, TRUE );
1068 gtk_widget_show( table1 );
1069 gtk_box_pack_start( GTK_BOX( vbox3 ), table1, TRUE, TRUE, 0 );
1071 surface_lightbutton = gtk_toggle_button_new_with_mnemonic( _( "Light" ) );
1072 gtk_widget_show( surface_lightbutton );
1073 gtk_table_attach( GTK_TABLE( table1 ), surface_lightbutton, 0, 1, 0, 1,
1074 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1075 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1077 surface_slickbutton = gtk_toggle_button_new_with_mnemonic( _( "Slick" ) );
1078 gtk_widget_show( surface_slickbutton );
1079 gtk_table_attach( GTK_TABLE( table1 ), surface_slickbutton, 1, 2, 0, 1,
1080 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1081 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1083 surface_skybutton = gtk_toggle_button_new_with_mnemonic( _( "Sky" ) );
1084 gtk_widget_show( surface_skybutton );
1085 gtk_table_attach( GTK_TABLE( table1 ), surface_skybutton, 2, 3, 0, 1,
1086 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1087 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1089 surface_warpbutton = gtk_toggle_button_new_with_mnemonic( _( "Warp" ) );
1090 gtk_widget_show( surface_warpbutton );
1091 gtk_table_attach( GTK_TABLE( table1 ), surface_warpbutton, 3, 4, 0, 1,
1092 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1093 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1095 surface_trans33button = gtk_toggle_button_new_with_mnemonic( _( "Trans33" ) );
1096 gtk_widget_show( surface_trans33button );
1097 gtk_table_attach( GTK_TABLE( table1 ), surface_trans33button, 0, 1, 1, 2,
1098 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1099 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1101 surface_trans66button = gtk_toggle_button_new_with_mnemonic( _( "Trans66" ) );
1102 gtk_widget_show( surface_trans66button );
1103 gtk_table_attach( GTK_TABLE( table1 ), surface_trans66button, 1, 2, 1, 2,
1104 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1105 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1107 surface_flowingbutton = gtk_toggle_button_new_with_mnemonic( _( "Flowing" ) );
1108 gtk_widget_show( surface_flowingbutton );
1109 gtk_table_attach( GTK_TABLE( table1 ), surface_flowingbutton, 2, 3, 1, 2,
1110 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1111 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1113 surface_nodrawbutton = gtk_toggle_button_new_with_mnemonic( _( "NoDraw" ) );
1114 gtk_widget_show( surface_nodrawbutton );
1115 gtk_table_attach( GTK_TABLE( table1 ), surface_nodrawbutton, 3, 4, 1, 2,
1116 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1117 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1119 surface_tallwallbutton = gtk_toggle_button_new_with_mnemonic( _( "TallWall" ) );
1120 gtk_widget_show( surface_tallwallbutton );
1121 gtk_table_attach( GTK_TABLE( table1 ), surface_tallwallbutton, 0, 1, 2, 3,
1122 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1123 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1125 surface_alphatexbutton = gtk_toggle_button_new_with_mnemonic( _( "AlphaTex" ) );
1126 gtk_widget_show( surface_alphatexbutton );
1127 gtk_table_attach( GTK_TABLE( table1 ), surface_alphatexbutton, 1, 2, 2, 3,
1128 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1129 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1131 surface_animspeedbutton = gtk_toggle_button_new_with_mnemonic( _( "AnimSpeed" ) );
1132 gtk_widget_show( surface_animspeedbutton );
1133 gtk_table_attach( GTK_TABLE( table1 ), surface_animspeedbutton, 2, 3, 2, 3,
1134 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1135 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1137 surface_undulatebutton = gtk_toggle_button_new_with_mnemonic( _( "Undulate" ) );
1138 gtk_widget_show( surface_undulatebutton );
1139 gtk_table_attach( GTK_TABLE( table1 ), surface_undulatebutton, 3, 4, 2, 3,
1140 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1141 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1143 frame2 = gtk_frame_new( NULL );
1144 gtk_widget_show( frame2 );
1145 gtk_box_pack_start( GTK_BOX( vbox3 ), frame2, FALSE, FALSE, 0 );
1146 gtk_frame_set_shadow_type( GTK_FRAME( frame2 ), GTK_SHADOW_ETCHED_OUT );
1147 gtk_container_set_border_width( GTK_CONTAINER( frame2 ), 4 );
1149 hbox4 = gtk_hbox_new( FALSE, 0 );
1150 gtk_widget_show( hbox4 );
1151 gtk_container_add( GTK_CONTAINER( frame2 ), hbox4 );
1153 surf_gravel_radiobutton = gtk_radio_button_new_with_mnemonic( NULL, _( "Gravel" ) );
1154 gtk_widget_show( surf_gravel_radiobutton );
1155 gtk_box_pack_start( GTK_BOX( hbox4 ), surf_gravel_radiobutton, TRUE, FALSE, 0 );
1157 surf_metal_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget( GTK_RADIO_BUTTON( surf_gravel_radiobutton ), _( "Metal" ) );
1158 gtk_widget_show( surf_metal_radiobutton );
1159 gtk_box_pack_start( GTK_BOX( hbox4 ), surf_metal_radiobutton, TRUE, FALSE, 0 );
1161 surf_stone_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget( GTK_RADIO_BUTTON( surf_metal_radiobutton ), _( "Stone" ) );
1162 gtk_widget_show( surf_stone_radiobutton );
1163 gtk_box_pack_start( GTK_BOX( hbox4 ), surf_stone_radiobutton, TRUE, FALSE, 0 );
1165 surf_wood_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget( GTK_RADIO_BUTTON( surf_stone_radiobutton ), _( "Wood" ) );
1166 gtk_widget_show( surf_wood_radiobutton );
1167 gtk_box_pack_start( GTK_BOX( hbox4 ), surf_wood_radiobutton, TRUE, FALSE, 0 );
1169 label4 = gtk_label_new( _( "Material" ) );
1170 gtk_widget_show( label4 );
1171 gtk_frame_set_label_widget( GTK_FRAME( frame2 ), label4 );
1172 gtk_label_set_justify( GTK_LABEL( label4 ), GTK_JUSTIFY_LEFT );
1174 table3 = gtk_table_new( 1, 4, FALSE );
1175 gtk_widget_show( table3 );
1176 gtk_box_pack_start( GTK_BOX( vbox3 ), table3, FALSE, FALSE, 0 );
1177 gtk_container_set_border_width( GTK_CONTAINER( table3 ), 3 );
1179 hbox1 = gtk_hbox_new( FALSE, 0 );
1180 gtk_widget_show( hbox1 );
1181 gtk_table_attach( GTK_TABLE( table3 ), hbox1, 0, 1, 0, 1,
1182 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1183 (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
1185 label5 = gtk_label_new( _( "Value: " ) );
1186 gtk_widget_show( label5 );
1187 gtk_table_attach( GTK_TABLE( table3 ), label5, 1, 2, 0, 1,
1188 (GtkAttachOptions) ( 0 ),
1189 (GtkAttachOptions) ( 0 ), 0, 0 );
1190 gtk_misc_set_alignment( GTK_MISC( label5 ), 0, 0 );
1191 gtk_label_set_justify( GTK_LABEL( label5 ), GTK_JUSTIFY_RIGHT );
1193 surf_value_entry = gtk_entry_new();
1194 gtk_widget_show( surf_value_entry );
1195 gtk_table_attach( GTK_TABLE( table3 ), surf_value_entry, 2, 3, 0, 1,
1196 (GtkAttachOptions) ( GTK_FILL ),
1197 (GtkAttachOptions) ( 0 ), 0, 0 );
1199 hbox2 = gtk_hbox_new( FALSE, 0 );
1200 gtk_widget_show( hbox2 );
1201 gtk_table_attach( GTK_TABLE( table3 ), hbox2, 3, 4, 0, 1,
1202 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1203 (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
1205 label2 = gtk_label_new( _( "Surface Flags" ) );
1206 gtk_widget_show( label2 );
1207 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ), gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ), 0 ), label2 );
1208 gtk_label_set_justify( GTK_LABEL( label2 ), GTK_JUSTIFY_LEFT );
1210 table2 = gtk_table_new( 5, 4, TRUE );
1211 gtk_widget_show( table2 );
1212 gtk_container_add( GTK_CONTAINER( notebook1 ), table2 );
1214 content_solidbutton = gtk_toggle_button_new_with_mnemonic( _( "Solid" ) );
1215 gtk_widget_show( content_solidbutton );
1216 gtk_table_attach( GTK_TABLE( table2 ), content_solidbutton, 0, 1, 0, 1,
1217 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1218 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1220 content_windowbutton = gtk_toggle_button_new_with_mnemonic( _( "Window" ) );
1221 gtk_widget_show( content_windowbutton );
1222 gtk_table_attach( GTK_TABLE( table2 ), content_windowbutton, 1, 2, 0, 1,
1223 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1224 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1226 content_illusbutton = gtk_toggle_button_new_with_mnemonic( _( "Illusion" ) );
1227 gtk_widget_show( content_illusbutton );
1228 gtk_table_attach( GTK_TABLE( table2 ), content_illusbutton, 2, 3, 0, 1,
1229 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1230 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1232 content_lavabutton = gtk_toggle_button_new_with_mnemonic( _( "Lava" ) );
1233 gtk_widget_show( content_lavabutton );
1234 gtk_table_attach( GTK_TABLE( table2 ), content_lavabutton, 3, 4, 0, 1,
1235 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1236 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1238 content_slimebutton = gtk_toggle_button_new_with_mnemonic( _( "Slime" ) );
1239 gtk_widget_show( content_slimebutton );
1240 gtk_table_attach( GTK_TABLE( table2 ), content_slimebutton, 0, 1, 1, 2,
1241 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1242 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1244 content_waterbutton = gtk_toggle_button_new_with_mnemonic( _( "Water" ) );
1245 gtk_widget_show( content_waterbutton );
1246 gtk_table_attach( GTK_TABLE( table2 ), content_waterbutton, 1, 2, 1, 2,
1247 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1248 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1250 content_mistbutton = gtk_toggle_button_new_with_mnemonic( _( "Mist" ) );
1251 gtk_widget_show( content_mistbutton );
1252 gtk_table_attach( GTK_TABLE( table2 ), content_mistbutton, 2, 3, 1, 2,
1253 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1254 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1256 content_areaportalbutton = gtk_toggle_button_new_with_mnemonic( _( "AreaPortal" ) );
1257 gtk_widget_show( content_areaportalbutton );
1258 gtk_table_attach( GTK_TABLE( table2 ), content_areaportalbutton, 3, 4, 1, 2,
1259 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1260 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1262 content_playerclipbutton = gtk_toggle_button_new_with_mnemonic( _( "PlayerClip" ) );
1263 gtk_widget_show( content_playerclipbutton );
1264 gtk_table_attach( GTK_TABLE( table2 ), content_playerclipbutton, 0, 1, 2, 3,
1265 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1266 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1268 content_monsterclipbutton = gtk_toggle_button_new_with_mnemonic( _( "MonsterClip" ) );
1269 gtk_widget_show( content_monsterclipbutton );
1270 gtk_table_attach( GTK_TABLE( table2 ), content_monsterclipbutton, 1, 2, 2, 3,
1271 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1272 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1274 content_current0button = gtk_toggle_button_new_with_mnemonic( _( "Current 0" ) );
1275 gtk_widget_show( content_current0button );
1276 gtk_table_attach( GTK_TABLE( table2 ), content_current0button, 2, 3, 2, 3,
1277 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1278 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1280 content_current90button = gtk_toggle_button_new_with_mnemonic( _( "Current 90" ) );
1281 gtk_widget_show( content_current90button );
1282 gtk_table_attach( GTK_TABLE( table2 ), content_current90button, 3, 4, 2, 3,
1283 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1284 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1286 content_current180button = gtk_toggle_button_new_with_mnemonic( _( "Current 180" ) );
1287 gtk_widget_show( content_current180button );
1288 gtk_table_attach( GTK_TABLE( table2 ), content_current180button, 0, 1, 3, 4,
1289 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1290 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1292 content_current270button = gtk_toggle_button_new_with_mnemonic( _( "Current 270" ) );
1293 gtk_widget_show( content_current270button );
1294 gtk_table_attach( GTK_TABLE( table2 ), content_current270button, 1, 2, 3, 4,
1295 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1296 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1298 content_currentUPbutton = gtk_toggle_button_new_with_mnemonic( _( "Current UP" ) );
1299 gtk_widget_show( content_currentUPbutton );
1300 gtk_table_attach( GTK_TABLE( table2 ), content_currentUPbutton, 2, 3, 3, 4,
1301 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1302 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1304 content_currentDOWNbutton = gtk_toggle_button_new_with_mnemonic( _( "Current DOWN" ) );
1305 gtk_widget_show( content_currentDOWNbutton );
1306 gtk_table_attach( GTK_TABLE( table2 ), content_currentDOWNbutton, 3, 4, 3, 4,
1307 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1308 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1310 content_originbutton = gtk_toggle_button_new_with_mnemonic( _( "Origin" ) );
1311 gtk_widget_show( content_originbutton );
1312 gtk_table_attach( GTK_TABLE( table2 ), content_originbutton, 0, 1, 4, 5,
1313 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1314 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1316 content_detailbutton = gtk_toggle_button_new_with_mnemonic( _( "Detail" ) );
1317 gtk_widget_show( content_detailbutton );
1318 gtk_table_attach( GTK_TABLE( table2 ), content_detailbutton, 1, 2, 4, 5,
1319 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1320 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1322 content_ladderbutton = gtk_toggle_button_new_with_mnemonic( _( "Ladder" ) );
1323 gtk_widget_show( content_ladderbutton );
1324 gtk_table_attach( GTK_TABLE( table2 ), content_ladderbutton, 2, 3, 4, 5,
1325 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1326 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1328 content_camnoblockbutton = gtk_toggle_button_new_with_mnemonic( _( "Cam No Block" ) );
1329 gtk_widget_show( content_camnoblockbutton );
1330 gtk_table_attach( GTK_TABLE( table2 ), content_camnoblockbutton, 3, 4, 4, 5,
1331 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
1332 (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
1334 label3 = gtk_label_new( _( "Content Flags" ) );
1335 gtk_widget_show( label3 );
1336 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ), gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ), 1 ), label3 );
1337 gtk_label_set_justify( GTK_LABEL( label3 ), GTK_JUSTIFY_LEFT );
1340 g_signal_connect( (gpointer) surface_lightbutton, "toggled",
1341 G_CALLBACK( on_surface_lightbutton_toggled ),
1343 g_signal_connect( (gpointer) surface_slickbutton, "toggled",
1344 G_CALLBACK( on_surface_slickbutton_toggled ),
1346 g_signal_connect( (gpointer) surface_skybutton, "toggled",
1347 G_CALLBACK( on_surface_skybutton_toggled ),
1349 g_signal_connect( (gpointer) surface_warpbutton, "toggled",
1350 G_CALLBACK( on_surface_warpbutton_toggled ),
1352 g_signal_connect( (gpointer) surface_trans33button, "toggled",
1353 G_CALLBACK( on_surface_trans33button_toggled ),
1355 g_signal_connect( (gpointer) surface_trans66button, "toggled",
1356 G_CALLBACK( on_surface_trans66button_toggled ),
1358 g_signal_connect( (gpointer) surface_flowingbutton, "toggled",
1359 G_CALLBACK( on_surface_flowingbutton_toggled ),
1361 g_signal_connect( (gpointer) surface_nodrawbutton, "toggled",
1362 G_CALLBACK( on_surface_nodrawbutton_toggled ),
1364 g_signal_connect( (gpointer) surface_tallwallbutton, "toggled",
1365 G_CALLBACK( on_surface_tallwallbutton_toggled ),
1367 g_signal_connect( (gpointer) surface_alphatexbutton, "toggled",
1368 G_CALLBACK( on_surface_alphatexbutton_toggled ),
1370 g_signal_connect( (gpointer) surface_animspeedbutton, "toggled",
1371 G_CALLBACK( on_surface_animspeedbutton_toggled ),
1373 g_signal_connect( (gpointer) surface_undulatebutton, "toggled",
1374 G_CALLBACK( on_surface_undulatebutton_toggled ),
1377 g_signal_connect( (gpointer) surf_gravel_radiobutton, "toggled",
1378 G_CALLBACK( on_surf_gravel_radiobutton_toggled ),
1380 g_signal_connect( (gpointer) surf_metal_radiobutton, "toggled",
1381 G_CALLBACK( on_surf_metal_radiobutton_toggled ),
1383 g_signal_connect( (gpointer) surf_stone_radiobutton, "toggled",
1384 G_CALLBACK( on_surf_stone_radiobutton_toggled ),
1386 g_signal_connect( (gpointer) surf_wood_radiobutton, "toggled",
1387 G_CALLBACK( on_surf_wood_radiobutton_toggled ),
1390 g_signal_connect( (gpointer) surf_value_entry, "changed",
1391 G_CALLBACK( on_surf_value_entry_changed ),
1393 g_signal_connect( (gpointer) surf_value_entry, "insert_text",
1394 G_CALLBACK( on_surf_value_entry_insert_text ),
1396 g_signal_connect( (gpointer) content_solidbutton, "toggled",
1397 G_CALLBACK( on_content_solidbutton_toggled ),
1399 g_signal_connect( (gpointer) content_windowbutton, "toggled",
1400 G_CALLBACK( on_content_windowbutton_toggled ),
1402 g_signal_connect( (gpointer) content_illusbutton, "toggled",
1403 G_CALLBACK( on_content_illusbutton_toggled ),
1405 g_signal_connect( (gpointer) content_lavabutton, "toggled",
1406 G_CALLBACK( on_content_lavabutton_toggled ),
1408 g_signal_connect( (gpointer) content_slimebutton, "toggled",
1409 G_CALLBACK( on_content_slimebutton_toggled ),
1411 g_signal_connect( (gpointer) content_waterbutton, "toggled",
1412 G_CALLBACK( on_content_waterbutton_toggled ),
1414 g_signal_connect( (gpointer) content_mistbutton, "toggled",
1415 G_CALLBACK( on_content_mistbutton_toggled ),
1417 g_signal_connect( (gpointer) content_areaportalbutton, "toggled",
1418 G_CALLBACK( on_content_areaportalbutton_toggled ),
1420 g_signal_connect( (gpointer) content_playerclipbutton, "toggled",
1421 G_CALLBACK( on_content_playerclipbutton_toggled ),
1423 g_signal_connect( (gpointer) content_monsterclipbutton, "toggled",
1424 G_CALLBACK( on_content_monsterclipbutton_toggled ),
1426 g_signal_connect( (gpointer) content_current0button, "toggled",
1427 G_CALLBACK( on_content_current0button_toggled ),
1429 g_signal_connect( (gpointer) content_current90button, "toggled",
1430 G_CALLBACK( on_content_current90button_toggled ),
1432 g_signal_connect( (gpointer) content_current180button, "toggled",
1433 G_CALLBACK( on_content_current180button_toggled ),
1435 g_signal_connect( (gpointer) content_current270button, "toggled",
1436 G_CALLBACK( on_content_current270button_toggled ),
1438 g_signal_connect( (gpointer) content_currentUPbutton, "toggled",
1439 G_CALLBACK( on_content_currentUPbutton_toggled ),
1441 g_signal_connect( (gpointer) content_currentDOWNbutton, "toggled",
1442 G_CALLBACK( on_content_currentDOWNbutton_toggled ),
1444 g_signal_connect( (gpointer) content_originbutton, "toggled",
1445 G_CALLBACK( on_content_originbutton_toggled ),
1447 g_signal_connect( (gpointer) content_detailbutton, "toggled",
1448 G_CALLBACK( on_content_detailbutton_toggled ),
1450 g_signal_connect( (gpointer) content_ladderbutton, "toggled",
1451 G_CALLBACK( on_content_ladderbutton_toggled ),
1453 g_signal_connect( (gpointer) content_camnoblockbutton, "toggled",
1454 G_CALLBACK( on_content_camnoblockbutton_toggled ),