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>
25 #include "surfdlg_plugin.h"
27 #include "surfaceflagsdialog_heretic2.h"
29 GtkWidget *surface_lightbutton;
30 GtkWidget *surface_slickbutton;
31 GtkWidget *surface_skybutton;
32 GtkWidget *surface_warpbutton;
33 GtkWidget *surface_trans33button;
34 GtkWidget *surface_trans66button;
35 GtkWidget *surface_flowingbutton;
36 GtkWidget *surface_nodrawbutton;
37 GtkWidget *surface_tallwallbutton;
38 GtkWidget *surface_alphatexbutton;
39 GtkWidget *surface_animspeedbutton;
40 GtkWidget *surface_undulatebutton;
42 GtkWidget *surf_gravel_radiobutton;
43 GSList *surf_gravel_radiobutton_group = NULL;
44 GtkWidget *surf_metal_radiobutton;
45 GtkWidget *surf_stone_radiobutton;
46 GtkWidget *surf_wood_radiobutton;
48 GtkWidget *surf_value_entry;
52 GtkWidget *content_solidbutton;
53 GtkWidget *content_windowbutton;
54 GtkWidget *content_illusbutton;
55 GtkWidget *content_lavabutton;
56 GtkWidget *content_slimebutton;
57 GtkWidget *content_waterbutton;
58 GtkWidget *content_mistbutton;
59 GtkWidget *content_areaportalbutton;
60 GtkWidget *content_playerclipbutton;
61 GtkWidget *content_monsterclipbutton;
62 GtkWidget *content_current0button;
63 GtkWidget *content_current90button;
64 GtkWidget *content_current180button;
65 GtkWidget *content_current270button;
66 GtkWidget *content_currentUPbutton;
67 GtkWidget *content_currentDOWNbutton;
68 GtkWidget *content_originbutton;
69 GtkWidget *content_detailbutton;
70 GtkWidget *content_ladderbutton;
71 GtkWidget *content_camnoblockbutton;
74 gboolean setup_buttons = TRUE;
76 int working_surface_flags;
78 int working_content_flags;
81 gboolean surface_material_inconsistant = FALSE;
83 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)
90 if ( gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (toggle_button)) )
92 gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), FALSE);
97 void clear_all_inconsistent(void)
99 clear_inconsistent( surface_lightbutton );
100 clear_inconsistent( surface_slickbutton );
101 clear_inconsistent( surface_skybutton );
102 clear_inconsistent( surface_warpbutton );
103 clear_inconsistent( surface_trans33button );
104 clear_inconsistent( surface_trans66button );
105 clear_inconsistent( surface_flowingbutton );
106 clear_inconsistent( surface_nodrawbutton );
107 clear_inconsistent( surface_tallwallbutton );
108 clear_inconsistent( surface_alphatexbutton );
109 clear_inconsistent( surface_animspeedbutton );
110 clear_inconsistent( surface_undulatebutton );
112 clear_inconsistent( surf_gravel_radiobutton );
113 clear_inconsistent( surf_metal_radiobutton );
114 clear_inconsistent( surf_stone_radiobutton );
115 clear_inconsistent( surf_wood_radiobutton );
117 clear_inconsistent( content_solidbutton );
118 clear_inconsistent( content_windowbutton );
119 clear_inconsistent( content_illusbutton );
120 clear_inconsistent( content_lavabutton );
121 clear_inconsistent( content_slimebutton );
122 clear_inconsistent( content_waterbutton );
123 clear_inconsistent( content_mistbutton );
124 clear_inconsistent( content_areaportalbutton );
125 clear_inconsistent( content_playerclipbutton );
126 clear_inconsistent( content_monsterclipbutton );
127 clear_inconsistent( content_current0button );
128 clear_inconsistent( content_current90button );
129 clear_inconsistent( content_current180button );
130 clear_inconsistent( content_current270button );
131 clear_inconsistent( content_currentUPbutton );
132 clear_inconsistent( content_currentDOWNbutton );
133 clear_inconsistent( content_originbutton );
134 clear_inconsistent( content_detailbutton );
135 clear_inconsistent( content_ladderbutton );
136 clear_inconsistent( content_camnoblockbutton );
139 void clear_all_buttons_and_values()
141 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_lightbutton ), FALSE);
142 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_slickbutton ), FALSE);
143 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_skybutton ), FALSE);
144 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_warpbutton ), FALSE);
145 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_trans33button ), FALSE);
146 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_trans66button ), FALSE);
147 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_flowingbutton ), FALSE);
148 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_nodrawbutton ), FALSE);
149 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_tallwallbutton ), FALSE);
150 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_alphatexbutton ), FALSE);
151 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_animspeedbutton ), FALSE);
152 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_undulatebutton ), FALSE);
154 // surface_material_inconsistant = TRUE;
156 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), FALSE);
157 set_inconsistent(surf_gravel_radiobutton);
159 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), FALSE);
160 set_inconsistent(surf_metal_radiobutton);
162 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), FALSE);
163 set_inconsistent(surf_stone_radiobutton);
165 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), FALSE);
166 set_inconsistent(surf_wood_radiobutton);
168 gtk_entry_set_text( (GtkEntry *)surf_value_entry, "");
170 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_solidbutton ), FALSE);
171 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_windowbutton ), FALSE);
172 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_illusbutton ), FALSE);
173 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_lavabutton ), FALSE);
174 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_slimebutton ), FALSE);
175 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_waterbutton ), FALSE);
176 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_mistbutton ), FALSE);
177 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_areaportalbutton ), FALSE);
178 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_playerclipbutton ), FALSE);
179 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_monsterclipbutton ), FALSE);
180 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current0button ), FALSE);
181 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current90button ), FALSE);
182 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current180button ), FALSE);
183 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current270button ), FALSE);
184 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_currentUPbutton ), FALSE);
185 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), FALSE);
186 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_originbutton ), FALSE);
187 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_detailbutton ), FALSE);
188 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_ladderbutton ), FALSE);
189 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_camnoblockbutton ), FALSE);
193 void SetFlagButtons_Heretic2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty)
199 int diff_contents = 0;
201 gboolean diff_value = FALSE;
203 texdef_t* tmp_texdef;
204 texdef_to_face_t* temp_texdef_face_list;
205 gboolean surface_which_material_inconsistant[4];
206 int surface_iterator;
208 setup_buttons = TRUE;
209 working_surface_flags = 0;
211 working_content_flags = 0;
214 surface_material_inconsistant = FALSE;
215 surface_which_material_inconsistant[0] = FALSE;
216 surface_which_material_inconsistant[1] = FALSE;
217 surface_which_material_inconsistant[2] = FALSE;
218 surface_which_material_inconsistant[3] = FALSE;
222 tmp_texdef = &texdef_face_list->texdef;
223 contents = tmp_texdef->contents;
224 flags = tmp_texdef->flags;
225 value = tmp_texdef->value;
227 surface_iterator = (tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24; // Inconsistant Material?
228 surface_which_material_inconsistant[surface_iterator] = TRUE;
230 for (temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
232 tmp_texdef = &temp_texdef_face_list->texdef;
233 diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent
234 diff_flags |= flags ^ tmp_texdef->flags;
235 if (tmp_texdef->value != value)
238 surface_iterator = (tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24; // Inconsistant Material?
239 surface_which_material_inconsistant[surface_iterator] = TRUE;
241 Sys_Printf("Diff_Flags: %d\t Surf_Iter: %d\n",diff_flags, surface_iterator);
247 clear_all_inconsistent();
249 // If no faces/brushes are selected, clear everything and bail
252 clear_all_buttons_and_values();
253 setup_buttons = FALSE;
257 // Set surface buttons to reflect brush/face flags, contents, and values
258 if(diff_flags & HERETIC2_SURF_LIGHT)
259 set_inconsistent(surface_lightbutton);
261 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), (flags & HERETIC2_SURF_LIGHT));
263 if(diff_flags & HERETIC2_SURF_SLICK)
264 set_inconsistent(surface_slickbutton);
265 else if(flags & HERETIC2_SURF_SLICK)
266 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), TRUE);
268 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE);
270 if(diff_flags & HERETIC2_SURF_SKY)
271 set_inconsistent(surface_skybutton);
272 else if(flags & HERETIC2_SURF_SKY)
273 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), TRUE);
275 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE);
277 if(diff_flags & HERETIC2_SURF_WARP)
278 set_inconsistent(surface_warpbutton);
279 else if(flags & HERETIC2_SURF_WARP)
280 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), TRUE);
282 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE);
284 if(diff_flags & HERETIC2_SURF_TRANS33)
285 set_inconsistent(surface_trans33button);
286 else if(flags & HERETIC2_SURF_TRANS33)
287 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), TRUE);
289 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE);
291 if(diff_flags & HERETIC2_SURF_TRANS66)
292 set_inconsistent(surface_trans66button);
293 else if(flags & HERETIC2_SURF_TRANS66)
294 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), TRUE);
296 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE);
298 if(diff_flags & HERETIC2_SURF_FLOWING)
299 set_inconsistent(surface_flowingbutton);
300 else if(flags & HERETIC2_SURF_FLOWING)
301 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), TRUE);
303 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE);
305 if(diff_flags & HERETIC2_SURF_NODRAW)
306 set_inconsistent(surface_nodrawbutton);
307 else if(flags & HERETIC2_SURF_NODRAW)
308 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), TRUE);
310 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE);
312 if(diff_flags & HERETIC2_SURF_TALL_WALL)
313 set_inconsistent(surface_tallwallbutton);
314 else if(flags & HERETIC2_SURF_TALL_WALL)
315 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_tallwallbutton ), TRUE);
317 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_tallwallbutton ), FALSE);
319 if(diff_flags & HERETIC2_SURF_ALPHA_TEXTURE)
320 set_inconsistent(surface_alphatexbutton);
321 else if(flags & HERETIC2_SURF_ALPHA_TEXTURE)
322 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_alphatexbutton ), TRUE);
324 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_alphatexbutton ), FALSE);
326 if(diff_flags & HERETIC2_SURF_ANIMSPEED)
327 set_inconsistent(surface_animspeedbutton);
328 else if(flags & HERETIC2_SURF_ANIMSPEED)
329 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_animspeedbutton ), TRUE);
331 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_animspeedbutton ), FALSE);
333 if(diff_flags & HERETIC2_SURF_UNDULATE)
334 set_inconsistent(surface_undulatebutton);
335 else if(flags & HERETIC2_SURF_UNDULATE)
336 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_undulatebutton ), TRUE);
338 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_undulatebutton ), FALSE);
340 if(diff_flags & ~HERETIC2_SURF_MATERIAL_MASK)
342 Sys_Printf("--> %d\n", (diff_flags & ~HERETIC2_SURF_MATERIAL_MASK) );
343 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]);
345 if (surface_which_material_inconsistant[0])
347 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), FALSE);
348 surface_material_inconsistant = TRUE;
349 set_inconsistent(surf_gravel_radiobutton);
351 if (surface_which_material_inconsistant[1])
353 //if (!surface_material_inconsistant)
355 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), FALSE);
356 surface_material_inconsistant = TRUE;
358 set_inconsistent(surf_metal_radiobutton);
360 if (surface_which_material_inconsistant[2])
362 //if (!surface_material_inconsistant)
364 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), FALSE);
365 surface_material_inconsistant = TRUE;
367 set_inconsistent(surf_stone_radiobutton);
369 if (surface_which_material_inconsistant[3])
371 //if (!surface_material_inconsistant)
373 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), FALSE);
374 surface_material_inconsistant = TRUE;
376 set_inconsistent(surf_wood_radiobutton);
381 if(flags & ~HERETIC2_SURF_MATERIAL_MASK)
383 surface_iterator = (flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24;
384 if( surface_iterator == 1)
385 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), TRUE);
386 else if(surface_iterator == 2)
387 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), TRUE);
388 else if(surface_iterator == 3)
389 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), TRUE);
393 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), TRUE);
397 // Set content buttons to reflect brush values
398 if(diff_contents & HERETIC2_CONTENTS_SOLID)
399 set_inconsistent(content_solidbutton);
400 else if(contents & HERETIC2_CONTENTS_SOLID)
401 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), TRUE);
403 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE);
405 if(diff_contents & HERETIC2_CONTENTS_WINDOW)
406 set_inconsistent(content_windowbutton);
407 else if(contents & HERETIC2_CONTENTS_WINDOW)
408 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), TRUE);
410 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE);
412 if(diff_contents & HERETIC2_CONTENTS_ILLUSIONARY)
413 set_inconsistent(content_illusbutton);
414 else if(contents & HERETIC2_CONTENTS_ILLUSIONARY)
415 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_illusbutton ), TRUE);
417 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_illusbutton ), FALSE);
419 if(diff_contents & HERETIC2_CONTENTS_LAVA)
420 set_inconsistent(content_lavabutton);
421 else if(contents & HERETIC2_CONTENTS_LAVA)
422 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), TRUE);
424 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE);
426 if(diff_contents & HERETIC2_CONTENTS_SLIME)
427 set_inconsistent(content_slimebutton);
428 else if(contents & HERETIC2_CONTENTS_SLIME)
429 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), TRUE);
431 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE);
433 if(diff_contents & HERETIC2_CONTENTS_WATER)
434 set_inconsistent(content_waterbutton);
435 else if(contents & HERETIC2_CONTENTS_WATER)
436 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), TRUE);
438 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE);
440 if(diff_contents & HERETIC2_CONTENTS_MIST)
441 set_inconsistent(content_mistbutton);
442 else if(contents & HERETIC2_CONTENTS_MIST)
443 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), TRUE);
445 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE);
447 if(diff_contents & HERETIC2_CONTENTS_AREAPORTAL)
448 set_inconsistent(content_areaportalbutton);
449 else if(contents & HERETIC2_CONTENTS_AREAPORTAL)
450 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), TRUE);
452 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE);
454 if(diff_contents & HERETIC2_CONTENTS_PLAYERCLIP)
455 set_inconsistent(content_playerclipbutton);
456 else if(contents & HERETIC2_CONTENTS_PLAYERCLIP)
457 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), TRUE);
459 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE);
461 if(diff_contents & HERETIC2_CONTENTS_MONSTERCLIP)
462 set_inconsistent(content_monsterclipbutton);
463 else if(contents & HERETIC2_CONTENTS_MONSTERCLIP)
464 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), TRUE);
466 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE);
468 if(diff_contents & HERETIC2_CONTENTS_CURRENT_0)
469 set_inconsistent(content_current0button);
470 else if(contents & HERETIC2_CONTENTS_CURRENT_0)
471 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), TRUE);
473 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE);
475 if(diff_contents & HERETIC2_CONTENTS_CURRENT_90)
476 set_inconsistent(content_current90button);
477 else if(contents & HERETIC2_CONTENTS_CURRENT_90)
478 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), TRUE);
480 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE);
482 if(diff_contents & HERETIC2_CONTENTS_CURRENT_180)
483 set_inconsistent(content_current180button);
484 else if(contents & HERETIC2_CONTENTS_CURRENT_180)
485 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), TRUE);
487 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE);
489 if(diff_contents & HERETIC2_CONTENTS_CURRENT_270)
490 set_inconsistent(content_current270button);
491 else if(contents & HERETIC2_CONTENTS_CURRENT_270)
492 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), TRUE);
494 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE);
496 if(diff_contents & HERETIC2_CONTENTS_CURRENT_UP)
497 set_inconsistent(content_currentUPbutton);
498 else if(contents & HERETIC2_CONTENTS_CURRENT_UP)
499 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), TRUE);
501 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE);
503 if(diff_contents & HERETIC2_CONTENTS_CURRENT_DOWN)
504 set_inconsistent(content_currentDOWNbutton);
505 else if(contents & HERETIC2_CONTENTS_CURRENT_DOWN)
506 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), TRUE);
508 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE);
510 if(diff_contents & HERETIC2_CONTENTS_ORIGIN)
511 set_inconsistent(content_originbutton);
512 else if(contents & HERETIC2_CONTENTS_ORIGIN)
513 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), TRUE);
515 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE);
517 if(diff_contents & HERETIC2_CONTENTS_DETAIL)
518 set_inconsistent(content_detailbutton);
519 else if(contents & HERETIC2_CONTENTS_DETAIL)
520 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), TRUE);
522 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE);
524 if(diff_contents & HERETIC2_CONTENTS_LADDER)
525 set_inconsistent(content_ladderbutton);
526 else if(contents & HERETIC2_CONTENTS_LADDER)
527 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), TRUE);
529 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE);
531 if(diff_contents & HERETIC2_CONTENTS_CAMERANOBLOCK)
532 set_inconsistent(content_camnoblockbutton);
533 else if(contents & HERETIC2_CONTENTS_CAMERANOBLOCK)
534 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_camnoblockbutton ), TRUE);
536 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_camnoblockbutton ), FALSE);
540 gtk_entry_set_text( (GtkEntry *)surf_value_entry, "");
543 working_value = value;
544 sprintf( tex_buff, "%d", value);
545 gtk_entry_set_text( (GtkEntry *)surf_value_entry, tex_buff);
548 setup_buttons = FALSE;
551 void SetChangeInFlags_Face_Heretic2 (texdef_to_face_t *texdef_face_list)
553 texdef_to_face_t *temp_texdef_face_list;
554 texdef_t *tmp_texdef;
556 for (temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
558 tmp_texdef = &temp_texdef_face_list->texdef;
559 tmp_texdef->flags = (tmp_texdef->flags & ~surface_mask) | working_surface_flags;
560 tmp_texdef->contents = (tmp_texdef->contents & ~content_mask) | working_content_flags;
561 tmp_texdef->value = working_value;
562 Sys_Printf("content_flag: %d content_mask: %d\n",working_content_flags,content_mask);
563 Sys_Printf("content: %d\n",tmp_texdef->contents);
567 inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag) // For Material
569 if (!setup_buttons) // If we're setting up the buttons, we really don't need to
570 { // set flags that are already set
571 if (surface_material_inconsistant)
573 clear_inconsistent( surf_gravel_radiobutton );
574 clear_inconsistent( surf_metal_radiobutton );
575 clear_inconsistent( surf_stone_radiobutton );
576 clear_inconsistent( surf_wood_radiobutton );
578 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
579 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | sur_flag;
583 inline void change_material (GtkWidget *togglebutton)
585 if (!setup_buttons) // If we're setting up the buttons, we really don't need to
586 { // set flags that are already set
587 if (surface_material_inconsistant)
589 clear_inconsistent( surf_gravel_radiobutton );
590 clear_inconsistent( surf_metal_radiobutton );
591 clear_inconsistent( surf_stone_radiobutton );
592 clear_inconsistent( surf_wood_radiobutton );
594 if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_gravel_radiobutton)) )
596 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
597 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_GRAVEL;
599 else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_metal_radiobutton)) )
601 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
602 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_METAL;
604 else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_stone_radiobutton)) )
606 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
607 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_STONE;
609 else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_wood_radiobutton)) )
611 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
612 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_WOOD;
617 inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to)
620 if (!setup_buttons) // If we're setting up the buttons, we really don't need to
621 { // set flags that are already set
622 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) // Clear out inconsistent, if set
623 clear_inconsistent(GTK_WIDGET (togglebutton));
625 surface_mask |= sur_flag;
628 working_surface_flags |= sur_flag;
630 working_surface_flags &= ~sur_flag;
634 inline void change_contentflag (GtkWidget *togglebutton, int content_flag, gboolean change_flag_to)
637 if ( (!setup_buttons) ) // If we're setting up the buttons, we really don't need to
638 { // set flags that are already set
640 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton)))
641 clear_inconsistent(togglebutton);
642 //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces.
644 content_mask |= content_flag;
647 working_content_flags |= content_flag;
649 working_content_flags &= ~content_flag;
654 // Surface Flags Callbacks
656 on_surface_lightbutton_toggled (GtkToggleButton *togglebutton,
659 change_surfaceflag(surface_lightbutton, HERETIC2_SURF_LIGHT, (GTK_TOGGLE_BUTTON (surface_lightbutton)->active));
664 on_surface_slickbutton_toggled (GtkToggleButton *togglebutton,
667 change_surfaceflag(surface_slickbutton, HERETIC2_SURF_SLICK, (GTK_TOGGLE_BUTTON (surface_slickbutton)->active));
672 on_surface_skybutton_toggled (GtkToggleButton *togglebutton,
675 change_surfaceflag(surface_skybutton, HERETIC2_SURF_SKY, (GTK_TOGGLE_BUTTON (surface_skybutton)->active));
680 on_surface_warpbutton_toggled (GtkToggleButton *togglebutton,
683 change_surfaceflag(surface_warpbutton, HERETIC2_SURF_WARP, (GTK_TOGGLE_BUTTON (surface_warpbutton)->active));
688 on_surface_trans33button_toggled (GtkToggleButton *togglebutton,
691 change_surfaceflag(surface_trans33button, HERETIC2_SURF_TRANS33, (GTK_TOGGLE_BUTTON (surface_trans33button)->active));
696 on_surface_trans66button_toggled (GtkToggleButton *togglebutton,
699 change_surfaceflag(surface_trans66button, HERETIC2_SURF_TRANS66, (GTK_TOGGLE_BUTTON (surface_trans66button)->active));
704 on_surface_flowingbutton_toggled (GtkToggleButton *togglebutton,
707 change_surfaceflag(surface_flowingbutton, HERETIC2_SURF_FLOWING, (GTK_TOGGLE_BUTTON (surface_flowingbutton)->active));
712 on_surface_nodrawbutton_toggled (GtkToggleButton *togglebutton,
715 change_surfaceflag(surface_nodrawbutton, HERETIC2_SURF_NODRAW, (GTK_TOGGLE_BUTTON (surface_nodrawbutton)->active));
720 on_surface_tallwallbutton_toggled (GtkToggleButton *togglebutton,
723 change_surfaceflag(surface_tallwallbutton, HERETIC2_SURF_TALL_WALL, (GTK_TOGGLE_BUTTON (surface_tallwallbutton)->active));
728 on_surface_alphatexbutton_toggled (GtkToggleButton *togglebutton,
731 change_surfaceflag(surface_alphatexbutton, HERETIC2_SURF_ALPHA_TEXTURE, (GTK_TOGGLE_BUTTON (surface_alphatexbutton)->active));
736 on_surface_animspeedbutton_toggled (GtkToggleButton *togglebutton,
739 change_surfaceflag(surface_animspeedbutton, HERETIC2_SURF_ANIMSPEED, (GTK_TOGGLE_BUTTON (surface_animspeedbutton)->active));
744 on_surface_undulatebutton_toggled (GtkToggleButton *togglebutton,
747 change_surfaceflag(surface_undulatebutton, HERETIC2_SURF_UNDULATE, (GTK_TOGGLE_BUTTON (surface_undulatebutton)->active));
752 on_surf_gravel_radiobutton_toggled (GtkToggleButton *togglebutton,
755 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_gravel_radiobutton)))
756 change_material(GTK_WIDGET(togglebutton));
760 on_surf_metal_radiobutton_toggled (GtkToggleButton *togglebutton,
763 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_metal_radiobutton)))
764 change_material(GTK_WIDGET(togglebutton));
768 on_surf_stone_radiobutton_toggled (GtkToggleButton *togglebutton,
771 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_stone_radiobutton)))
772 change_material(GTK_WIDGET(togglebutton));
776 on_surf_wood_radiobutton_toggled (GtkToggleButton *togglebutton,
779 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_wood_radiobutton)))
780 change_material(GTK_WIDGET(togglebutton));
783 // Content Flags Callbacks
785 on_content_solidbutton_toggled (GtkToggleButton *togglebutton,
788 change_contentflag(content_solidbutton, HERETIC2_CONTENTS_SOLID, (GTK_TOGGLE_BUTTON (content_solidbutton)->active));
793 on_content_windowbutton_toggled (GtkToggleButton *togglebutton,
796 change_contentflag(content_windowbutton, HERETIC2_CONTENTS_WINDOW, (GTK_TOGGLE_BUTTON (content_windowbutton)->active));
801 on_content_illusbutton_toggled (GtkToggleButton *togglebutton,
804 change_contentflag(content_illusbutton, HERETIC2_CONTENTS_ILLUSIONARY, (GTK_TOGGLE_BUTTON (content_illusbutton)->active));
809 on_content_lavabutton_toggled (GtkToggleButton *togglebutton,
812 change_contentflag(content_lavabutton, HERETIC2_CONTENTS_LAVA, (GTK_TOGGLE_BUTTON (content_lavabutton)->active));
817 on_content_slimebutton_toggled (GtkToggleButton *togglebutton,
820 change_contentflag(content_slimebutton, HERETIC2_CONTENTS_SLIME, (GTK_TOGGLE_BUTTON (content_slimebutton)->active));
825 on_content_waterbutton_toggled (GtkToggleButton *togglebutton,
828 change_contentflag(content_waterbutton, HERETIC2_CONTENTS_WATER, (GTK_TOGGLE_BUTTON (content_waterbutton)->active));
833 on_content_mistbutton_toggled (GtkToggleButton *togglebutton,
836 change_contentflag(content_mistbutton, HERETIC2_CONTENTS_MIST, (GTK_TOGGLE_BUTTON (content_mistbutton)->active));
841 on_content_areaportalbutton_toggled (GtkToggleButton *togglebutton,
844 change_contentflag(content_areaportalbutton, HERETIC2_CONTENTS_AREAPORTAL, (GTK_TOGGLE_BUTTON (content_areaportalbutton)->active));
849 on_content_playerclipbutton_toggled (GtkToggleButton *togglebutton,
852 change_contentflag(content_playerclipbutton, HERETIC2_CONTENTS_PLAYERCLIP, (GTK_TOGGLE_BUTTON (content_playerclipbutton)->active));
857 on_content_monsterclipbutton_toggled (GtkToggleButton *togglebutton,
860 change_contentflag(content_monsterclipbutton, HERETIC2_CONTENTS_MONSTERCLIP, (GTK_TOGGLE_BUTTON (content_monsterclipbutton)->active));
865 on_content_current0button_toggled (GtkToggleButton *togglebutton,
868 change_contentflag(content_current0button, HERETIC2_CONTENTS_CURRENT_0, (GTK_TOGGLE_BUTTON (content_current0button)->active));
873 on_content_current90button_toggled (GtkToggleButton *togglebutton,
876 change_contentflag(content_current90button, HERETIC2_CONTENTS_CURRENT_90, (GTK_TOGGLE_BUTTON (content_current90button)->active));
881 on_content_current180button_toggled (GtkToggleButton *togglebutton,
884 change_contentflag(content_current180button, HERETIC2_CONTENTS_CURRENT_180, (GTK_TOGGLE_BUTTON (content_current180button)->active));
889 on_content_current270button_toggled (GtkToggleButton *togglebutton,
892 change_contentflag(content_current270button, HERETIC2_CONTENTS_CURRENT_270, (GTK_TOGGLE_BUTTON (content_current270button)->active));
897 on_content_currentUPbutton_toggled (GtkToggleButton *togglebutton,
900 change_contentflag(content_currentUPbutton, HERETIC2_CONTENTS_CURRENT_UP, (GTK_TOGGLE_BUTTON (content_currentUPbutton)->active));
905 on_content_currentDOWNbutton_toggled (GtkToggleButton *togglebutton,
908 change_contentflag(content_currentDOWNbutton, HERETIC2_CONTENTS_CURRENT_DOWN, (GTK_TOGGLE_BUTTON (content_currentDOWNbutton)->active));
913 on_content_originbutton_toggled (GtkToggleButton *togglebutton,
916 change_contentflag(content_originbutton, HERETIC2_CONTENTS_ORIGIN, (GTK_TOGGLE_BUTTON (content_originbutton)->active));
921 on_content_detailbutton_toggled (GtkToggleButton *togglebutton,
924 change_contentflag(content_detailbutton, HERETIC2_CONTENTS_DETAIL, (GTK_TOGGLE_BUTTON (content_detailbutton)->active));
929 on_content_ladderbutton_toggled (GtkToggleButton *togglebutton,
932 change_contentflag(content_ladderbutton, HERETIC2_CONTENTS_LADDER, (GTK_TOGGLE_BUTTON (content_ladderbutton)->active));
937 on_content_camnoblockbutton_toggled (GtkToggleButton *togglebutton,
940 change_contentflag(content_camnoblockbutton, HERETIC2_CONTENTS_CAMERANOBLOCK, (GTK_TOGGLE_BUTTON (content_camnoblockbutton)->active));
943 // Value Entry Callback
945 on_surf_value_entry_changed (GtkEditable *editable,
948 if ( (!setup_buttons) ) // If we're setting up the buttons, don't change value
949 working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable) );
953 on_surf_value_entry_insert_text (GtkEditable *editable,
955 gint new_text_length,
966 // Limit input to digits, throwing out anything else
967 // Modified from Gtk FAQ for text filtering of GtkEntry
968 result = g_new (gchar, new_text_length);
970 for (i=0; i < new_text_length; i++) {
971 if (!isdigit(new_text[i]))
973 result[count++] = new_text[i];
977 gtk_signal_handler_block_by_func (GTK_OBJECT (editable),
978 GTK_SIGNAL_FUNC (on_surf_value_entry_insert_text),
980 gtk_editable_insert_text (editable, result, count, position);
981 gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable),
982 GTK_SIGNAL_FUNC (on_surf_value_entry_insert_text),
985 gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text");
990 #define HERETIC2_FLAG_BUTTON_BORDER 3
992 GtkWidget* Create_Heretic2FlagsDialog (GtkWidget* surfacedialog_widget)
995 GtkWidget *notebook1;
1012 frame1 = gtk_frame_new ("Brush/Face Flags");
1013 gtk_widget_show (frame1);
1014 gtk_container_add (GTK_CONTAINER (surfacedialog_widget), frame1);
1016 notebook1 = gtk_notebook_new ();
1017 gtk_widget_show (notebook1);
1018 gtk_container_add (GTK_CONTAINER (frame1), notebook1);
1020 vbox3 = gtk_vbox_new (FALSE, 0);
1021 gtk_widget_show (vbox3);
1022 gtk_container_add (GTK_CONTAINER (notebook1), vbox3);
1024 table1 = gtk_table_new (3, 4, TRUE);
1025 gtk_widget_show (table1);
1026 gtk_box_pack_start (GTK_BOX (vbox3), table1, TRUE, TRUE, 0);
1028 surface_lightbutton = gtk_toggle_button_new_with_mnemonic ("Light");
1029 gtk_widget_show (surface_lightbutton);
1030 gtk_table_attach (GTK_TABLE (table1), surface_lightbutton, 0, 1, 0, 1,
1031 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1032 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1034 surface_slickbutton = gtk_toggle_button_new_with_mnemonic ("Slick");
1035 gtk_widget_show (surface_slickbutton);
1036 gtk_table_attach (GTK_TABLE (table1), surface_slickbutton, 1, 2, 0, 1,
1037 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1038 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1040 surface_skybutton = gtk_toggle_button_new_with_mnemonic ("Sky");
1041 gtk_widget_show (surface_skybutton);
1042 gtk_table_attach (GTK_TABLE (table1), surface_skybutton, 2, 3, 0, 1,
1043 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1044 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1046 surface_warpbutton = gtk_toggle_button_new_with_mnemonic ("Warp");
1047 gtk_widget_show (surface_warpbutton);
1048 gtk_table_attach (GTK_TABLE (table1), surface_warpbutton, 3, 4, 0, 1,
1049 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1050 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1052 surface_trans33button = gtk_toggle_button_new_with_mnemonic ("Trans33");
1053 gtk_widget_show (surface_trans33button);
1054 gtk_table_attach (GTK_TABLE (table1), surface_trans33button, 0, 1, 1, 2,
1055 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1056 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1058 surface_trans66button = gtk_toggle_button_new_with_mnemonic ("Trans66");
1059 gtk_widget_show (surface_trans66button);
1060 gtk_table_attach (GTK_TABLE (table1), surface_trans66button, 1, 2, 1, 2,
1061 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1062 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1064 surface_flowingbutton = gtk_toggle_button_new_with_mnemonic ("Flowing");
1065 gtk_widget_show (surface_flowingbutton);
1066 gtk_table_attach (GTK_TABLE (table1), surface_flowingbutton, 2, 3, 1, 2,
1067 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1068 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1070 surface_nodrawbutton = gtk_toggle_button_new_with_mnemonic ("NoDraw");
1071 gtk_widget_show (surface_nodrawbutton);
1072 gtk_table_attach (GTK_TABLE (table1), surface_nodrawbutton, 3, 4, 1, 2,
1073 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1074 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1076 surface_tallwallbutton = gtk_toggle_button_new_with_mnemonic ("TallWall");
1077 gtk_widget_show (surface_tallwallbutton);
1078 gtk_table_attach (GTK_TABLE (table1), surface_tallwallbutton, 0, 1, 2, 3,
1079 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1080 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1082 surface_alphatexbutton = gtk_toggle_button_new_with_mnemonic ("AlphaTex");
1083 gtk_widget_show (surface_alphatexbutton);
1084 gtk_table_attach (GTK_TABLE (table1), surface_alphatexbutton, 1, 2, 2, 3,
1085 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1086 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1088 surface_animspeedbutton = gtk_toggle_button_new_with_mnemonic ("AnimSpeed");
1089 gtk_widget_show (surface_animspeedbutton);
1090 gtk_table_attach (GTK_TABLE (table1), surface_animspeedbutton, 2, 3, 2, 3,
1091 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1092 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1094 surface_undulatebutton = gtk_toggle_button_new_with_mnemonic ("Undulate");
1095 gtk_widget_show (surface_undulatebutton);
1096 gtk_table_attach (GTK_TABLE (table1), surface_undulatebutton, 3, 4, 2, 3,
1097 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1098 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1100 frame2 = gtk_frame_new (NULL);
1101 gtk_widget_show (frame2);
1102 gtk_box_pack_start (GTK_BOX (vbox3), frame2, FALSE, FALSE, 0);
1103 gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_ETCHED_OUT);
1104 gtk_container_set_border_width (GTK_CONTAINER (frame2), 4);
1106 hbox4 = gtk_hbox_new (FALSE, 0);
1107 gtk_widget_show (hbox4);
1108 gtk_container_add (GTK_CONTAINER (frame2), hbox4);
1110 surf_gravel_radiobutton = gtk_radio_button_new_with_mnemonic (NULL, "Gravel");
1111 gtk_widget_show (surf_gravel_radiobutton);
1112 gtk_box_pack_start (GTK_BOX (hbox4), surf_gravel_radiobutton, TRUE, FALSE, 0);
1114 surf_metal_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_gravel_radiobutton), "Metal");
1115 gtk_widget_show (surf_metal_radiobutton);
1116 gtk_box_pack_start (GTK_BOX (hbox4), surf_metal_radiobutton, TRUE, FALSE, 0);
1118 surf_stone_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_metal_radiobutton), "Stone");
1119 gtk_widget_show (surf_stone_radiobutton);
1120 gtk_box_pack_start (GTK_BOX (hbox4), surf_stone_radiobutton, TRUE, FALSE, 0);
1122 surf_wood_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_stone_radiobutton), "Wood");
1123 gtk_widget_show (surf_wood_radiobutton);
1124 gtk_box_pack_start (GTK_BOX (hbox4), surf_wood_radiobutton, TRUE, FALSE, 0);
1126 label4 = gtk_label_new ("Material");
1127 gtk_widget_show (label4);
1128 gtk_frame_set_label_widget (GTK_FRAME (frame2), label4);
1129 gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
1131 table3 = gtk_table_new (1, 4, FALSE);
1132 gtk_widget_show (table3);
1133 gtk_box_pack_start (GTK_BOX (vbox3), table3, FALSE, FALSE, 0);
1134 gtk_container_set_border_width (GTK_CONTAINER (table3), 3);
1136 hbox1 = gtk_hbox_new (FALSE, 0);
1137 gtk_widget_show (hbox1);
1138 gtk_table_attach (GTK_TABLE (table3), hbox1, 0, 1, 0, 1,
1139 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1140 (GtkAttachOptions) (GTK_FILL), 0, 0);
1142 label5 = gtk_label_new ("Value: ");
1143 gtk_widget_show (label5);
1144 gtk_table_attach (GTK_TABLE (table3), label5, 1, 2, 0, 1,
1145 (GtkAttachOptions) (0),
1146 (GtkAttachOptions) (0), 0, 0);
1147 gtk_misc_set_alignment (GTK_MISC (label5), 0, 0);
1148 gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_RIGHT);
1150 surf_value_entry = gtk_entry_new ();
1151 gtk_widget_show (surf_value_entry);
1152 gtk_table_attach (GTK_TABLE (table3), surf_value_entry, 2, 3, 0, 1,
1153 (GtkAttachOptions) (GTK_FILL),
1154 (GtkAttachOptions) (0), 0, 0);
1156 hbox2 = gtk_hbox_new (FALSE, 0);
1157 gtk_widget_show (hbox2);
1158 gtk_table_attach (GTK_TABLE (table3), hbox2, 3, 4, 0, 1,
1159 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1160 (GtkAttachOptions) (GTK_FILL), 0, 0);
1162 label2 = gtk_label_new ("Surface Flags");
1163 gtk_widget_show (label2);
1164 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label2);
1165 gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
1167 table2 = gtk_table_new (5, 4, TRUE);
1168 gtk_widget_show (table2);
1169 gtk_container_add (GTK_CONTAINER (notebook1), table2);
1171 content_solidbutton = gtk_toggle_button_new_with_mnemonic ("Solid");
1172 gtk_widget_show (content_solidbutton);
1173 gtk_table_attach (GTK_TABLE (table2), content_solidbutton, 0, 1, 0, 1,
1174 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1175 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1177 content_windowbutton = gtk_toggle_button_new_with_mnemonic ("Window");
1178 gtk_widget_show (content_windowbutton);
1179 gtk_table_attach (GTK_TABLE (table2), content_windowbutton, 1, 2, 0, 1,
1180 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1181 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1183 content_illusbutton = gtk_toggle_button_new_with_mnemonic ("Illusion");
1184 gtk_widget_show (content_illusbutton);
1185 gtk_table_attach (GTK_TABLE (table2), content_illusbutton, 2, 3, 0, 1,
1186 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1187 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1189 content_lavabutton = gtk_toggle_button_new_with_mnemonic ("Lava");
1190 gtk_widget_show (content_lavabutton);
1191 gtk_table_attach (GTK_TABLE (table2), content_lavabutton, 3, 4, 0, 1,
1192 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1193 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1195 content_slimebutton = gtk_toggle_button_new_with_mnemonic ("Slime");
1196 gtk_widget_show (content_slimebutton);
1197 gtk_table_attach (GTK_TABLE (table2), content_slimebutton, 0, 1, 1, 2,
1198 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1199 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1201 content_waterbutton = gtk_toggle_button_new_with_mnemonic ("Water");
1202 gtk_widget_show (content_waterbutton);
1203 gtk_table_attach (GTK_TABLE (table2), content_waterbutton, 1, 2, 1, 2,
1204 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1205 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1207 content_mistbutton = gtk_toggle_button_new_with_mnemonic ("Mist");
1208 gtk_widget_show (content_mistbutton);
1209 gtk_table_attach (GTK_TABLE (table2), content_mistbutton, 2, 3, 1, 2,
1210 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1211 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1213 content_areaportalbutton = gtk_toggle_button_new_with_mnemonic ("AreaPortal");
1214 gtk_widget_show (content_areaportalbutton);
1215 gtk_table_attach (GTK_TABLE (table2), content_areaportalbutton, 3, 4, 1, 2,
1216 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1217 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1219 content_playerclipbutton = gtk_toggle_button_new_with_mnemonic ("PlayerClip");
1220 gtk_widget_show (content_playerclipbutton);
1221 gtk_table_attach (GTK_TABLE (table2), content_playerclipbutton, 0, 1, 2, 3,
1222 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1223 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1225 content_monsterclipbutton = gtk_toggle_button_new_with_mnemonic ("MonsterClip");
1226 gtk_widget_show (content_monsterclipbutton);
1227 gtk_table_attach (GTK_TABLE (table2), content_monsterclipbutton, 1, 2, 2, 3,
1228 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1229 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1231 content_current0button = gtk_toggle_button_new_with_mnemonic ("Current 0");
1232 gtk_widget_show (content_current0button);
1233 gtk_table_attach (GTK_TABLE (table2), content_current0button, 2, 3, 2, 3,
1234 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1235 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1237 content_current90button = gtk_toggle_button_new_with_mnemonic ("Current 90");
1238 gtk_widget_show (content_current90button);
1239 gtk_table_attach (GTK_TABLE (table2), content_current90button, 3, 4, 2, 3,
1240 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1241 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1243 content_current180button = gtk_toggle_button_new_with_mnemonic ("Current 180");
1244 gtk_widget_show (content_current180button);
1245 gtk_table_attach (GTK_TABLE (table2), content_current180button, 0, 1, 3, 4,
1246 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1247 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1249 content_current270button = gtk_toggle_button_new_with_mnemonic ("Current 270");
1250 gtk_widget_show (content_current270button);
1251 gtk_table_attach (GTK_TABLE (table2), content_current270button, 1, 2, 3, 4,
1252 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1253 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1255 content_currentUPbutton = gtk_toggle_button_new_with_mnemonic ("Current UP");
1256 gtk_widget_show (content_currentUPbutton);
1257 gtk_table_attach (GTK_TABLE (table2), content_currentUPbutton, 2, 3, 3, 4,
1258 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1259 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1261 content_currentDOWNbutton = gtk_toggle_button_new_with_mnemonic ("Current DOWN");
1262 gtk_widget_show (content_currentDOWNbutton);
1263 gtk_table_attach (GTK_TABLE (table2), content_currentDOWNbutton, 3, 4, 3, 4,
1264 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1265 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1267 content_originbutton = gtk_toggle_button_new_with_mnemonic ("Origin");
1268 gtk_widget_show (content_originbutton);
1269 gtk_table_attach (GTK_TABLE (table2), content_originbutton, 0, 1, 4, 5,
1270 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1271 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1273 content_detailbutton = gtk_toggle_button_new_with_mnemonic ("Detail");
1274 gtk_widget_show (content_detailbutton);
1275 gtk_table_attach (GTK_TABLE (table2), content_detailbutton, 1, 2, 4, 5,
1276 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1277 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1279 content_ladderbutton = gtk_toggle_button_new_with_mnemonic ("Ladder");
1280 gtk_widget_show (content_ladderbutton);
1281 gtk_table_attach (GTK_TABLE (table2), content_ladderbutton, 2, 3, 4, 5,
1282 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1283 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1285 content_camnoblockbutton = gtk_toggle_button_new_with_mnemonic ("Cam No Block");
1286 gtk_widget_show (content_camnoblockbutton);
1287 gtk_table_attach (GTK_TABLE (table2), content_camnoblockbutton, 3, 4, 4, 5,
1288 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1289 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1291 label3 = gtk_label_new ("Content Flags");
1292 gtk_widget_show (label3);
1293 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label3);
1294 gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
1297 g_signal_connect ((gpointer) surface_lightbutton, "toggled",
1298 G_CALLBACK (on_surface_lightbutton_toggled),
1300 g_signal_connect ((gpointer) surface_slickbutton, "toggled",
1301 G_CALLBACK (on_surface_slickbutton_toggled),
1303 g_signal_connect ((gpointer) surface_skybutton, "toggled",
1304 G_CALLBACK (on_surface_skybutton_toggled),
1306 g_signal_connect ((gpointer) surface_warpbutton, "toggled",
1307 G_CALLBACK (on_surface_warpbutton_toggled),
1309 g_signal_connect ((gpointer) surface_trans33button, "toggled",
1310 G_CALLBACK (on_surface_trans33button_toggled),
1312 g_signal_connect ((gpointer) surface_trans66button, "toggled",
1313 G_CALLBACK (on_surface_trans66button_toggled),
1315 g_signal_connect ((gpointer) surface_flowingbutton, "toggled",
1316 G_CALLBACK (on_surface_flowingbutton_toggled),
1318 g_signal_connect ((gpointer) surface_nodrawbutton, "toggled",
1319 G_CALLBACK (on_surface_nodrawbutton_toggled),
1321 g_signal_connect ((gpointer) surface_tallwallbutton, "toggled",
1322 G_CALLBACK (on_surface_tallwallbutton_toggled),
1324 g_signal_connect ((gpointer) surface_alphatexbutton, "toggled",
1325 G_CALLBACK (on_surface_alphatexbutton_toggled),
1327 g_signal_connect ((gpointer) surface_animspeedbutton, "toggled",
1328 G_CALLBACK (on_surface_animspeedbutton_toggled),
1330 g_signal_connect ((gpointer) surface_undulatebutton, "toggled",
1331 G_CALLBACK (on_surface_undulatebutton_toggled),
1334 g_signal_connect ((gpointer) surf_gravel_radiobutton, "toggled",
1335 G_CALLBACK (on_surf_gravel_radiobutton_toggled),
1337 g_signal_connect ((gpointer) surf_metal_radiobutton, "toggled",
1338 G_CALLBACK (on_surf_metal_radiobutton_toggled),
1340 g_signal_connect ((gpointer) surf_stone_radiobutton, "toggled",
1341 G_CALLBACK (on_surf_stone_radiobutton_toggled),
1343 g_signal_connect ((gpointer) surf_wood_radiobutton, "toggled",
1344 G_CALLBACK (on_surf_wood_radiobutton_toggled),
1347 g_signal_connect ((gpointer) surf_value_entry, "changed",
1348 G_CALLBACK (on_surf_value_entry_changed),
1350 g_signal_connect ((gpointer) surf_value_entry, "insert_text",
1351 G_CALLBACK (on_surf_value_entry_insert_text),
1353 g_signal_connect ((gpointer) content_solidbutton, "toggled",
1354 G_CALLBACK (on_content_solidbutton_toggled),
1356 g_signal_connect ((gpointer) content_windowbutton, "toggled",
1357 G_CALLBACK (on_content_windowbutton_toggled),
1359 g_signal_connect ((gpointer) content_illusbutton, "toggled",
1360 G_CALLBACK (on_content_illusbutton_toggled),
1362 g_signal_connect ((gpointer) content_lavabutton, "toggled",
1363 G_CALLBACK (on_content_lavabutton_toggled),
1365 g_signal_connect ((gpointer) content_slimebutton, "toggled",
1366 G_CALLBACK (on_content_slimebutton_toggled),
1368 g_signal_connect ((gpointer) content_waterbutton, "toggled",
1369 G_CALLBACK (on_content_waterbutton_toggled),
1371 g_signal_connect ((gpointer) content_mistbutton, "toggled",
1372 G_CALLBACK (on_content_mistbutton_toggled),
1374 g_signal_connect ((gpointer) content_areaportalbutton, "toggled",
1375 G_CALLBACK (on_content_areaportalbutton_toggled),
1377 g_signal_connect ((gpointer) content_playerclipbutton, "toggled",
1378 G_CALLBACK (on_content_playerclipbutton_toggled),
1380 g_signal_connect ((gpointer) content_monsterclipbutton, "toggled",
1381 G_CALLBACK (on_content_monsterclipbutton_toggled),
1383 g_signal_connect ((gpointer) content_current0button, "toggled",
1384 G_CALLBACK (on_content_current0button_toggled),
1386 g_signal_connect ((gpointer) content_current90button, "toggled",
1387 G_CALLBACK (on_content_current90button_toggled),
1389 g_signal_connect ((gpointer) content_current180button, "toggled",
1390 G_CALLBACK (on_content_current180button_toggled),
1392 g_signal_connect ((gpointer) content_current270button, "toggled",
1393 G_CALLBACK (on_content_current270button_toggled),
1395 g_signal_connect ((gpointer) content_currentUPbutton, "toggled",
1396 G_CALLBACK (on_content_currentUPbutton_toggled),
1398 g_signal_connect ((gpointer) content_currentDOWNbutton, "toggled",
1399 G_CALLBACK (on_content_currentDOWNbutton_toggled),
1401 g_signal_connect ((gpointer) content_originbutton, "toggled",
1402 G_CALLBACK (on_content_originbutton_toggled),
1404 g_signal_connect ((gpointer) content_detailbutton, "toggled",
1405 G_CALLBACK (on_content_detailbutton_toggled),
1407 g_signal_connect ((gpointer) content_ladderbutton, "toggled",
1408 G_CALLBACK (on_content_ladderbutton_toggled),
1410 g_signal_connect ((gpointer) content_camnoblockbutton, "toggled",
1411 G_CALLBACK (on_content_camnoblockbutton_toggled),