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 <glib/gi18n.h>
24 #include <gdk/gdkkeysyms.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)
86 gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), TRUE);
89 inline void clear_inconsistent(GtkWidget *toggle_button)
91 if ( gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (toggle_button)) )
93 gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), FALSE);
98 void clear_all_inconsistent(void)
100 clear_inconsistent( surface_lightbutton );
101 clear_inconsistent( surface_slickbutton );
102 clear_inconsistent( surface_skybutton );
103 clear_inconsistent( surface_warpbutton );
104 clear_inconsistent( surface_trans33button );
105 clear_inconsistent( surface_trans66button );
106 clear_inconsistent( surface_flowingbutton );
107 clear_inconsistent( surface_nodrawbutton );
108 clear_inconsistent( surface_tallwallbutton );
109 clear_inconsistent( surface_alphatexbutton );
110 clear_inconsistent( surface_animspeedbutton );
111 clear_inconsistent( surface_undulatebutton );
113 clear_inconsistent( surf_gravel_radiobutton );
114 clear_inconsistent( surf_metal_radiobutton );
115 clear_inconsistent( surf_stone_radiobutton );
116 clear_inconsistent( surf_wood_radiobutton );
118 clear_inconsistent( content_solidbutton );
119 clear_inconsistent( content_windowbutton );
120 clear_inconsistent( content_illusbutton );
121 clear_inconsistent( content_lavabutton );
122 clear_inconsistent( content_slimebutton );
123 clear_inconsistent( content_waterbutton );
124 clear_inconsistent( content_mistbutton );
125 clear_inconsistent( content_areaportalbutton );
126 clear_inconsistent( content_playerclipbutton );
127 clear_inconsistent( content_monsterclipbutton );
128 clear_inconsistent( content_current0button );
129 clear_inconsistent( content_current90button );
130 clear_inconsistent( content_current180button );
131 clear_inconsistent( content_current270button );
132 clear_inconsistent( content_currentUPbutton );
133 clear_inconsistent( content_currentDOWNbutton );
134 clear_inconsistent( content_originbutton );
135 clear_inconsistent( content_detailbutton );
136 clear_inconsistent( content_ladderbutton );
137 clear_inconsistent( content_camnoblockbutton );
140 void clear_all_buttons_and_values()
142 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_lightbutton ), FALSE);
143 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_slickbutton ), FALSE);
144 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_skybutton ), FALSE);
145 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_warpbutton ), FALSE);
146 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_trans33button ), FALSE);
147 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_trans66button ), FALSE);
148 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_flowingbutton ), FALSE);
149 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_nodrawbutton ), FALSE);
150 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_tallwallbutton ), FALSE);
151 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_alphatexbutton ), FALSE);
152 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_animspeedbutton ), FALSE);
153 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_undulatebutton ), FALSE);
155 // surface_material_inconsistant = TRUE;
157 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), FALSE);
158 set_inconsistent(surf_gravel_radiobutton);
160 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), FALSE);
161 set_inconsistent(surf_metal_radiobutton);
163 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), FALSE);
164 set_inconsistent(surf_stone_radiobutton);
166 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), FALSE);
167 set_inconsistent(surf_wood_radiobutton);
169 gtk_entry_set_text( (GtkEntry *)surf_value_entry, "");
171 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_solidbutton ), FALSE);
172 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_windowbutton ), FALSE);
173 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_illusbutton ), FALSE);
174 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_lavabutton ), FALSE);
175 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_slimebutton ), FALSE);
176 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_waterbutton ), FALSE);
177 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_mistbutton ), FALSE);
178 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_areaportalbutton ), FALSE);
179 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_playerclipbutton ), FALSE);
180 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_monsterclipbutton ), FALSE);
181 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current0button ), FALSE);
182 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current90button ), FALSE);
183 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current180button ), FALSE);
184 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current270button ), FALSE);
185 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_currentUPbutton ), FALSE);
186 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), FALSE);
187 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_originbutton ), FALSE);
188 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_detailbutton ), FALSE);
189 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_ladderbutton ), FALSE);
190 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_camnoblockbutton ), FALSE);
194 void SetFlagButtons_Heretic2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty)
200 int diff_contents = 0;
202 gboolean diff_value = FALSE;
204 texdef_t* tmp_texdef;
205 texdef_to_face_t* temp_texdef_face_list;
206 gboolean surface_which_material_inconsistant[4];
207 int surface_iterator;
209 setup_buttons = TRUE;
210 working_surface_flags = 0;
212 working_content_flags = 0;
215 surface_material_inconsistant = FALSE;
216 surface_which_material_inconsistant[0] = FALSE;
217 surface_which_material_inconsistant[1] = FALSE;
218 surface_which_material_inconsistant[2] = FALSE;
219 surface_which_material_inconsistant[3] = FALSE;
223 tmp_texdef = &texdef_face_list->texdef;
224 contents = tmp_texdef->contents;
225 flags = tmp_texdef->flags;
226 value = tmp_texdef->value;
228 surface_iterator = (tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24; // Inconsistant Material?
229 surface_which_material_inconsistant[surface_iterator] = TRUE;
231 for (temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
233 tmp_texdef = &temp_texdef_face_list->texdef;
234 diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent
235 diff_flags |= flags ^ tmp_texdef->flags;
236 if (tmp_texdef->value != value)
239 surface_iterator = (tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24; // Inconsistant Material?
240 surface_which_material_inconsistant[surface_iterator] = TRUE;
242 Sys_Printf("Diff_Flags: %d\t Surf_Iter: %d\n",diff_flags, surface_iterator);
248 clear_all_inconsistent();
250 // If no faces/brushes are selected, clear everything and bail
253 clear_all_buttons_and_values();
254 setup_buttons = FALSE;
258 // Set surface buttons to reflect brush/face flags, contents, and values
259 if(diff_flags & HERETIC2_SURF_LIGHT)
260 set_inconsistent(surface_lightbutton);
262 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), (flags & HERETIC2_SURF_LIGHT));
264 if(diff_flags & HERETIC2_SURF_SLICK)
265 set_inconsistent(surface_slickbutton);
266 else if(flags & HERETIC2_SURF_SLICK)
267 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), TRUE);
269 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE);
271 if(diff_flags & HERETIC2_SURF_SKY)
272 set_inconsistent(surface_skybutton);
273 else if(flags & HERETIC2_SURF_SKY)
274 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), TRUE);
276 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE);
278 if(diff_flags & HERETIC2_SURF_WARP)
279 set_inconsistent(surface_warpbutton);
280 else if(flags & HERETIC2_SURF_WARP)
281 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), TRUE);
283 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE);
285 if(diff_flags & HERETIC2_SURF_TRANS33)
286 set_inconsistent(surface_trans33button);
287 else if(flags & HERETIC2_SURF_TRANS33)
288 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), TRUE);
290 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE);
292 if(diff_flags & HERETIC2_SURF_TRANS66)
293 set_inconsistent(surface_trans66button);
294 else if(flags & HERETIC2_SURF_TRANS66)
295 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), TRUE);
297 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE);
299 if(diff_flags & HERETIC2_SURF_FLOWING)
300 set_inconsistent(surface_flowingbutton);
301 else if(flags & HERETIC2_SURF_FLOWING)
302 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), TRUE);
304 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE);
306 if(diff_flags & HERETIC2_SURF_NODRAW)
307 set_inconsistent(surface_nodrawbutton);
308 else if(flags & HERETIC2_SURF_NODRAW)
309 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), TRUE);
311 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE);
313 if(diff_flags & HERETIC2_SURF_TALL_WALL)
314 set_inconsistent(surface_tallwallbutton);
315 else if(flags & HERETIC2_SURF_TALL_WALL)
316 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_tallwallbutton ), TRUE);
318 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_tallwallbutton ), FALSE);
320 if(diff_flags & HERETIC2_SURF_ALPHA_TEXTURE)
321 set_inconsistent(surface_alphatexbutton);
322 else if(flags & HERETIC2_SURF_ALPHA_TEXTURE)
323 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_alphatexbutton ), TRUE);
325 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_alphatexbutton ), FALSE);
327 if(diff_flags & HERETIC2_SURF_ANIMSPEED)
328 set_inconsistent(surface_animspeedbutton);
329 else if(flags & HERETIC2_SURF_ANIMSPEED)
330 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_animspeedbutton ), TRUE);
332 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_animspeedbutton ), FALSE);
334 if(diff_flags & HERETIC2_SURF_UNDULATE)
335 set_inconsistent(surface_undulatebutton);
336 else if(flags & HERETIC2_SURF_UNDULATE)
337 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_undulatebutton ), TRUE);
339 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_undulatebutton ), FALSE);
341 if(diff_flags & ~HERETIC2_SURF_MATERIAL_MASK)
343 Sys_Printf("--> %d\n", (diff_flags & ~HERETIC2_SURF_MATERIAL_MASK) );
344 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]);
346 if (surface_which_material_inconsistant[0])
348 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), FALSE);
349 surface_material_inconsistant = TRUE;
350 set_inconsistent(surf_gravel_radiobutton);
352 if (surface_which_material_inconsistant[1])
354 //if (!surface_material_inconsistant)
356 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), FALSE);
357 surface_material_inconsistant = TRUE;
359 set_inconsistent(surf_metal_radiobutton);
361 if (surface_which_material_inconsistant[2])
363 //if (!surface_material_inconsistant)
365 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), FALSE);
366 surface_material_inconsistant = TRUE;
368 set_inconsistent(surf_stone_radiobutton);
370 if (surface_which_material_inconsistant[3])
372 //if (!surface_material_inconsistant)
374 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), FALSE);
375 surface_material_inconsistant = TRUE;
377 set_inconsistent(surf_wood_radiobutton);
382 if(flags & ~HERETIC2_SURF_MATERIAL_MASK)
384 surface_iterator = (flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24;
385 if( surface_iterator == 1)
386 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), TRUE);
387 else if(surface_iterator == 2)
388 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), TRUE);
389 else if(surface_iterator == 3)
390 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), TRUE);
394 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), TRUE);
398 // Set content buttons to reflect brush values
399 if(diff_contents & HERETIC2_CONTENTS_SOLID)
400 set_inconsistent(content_solidbutton);
401 else if(contents & HERETIC2_CONTENTS_SOLID)
402 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), TRUE);
404 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE);
406 if(diff_contents & HERETIC2_CONTENTS_WINDOW)
407 set_inconsistent(content_windowbutton);
408 else if(contents & HERETIC2_CONTENTS_WINDOW)
409 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), TRUE);
411 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE);
413 if(diff_contents & HERETIC2_CONTENTS_ILLUSIONARY)
414 set_inconsistent(content_illusbutton);
415 else if(contents & HERETIC2_CONTENTS_ILLUSIONARY)
416 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_illusbutton ), TRUE);
418 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_illusbutton ), FALSE);
420 if(diff_contents & HERETIC2_CONTENTS_LAVA)
421 set_inconsistent(content_lavabutton);
422 else if(contents & HERETIC2_CONTENTS_LAVA)
423 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), TRUE);
425 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE);
427 if(diff_contents & HERETIC2_CONTENTS_SLIME)
428 set_inconsistent(content_slimebutton);
429 else if(contents & HERETIC2_CONTENTS_SLIME)
430 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), TRUE);
432 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE);
434 if(diff_contents & HERETIC2_CONTENTS_WATER)
435 set_inconsistent(content_waterbutton);
436 else if(contents & HERETIC2_CONTENTS_WATER)
437 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), TRUE);
439 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE);
441 if(diff_contents & HERETIC2_CONTENTS_MIST)
442 set_inconsistent(content_mistbutton);
443 else if(contents & HERETIC2_CONTENTS_MIST)
444 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), TRUE);
446 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE);
448 if(diff_contents & HERETIC2_CONTENTS_AREAPORTAL)
449 set_inconsistent(content_areaportalbutton);
450 else if(contents & HERETIC2_CONTENTS_AREAPORTAL)
451 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), TRUE);
453 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE);
455 if(diff_contents & HERETIC2_CONTENTS_PLAYERCLIP)
456 set_inconsistent(content_playerclipbutton);
457 else if(contents & HERETIC2_CONTENTS_PLAYERCLIP)
458 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), TRUE);
460 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE);
462 if(diff_contents & HERETIC2_CONTENTS_MONSTERCLIP)
463 set_inconsistent(content_monsterclipbutton);
464 else if(contents & HERETIC2_CONTENTS_MONSTERCLIP)
465 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), TRUE);
467 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE);
469 if(diff_contents & HERETIC2_CONTENTS_CURRENT_0)
470 set_inconsistent(content_current0button);
471 else if(contents & HERETIC2_CONTENTS_CURRENT_0)
472 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), TRUE);
474 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE);
476 if(diff_contents & HERETIC2_CONTENTS_CURRENT_90)
477 set_inconsistent(content_current90button);
478 else if(contents & HERETIC2_CONTENTS_CURRENT_90)
479 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), TRUE);
481 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE);
483 if(diff_contents & HERETIC2_CONTENTS_CURRENT_180)
484 set_inconsistent(content_current180button);
485 else if(contents & HERETIC2_CONTENTS_CURRENT_180)
486 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), TRUE);
488 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE);
490 if(diff_contents & HERETIC2_CONTENTS_CURRENT_270)
491 set_inconsistent(content_current270button);
492 else if(contents & HERETIC2_CONTENTS_CURRENT_270)
493 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), TRUE);
495 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE);
497 if(diff_contents & HERETIC2_CONTENTS_CURRENT_UP)
498 set_inconsistent(content_currentUPbutton);
499 else if(contents & HERETIC2_CONTENTS_CURRENT_UP)
500 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), TRUE);
502 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE);
504 if(diff_contents & HERETIC2_CONTENTS_CURRENT_DOWN)
505 set_inconsistent(content_currentDOWNbutton);
506 else if(contents & HERETIC2_CONTENTS_CURRENT_DOWN)
507 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), TRUE);
509 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE);
511 if(diff_contents & HERETIC2_CONTENTS_ORIGIN)
512 set_inconsistent(content_originbutton);
513 else if(contents & HERETIC2_CONTENTS_ORIGIN)
514 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), TRUE);
516 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE);
518 if(diff_contents & HERETIC2_CONTENTS_DETAIL)
519 set_inconsistent(content_detailbutton);
520 else if(contents & HERETIC2_CONTENTS_DETAIL)
521 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), TRUE);
523 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE);
525 if(diff_contents & HERETIC2_CONTENTS_LADDER)
526 set_inconsistent(content_ladderbutton);
527 else if(contents & HERETIC2_CONTENTS_LADDER)
528 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), TRUE);
530 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE);
532 if(diff_contents & HERETIC2_CONTENTS_CAMERANOBLOCK)
533 set_inconsistent(content_camnoblockbutton);
534 else if(contents & HERETIC2_CONTENTS_CAMERANOBLOCK)
535 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_camnoblockbutton ), TRUE);
537 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_camnoblockbutton ), FALSE);
541 gtk_entry_set_text( (GtkEntry *)surf_value_entry, "");
544 working_value = value;
545 sprintf( tex_buff, "%d", value);
546 gtk_entry_set_text( (GtkEntry *)surf_value_entry, tex_buff);
549 setup_buttons = FALSE;
552 void SetChangeInFlags_Face_Heretic2 (texdef_to_face_t *texdef_face_list)
554 texdef_to_face_t *temp_texdef_face_list;
555 texdef_t *tmp_texdef;
557 for (temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
559 tmp_texdef = &temp_texdef_face_list->texdef;
560 tmp_texdef->flags = (tmp_texdef->flags & ~surface_mask) | working_surface_flags;
561 tmp_texdef->contents = (tmp_texdef->contents & ~content_mask) | working_content_flags;
562 tmp_texdef->value = working_value;
563 Sys_Printf("content_flag: %d content_mask: %d\n",working_content_flags,content_mask);
564 Sys_Printf("content: %d\n",tmp_texdef->contents);
568 inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag) // For Material
570 if (!setup_buttons) // If we're setting up the buttons, we really don't need to
571 { // set flags that are already set
572 if (surface_material_inconsistant)
574 clear_inconsistent( surf_gravel_radiobutton );
575 clear_inconsistent( surf_metal_radiobutton );
576 clear_inconsistent( surf_stone_radiobutton );
577 clear_inconsistent( surf_wood_radiobutton );
579 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
580 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | sur_flag;
584 inline void change_material (GtkWidget *togglebutton)
586 if (!setup_buttons) // If we're setting up the buttons, we really don't need to
587 { // set flags that are already set
588 if (surface_material_inconsistant)
590 clear_inconsistent( surf_gravel_radiobutton );
591 clear_inconsistent( surf_metal_radiobutton );
592 clear_inconsistent( surf_stone_radiobutton );
593 clear_inconsistent( surf_wood_radiobutton );
595 if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_gravel_radiobutton)) )
597 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
598 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_GRAVEL;
600 else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_metal_radiobutton)) )
602 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
603 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_METAL;
605 else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_stone_radiobutton)) )
607 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
608 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_STONE;
610 else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_wood_radiobutton)) )
612 surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
613 working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_WOOD;
618 inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to)
621 if (!setup_buttons) // If we're setting up the buttons, we really don't need to
622 { // set flags that are already set
623 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) // Clear out inconsistent, if set
624 clear_inconsistent(GTK_WIDGET (togglebutton));
626 surface_mask |= sur_flag;
629 working_surface_flags |= sur_flag;
631 working_surface_flags &= ~sur_flag;
635 inline void change_contentflag (GtkWidget *togglebutton, int content_flag, gboolean change_flag_to)
638 if ( (!setup_buttons) ) // If we're setting up the buttons, we really don't need to
639 { // set flags that are already set
641 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton)))
642 clear_inconsistent(togglebutton);
643 //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces.
645 content_mask |= content_flag;
648 working_content_flags |= content_flag;
650 working_content_flags &= ~content_flag;
655 // Surface Flags Callbacks
657 on_surface_lightbutton_toggled (GtkToggleButton *togglebutton,
660 change_surfaceflag(surface_lightbutton, HERETIC2_SURF_LIGHT, (GTK_TOGGLE_BUTTON (surface_lightbutton)->active));
665 on_surface_slickbutton_toggled (GtkToggleButton *togglebutton,
668 change_surfaceflag(surface_slickbutton, HERETIC2_SURF_SLICK, (GTK_TOGGLE_BUTTON (surface_slickbutton)->active));
673 on_surface_skybutton_toggled (GtkToggleButton *togglebutton,
676 change_surfaceflag(surface_skybutton, HERETIC2_SURF_SKY, (GTK_TOGGLE_BUTTON (surface_skybutton)->active));
681 on_surface_warpbutton_toggled (GtkToggleButton *togglebutton,
684 change_surfaceflag(surface_warpbutton, HERETIC2_SURF_WARP, (GTK_TOGGLE_BUTTON (surface_warpbutton)->active));
689 on_surface_trans33button_toggled (GtkToggleButton *togglebutton,
692 change_surfaceflag(surface_trans33button, HERETIC2_SURF_TRANS33, (GTK_TOGGLE_BUTTON (surface_trans33button)->active));
697 on_surface_trans66button_toggled (GtkToggleButton *togglebutton,
700 change_surfaceflag(surface_trans66button, HERETIC2_SURF_TRANS66, (GTK_TOGGLE_BUTTON (surface_trans66button)->active));
705 on_surface_flowingbutton_toggled (GtkToggleButton *togglebutton,
708 change_surfaceflag(surface_flowingbutton, HERETIC2_SURF_FLOWING, (GTK_TOGGLE_BUTTON (surface_flowingbutton)->active));
713 on_surface_nodrawbutton_toggled (GtkToggleButton *togglebutton,
716 change_surfaceflag(surface_nodrawbutton, HERETIC2_SURF_NODRAW, (GTK_TOGGLE_BUTTON (surface_nodrawbutton)->active));
721 on_surface_tallwallbutton_toggled (GtkToggleButton *togglebutton,
724 change_surfaceflag(surface_tallwallbutton, HERETIC2_SURF_TALL_WALL, (GTK_TOGGLE_BUTTON (surface_tallwallbutton)->active));
729 on_surface_alphatexbutton_toggled (GtkToggleButton *togglebutton,
732 change_surfaceflag(surface_alphatexbutton, HERETIC2_SURF_ALPHA_TEXTURE, (GTK_TOGGLE_BUTTON (surface_alphatexbutton)->active));
737 on_surface_animspeedbutton_toggled (GtkToggleButton *togglebutton,
740 change_surfaceflag(surface_animspeedbutton, HERETIC2_SURF_ANIMSPEED, (GTK_TOGGLE_BUTTON (surface_animspeedbutton)->active));
745 on_surface_undulatebutton_toggled (GtkToggleButton *togglebutton,
748 change_surfaceflag(surface_undulatebutton, HERETIC2_SURF_UNDULATE, (GTK_TOGGLE_BUTTON (surface_undulatebutton)->active));
753 on_surf_gravel_radiobutton_toggled (GtkToggleButton *togglebutton,
756 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_gravel_radiobutton)))
757 change_material(GTK_WIDGET(togglebutton));
761 on_surf_metal_radiobutton_toggled (GtkToggleButton *togglebutton,
764 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_metal_radiobutton)))
765 change_material(GTK_WIDGET(togglebutton));
769 on_surf_stone_radiobutton_toggled (GtkToggleButton *togglebutton,
772 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_stone_radiobutton)))
773 change_material(GTK_WIDGET(togglebutton));
777 on_surf_wood_radiobutton_toggled (GtkToggleButton *togglebutton,
780 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_wood_radiobutton)))
781 change_material(GTK_WIDGET(togglebutton));
784 // Content Flags Callbacks
786 on_content_solidbutton_toggled (GtkToggleButton *togglebutton,
789 change_contentflag(content_solidbutton, HERETIC2_CONTENTS_SOLID, (GTK_TOGGLE_BUTTON (content_solidbutton)->active));
794 on_content_windowbutton_toggled (GtkToggleButton *togglebutton,
797 change_contentflag(content_windowbutton, HERETIC2_CONTENTS_WINDOW, (GTK_TOGGLE_BUTTON (content_windowbutton)->active));
802 on_content_illusbutton_toggled (GtkToggleButton *togglebutton,
805 change_contentflag(content_illusbutton, HERETIC2_CONTENTS_ILLUSIONARY, (GTK_TOGGLE_BUTTON (content_illusbutton)->active));
810 on_content_lavabutton_toggled (GtkToggleButton *togglebutton,
813 change_contentflag(content_lavabutton, HERETIC2_CONTENTS_LAVA, (GTK_TOGGLE_BUTTON (content_lavabutton)->active));
818 on_content_slimebutton_toggled (GtkToggleButton *togglebutton,
821 change_contentflag(content_slimebutton, HERETIC2_CONTENTS_SLIME, (GTK_TOGGLE_BUTTON (content_slimebutton)->active));
826 on_content_waterbutton_toggled (GtkToggleButton *togglebutton,
829 change_contentflag(content_waterbutton, HERETIC2_CONTENTS_WATER, (GTK_TOGGLE_BUTTON (content_waterbutton)->active));
834 on_content_mistbutton_toggled (GtkToggleButton *togglebutton,
837 change_contentflag(content_mistbutton, HERETIC2_CONTENTS_MIST, (GTK_TOGGLE_BUTTON (content_mistbutton)->active));
842 on_content_areaportalbutton_toggled (GtkToggleButton *togglebutton,
845 change_contentflag(content_areaportalbutton, HERETIC2_CONTENTS_AREAPORTAL, (GTK_TOGGLE_BUTTON (content_areaportalbutton)->active));
850 on_content_playerclipbutton_toggled (GtkToggleButton *togglebutton,
853 change_contentflag(content_playerclipbutton, HERETIC2_CONTENTS_PLAYERCLIP, (GTK_TOGGLE_BUTTON (content_playerclipbutton)->active));
858 on_content_monsterclipbutton_toggled (GtkToggleButton *togglebutton,
861 change_contentflag(content_monsterclipbutton, HERETIC2_CONTENTS_MONSTERCLIP, (GTK_TOGGLE_BUTTON (content_monsterclipbutton)->active));
866 on_content_current0button_toggled (GtkToggleButton *togglebutton,
869 change_contentflag(content_current0button, HERETIC2_CONTENTS_CURRENT_0, (GTK_TOGGLE_BUTTON (content_current0button)->active));
874 on_content_current90button_toggled (GtkToggleButton *togglebutton,
877 change_contentflag(content_current90button, HERETIC2_CONTENTS_CURRENT_90, (GTK_TOGGLE_BUTTON (content_current90button)->active));
882 on_content_current180button_toggled (GtkToggleButton *togglebutton,
885 change_contentflag(content_current180button, HERETIC2_CONTENTS_CURRENT_180, (GTK_TOGGLE_BUTTON (content_current180button)->active));
890 on_content_current270button_toggled (GtkToggleButton *togglebutton,
893 change_contentflag(content_current270button, HERETIC2_CONTENTS_CURRENT_270, (GTK_TOGGLE_BUTTON (content_current270button)->active));
898 on_content_currentUPbutton_toggled (GtkToggleButton *togglebutton,
901 change_contentflag(content_currentUPbutton, HERETIC2_CONTENTS_CURRENT_UP, (GTK_TOGGLE_BUTTON (content_currentUPbutton)->active));
906 on_content_currentDOWNbutton_toggled (GtkToggleButton *togglebutton,
909 change_contentflag(content_currentDOWNbutton, HERETIC2_CONTENTS_CURRENT_DOWN, (GTK_TOGGLE_BUTTON (content_currentDOWNbutton)->active));
914 on_content_originbutton_toggled (GtkToggleButton *togglebutton,
917 change_contentflag(content_originbutton, HERETIC2_CONTENTS_ORIGIN, (GTK_TOGGLE_BUTTON (content_originbutton)->active));
922 on_content_detailbutton_toggled (GtkToggleButton *togglebutton,
925 change_contentflag(content_detailbutton, HERETIC2_CONTENTS_DETAIL, (GTK_TOGGLE_BUTTON (content_detailbutton)->active));
930 on_content_ladderbutton_toggled (GtkToggleButton *togglebutton,
933 change_contentflag(content_ladderbutton, HERETIC2_CONTENTS_LADDER, (GTK_TOGGLE_BUTTON (content_ladderbutton)->active));
938 on_content_camnoblockbutton_toggled (GtkToggleButton *togglebutton,
941 change_contentflag(content_camnoblockbutton, HERETIC2_CONTENTS_CAMERANOBLOCK, (GTK_TOGGLE_BUTTON (content_camnoblockbutton)->active));
944 // Value Entry Callback
946 on_surf_value_entry_changed (GtkEditable *editable,
949 if ( (!setup_buttons) ) // If we're setting up the buttons, don't change value
950 working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable) );
954 on_surf_value_entry_insert_text (GtkEditable *editable,
956 gint new_text_length,
967 // Limit input to digits, throwing out anything else
968 // Modified from Gtk FAQ for text filtering of GtkEntry
969 result = g_new (gchar, new_text_length);
971 for (i=0; i < new_text_length; i++) {
972 if (!isdigit(new_text[i]))
974 result[count++] = new_text[i];
978 gtk_signal_handler_block_by_func (GTK_OBJECT (editable),
979 GTK_SIGNAL_FUNC (on_surf_value_entry_insert_text),
981 gtk_editable_insert_text (editable, result, count, position);
982 gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable),
983 GTK_SIGNAL_FUNC (on_surf_value_entry_insert_text),
986 gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text");
991 #define HERETIC2_FLAG_BUTTON_BORDER 3
993 GtkWidget* Create_Heretic2FlagsDialog (GtkWidget* surfacedialog_widget)
996 GtkWidget *notebook1;
1013 frame1 = gtk_frame_new ("Brush/Face Flags");
1014 gtk_widget_show (frame1);
1015 gtk_container_add (GTK_CONTAINER (surfacedialog_widget), frame1);
1017 notebook1 = gtk_notebook_new ();
1018 gtk_widget_show (notebook1);
1019 gtk_container_add (GTK_CONTAINER (frame1), notebook1);
1021 vbox3 = gtk_vbox_new (FALSE, 0);
1022 gtk_widget_show (vbox3);
1023 gtk_container_add (GTK_CONTAINER (notebook1), vbox3);
1025 table1 = gtk_table_new (3, 4, TRUE);
1026 gtk_widget_show (table1);
1027 gtk_box_pack_start (GTK_BOX (vbox3), table1, TRUE, TRUE, 0);
1029 surface_lightbutton = gtk_toggle_button_new_with_mnemonic ("Light");
1030 gtk_widget_show (surface_lightbutton);
1031 gtk_table_attach (GTK_TABLE (table1), surface_lightbutton, 0, 1, 0, 1,
1032 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1033 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1035 surface_slickbutton = gtk_toggle_button_new_with_mnemonic ("Slick");
1036 gtk_widget_show (surface_slickbutton);
1037 gtk_table_attach (GTK_TABLE (table1), surface_slickbutton, 1, 2, 0, 1,
1038 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1039 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1041 surface_skybutton = gtk_toggle_button_new_with_mnemonic ("Sky");
1042 gtk_widget_show (surface_skybutton);
1043 gtk_table_attach (GTK_TABLE (table1), surface_skybutton, 2, 3, 0, 1,
1044 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1045 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1047 surface_warpbutton = gtk_toggle_button_new_with_mnemonic ("Warp");
1048 gtk_widget_show (surface_warpbutton);
1049 gtk_table_attach (GTK_TABLE (table1), surface_warpbutton, 3, 4, 0, 1,
1050 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1051 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1053 surface_trans33button = gtk_toggle_button_new_with_mnemonic ("Trans33");
1054 gtk_widget_show (surface_trans33button);
1055 gtk_table_attach (GTK_TABLE (table1), surface_trans33button, 0, 1, 1, 2,
1056 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1057 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1059 surface_trans66button = gtk_toggle_button_new_with_mnemonic ("Trans66");
1060 gtk_widget_show (surface_trans66button);
1061 gtk_table_attach (GTK_TABLE (table1), surface_trans66button, 1, 2, 1, 2,
1062 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1063 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1065 surface_flowingbutton = gtk_toggle_button_new_with_mnemonic ("Flowing");
1066 gtk_widget_show (surface_flowingbutton);
1067 gtk_table_attach (GTK_TABLE (table1), surface_flowingbutton, 2, 3, 1, 2,
1068 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1069 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1071 surface_nodrawbutton = gtk_toggle_button_new_with_mnemonic ("NoDraw");
1072 gtk_widget_show (surface_nodrawbutton);
1073 gtk_table_attach (GTK_TABLE (table1), surface_nodrawbutton, 3, 4, 1, 2,
1074 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1075 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1077 surface_tallwallbutton = gtk_toggle_button_new_with_mnemonic ("TallWall");
1078 gtk_widget_show (surface_tallwallbutton);
1079 gtk_table_attach (GTK_TABLE (table1), surface_tallwallbutton, 0, 1, 2, 3,
1080 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1081 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1083 surface_alphatexbutton = gtk_toggle_button_new_with_mnemonic ("AlphaTex");
1084 gtk_widget_show (surface_alphatexbutton);
1085 gtk_table_attach (GTK_TABLE (table1), surface_alphatexbutton, 1, 2, 2, 3,
1086 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1087 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1089 surface_animspeedbutton = gtk_toggle_button_new_with_mnemonic ("AnimSpeed");
1090 gtk_widget_show (surface_animspeedbutton);
1091 gtk_table_attach (GTK_TABLE (table1), surface_animspeedbutton, 2, 3, 2, 3,
1092 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1093 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1095 surface_undulatebutton = gtk_toggle_button_new_with_mnemonic ("Undulate");
1096 gtk_widget_show (surface_undulatebutton);
1097 gtk_table_attach (GTK_TABLE (table1), surface_undulatebutton, 3, 4, 2, 3,
1098 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1099 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1101 frame2 = gtk_frame_new (NULL);
1102 gtk_widget_show (frame2);
1103 gtk_box_pack_start (GTK_BOX (vbox3), frame2, FALSE, FALSE, 0);
1104 gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_ETCHED_OUT);
1105 gtk_container_set_border_width (GTK_CONTAINER (frame2), 4);
1107 hbox4 = gtk_hbox_new (FALSE, 0);
1108 gtk_widget_show (hbox4);
1109 gtk_container_add (GTK_CONTAINER (frame2), hbox4);
1111 surf_gravel_radiobutton = gtk_radio_button_new_with_mnemonic (NULL, "Gravel");
1112 gtk_widget_show (surf_gravel_radiobutton);
1113 gtk_box_pack_start (GTK_BOX (hbox4), surf_gravel_radiobutton, TRUE, FALSE, 0);
1115 surf_metal_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_gravel_radiobutton), "Metal");
1116 gtk_widget_show (surf_metal_radiobutton);
1117 gtk_box_pack_start (GTK_BOX (hbox4), surf_metal_radiobutton, TRUE, FALSE, 0);
1119 surf_stone_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_metal_radiobutton), "Stone");
1120 gtk_widget_show (surf_stone_radiobutton);
1121 gtk_box_pack_start (GTK_BOX (hbox4), surf_stone_radiobutton, TRUE, FALSE, 0);
1123 surf_wood_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_stone_radiobutton), "Wood");
1124 gtk_widget_show (surf_wood_radiobutton);
1125 gtk_box_pack_start (GTK_BOX (hbox4), surf_wood_radiobutton, TRUE, FALSE, 0);
1127 label4 = gtk_label_new ("Material");
1128 gtk_widget_show (label4);
1129 gtk_frame_set_label_widget (GTK_FRAME (frame2), label4);
1130 gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
1132 table3 = gtk_table_new (1, 4, FALSE);
1133 gtk_widget_show (table3);
1134 gtk_box_pack_start (GTK_BOX (vbox3), table3, FALSE, FALSE, 0);
1135 gtk_container_set_border_width (GTK_CONTAINER (table3), 3);
1137 hbox1 = gtk_hbox_new (FALSE, 0);
1138 gtk_widget_show (hbox1);
1139 gtk_table_attach (GTK_TABLE (table3), hbox1, 0, 1, 0, 1,
1140 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1141 (GtkAttachOptions) (GTK_FILL), 0, 0);
1143 label5 = gtk_label_new ("Value: ");
1144 gtk_widget_show (label5);
1145 gtk_table_attach (GTK_TABLE (table3), label5, 1, 2, 0, 1,
1146 (GtkAttachOptions) (0),
1147 (GtkAttachOptions) (0), 0, 0);
1148 gtk_misc_set_alignment (GTK_MISC (label5), 0, 0);
1149 gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_RIGHT);
1151 surf_value_entry = gtk_entry_new ();
1152 gtk_widget_show (surf_value_entry);
1153 gtk_table_attach (GTK_TABLE (table3), surf_value_entry, 2, 3, 0, 1,
1154 (GtkAttachOptions) (GTK_FILL),
1155 (GtkAttachOptions) (0), 0, 0);
1157 hbox2 = gtk_hbox_new (FALSE, 0);
1158 gtk_widget_show (hbox2);
1159 gtk_table_attach (GTK_TABLE (table3), hbox2, 3, 4, 0, 1,
1160 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1161 (GtkAttachOptions) (GTK_FILL), 0, 0);
1163 label2 = gtk_label_new ("Surface Flags");
1164 gtk_widget_show (label2);
1165 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label2);
1166 gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
1168 table2 = gtk_table_new (5, 4, TRUE);
1169 gtk_widget_show (table2);
1170 gtk_container_add (GTK_CONTAINER (notebook1), table2);
1172 content_solidbutton = gtk_toggle_button_new_with_mnemonic ("Solid");
1173 gtk_widget_show (content_solidbutton);
1174 gtk_table_attach (GTK_TABLE (table2), content_solidbutton, 0, 1, 0, 1,
1175 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1176 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1178 content_windowbutton = gtk_toggle_button_new_with_mnemonic ("Window");
1179 gtk_widget_show (content_windowbutton);
1180 gtk_table_attach (GTK_TABLE (table2), content_windowbutton, 1, 2, 0, 1,
1181 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1182 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1184 content_illusbutton = gtk_toggle_button_new_with_mnemonic ("Illusion");
1185 gtk_widget_show (content_illusbutton);
1186 gtk_table_attach (GTK_TABLE (table2), content_illusbutton, 2, 3, 0, 1,
1187 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1188 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1190 content_lavabutton = gtk_toggle_button_new_with_mnemonic ("Lava");
1191 gtk_widget_show (content_lavabutton);
1192 gtk_table_attach (GTK_TABLE (table2), content_lavabutton, 3, 4, 0, 1,
1193 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1194 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1196 content_slimebutton = gtk_toggle_button_new_with_mnemonic ("Slime");
1197 gtk_widget_show (content_slimebutton);
1198 gtk_table_attach (GTK_TABLE (table2), content_slimebutton, 0, 1, 1, 2,
1199 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1200 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1202 content_waterbutton = gtk_toggle_button_new_with_mnemonic ("Water");
1203 gtk_widget_show (content_waterbutton);
1204 gtk_table_attach (GTK_TABLE (table2), content_waterbutton, 1, 2, 1, 2,
1205 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1206 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1208 content_mistbutton = gtk_toggle_button_new_with_mnemonic ("Mist");
1209 gtk_widget_show (content_mistbutton);
1210 gtk_table_attach (GTK_TABLE (table2), content_mistbutton, 2, 3, 1, 2,
1211 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1212 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1214 content_areaportalbutton = gtk_toggle_button_new_with_mnemonic ("AreaPortal");
1215 gtk_widget_show (content_areaportalbutton);
1216 gtk_table_attach (GTK_TABLE (table2), content_areaportalbutton, 3, 4, 1, 2,
1217 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1218 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1220 content_playerclipbutton = gtk_toggle_button_new_with_mnemonic ("PlayerClip");
1221 gtk_widget_show (content_playerclipbutton);
1222 gtk_table_attach (GTK_TABLE (table2), content_playerclipbutton, 0, 1, 2, 3,
1223 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1224 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1226 content_monsterclipbutton = gtk_toggle_button_new_with_mnemonic ("MonsterClip");
1227 gtk_widget_show (content_monsterclipbutton);
1228 gtk_table_attach (GTK_TABLE (table2), content_monsterclipbutton, 1, 2, 2, 3,
1229 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1230 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1232 content_current0button = gtk_toggle_button_new_with_mnemonic ("Current 0");
1233 gtk_widget_show (content_current0button);
1234 gtk_table_attach (GTK_TABLE (table2), content_current0button, 2, 3, 2, 3,
1235 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1236 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1238 content_current90button = gtk_toggle_button_new_with_mnemonic ("Current 90");
1239 gtk_widget_show (content_current90button);
1240 gtk_table_attach (GTK_TABLE (table2), content_current90button, 3, 4, 2, 3,
1241 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1242 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1244 content_current180button = gtk_toggle_button_new_with_mnemonic ("Current 180");
1245 gtk_widget_show (content_current180button);
1246 gtk_table_attach (GTK_TABLE (table2), content_current180button, 0, 1, 3, 4,
1247 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1248 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1250 content_current270button = gtk_toggle_button_new_with_mnemonic ("Current 270");
1251 gtk_widget_show (content_current270button);
1252 gtk_table_attach (GTK_TABLE (table2), content_current270button, 1, 2, 3, 4,
1253 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1254 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1256 content_currentUPbutton = gtk_toggle_button_new_with_mnemonic ("Current UP");
1257 gtk_widget_show (content_currentUPbutton);
1258 gtk_table_attach (GTK_TABLE (table2), content_currentUPbutton, 2, 3, 3, 4,
1259 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1260 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1262 content_currentDOWNbutton = gtk_toggle_button_new_with_mnemonic ("Current DOWN");
1263 gtk_widget_show (content_currentDOWNbutton);
1264 gtk_table_attach (GTK_TABLE (table2), content_currentDOWNbutton, 3, 4, 3, 4,
1265 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1266 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1268 content_originbutton = gtk_toggle_button_new_with_mnemonic ("Origin");
1269 gtk_widget_show (content_originbutton);
1270 gtk_table_attach (GTK_TABLE (table2), content_originbutton, 0, 1, 4, 5,
1271 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1272 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1274 content_detailbutton = gtk_toggle_button_new_with_mnemonic ("Detail");
1275 gtk_widget_show (content_detailbutton);
1276 gtk_table_attach (GTK_TABLE (table2), content_detailbutton, 1, 2, 4, 5,
1277 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1278 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1280 content_ladderbutton = gtk_toggle_button_new_with_mnemonic ("Ladder");
1281 gtk_widget_show (content_ladderbutton);
1282 gtk_table_attach (GTK_TABLE (table2), content_ladderbutton, 2, 3, 4, 5,
1283 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1284 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1286 content_camnoblockbutton = gtk_toggle_button_new_with_mnemonic ("Cam No Block");
1287 gtk_widget_show (content_camnoblockbutton);
1288 gtk_table_attach (GTK_TABLE (table2), content_camnoblockbutton, 3, 4, 4, 5,
1289 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1290 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1292 label3 = gtk_label_new ("Content Flags");
1293 gtk_widget_show (label3);
1294 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label3);
1295 gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
1298 g_signal_connect ((gpointer) surface_lightbutton, "toggled",
1299 G_CALLBACK (on_surface_lightbutton_toggled),
1301 g_signal_connect ((gpointer) surface_slickbutton, "toggled",
1302 G_CALLBACK (on_surface_slickbutton_toggled),
1304 g_signal_connect ((gpointer) surface_skybutton, "toggled",
1305 G_CALLBACK (on_surface_skybutton_toggled),
1307 g_signal_connect ((gpointer) surface_warpbutton, "toggled",
1308 G_CALLBACK (on_surface_warpbutton_toggled),
1310 g_signal_connect ((gpointer) surface_trans33button, "toggled",
1311 G_CALLBACK (on_surface_trans33button_toggled),
1313 g_signal_connect ((gpointer) surface_trans66button, "toggled",
1314 G_CALLBACK (on_surface_trans66button_toggled),
1316 g_signal_connect ((gpointer) surface_flowingbutton, "toggled",
1317 G_CALLBACK (on_surface_flowingbutton_toggled),
1319 g_signal_connect ((gpointer) surface_nodrawbutton, "toggled",
1320 G_CALLBACK (on_surface_nodrawbutton_toggled),
1322 g_signal_connect ((gpointer) surface_tallwallbutton, "toggled",
1323 G_CALLBACK (on_surface_tallwallbutton_toggled),
1325 g_signal_connect ((gpointer) surface_alphatexbutton, "toggled",
1326 G_CALLBACK (on_surface_alphatexbutton_toggled),
1328 g_signal_connect ((gpointer) surface_animspeedbutton, "toggled",
1329 G_CALLBACK (on_surface_animspeedbutton_toggled),
1331 g_signal_connect ((gpointer) surface_undulatebutton, "toggled",
1332 G_CALLBACK (on_surface_undulatebutton_toggled),
1335 g_signal_connect ((gpointer) surf_gravel_radiobutton, "toggled",
1336 G_CALLBACK (on_surf_gravel_radiobutton_toggled),
1338 g_signal_connect ((gpointer) surf_metal_radiobutton, "toggled",
1339 G_CALLBACK (on_surf_metal_radiobutton_toggled),
1341 g_signal_connect ((gpointer) surf_stone_radiobutton, "toggled",
1342 G_CALLBACK (on_surf_stone_radiobutton_toggled),
1344 g_signal_connect ((gpointer) surf_wood_radiobutton, "toggled",
1345 G_CALLBACK (on_surf_wood_radiobutton_toggled),
1348 g_signal_connect ((gpointer) surf_value_entry, "changed",
1349 G_CALLBACK (on_surf_value_entry_changed),
1351 g_signal_connect ((gpointer) surf_value_entry, "insert_text",
1352 G_CALLBACK (on_surf_value_entry_insert_text),
1354 g_signal_connect ((gpointer) content_solidbutton, "toggled",
1355 G_CALLBACK (on_content_solidbutton_toggled),
1357 g_signal_connect ((gpointer) content_windowbutton, "toggled",
1358 G_CALLBACK (on_content_windowbutton_toggled),
1360 g_signal_connect ((gpointer) content_illusbutton, "toggled",
1361 G_CALLBACK (on_content_illusbutton_toggled),
1363 g_signal_connect ((gpointer) content_lavabutton, "toggled",
1364 G_CALLBACK (on_content_lavabutton_toggled),
1366 g_signal_connect ((gpointer) content_slimebutton, "toggled",
1367 G_CALLBACK (on_content_slimebutton_toggled),
1369 g_signal_connect ((gpointer) content_waterbutton, "toggled",
1370 G_CALLBACK (on_content_waterbutton_toggled),
1372 g_signal_connect ((gpointer) content_mistbutton, "toggled",
1373 G_CALLBACK (on_content_mistbutton_toggled),
1375 g_signal_connect ((gpointer) content_areaportalbutton, "toggled",
1376 G_CALLBACK (on_content_areaportalbutton_toggled),
1378 g_signal_connect ((gpointer) content_playerclipbutton, "toggled",
1379 G_CALLBACK (on_content_playerclipbutton_toggled),
1381 g_signal_connect ((gpointer) content_monsterclipbutton, "toggled",
1382 G_CALLBACK (on_content_monsterclipbutton_toggled),
1384 g_signal_connect ((gpointer) content_current0button, "toggled",
1385 G_CALLBACK (on_content_current0button_toggled),
1387 g_signal_connect ((gpointer) content_current90button, "toggled",
1388 G_CALLBACK (on_content_current90button_toggled),
1390 g_signal_connect ((gpointer) content_current180button, "toggled",
1391 G_CALLBACK (on_content_current180button_toggled),
1393 g_signal_connect ((gpointer) content_current270button, "toggled",
1394 G_CALLBACK (on_content_current270button_toggled),
1396 g_signal_connect ((gpointer) content_currentUPbutton, "toggled",
1397 G_CALLBACK (on_content_currentUPbutton_toggled),
1399 g_signal_connect ((gpointer) content_currentDOWNbutton, "toggled",
1400 G_CALLBACK (on_content_currentDOWNbutton_toggled),
1402 g_signal_connect ((gpointer) content_originbutton, "toggled",
1403 G_CALLBACK (on_content_originbutton_toggled),
1405 g_signal_connect ((gpointer) content_detailbutton, "toggled",
1406 G_CALLBACK (on_content_detailbutton_toggled),
1408 g_signal_connect ((gpointer) content_ladderbutton, "toggled",
1409 G_CALLBACK (on_content_ladderbutton_toggled),
1411 g_signal_connect ((gpointer) content_camnoblockbutton, "toggled",
1412 G_CALLBACK (on_content_camnoblockbutton_toggled),