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_quake2.h"
31 GtkWidget *surface_lightbutton;
32 GtkWidget *surface_slickbutton;
33 GtkWidget *surface_skybutton;
34 GtkWidget *surface_warpbutton;
35 GtkWidget *surface_trans33button;
36 GtkWidget *surface_trans66button;
37 GtkWidget *surface_flowingbutton;
38 GtkWidget *surface_nodrawbutton;
39 GtkWidget *surface_hintbutton;
40 GtkWidget *surface_skipbutton;
42 GtkWidget *content_solidbutton;
43 GtkWidget *content_windowbutton;
44 GtkWidget *content_auxbutton;
45 GtkWidget *content_lavabutton;
46 GtkWidget *content_slimebutton;
47 GtkWidget *content_waterbutton;
48 GtkWidget *content_mistbutton;
49 GtkWidget *content_areaportalbutton;
50 GtkWidget *content_playerclipbutton;
51 GtkWidget *content_monsterclipbutton;
52 GtkWidget *content_current0button;
53 GtkWidget *content_current90button;
54 GtkWidget *content_current180button;
55 GtkWidget *content_current270button;
56 GtkWidget *content_currentUPbutton;
57 GtkWidget *content_currentDOWNbutton;
58 GtkWidget *content_originbutton;
59 GtkWidget *content_detailbutton;
60 GtkWidget *content_translucentbutton;
61 GtkWidget *content_ladderbutton;
63 GtkWidget *surfacebutton;
64 GtkWidget *contentbutton;
66 GtkWidget *value_entry;
67 gboolean setup_buttons = TRUE;
69 int working_surface_flags;
71 int working_content_flags;
75 inline void set_inconsistent(GtkWidget *toggle_button)
77 gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), TRUE);
80 inline void clear_inconsistent(GtkWidget *toggle_button)
82 GtkWidget *button_label;
84 if ( gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (toggle_button)) )
86 gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), FALSE);
91 void clear_all_inconsistent(void)
93 clear_inconsistent( surface_lightbutton );
94 clear_inconsistent( surface_slickbutton );
95 clear_inconsistent( surface_skybutton );
96 clear_inconsistent( surface_warpbutton );
97 clear_inconsistent( surface_trans33button );
98 clear_inconsistent( surface_trans66button );
99 clear_inconsistent( surface_flowingbutton );
100 clear_inconsistent( surface_nodrawbutton );
101 clear_inconsistent( surface_hintbutton );
102 clear_inconsistent( surface_skipbutton );
104 clear_inconsistent( content_solidbutton );
105 clear_inconsistent( content_windowbutton );
106 clear_inconsistent( content_auxbutton );
107 clear_inconsistent( content_lavabutton );
108 clear_inconsistent( content_slimebutton );
109 clear_inconsistent( content_waterbutton );
110 clear_inconsistent( content_mistbutton );
111 clear_inconsistent( content_areaportalbutton );
112 clear_inconsistent( content_playerclipbutton );
113 clear_inconsistent( content_monsterclipbutton );
114 clear_inconsistent( content_current0button );
115 clear_inconsistent( content_current90button );
116 clear_inconsistent( content_current180button );
117 clear_inconsistent( content_current270button );
118 clear_inconsistent( content_currentUPbutton );
119 clear_inconsistent( content_currentDOWNbutton );
120 clear_inconsistent( content_originbutton );
121 clear_inconsistent( content_detailbutton );
122 clear_inconsistent( content_translucentbutton );
123 clear_inconsistent( content_ladderbutton );
126 void clear_all_buttons_and_values()
128 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_lightbutton ), FALSE);
129 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE);
130 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE);
131 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE);
132 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE);
133 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE);
134 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE);
135 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE);
136 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), FALSE);
137 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), FALSE);
139 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE);
140 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE);
141 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), FALSE);
142 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE);
143 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE);
144 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE);
145 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE);
146 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE);
147 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE);
148 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE);
149 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE);
150 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE);
151 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE);
152 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE);
153 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE);
154 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE);
155 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE);
156 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE);
157 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), FALSE);
158 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE);
160 gtk_entry_set_text( (GtkEntry *)value_entry, "");
163 void SetFlagButtons_Quake2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty)
169 int diff_contents = 0;
171 gboolean diff_value = FALSE;
173 texdef_t* tmp_texdef;
174 texdef_to_face_t* temp_texdef_face_list;
177 setup_buttons = TRUE;
178 working_surface_flags = 0;
180 working_content_flags = 0;
186 tmp_texdef = &texdef_face_list->texdef;
187 contents = tmp_texdef->contents;
188 flags = tmp_texdef->flags;
189 value = tmp_texdef->value;
191 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value);
192 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value);
194 for (temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
196 tmp_texdef = &temp_texdef_face_list->texdef;
197 diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent
198 diff_flags |= flags ^ tmp_texdef->flags;
199 if (tmp_texdef->value != value)
202 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value);
203 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value);
210 clear_all_inconsistent();
212 // If no faces/brushes are selected, clear everything and bail
215 clear_all_buttons_and_values();
216 setup_buttons = FALSE;
220 // Set surface buttons to reflect brush/face flags, contents, and values
221 if(diff_flags & QUAKE2_SURF_LIGHT)
222 set_inconsistent(surface_lightbutton);
223 else if(flags & QUAKE2_SURF_LIGHT)
224 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), TRUE);
226 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), FALSE);
228 if(diff_flags & QUAKE2_SURF_SLICK)
229 set_inconsistent(surface_slickbutton);
230 else if(flags & QUAKE2_SURF_SLICK)
231 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), TRUE);
233 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE);
235 if(diff_flags & QUAKE2_SURF_SKY)
236 set_inconsistent(surface_skybutton);
237 else if(flags & QUAKE2_SURF_SKY)
238 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), TRUE);
240 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE);
242 if(diff_flags & QUAKE2_SURF_WARP)
243 set_inconsistent(surface_warpbutton);
244 else if(flags & QUAKE2_SURF_WARP)
245 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), TRUE);
247 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE);
249 if(diff_flags & QUAKE2_SURF_TRANS33)
250 set_inconsistent(surface_trans33button);
251 else if(flags & QUAKE2_SURF_TRANS33)
252 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), TRUE);
254 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE);
256 if(diff_flags & QUAKE2_SURF_TRANS66)
257 set_inconsistent(surface_trans66button);
258 else if(flags & QUAKE2_SURF_TRANS66)
259 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), TRUE);
261 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE);
263 if(diff_flags & QUAKE2_SURF_FLOWING)
264 set_inconsistent(surface_flowingbutton);
265 else if(flags & QUAKE2_SURF_FLOWING)
266 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), TRUE);
268 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE);
270 if(diff_flags & QUAKE2_SURF_NODRAW)
271 set_inconsistent(surface_nodrawbutton);
272 else if(flags & QUAKE2_SURF_NODRAW)
273 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), TRUE);
275 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE);
277 if(diff_flags & QUAKE2_SURF_HINT)
278 set_inconsistent(surface_hintbutton);
279 else if(flags & QUAKE2_SURF_HINT)
280 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), TRUE);
282 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), FALSE);
284 if(diff_flags & QUAKE2_SURF_SKIP)
285 set_inconsistent(surface_skipbutton);
286 else if(flags & QUAKE2_SURF_SKIP)
287 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), TRUE);
289 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), FALSE);
291 // Set content buttons to reflect brush values
292 if(diff_contents & QUAKE2_CONTENTS_SOLID)
293 set_inconsistent(content_solidbutton);
294 else if(contents & QUAKE2_CONTENTS_SOLID)
295 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), TRUE);
297 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE);
299 if(diff_contents & QUAKE2_CONTENTS_WINDOW)
300 set_inconsistent(content_windowbutton);
301 else if(contents & QUAKE2_CONTENTS_WINDOW)
302 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), TRUE);
304 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE);
306 if(diff_contents & QUAKE2_CONTENTS_AUX)
307 set_inconsistent(content_auxbutton);
308 else if(contents & QUAKE2_CONTENTS_AUX)
309 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), TRUE);
311 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), FALSE);
313 if(diff_contents & QUAKE2_CONTENTS_LAVA)
314 set_inconsistent(content_lavabutton);
315 else if(contents & QUAKE2_CONTENTS_LAVA)
316 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), TRUE);
318 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE);
320 if(diff_contents & QUAKE2_CONTENTS_SLIME)
321 set_inconsistent(content_slimebutton);
322 else if(contents & QUAKE2_CONTENTS_SLIME)
323 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), TRUE);
325 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE);
327 if(diff_contents & QUAKE2_CONTENTS_WATER)
328 set_inconsistent(content_waterbutton);
329 else if(contents & QUAKE2_CONTENTS_WATER)
330 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), TRUE);
332 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE);
334 if(diff_contents & QUAKE2_CONTENTS_MIST)
335 set_inconsistent(content_mistbutton);
336 else if(contents & QUAKE2_CONTENTS_MIST)
337 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), TRUE);
339 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE);
341 if(diff_contents & QUAKE2_CONTENTS_AREAPORTAL)
342 set_inconsistent(content_areaportalbutton);
343 else if(contents & QUAKE2_CONTENTS_AREAPORTAL)
344 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), TRUE);
346 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE);
348 if(diff_contents & QUAKE2_CONTENTS_PLAYERCLIP)
349 set_inconsistent(content_playerclipbutton);
350 else if(contents & QUAKE2_CONTENTS_PLAYERCLIP)
351 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), TRUE);
353 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE);
355 if(diff_contents & QUAKE2_CONTENTS_MONSTERCLIP)
356 set_inconsistent(content_monsterclipbutton);
357 else if(contents & QUAKE2_CONTENTS_MONSTERCLIP)
358 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), TRUE);
360 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE);
362 if(diff_contents & QUAKE2_CONTENTS_CURRENT_0)
363 set_inconsistent(content_current0button);
364 else if(contents & QUAKE2_CONTENTS_CURRENT_0)
365 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), TRUE);
367 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE);
369 if(diff_contents & QUAKE2_CONTENTS_CURRENT_90)
370 set_inconsistent(content_current90button);
371 else if(contents & QUAKE2_CONTENTS_CURRENT_90)
372 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), TRUE);
374 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE);
376 if(diff_contents & QUAKE2_CONTENTS_CURRENT_180)
377 set_inconsistent(content_current180button);
378 else if(contents & QUAKE2_CONTENTS_CURRENT_180)
379 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), TRUE);
381 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE);
383 if(diff_contents & QUAKE2_CONTENTS_CURRENT_270)
384 set_inconsistent(content_current270button);
385 else if(contents & QUAKE2_CONTENTS_CURRENT_270)
386 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), TRUE);
388 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE);
390 if(diff_contents & QUAKE2_CONTENTS_CURRENT_UP)
391 set_inconsistent(content_currentUPbutton);
392 else if(contents & QUAKE2_CONTENTS_CURRENT_UP)
393 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), TRUE);
395 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE);
397 if(diff_contents & QUAKE2_CONTENTS_CURRENT_DOWN)
398 set_inconsistent(content_currentDOWNbutton);
399 else if(contents & QUAKE2_CONTENTS_CURRENT_DOWN)
400 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), TRUE);
402 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE);
404 if(diff_contents & QUAKE2_CONTENTS_ORIGIN)
405 set_inconsistent(content_originbutton);
406 else if(contents & QUAKE2_CONTENTS_ORIGIN)
407 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), TRUE);
409 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE);
411 if(diff_contents & QUAKE2_CONTENTS_DETAIL)
412 set_inconsistent(content_detailbutton);
413 else if(contents & QUAKE2_CONTENTS_DETAIL)
414 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), TRUE);
416 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE);
418 if(diff_contents & QUAKE2_CONTENTS_TRANSLUCENT)
419 set_inconsistent(content_translucentbutton);
420 else if(contents & QUAKE2_CONTENTS_TRANSLUCENT)
421 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), TRUE);
423 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), FALSE);
425 if(diff_contents & QUAKE2_CONTENTS_LADDER)
426 set_inconsistent(content_ladderbutton);
427 else if(contents & QUAKE2_CONTENTS_LADDER)
428 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), TRUE);
430 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE);
434 gtk_entry_set_text( (GtkEntry *)value_entry, "");
437 working_value = value;
438 sprintf( tex_buff, "%d", value);
439 gtk_entry_set_text( (GtkEntry *)value_entry, tex_buff);
442 setup_buttons = FALSE;
445 void SetChangeInFlags_Face_Quake2 (texdef_to_face_t *texdef_face_list)
447 texdef_to_face_t *temp_texdef_face_list;
448 texdef_t *tmp_texdef;
450 for (temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
452 tmp_texdef = &temp_texdef_face_list->texdef;
453 tmp_texdef->flags = (tmp_texdef->flags & ~surface_mask) | working_surface_flags;
454 tmp_texdef->contents = (tmp_texdef->contents & ~content_mask) | working_content_flags;
455 tmp_texdef->value = working_value;
456 Sys_Printf("content_flag: %d content_mask: %d\n",working_content_flags,content_mask);
457 Sys_Printf("content: %d\n",tmp_texdef->contents);
461 inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to)
464 if (!setup_buttons) // If we're setting up the buttons, we really don't need to
465 { // set flags that are already set
467 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) // Clear out inconsistent, if set
468 clear_inconsistent(GTK_WIDGET (togglebutton));
470 surface_mask |= sur_flag;
473 working_surface_flags |= sur_flag;
475 working_surface_flags &= ~sur_flag;
479 inline void change_contentflag (GtkWidget *togglebutton, int content_flag, gboolean change_flag_to)
482 if ( (!setup_buttons) ) // If we're setting up the buttons, we really don't need to
483 { // set flags that are already set
485 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton)))
486 clear_inconsistent(togglebutton);
487 //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces.
489 content_mask |= content_flag;
492 working_content_flags |= content_flag;
494 working_content_flags &= ~content_flag;
496 Sys_Printf("content_flag: %d content_mask: %d\n",content_flag,content_mask);
500 // Surface Flags Callbacks
502 on_surface_lightbutton_toggled (GtkToggleButton *togglebutton,
505 change_surfaceflag(surface_lightbutton, QUAKE2_SURF_LIGHT, (GTK_TOGGLE_BUTTON (surface_lightbutton)->active));
510 on_surface_slickbutton_toggled (GtkToggleButton *togglebutton,
513 change_surfaceflag(surface_slickbutton, QUAKE2_SURF_SLICK, (GTK_TOGGLE_BUTTON (surface_slickbutton)->active));
518 on_surface_skybutton_toggled (GtkToggleButton *togglebutton,
521 change_surfaceflag(surface_skybutton, QUAKE2_SURF_SKY, (GTK_TOGGLE_BUTTON (surface_skybutton)->active));
525 on_surface_warpbutton_toggled (GtkToggleButton *togglebutton,
528 change_surfaceflag(surface_warpbutton, QUAKE2_SURF_WARP, (GTK_TOGGLE_BUTTON (surface_warpbutton)->active));
532 on_surface_trans33button_toggled (GtkToggleButton *togglebutton,
535 change_surfaceflag(surface_trans33button, QUAKE2_SURF_TRANS33, (GTK_TOGGLE_BUTTON (surface_trans33button)->active));
539 on_surface_trans66button_toggled (GtkToggleButton *togglebutton,
542 change_surfaceflag(surface_trans66button, QUAKE2_SURF_TRANS66, (GTK_TOGGLE_BUTTON (surface_trans66button)->active));
546 on_surface_flowingbutton_toggled (GtkToggleButton *togglebutton,
549 change_surfaceflag(surface_flowingbutton, QUAKE2_SURF_FLOWING, (GTK_TOGGLE_BUTTON (surface_flowingbutton)->active));
553 on_surface_nodrawbutton_toggled (GtkToggleButton *togglebutton,
556 change_surfaceflag(surface_nodrawbutton, QUAKE2_SURF_NODRAW, (GTK_TOGGLE_BUTTON (surface_nodrawbutton)->active));
560 on_surface_hintbutton_toggled (GtkToggleButton *togglebutton,
563 change_surfaceflag(surface_hintbutton, QUAKE2_SURF_HINT, (GTK_TOGGLE_BUTTON (surface_hintbutton)->active));
567 on_surface_skipbutton_toggled (GtkToggleButton *togglebutton,
570 change_surfaceflag(surface_skipbutton, QUAKE2_SURF_SKIP, (GTK_TOGGLE_BUTTON (surface_skipbutton)->active));
573 // Content Flags Callbacks
575 on_content_solidbutton_toggled (GtkToggleButton *togglebutton,
578 change_contentflag(content_solidbutton, QUAKE2_CONTENTS_SOLID, (GTK_TOGGLE_BUTTON (content_solidbutton)->active));
582 on_content_windowbutton_toggled (GtkToggleButton *togglebutton,
585 change_contentflag(content_windowbutton, QUAKE2_CONTENTS_WINDOW, (GTK_TOGGLE_BUTTON (content_windowbutton)->active));
589 on_content_auxbutton_toggled (GtkToggleButton *togglebutton,
592 change_contentflag(content_auxbutton, QUAKE2_CONTENTS_AUX, (GTK_TOGGLE_BUTTON (content_auxbutton)->active));
596 on_content_lavabutton_toggled (GtkToggleButton *togglebutton,
599 change_contentflag(content_lavabutton, QUAKE2_CONTENTS_LAVA, (GTK_TOGGLE_BUTTON (content_lavabutton)->active));
603 on_content_slimebutton_toggled (GtkToggleButton *togglebutton,
606 change_contentflag(content_slimebutton, QUAKE2_CONTENTS_SLIME, (GTK_TOGGLE_BUTTON (content_slimebutton)->active));
610 on_content_waterbutton_toggled (GtkToggleButton *togglebutton,
613 change_contentflag(content_waterbutton, QUAKE2_CONTENTS_WATER, (GTK_TOGGLE_BUTTON (content_waterbutton)->active));
617 on_content_mistbutton_toggled (GtkToggleButton *togglebutton,
620 change_contentflag(content_mistbutton, QUAKE2_CONTENTS_MIST, (GTK_TOGGLE_BUTTON (content_mistbutton)->active));
624 on_content_areaportalbutton_toggled (GtkToggleButton *togglebutton,
627 change_contentflag(content_areaportalbutton, QUAKE2_CONTENTS_AREAPORTAL, (GTK_TOGGLE_BUTTON (content_areaportalbutton)->active));
631 on_content_playerclipbutton_toggled (GtkToggleButton *togglebutton,
634 change_contentflag(content_playerclipbutton, QUAKE2_CONTENTS_PLAYERCLIP, (GTK_TOGGLE_BUTTON (content_playerclipbutton)->active));
638 on_content_monsterclipbutton_toggled (GtkToggleButton *togglebutton,
641 change_contentflag(content_monsterclipbutton, QUAKE2_CONTENTS_MONSTERCLIP, (GTK_TOGGLE_BUTTON (content_monsterclipbutton)->active));
645 on_content_current0button_toggled (GtkToggleButton *togglebutton,
648 change_contentflag(content_current0button, QUAKE2_CONTENTS_CURRENT_0, (GTK_TOGGLE_BUTTON (content_current0button)->active));
652 on_content_current90button_toggled (GtkToggleButton *togglebutton,
655 change_contentflag(content_current90button, QUAKE2_CONTENTS_CURRENT_90, (GTK_TOGGLE_BUTTON (content_current90button)->active));
659 on_content_current180button_toggled (GtkToggleButton *togglebutton,
662 change_contentflag(content_current180button, QUAKE2_CONTENTS_CURRENT_180, (GTK_TOGGLE_BUTTON (content_current180button)->active));
666 on_content_current270button_toggled (GtkToggleButton *togglebutton,
669 change_contentflag(content_current270button, QUAKE2_CONTENTS_CURRENT_270, (GTK_TOGGLE_BUTTON (content_current270button)->active));
673 on_content_currentUPbutton_toggled (GtkToggleButton *togglebutton,
676 change_contentflag(content_currentUPbutton, QUAKE2_CONTENTS_CURRENT_UP, (GTK_TOGGLE_BUTTON (content_currentUPbutton)->active));
680 on_content_currentDOWNbutton_toggled (GtkToggleButton *togglebutton,
683 change_contentflag(content_currentDOWNbutton, QUAKE2_CONTENTS_CURRENT_DOWN, (GTK_TOGGLE_BUTTON (content_currentDOWNbutton)->active));
687 on_content_originbutton_toggled (GtkToggleButton *togglebutton,
690 change_contentflag(content_originbutton, QUAKE2_CONTENTS_ORIGIN, (GTK_TOGGLE_BUTTON (content_originbutton)->active));
694 on_content_detailbutton_toggled (GtkToggleButton *togglebutton,
697 change_contentflag(content_detailbutton, QUAKE2_CONTENTS_DETAIL, (GTK_TOGGLE_BUTTON (content_detailbutton)->active));
701 on_content_translucentbutton_toggled (GtkToggleButton *togglebutton,
704 change_contentflag(content_translucentbutton, QUAKE2_CONTENTS_TRANSLUCENT, (GTK_TOGGLE_BUTTON (content_translucentbutton)->active));
708 on_content_ladderbutton_toggled (GtkToggleButton *togglebutton,
711 change_contentflag(content_ladderbutton, QUAKE2_CONTENTS_LADDER, (GTK_TOGGLE_BUTTON (content_ladderbutton)->active));
714 // Value Entry Callback
716 on_value_entry_changed (GtkEditable *editable,
719 if ( (!setup_buttons) ) // If we're setting up the buttons, don't change value
720 working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable) );
724 on_value_entry_insert_text (GtkEditable *editable,
726 gint new_text_length,
737 // Limit input to digits, throwing out anything else
738 // Modified from Gtk FAQ for text filtering of GtkEntry
739 result = g_new (gchar, new_text_length);
741 for (i=0; i < new_text_length; i++) {
742 if (!isdigit(new_text[i]))
744 result[count++] = new_text[i];
748 gtk_signal_handler_block_by_func (GTK_OBJECT (editable),
749 GTK_SIGNAL_FUNC (on_value_entry_insert_text),
751 gtk_editable_insert_text (editable, result, count, position);
752 gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable),
753 GTK_SIGNAL_FUNC (on_value_entry_insert_text),
756 gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text");
762 on_surfacebutton_clicked (GtkButton *button,
765 gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 0);
769 on_contentbutton_clicked (GtkButton *button,
772 gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 1);
776 #define QUAKE2_FLAG_BUTTON_BORDER 3
778 GtkWidget* Create_Quake2FlagsDialog (GtkWidget* surfacedialog_widget)
788 GtkWidget *hseparator1;
789 GtkWidget *value_label;
796 frame1 = gtk_frame_new ("Flags");
797 gtk_widget_show (frame1);
798 gtk_container_add (GTK_CONTAINER (surfacedialog_widget), frame1);
800 vbox1 = gtk_vbox_new (FALSE, 0);
801 gtk_widget_show (vbox1);
802 gtk_container_add (GTK_CONTAINER (frame1), vbox1);
804 notebook1 = gtk_notebook_new ();
805 gtk_widget_show (notebook1);
806 gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0);
807 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook1), TRUE);
808 gtk_container_set_border_width (GTK_CONTAINER (notebook1), 5);
810 vbox2 = gtk_vbox_new (FALSE, 0);
811 gtk_widget_show (vbox2);
812 gtk_container_add (GTK_CONTAINER (notebook1), vbox2);
814 table4 = gtk_table_new (3, 4, FALSE);
815 gtk_widget_show (table4);
816 gtk_box_pack_start (GTK_BOX (vbox2), table4, TRUE, TRUE, 0);
818 surface_lightbutton = gtk_toggle_button_new_with_label ("Light");
819 gtk_signal_connect (GTK_OBJECT (surface_lightbutton), "toggled",
820 GTK_SIGNAL_FUNC (on_surface_lightbutton_toggled),
822 gtk_widget_show (surface_lightbutton);
823 gtk_table_attach (GTK_TABLE (table4), surface_lightbutton, 0, 1, 0, 1,
824 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
825 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
826 gtk_container_set_border_width (GTK_CONTAINER (surface_lightbutton), QUAKE2_FLAG_BUTTON_BORDER);
828 surface_slickbutton = gtk_toggle_button_new_with_label ("Slick");
829 gtk_signal_connect (GTK_OBJECT (surface_slickbutton), "toggled",
830 GTK_SIGNAL_FUNC (on_surface_slickbutton_toggled),
832 gtk_widget_show (surface_slickbutton);
833 gtk_table_attach (GTK_TABLE (table4), surface_slickbutton, 1, 2, 0, 1,
834 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
835 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
836 gtk_container_set_border_width (GTK_CONTAINER (surface_slickbutton), QUAKE2_FLAG_BUTTON_BORDER);
838 surface_skybutton = gtk_toggle_button_new_with_label ("Sky");
839 gtk_signal_connect (GTK_OBJECT (surface_skybutton), "toggled",
840 GTK_SIGNAL_FUNC (on_surface_skybutton_toggled),
842 gtk_widget_show (surface_skybutton);
843 gtk_table_attach (GTK_TABLE (table4), surface_skybutton, 2, 3, 0, 1,
844 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
845 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
846 gtk_container_set_border_width (GTK_CONTAINER (surface_skybutton), QUAKE2_FLAG_BUTTON_BORDER);
848 surface_warpbutton = gtk_toggle_button_new_with_label ("Warp");
849 gtk_signal_connect (GTK_OBJECT (surface_warpbutton), "toggled",
850 GTK_SIGNAL_FUNC (on_surface_warpbutton_toggled),
852 gtk_widget_show (surface_warpbutton);
853 gtk_table_attach (GTK_TABLE (table4), surface_warpbutton, 3, 4, 0, 1,
854 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
855 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
856 gtk_container_set_border_width (GTK_CONTAINER (surface_warpbutton), QUAKE2_FLAG_BUTTON_BORDER);
858 surface_trans33button = gtk_toggle_button_new_with_label ("Trans 33");
859 gtk_signal_connect (GTK_OBJECT (surface_trans33button), "toggled",
860 GTK_SIGNAL_FUNC (on_surface_trans33button_toggled),
862 gtk_widget_show (surface_trans33button);
863 gtk_table_attach (GTK_TABLE (table4), surface_trans33button, 0, 1, 1, 2,
864 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
865 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
866 gtk_container_set_border_width (GTK_CONTAINER (surface_trans33button), QUAKE2_FLAG_BUTTON_BORDER);
868 surface_trans66button = gtk_toggle_button_new_with_label ("Trans 66");
869 gtk_signal_connect (GTK_OBJECT (surface_trans66button), "toggled",
870 GTK_SIGNAL_FUNC (on_surface_trans66button_toggled),
872 gtk_widget_show (surface_trans66button);
873 gtk_table_attach (GTK_TABLE (table4), surface_trans66button, 1, 2, 1, 2,
874 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
875 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
876 gtk_container_set_border_width (GTK_CONTAINER (surface_trans66button), QUAKE2_FLAG_BUTTON_BORDER);
878 surface_flowingbutton = gtk_toggle_button_new_with_label ("Flowing");
879 gtk_signal_connect (GTK_OBJECT (surface_flowingbutton), "toggled",
880 GTK_SIGNAL_FUNC (on_surface_flowingbutton_toggled),
882 gtk_widget_show (surface_flowingbutton);
883 gtk_table_attach (GTK_TABLE (table4), surface_flowingbutton, 2, 3, 1, 2,
884 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
885 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
886 gtk_container_set_border_width (GTK_CONTAINER (surface_flowingbutton), QUAKE2_FLAG_BUTTON_BORDER);
888 surface_nodrawbutton = gtk_toggle_button_new_with_label ("NoDraw");
889 gtk_signal_connect (GTK_OBJECT (surface_nodrawbutton), "toggled",
890 GTK_SIGNAL_FUNC (on_surface_nodrawbutton_toggled),
892 gtk_widget_show (surface_nodrawbutton);
893 gtk_table_attach (GTK_TABLE (table4), surface_nodrawbutton, 3, 4, 1, 2,
894 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
895 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
896 gtk_container_set_border_width (GTK_CONTAINER (surface_nodrawbutton), QUAKE2_FLAG_BUTTON_BORDER);
898 surface_hintbutton = gtk_toggle_button_new_with_label ("Hint");
899 gtk_signal_connect (GTK_OBJECT (surface_hintbutton), "toggled",
900 GTK_SIGNAL_FUNC (on_surface_hintbutton_toggled),
902 gtk_widget_show (surface_hintbutton);
903 gtk_table_attach (GTK_TABLE (table4), surface_hintbutton, 0, 1, 2, 3,
904 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
905 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
906 gtk_container_set_border_width (GTK_CONTAINER (surface_hintbutton), QUAKE2_FLAG_BUTTON_BORDER);
908 surface_skipbutton = gtk_toggle_button_new_with_label ("Skip");
909 gtk_signal_connect (GTK_OBJECT (surface_skipbutton), "toggled",
910 GTK_SIGNAL_FUNC (on_surface_skipbutton_toggled),
912 gtk_widget_show (surface_skipbutton);
913 gtk_table_attach (GTK_TABLE (table4), surface_skipbutton, 3, 4, 2, 3,
914 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
915 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
916 gtk_container_set_border_width (GTK_CONTAINER (surface_skipbutton), QUAKE2_FLAG_BUTTON_BORDER);
918 hseparator1 = gtk_hseparator_new ();
919 gtk_widget_show (hseparator1);
920 gtk_box_pack_start (GTK_BOX (vbox2), hseparator1, FALSE, FALSE, 0);
921 gtk_widget_set_usize (hseparator1, -2, 5);
923 hbox2 = gtk_hbox_new (FALSE, 0);
924 gtk_widget_show (hbox2);
925 gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
927 hbox3 = gtk_hbox_new (FALSE, 0);
928 gtk_widget_show (hbox3);
929 gtk_box_pack_start (GTK_BOX (hbox2), hbox3, TRUE, TRUE, 0);
931 vbox4 = gtk_vbox_new (FALSE, 0);
932 gtk_widget_show (vbox4);
933 gtk_box_pack_start (GTK_BOX (hbox3), vbox4, TRUE, TRUE, 0);
935 value_label = gtk_label_new (" Value: ");
936 gtk_widget_show (value_label);
937 gtk_box_pack_start (GTK_BOX (hbox3), value_label, FALSE, FALSE, 0);
939 value_entry = gtk_entry_new ();
940 gtk_signal_connect (GTK_OBJECT (value_entry), "changed",
941 GTK_SIGNAL_FUNC (on_value_entry_changed),
943 gtk_signal_connect (GTK_OBJECT (value_entry), "insert_text",
944 GTK_SIGNAL_FUNC (on_value_entry_insert_text),
946 gtk_entry_set_max_length( (GtkEntry *)value_entry, 11);
947 gtk_widget_show (value_entry);
948 gtk_box_pack_start (GTK_BOX (hbox3), value_entry, TRUE, TRUE, 0);
950 vbox3 = gtk_vbox_new (FALSE, 0);
951 gtk_widget_show (vbox3);
952 gtk_box_pack_start (GTK_BOX (hbox3), vbox3, TRUE, TRUE, 0);
954 label5 = gtk_label_new ("Surface Flags");
955 gtk_widget_show (label5);
956 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label5);
958 table3 = gtk_table_new (5, 4, FALSE);
959 gtk_widget_show (table3);
960 gtk_container_add (GTK_CONTAINER (notebook1), table3);
962 content_solidbutton = gtk_toggle_button_new_with_label ("Solid");
963 gtk_signal_connect (GTK_OBJECT (content_solidbutton), "toggled",
964 GTK_SIGNAL_FUNC (on_content_solidbutton_toggled),
966 gtk_widget_show (content_solidbutton);
967 gtk_table_attach (GTK_TABLE (table3), content_solidbutton, 0, 1, 0, 1,
968 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
969 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
970 gtk_container_set_border_width (GTK_CONTAINER (content_solidbutton), QUAKE2_FLAG_BUTTON_BORDER);
972 content_windowbutton = gtk_toggle_button_new_with_label ("Window");
973 gtk_signal_connect (GTK_OBJECT (content_windowbutton), "toggled",
974 GTK_SIGNAL_FUNC (on_content_windowbutton_toggled),
976 gtk_widget_show (content_windowbutton);
977 gtk_table_attach (GTK_TABLE (table3), content_windowbutton, 1, 2, 0, 1,
978 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
979 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
980 gtk_container_set_border_width (GTK_CONTAINER (content_windowbutton), QUAKE2_FLAG_BUTTON_BORDER);
982 content_auxbutton = gtk_toggle_button_new_with_label ("Aux");
983 gtk_signal_connect (GTK_OBJECT (content_auxbutton), "toggled",
984 GTK_SIGNAL_FUNC (on_content_auxbutton_toggled),
986 gtk_widget_show (content_auxbutton);
987 gtk_table_attach (GTK_TABLE (table3), content_auxbutton, 2, 3, 0, 1,
988 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
989 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
990 gtk_container_set_border_width (GTK_CONTAINER (content_auxbutton), QUAKE2_FLAG_BUTTON_BORDER);
992 content_lavabutton = gtk_toggle_button_new_with_label ("Lava");
993 gtk_signal_connect (GTK_OBJECT (content_lavabutton), "toggled",
994 GTK_SIGNAL_FUNC (on_content_lavabutton_toggled),
996 gtk_widget_show (content_lavabutton);
997 gtk_table_attach (GTK_TABLE (table3), content_lavabutton, 3, 4, 0, 1,
998 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
999 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1000 gtk_container_set_border_width (GTK_CONTAINER (content_lavabutton), QUAKE2_FLAG_BUTTON_BORDER);
1002 content_slimebutton = gtk_toggle_button_new_with_label ("Slime");
1003 gtk_signal_connect (GTK_OBJECT (content_slimebutton), "toggled",
1004 GTK_SIGNAL_FUNC (on_content_slimebutton_toggled),
1006 gtk_widget_show (content_slimebutton);
1007 gtk_table_attach (GTK_TABLE (table3), content_slimebutton, 0, 1, 1, 2,
1008 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1009 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1010 gtk_container_set_border_width (GTK_CONTAINER (content_slimebutton), QUAKE2_FLAG_BUTTON_BORDER);
1012 content_waterbutton = gtk_toggle_button_new_with_label ("Water");
1013 gtk_signal_connect (GTK_OBJECT (content_waterbutton), "toggled",
1014 GTK_SIGNAL_FUNC (on_content_waterbutton_toggled),
1016 gtk_widget_show (content_waterbutton);
1017 gtk_table_attach (GTK_TABLE (table3), content_waterbutton, 1, 2, 1, 2,
1018 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1019 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1020 gtk_container_set_border_width (GTK_CONTAINER (content_waterbutton), QUAKE2_FLAG_BUTTON_BORDER);
1022 content_mistbutton = gtk_toggle_button_new_with_label ("Mist");
1023 gtk_signal_connect (GTK_OBJECT (content_mistbutton), "toggled",
1024 GTK_SIGNAL_FUNC (on_content_mistbutton_toggled),
1026 gtk_widget_show (content_mistbutton);
1027 gtk_table_attach (GTK_TABLE (table3), content_mistbutton, 2, 3, 1, 2,
1028 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1029 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1030 gtk_container_set_border_width (GTK_CONTAINER (content_mistbutton), QUAKE2_FLAG_BUTTON_BORDER);
1032 content_areaportalbutton = gtk_toggle_button_new_with_label ("AreaPortal");
1033 gtk_signal_connect (GTK_OBJECT (content_areaportalbutton), "toggled",
1034 GTK_SIGNAL_FUNC (on_content_areaportalbutton_toggled),
1036 gtk_widget_show (content_areaportalbutton);
1037 gtk_table_attach (GTK_TABLE (table3), content_areaportalbutton, 3, 4, 1, 2,
1038 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1039 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1040 gtk_container_set_border_width (GTK_CONTAINER (content_areaportalbutton), QUAKE2_FLAG_BUTTON_BORDER);
1042 content_playerclipbutton = gtk_toggle_button_new_with_label ("PlayerClip");
1043 gtk_signal_connect (GTK_OBJECT (content_playerclipbutton), "toggled",
1044 GTK_SIGNAL_FUNC (on_content_playerclipbutton_toggled),
1046 gtk_widget_show (content_playerclipbutton);
1047 gtk_table_attach (GTK_TABLE (table3), content_playerclipbutton, 0, 1, 2, 3,
1048 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1049 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1050 gtk_container_set_border_width (GTK_CONTAINER (content_playerclipbutton), QUAKE2_FLAG_BUTTON_BORDER);
1052 content_monsterclipbutton = gtk_toggle_button_new_with_label ("MonsterClip");
1053 gtk_signal_connect (GTK_OBJECT (content_monsterclipbutton), "toggled",
1054 GTK_SIGNAL_FUNC (on_content_monsterclipbutton_toggled),
1056 gtk_widget_show (content_monsterclipbutton);
1057 gtk_table_attach (GTK_TABLE (table3), content_monsterclipbutton, 1, 2, 2, 3,
1058 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1059 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1060 gtk_container_set_border_width (GTK_CONTAINER (content_monsterclipbutton), QUAKE2_FLAG_BUTTON_BORDER);
1062 content_current0button = gtk_toggle_button_new_with_label ("Current 0");
1063 gtk_signal_connect (GTK_OBJECT (content_current0button), "toggled",
1064 GTK_SIGNAL_FUNC (on_content_current0button_toggled),
1066 gtk_widget_show (content_current0button);
1067 gtk_table_attach (GTK_TABLE (table3), content_current0button, 2, 3, 2, 3,
1068 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1069 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1070 gtk_container_set_border_width (GTK_CONTAINER (content_current0button), QUAKE2_FLAG_BUTTON_BORDER);
1072 content_current90button = gtk_toggle_button_new_with_label ("Current 90");
1073 gtk_signal_connect (GTK_OBJECT (content_current90button), "toggled",
1074 GTK_SIGNAL_FUNC (on_content_current90button_toggled),
1076 gtk_widget_show (content_current90button);
1077 gtk_table_attach (GTK_TABLE (table3), content_current90button, 3, 4, 2, 3,
1078 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1079 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1080 gtk_container_set_border_width (GTK_CONTAINER (content_current90button), QUAKE2_FLAG_BUTTON_BORDER);
1082 content_current180button = gtk_toggle_button_new_with_label ("Current 180");
1083 gtk_signal_connect (GTK_OBJECT (content_current180button), "toggled",
1084 GTK_SIGNAL_FUNC (on_content_current180button_toggled),
1086 gtk_widget_show (content_current180button);
1087 gtk_table_attach (GTK_TABLE (table3), content_current180button, 0, 1, 3, 4,
1088 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1089 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1090 gtk_container_set_border_width (GTK_CONTAINER (content_current180button), QUAKE2_FLAG_BUTTON_BORDER);
1092 content_current270button = gtk_toggle_button_new_with_label ("Current 270");
1093 gtk_signal_connect (GTK_OBJECT (content_current270button), "toggled",
1094 GTK_SIGNAL_FUNC (on_content_current270button_toggled),
1096 gtk_widget_show (content_current270button);
1097 gtk_table_attach (GTK_TABLE (table3), content_current270button, 1, 2, 3, 4,
1098 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1099 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1100 gtk_container_set_border_width (GTK_CONTAINER (content_current270button), QUAKE2_FLAG_BUTTON_BORDER);
1102 content_currentUPbutton = gtk_toggle_button_new_with_label ("Current UP");
1103 gtk_signal_connect (GTK_OBJECT (content_currentUPbutton), "toggled",
1104 GTK_SIGNAL_FUNC (on_content_currentUPbutton_toggled),
1106 gtk_widget_show (content_currentUPbutton);
1107 gtk_table_attach (GTK_TABLE (table3), content_currentUPbutton, 2, 3, 3, 4,
1108 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1109 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1110 gtk_container_set_border_width (GTK_CONTAINER (content_currentUPbutton), QUAKE2_FLAG_BUTTON_BORDER);
1112 content_currentDOWNbutton = gtk_toggle_button_new_with_label ("Current DOWN");
1113 gtk_signal_connect (GTK_OBJECT (content_currentDOWNbutton), "toggled",
1114 GTK_SIGNAL_FUNC (on_content_currentDOWNbutton_toggled),
1116 gtk_widget_show (content_currentDOWNbutton);
1117 gtk_table_attach (GTK_TABLE (table3), content_currentDOWNbutton, 3, 4, 3, 4,
1118 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1119 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1120 gtk_container_set_border_width (GTK_CONTAINER (content_currentDOWNbutton), QUAKE2_FLAG_BUTTON_BORDER);
1122 content_originbutton = gtk_toggle_button_new_with_label ("Origin");
1123 gtk_signal_connect (GTK_OBJECT (content_originbutton), "toggled",
1124 GTK_SIGNAL_FUNC (on_content_originbutton_toggled),
1126 gtk_widget_show (content_originbutton);
1127 gtk_table_attach (GTK_TABLE (table3), content_originbutton, 0, 1, 4, 5,
1128 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1129 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1130 gtk_container_set_border_width (GTK_CONTAINER (content_originbutton), QUAKE2_FLAG_BUTTON_BORDER);
1132 content_detailbutton = gtk_toggle_button_new_with_label ("Detail");
1133 gtk_signal_connect (GTK_OBJECT (content_detailbutton), "toggled",
1134 GTK_SIGNAL_FUNC (on_content_detailbutton_toggled),
1136 gtk_widget_show (content_detailbutton);
1137 gtk_table_attach (GTK_TABLE (table3), content_detailbutton, 1, 2, 4, 5,
1138 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1139 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1140 gtk_container_set_border_width (GTK_CONTAINER (content_detailbutton), QUAKE2_FLAG_BUTTON_BORDER);
1142 content_translucentbutton = gtk_toggle_button_new_with_label ("Translucent");
1143 gtk_signal_connect (GTK_OBJECT (content_translucentbutton), "toggled",
1144 GTK_SIGNAL_FUNC (on_content_translucentbutton_toggled),
1146 gtk_widget_show (content_translucentbutton);
1147 gtk_table_attach (GTK_TABLE (table3), content_translucentbutton, 2, 3, 4, 5,
1148 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1149 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1150 gtk_container_set_border_width (GTK_CONTAINER (content_translucentbutton), QUAKE2_FLAG_BUTTON_BORDER);
1152 content_ladderbutton = gtk_toggle_button_new_with_label ("Ladder");
1153 gtk_signal_connect (GTK_OBJECT (content_ladderbutton), "toggled",
1154 GTK_SIGNAL_FUNC (on_content_ladderbutton_toggled),
1156 gtk_widget_show (content_ladderbutton);
1157 gtk_table_attach (GTK_TABLE (table3), content_ladderbutton, 3, 4, 4, 5,
1158 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1159 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1160 gtk_container_set_border_width (GTK_CONTAINER (content_ladderbutton), QUAKE2_FLAG_BUTTON_BORDER);
1162 label6 = gtk_label_new ("Content Flags");
1163 gtk_widget_show (label6);
1164 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label6);