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_quake2.h"
32 GtkWidget *surface_lightbutton;
33 GtkWidget *surface_slickbutton;
34 GtkWidget *surface_skybutton;
35 GtkWidget *surface_warpbutton;
36 GtkWidget *surface_trans33button;
37 GtkWidget *surface_trans66button;
38 GtkWidget *surface_flowingbutton;
39 GtkWidget *surface_nodrawbutton;
40 GtkWidget *surface_hintbutton;
41 GtkWidget *surface_skipbutton;
43 GtkWidget *content_solidbutton;
44 GtkWidget *content_windowbutton;
45 GtkWidget *content_auxbutton;
46 GtkWidget *content_lavabutton;
47 GtkWidget *content_slimebutton;
48 GtkWidget *content_waterbutton;
49 GtkWidget *content_mistbutton;
50 GtkWidget *content_areaportalbutton;
51 GtkWidget *content_playerclipbutton;
52 GtkWidget *content_monsterclipbutton;
53 GtkWidget *content_current0button;
54 GtkWidget *content_current90button;
55 GtkWidget *content_current180button;
56 GtkWidget *content_current270button;
57 GtkWidget *content_currentUPbutton;
58 GtkWidget *content_currentDOWNbutton;
59 GtkWidget *content_originbutton;
60 GtkWidget *content_detailbutton;
61 GtkWidget *content_translucentbutton;
62 GtkWidget *content_ladderbutton;
64 GtkWidget *surfacebutton;
65 GtkWidget *contentbutton;
67 GtkWidget *value_entry;
68 gboolean setup_buttons = TRUE;
70 int working_surface_flags;
72 int working_content_flags;
76 inline void set_inconsistent(GtkWidget *toggle_button)
78 gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), TRUE);
81 inline void clear_inconsistent(GtkWidget *toggle_button)
83 GtkWidget *button_label;
85 if ( gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (toggle_button)) )
87 gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), FALSE);
92 void clear_all_inconsistent(void)
94 clear_inconsistent( surface_lightbutton );
95 clear_inconsistent( surface_slickbutton );
96 clear_inconsistent( surface_skybutton );
97 clear_inconsistent( surface_warpbutton );
98 clear_inconsistent( surface_trans33button );
99 clear_inconsistent( surface_trans66button );
100 clear_inconsistent( surface_flowingbutton );
101 clear_inconsistent( surface_nodrawbutton );
102 clear_inconsistent( surface_hintbutton );
103 clear_inconsistent( surface_skipbutton );
105 clear_inconsistent( content_solidbutton );
106 clear_inconsistent( content_windowbutton );
107 clear_inconsistent( content_auxbutton );
108 clear_inconsistent( content_lavabutton );
109 clear_inconsistent( content_slimebutton );
110 clear_inconsistent( content_waterbutton );
111 clear_inconsistent( content_mistbutton );
112 clear_inconsistent( content_areaportalbutton );
113 clear_inconsistent( content_playerclipbutton );
114 clear_inconsistent( content_monsterclipbutton );
115 clear_inconsistent( content_current0button );
116 clear_inconsistent( content_current90button );
117 clear_inconsistent( content_current180button );
118 clear_inconsistent( content_current270button );
119 clear_inconsistent( content_currentUPbutton );
120 clear_inconsistent( content_currentDOWNbutton );
121 clear_inconsistent( content_originbutton );
122 clear_inconsistent( content_detailbutton );
123 clear_inconsistent( content_translucentbutton );
124 clear_inconsistent( content_ladderbutton );
127 void clear_all_buttons_and_values()
129 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_lightbutton ), FALSE);
130 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE);
131 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE);
132 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE);
133 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE);
134 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE);
135 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE);
136 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE);
137 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), FALSE);
138 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), FALSE);
140 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE);
141 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE);
142 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), FALSE);
143 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE);
144 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE);
145 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE);
146 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE);
147 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE);
148 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE);
149 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE);
150 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE);
151 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE);
152 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE);
153 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE);
154 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE);
155 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE);
156 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE);
157 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE);
158 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), FALSE);
159 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE);
161 gtk_entry_set_text( (GtkEntry *)value_entry, "");
164 void SetFlagButtons_Quake2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty)
170 int diff_contents = 0;
172 gboolean diff_value = FALSE;
174 texdef_t* tmp_texdef;
175 texdef_to_face_t* temp_texdef_face_list;
178 setup_buttons = TRUE;
179 working_surface_flags = 0;
181 working_content_flags = 0;
187 tmp_texdef = &texdef_face_list->texdef;
188 contents = tmp_texdef->contents;
189 flags = tmp_texdef->flags;
190 value = tmp_texdef->value;
192 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value);
193 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value);
195 for (temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
197 tmp_texdef = &temp_texdef_face_list->texdef;
198 diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent
199 diff_flags |= flags ^ tmp_texdef->flags;
200 if (tmp_texdef->value != value)
203 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value);
204 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value);
211 clear_all_inconsistent();
213 // If no faces/brushes are selected, clear everything and bail
216 clear_all_buttons_and_values();
217 setup_buttons = FALSE;
221 // Set surface buttons to reflect brush/face flags, contents, and values
222 if(diff_flags & QUAKE2_SURF_LIGHT)
223 set_inconsistent(surface_lightbutton);
224 else if(flags & QUAKE2_SURF_LIGHT)
225 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), TRUE);
227 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), FALSE);
229 if(diff_flags & QUAKE2_SURF_SLICK)
230 set_inconsistent(surface_slickbutton);
231 else if(flags & QUAKE2_SURF_SLICK)
232 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), TRUE);
234 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE);
236 if(diff_flags & QUAKE2_SURF_SKY)
237 set_inconsistent(surface_skybutton);
238 else if(flags & QUAKE2_SURF_SKY)
239 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), TRUE);
241 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE);
243 if(diff_flags & QUAKE2_SURF_WARP)
244 set_inconsistent(surface_warpbutton);
245 else if(flags & QUAKE2_SURF_WARP)
246 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), TRUE);
248 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE);
250 if(diff_flags & QUAKE2_SURF_TRANS33)
251 set_inconsistent(surface_trans33button);
252 else if(flags & QUAKE2_SURF_TRANS33)
253 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), TRUE);
255 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE);
257 if(diff_flags & QUAKE2_SURF_TRANS66)
258 set_inconsistent(surface_trans66button);
259 else if(flags & QUAKE2_SURF_TRANS66)
260 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), TRUE);
262 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE);
264 if(diff_flags & QUAKE2_SURF_FLOWING)
265 set_inconsistent(surface_flowingbutton);
266 else if(flags & QUAKE2_SURF_FLOWING)
267 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), TRUE);
269 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE);
271 if(diff_flags & QUAKE2_SURF_NODRAW)
272 set_inconsistent(surface_nodrawbutton);
273 else if(flags & QUAKE2_SURF_NODRAW)
274 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), TRUE);
276 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE);
278 if(diff_flags & QUAKE2_SURF_HINT)
279 set_inconsistent(surface_hintbutton);
280 else if(flags & QUAKE2_SURF_HINT)
281 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), TRUE);
283 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), FALSE);
285 if(diff_flags & QUAKE2_SURF_SKIP)
286 set_inconsistent(surface_skipbutton);
287 else if(flags & QUAKE2_SURF_SKIP)
288 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), TRUE);
290 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), FALSE);
292 // Set content buttons to reflect brush values
293 if(diff_contents & QUAKE2_CONTENTS_SOLID)
294 set_inconsistent(content_solidbutton);
295 else if(contents & QUAKE2_CONTENTS_SOLID)
296 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), TRUE);
298 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE);
300 if(diff_contents & QUAKE2_CONTENTS_WINDOW)
301 set_inconsistent(content_windowbutton);
302 else if(contents & QUAKE2_CONTENTS_WINDOW)
303 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), TRUE);
305 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE);
307 if(diff_contents & QUAKE2_CONTENTS_AUX)
308 set_inconsistent(content_auxbutton);
309 else if(contents & QUAKE2_CONTENTS_AUX)
310 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), TRUE);
312 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), FALSE);
314 if(diff_contents & QUAKE2_CONTENTS_LAVA)
315 set_inconsistent(content_lavabutton);
316 else if(contents & QUAKE2_CONTENTS_LAVA)
317 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), TRUE);
319 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE);
321 if(diff_contents & QUAKE2_CONTENTS_SLIME)
322 set_inconsistent(content_slimebutton);
323 else if(contents & QUAKE2_CONTENTS_SLIME)
324 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), TRUE);
326 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE);
328 if(diff_contents & QUAKE2_CONTENTS_WATER)
329 set_inconsistent(content_waterbutton);
330 else if(contents & QUAKE2_CONTENTS_WATER)
331 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), TRUE);
333 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE);
335 if(diff_contents & QUAKE2_CONTENTS_MIST)
336 set_inconsistent(content_mistbutton);
337 else if(contents & QUAKE2_CONTENTS_MIST)
338 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), TRUE);
340 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE);
342 if(diff_contents & QUAKE2_CONTENTS_AREAPORTAL)
343 set_inconsistent(content_areaportalbutton);
344 else if(contents & QUAKE2_CONTENTS_AREAPORTAL)
345 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), TRUE);
347 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE);
349 if(diff_contents & QUAKE2_CONTENTS_PLAYERCLIP)
350 set_inconsistent(content_playerclipbutton);
351 else if(contents & QUAKE2_CONTENTS_PLAYERCLIP)
352 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), TRUE);
354 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE);
356 if(diff_contents & QUAKE2_CONTENTS_MONSTERCLIP)
357 set_inconsistent(content_monsterclipbutton);
358 else if(contents & QUAKE2_CONTENTS_MONSTERCLIP)
359 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), TRUE);
361 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE);
363 if(diff_contents & QUAKE2_CONTENTS_CURRENT_0)
364 set_inconsistent(content_current0button);
365 else if(contents & QUAKE2_CONTENTS_CURRENT_0)
366 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), TRUE);
368 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE);
370 if(diff_contents & QUAKE2_CONTENTS_CURRENT_90)
371 set_inconsistent(content_current90button);
372 else if(contents & QUAKE2_CONTENTS_CURRENT_90)
373 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), TRUE);
375 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE);
377 if(diff_contents & QUAKE2_CONTENTS_CURRENT_180)
378 set_inconsistent(content_current180button);
379 else if(contents & QUAKE2_CONTENTS_CURRENT_180)
380 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), TRUE);
382 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE);
384 if(diff_contents & QUAKE2_CONTENTS_CURRENT_270)
385 set_inconsistent(content_current270button);
386 else if(contents & QUAKE2_CONTENTS_CURRENT_270)
387 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), TRUE);
389 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE);
391 if(diff_contents & QUAKE2_CONTENTS_CURRENT_UP)
392 set_inconsistent(content_currentUPbutton);
393 else if(contents & QUAKE2_CONTENTS_CURRENT_UP)
394 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), TRUE);
396 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE);
398 if(diff_contents & QUAKE2_CONTENTS_CURRENT_DOWN)
399 set_inconsistent(content_currentDOWNbutton);
400 else if(contents & QUAKE2_CONTENTS_CURRENT_DOWN)
401 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), TRUE);
403 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE);
405 if(diff_contents & QUAKE2_CONTENTS_ORIGIN)
406 set_inconsistent(content_originbutton);
407 else if(contents & QUAKE2_CONTENTS_ORIGIN)
408 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), TRUE);
410 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE);
412 if(diff_contents & QUAKE2_CONTENTS_DETAIL)
413 set_inconsistent(content_detailbutton);
414 else if(contents & QUAKE2_CONTENTS_DETAIL)
415 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), TRUE);
417 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE);
419 if(diff_contents & QUAKE2_CONTENTS_TRANSLUCENT)
420 set_inconsistent(content_translucentbutton);
421 else if(contents & QUAKE2_CONTENTS_TRANSLUCENT)
422 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), TRUE);
424 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), FALSE);
426 if(diff_contents & QUAKE2_CONTENTS_LADDER)
427 set_inconsistent(content_ladderbutton);
428 else if(contents & QUAKE2_CONTENTS_LADDER)
429 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), TRUE);
431 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE);
435 gtk_entry_set_text( (GtkEntry *)value_entry, "");
438 working_value = value;
439 sprintf( tex_buff, "%d", value);
440 gtk_entry_set_text( (GtkEntry *)value_entry, tex_buff);
443 setup_buttons = FALSE;
446 void SetChangeInFlags_Face_Quake2 (texdef_to_face_t *texdef_face_list)
448 texdef_to_face_t *temp_texdef_face_list;
449 texdef_t *tmp_texdef;
451 for (temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
453 tmp_texdef = &temp_texdef_face_list->texdef;
454 tmp_texdef->flags = (tmp_texdef->flags & ~surface_mask) | working_surface_flags;
455 tmp_texdef->contents = (tmp_texdef->contents & ~content_mask) | working_content_flags;
456 tmp_texdef->value = working_value;
457 Sys_Printf("content_flag: %d content_mask: %d\n",working_content_flags,content_mask);
458 Sys_Printf("content: %d\n",tmp_texdef->contents);
462 inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to)
465 if (!setup_buttons) // If we're setting up the buttons, we really don't need to
466 { // set flags that are already set
468 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) // Clear out inconsistent, if set
469 clear_inconsistent(GTK_WIDGET (togglebutton));
471 surface_mask |= sur_flag;
474 working_surface_flags |= sur_flag;
476 working_surface_flags &= ~sur_flag;
480 inline void change_contentflag (GtkWidget *togglebutton, int content_flag, gboolean change_flag_to)
483 if ( (!setup_buttons) ) // If we're setting up the buttons, we really don't need to
484 { // set flags that are already set
486 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton)))
487 clear_inconsistent(togglebutton);
488 //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces.
490 content_mask |= content_flag;
493 working_content_flags |= content_flag;
495 working_content_flags &= ~content_flag;
497 Sys_Printf("content_flag: %d content_mask: %d\n",content_flag,content_mask);
501 // Surface Flags Callbacks
503 on_surface_lightbutton_toggled (GtkToggleButton *togglebutton,
506 change_surfaceflag(surface_lightbutton, QUAKE2_SURF_LIGHT, (GTK_TOGGLE_BUTTON (surface_lightbutton)->active));
511 on_surface_slickbutton_toggled (GtkToggleButton *togglebutton,
514 change_surfaceflag(surface_slickbutton, QUAKE2_SURF_SLICK, (GTK_TOGGLE_BUTTON (surface_slickbutton)->active));
519 on_surface_skybutton_toggled (GtkToggleButton *togglebutton,
522 change_surfaceflag(surface_skybutton, QUAKE2_SURF_SKY, (GTK_TOGGLE_BUTTON (surface_skybutton)->active));
526 on_surface_warpbutton_toggled (GtkToggleButton *togglebutton,
529 change_surfaceflag(surface_warpbutton, QUAKE2_SURF_WARP, (GTK_TOGGLE_BUTTON (surface_warpbutton)->active));
533 on_surface_trans33button_toggled (GtkToggleButton *togglebutton,
536 change_surfaceflag(surface_trans33button, QUAKE2_SURF_TRANS33, (GTK_TOGGLE_BUTTON (surface_trans33button)->active));
540 on_surface_trans66button_toggled (GtkToggleButton *togglebutton,
543 change_surfaceflag(surface_trans66button, QUAKE2_SURF_TRANS66, (GTK_TOGGLE_BUTTON (surface_trans66button)->active));
547 on_surface_flowingbutton_toggled (GtkToggleButton *togglebutton,
550 change_surfaceflag(surface_flowingbutton, QUAKE2_SURF_FLOWING, (GTK_TOGGLE_BUTTON (surface_flowingbutton)->active));
554 on_surface_nodrawbutton_toggled (GtkToggleButton *togglebutton,
557 change_surfaceflag(surface_nodrawbutton, QUAKE2_SURF_NODRAW, (GTK_TOGGLE_BUTTON (surface_nodrawbutton)->active));
561 on_surface_hintbutton_toggled (GtkToggleButton *togglebutton,
564 change_surfaceflag(surface_hintbutton, QUAKE2_SURF_HINT, (GTK_TOGGLE_BUTTON (surface_hintbutton)->active));
568 on_surface_skipbutton_toggled (GtkToggleButton *togglebutton,
571 change_surfaceflag(surface_skipbutton, QUAKE2_SURF_SKIP, (GTK_TOGGLE_BUTTON (surface_skipbutton)->active));
574 // Content Flags Callbacks
576 on_content_solidbutton_toggled (GtkToggleButton *togglebutton,
579 change_contentflag(content_solidbutton, QUAKE2_CONTENTS_SOLID, (GTK_TOGGLE_BUTTON (content_solidbutton)->active));
583 on_content_windowbutton_toggled (GtkToggleButton *togglebutton,
586 change_contentflag(content_windowbutton, QUAKE2_CONTENTS_WINDOW, (GTK_TOGGLE_BUTTON (content_windowbutton)->active));
590 on_content_auxbutton_toggled (GtkToggleButton *togglebutton,
593 change_contentflag(content_auxbutton, QUAKE2_CONTENTS_AUX, (GTK_TOGGLE_BUTTON (content_auxbutton)->active));
597 on_content_lavabutton_toggled (GtkToggleButton *togglebutton,
600 change_contentflag(content_lavabutton, QUAKE2_CONTENTS_LAVA, (GTK_TOGGLE_BUTTON (content_lavabutton)->active));
604 on_content_slimebutton_toggled (GtkToggleButton *togglebutton,
607 change_contentflag(content_slimebutton, QUAKE2_CONTENTS_SLIME, (GTK_TOGGLE_BUTTON (content_slimebutton)->active));
611 on_content_waterbutton_toggled (GtkToggleButton *togglebutton,
614 change_contentflag(content_waterbutton, QUAKE2_CONTENTS_WATER, (GTK_TOGGLE_BUTTON (content_waterbutton)->active));
618 on_content_mistbutton_toggled (GtkToggleButton *togglebutton,
621 change_contentflag(content_mistbutton, QUAKE2_CONTENTS_MIST, (GTK_TOGGLE_BUTTON (content_mistbutton)->active));
625 on_content_areaportalbutton_toggled (GtkToggleButton *togglebutton,
628 change_contentflag(content_areaportalbutton, QUAKE2_CONTENTS_AREAPORTAL, (GTK_TOGGLE_BUTTON (content_areaportalbutton)->active));
632 on_content_playerclipbutton_toggled (GtkToggleButton *togglebutton,
635 change_contentflag(content_playerclipbutton, QUAKE2_CONTENTS_PLAYERCLIP, (GTK_TOGGLE_BUTTON (content_playerclipbutton)->active));
639 on_content_monsterclipbutton_toggled (GtkToggleButton *togglebutton,
642 change_contentflag(content_monsterclipbutton, QUAKE2_CONTENTS_MONSTERCLIP, (GTK_TOGGLE_BUTTON (content_monsterclipbutton)->active));
646 on_content_current0button_toggled (GtkToggleButton *togglebutton,
649 change_contentflag(content_current0button, QUAKE2_CONTENTS_CURRENT_0, (GTK_TOGGLE_BUTTON (content_current0button)->active));
653 on_content_current90button_toggled (GtkToggleButton *togglebutton,
656 change_contentflag(content_current90button, QUAKE2_CONTENTS_CURRENT_90, (GTK_TOGGLE_BUTTON (content_current90button)->active));
660 on_content_current180button_toggled (GtkToggleButton *togglebutton,
663 change_contentflag(content_current180button, QUAKE2_CONTENTS_CURRENT_180, (GTK_TOGGLE_BUTTON (content_current180button)->active));
667 on_content_current270button_toggled (GtkToggleButton *togglebutton,
670 change_contentflag(content_current270button, QUAKE2_CONTENTS_CURRENT_270, (GTK_TOGGLE_BUTTON (content_current270button)->active));
674 on_content_currentUPbutton_toggled (GtkToggleButton *togglebutton,
677 change_contentflag(content_currentUPbutton, QUAKE2_CONTENTS_CURRENT_UP, (GTK_TOGGLE_BUTTON (content_currentUPbutton)->active));
681 on_content_currentDOWNbutton_toggled (GtkToggleButton *togglebutton,
684 change_contentflag(content_currentDOWNbutton, QUAKE2_CONTENTS_CURRENT_DOWN, (GTK_TOGGLE_BUTTON (content_currentDOWNbutton)->active));
688 on_content_originbutton_toggled (GtkToggleButton *togglebutton,
691 change_contentflag(content_originbutton, QUAKE2_CONTENTS_ORIGIN, (GTK_TOGGLE_BUTTON (content_originbutton)->active));
695 on_content_detailbutton_toggled (GtkToggleButton *togglebutton,
698 change_contentflag(content_detailbutton, QUAKE2_CONTENTS_DETAIL, (GTK_TOGGLE_BUTTON (content_detailbutton)->active));
702 on_content_translucentbutton_toggled (GtkToggleButton *togglebutton,
705 change_contentflag(content_translucentbutton, QUAKE2_CONTENTS_TRANSLUCENT, (GTK_TOGGLE_BUTTON (content_translucentbutton)->active));
709 on_content_ladderbutton_toggled (GtkToggleButton *togglebutton,
712 change_contentflag(content_ladderbutton, QUAKE2_CONTENTS_LADDER, (GTK_TOGGLE_BUTTON (content_ladderbutton)->active));
715 // Value Entry Callback
717 on_value_entry_changed (GtkEditable *editable,
720 if ( (!setup_buttons) ) // If we're setting up the buttons, don't change value
721 working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable) );
725 on_value_entry_insert_text (GtkEditable *editable,
727 gint new_text_length,
738 // Limit input to digits, throwing out anything else
739 // Modified from Gtk FAQ for text filtering of GtkEntry
740 result = g_new (gchar, new_text_length);
742 for (i=0; i < new_text_length; i++) {
743 if (!isdigit(new_text[i]))
745 result[count++] = new_text[i];
749 gtk_signal_handler_block_by_func (GTK_OBJECT (editable),
750 GTK_SIGNAL_FUNC (on_value_entry_insert_text),
752 gtk_editable_insert_text (editable, result, count, position);
753 gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable),
754 GTK_SIGNAL_FUNC (on_value_entry_insert_text),
757 gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text");
763 on_surfacebutton_clicked (GtkButton *button,
766 gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 0);
770 on_contentbutton_clicked (GtkButton *button,
773 gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 1);
777 #define QUAKE2_FLAG_BUTTON_BORDER 3
779 GtkWidget* Create_Quake2FlagsDialog (GtkWidget* surfacedialog_widget)
789 GtkWidget *hseparator1;
790 GtkWidget *value_label;
797 frame1 = gtk_frame_new ("Flags");
798 gtk_widget_show (frame1);
799 gtk_container_add (GTK_CONTAINER (surfacedialog_widget), frame1);
801 vbox1 = gtk_vbox_new (FALSE, 0);
802 gtk_widget_show (vbox1);
803 gtk_container_add (GTK_CONTAINER (frame1), vbox1);
805 notebook1 = gtk_notebook_new ();
806 gtk_widget_show (notebook1);
807 gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0);
808 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook1), TRUE);
809 gtk_container_set_border_width (GTK_CONTAINER (notebook1), 5);
811 vbox2 = gtk_vbox_new (FALSE, 0);
812 gtk_widget_show (vbox2);
813 gtk_container_add (GTK_CONTAINER (notebook1), vbox2);
815 table4 = gtk_table_new (3, 4, FALSE);
816 gtk_widget_show (table4);
817 gtk_box_pack_start (GTK_BOX (vbox2), table4, TRUE, TRUE, 0);
819 surface_lightbutton = gtk_toggle_button_new_with_label ("Light");
820 gtk_signal_connect (GTK_OBJECT (surface_lightbutton), "toggled",
821 GTK_SIGNAL_FUNC (on_surface_lightbutton_toggled),
823 gtk_widget_show (surface_lightbutton);
824 gtk_table_attach (GTK_TABLE (table4), surface_lightbutton, 0, 1, 0, 1,
825 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
826 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
827 gtk_container_set_border_width (GTK_CONTAINER (surface_lightbutton), QUAKE2_FLAG_BUTTON_BORDER);
829 surface_slickbutton = gtk_toggle_button_new_with_label ("Slick");
830 gtk_signal_connect (GTK_OBJECT (surface_slickbutton), "toggled",
831 GTK_SIGNAL_FUNC (on_surface_slickbutton_toggled),
833 gtk_widget_show (surface_slickbutton);
834 gtk_table_attach (GTK_TABLE (table4), surface_slickbutton, 1, 2, 0, 1,
835 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
836 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
837 gtk_container_set_border_width (GTK_CONTAINER (surface_slickbutton), QUAKE2_FLAG_BUTTON_BORDER);
839 surface_skybutton = gtk_toggle_button_new_with_label ("Sky");
840 gtk_signal_connect (GTK_OBJECT (surface_skybutton), "toggled",
841 GTK_SIGNAL_FUNC (on_surface_skybutton_toggled),
843 gtk_widget_show (surface_skybutton);
844 gtk_table_attach (GTK_TABLE (table4), surface_skybutton, 2, 3, 0, 1,
845 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
846 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
847 gtk_container_set_border_width (GTK_CONTAINER (surface_skybutton), QUAKE2_FLAG_BUTTON_BORDER);
849 surface_warpbutton = gtk_toggle_button_new_with_label ("Warp");
850 gtk_signal_connect (GTK_OBJECT (surface_warpbutton), "toggled",
851 GTK_SIGNAL_FUNC (on_surface_warpbutton_toggled),
853 gtk_widget_show (surface_warpbutton);
854 gtk_table_attach (GTK_TABLE (table4), surface_warpbutton, 3, 4, 0, 1,
855 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
856 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
857 gtk_container_set_border_width (GTK_CONTAINER (surface_warpbutton), QUAKE2_FLAG_BUTTON_BORDER);
859 surface_trans33button = gtk_toggle_button_new_with_label ("Trans 33");
860 gtk_signal_connect (GTK_OBJECT (surface_trans33button), "toggled",
861 GTK_SIGNAL_FUNC (on_surface_trans33button_toggled),
863 gtk_widget_show (surface_trans33button);
864 gtk_table_attach (GTK_TABLE (table4), surface_trans33button, 0, 1, 1, 2,
865 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
866 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
867 gtk_container_set_border_width (GTK_CONTAINER (surface_trans33button), QUAKE2_FLAG_BUTTON_BORDER);
869 surface_trans66button = gtk_toggle_button_new_with_label ("Trans 66");
870 gtk_signal_connect (GTK_OBJECT (surface_trans66button), "toggled",
871 GTK_SIGNAL_FUNC (on_surface_trans66button_toggled),
873 gtk_widget_show (surface_trans66button);
874 gtk_table_attach (GTK_TABLE (table4), surface_trans66button, 1, 2, 1, 2,
875 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
876 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
877 gtk_container_set_border_width (GTK_CONTAINER (surface_trans66button), QUAKE2_FLAG_BUTTON_BORDER);
879 surface_flowingbutton = gtk_toggle_button_new_with_label ("Flowing");
880 gtk_signal_connect (GTK_OBJECT (surface_flowingbutton), "toggled",
881 GTK_SIGNAL_FUNC (on_surface_flowingbutton_toggled),
883 gtk_widget_show (surface_flowingbutton);
884 gtk_table_attach (GTK_TABLE (table4), surface_flowingbutton, 2, 3, 1, 2,
885 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
886 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
887 gtk_container_set_border_width (GTK_CONTAINER (surface_flowingbutton), QUAKE2_FLAG_BUTTON_BORDER);
889 surface_nodrawbutton = gtk_toggle_button_new_with_label ("NoDraw");
890 gtk_signal_connect (GTK_OBJECT (surface_nodrawbutton), "toggled",
891 GTK_SIGNAL_FUNC (on_surface_nodrawbutton_toggled),
893 gtk_widget_show (surface_nodrawbutton);
894 gtk_table_attach (GTK_TABLE (table4), surface_nodrawbutton, 3, 4, 1, 2,
895 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
896 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
897 gtk_container_set_border_width (GTK_CONTAINER (surface_nodrawbutton), QUAKE2_FLAG_BUTTON_BORDER);
899 surface_hintbutton = gtk_toggle_button_new_with_label ("Hint");
900 gtk_signal_connect (GTK_OBJECT (surface_hintbutton), "toggled",
901 GTK_SIGNAL_FUNC (on_surface_hintbutton_toggled),
903 gtk_widget_show (surface_hintbutton);
904 gtk_table_attach (GTK_TABLE (table4), surface_hintbutton, 0, 1, 2, 3,
905 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
906 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
907 gtk_container_set_border_width (GTK_CONTAINER (surface_hintbutton), QUAKE2_FLAG_BUTTON_BORDER);
909 surface_skipbutton = gtk_toggle_button_new_with_label ("Skip");
910 gtk_signal_connect (GTK_OBJECT (surface_skipbutton), "toggled",
911 GTK_SIGNAL_FUNC (on_surface_skipbutton_toggled),
913 gtk_widget_show (surface_skipbutton);
914 gtk_table_attach (GTK_TABLE (table4), surface_skipbutton, 3, 4, 2, 3,
915 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
916 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
917 gtk_container_set_border_width (GTK_CONTAINER (surface_skipbutton), QUAKE2_FLAG_BUTTON_BORDER);
919 hseparator1 = gtk_hseparator_new ();
920 gtk_widget_show (hseparator1);
921 gtk_box_pack_start (GTK_BOX (vbox2), hseparator1, FALSE, FALSE, 0);
922 gtk_widget_set_usize (hseparator1, -2, 5);
924 hbox2 = gtk_hbox_new (FALSE, 0);
925 gtk_widget_show (hbox2);
926 gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
928 hbox3 = gtk_hbox_new (FALSE, 0);
929 gtk_widget_show (hbox3);
930 gtk_box_pack_start (GTK_BOX (hbox2), hbox3, TRUE, TRUE, 0);
932 vbox4 = gtk_vbox_new (FALSE, 0);
933 gtk_widget_show (vbox4);
934 gtk_box_pack_start (GTK_BOX (hbox3), vbox4, TRUE, TRUE, 0);
936 value_label = gtk_label_new (" Value: ");
937 gtk_widget_show (value_label);
938 gtk_box_pack_start (GTK_BOX (hbox3), value_label, FALSE, FALSE, 0);
940 value_entry = gtk_entry_new ();
941 gtk_signal_connect (GTK_OBJECT (value_entry), "changed",
942 GTK_SIGNAL_FUNC (on_value_entry_changed),
944 gtk_signal_connect (GTK_OBJECT (value_entry), "insert_text",
945 GTK_SIGNAL_FUNC (on_value_entry_insert_text),
947 gtk_entry_set_max_length( (GtkEntry *)value_entry, 11);
948 gtk_widget_show (value_entry);
949 gtk_box_pack_start (GTK_BOX (hbox3), value_entry, TRUE, TRUE, 0);
951 vbox3 = gtk_vbox_new (FALSE, 0);
952 gtk_widget_show (vbox3);
953 gtk_box_pack_start (GTK_BOX (hbox3), vbox3, TRUE, TRUE, 0);
955 label5 = gtk_label_new ("Surface Flags");
956 gtk_widget_show (label5);
957 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label5);
959 table3 = gtk_table_new (5, 4, FALSE);
960 gtk_widget_show (table3);
961 gtk_container_add (GTK_CONTAINER (notebook1), table3);
963 content_solidbutton = gtk_toggle_button_new_with_label ("Solid");
964 gtk_signal_connect (GTK_OBJECT (content_solidbutton), "toggled",
965 GTK_SIGNAL_FUNC (on_content_solidbutton_toggled),
967 gtk_widget_show (content_solidbutton);
968 gtk_table_attach (GTK_TABLE (table3), content_solidbutton, 0, 1, 0, 1,
969 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
970 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
971 gtk_container_set_border_width (GTK_CONTAINER (content_solidbutton), QUAKE2_FLAG_BUTTON_BORDER);
973 content_windowbutton = gtk_toggle_button_new_with_label ("Window");
974 gtk_signal_connect (GTK_OBJECT (content_windowbutton), "toggled",
975 GTK_SIGNAL_FUNC (on_content_windowbutton_toggled),
977 gtk_widget_show (content_windowbutton);
978 gtk_table_attach (GTK_TABLE (table3), content_windowbutton, 1, 2, 0, 1,
979 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
980 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
981 gtk_container_set_border_width (GTK_CONTAINER (content_windowbutton), QUAKE2_FLAG_BUTTON_BORDER);
983 content_auxbutton = gtk_toggle_button_new_with_label ("Aux");
984 gtk_signal_connect (GTK_OBJECT (content_auxbutton), "toggled",
985 GTK_SIGNAL_FUNC (on_content_auxbutton_toggled),
987 gtk_widget_show (content_auxbutton);
988 gtk_table_attach (GTK_TABLE (table3), content_auxbutton, 2, 3, 0, 1,
989 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
990 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
991 gtk_container_set_border_width (GTK_CONTAINER (content_auxbutton), QUAKE2_FLAG_BUTTON_BORDER);
993 content_lavabutton = gtk_toggle_button_new_with_label ("Lava");
994 gtk_signal_connect (GTK_OBJECT (content_lavabutton), "toggled",
995 GTK_SIGNAL_FUNC (on_content_lavabutton_toggled),
997 gtk_widget_show (content_lavabutton);
998 gtk_table_attach (GTK_TABLE (table3), content_lavabutton, 3, 4, 0, 1,
999 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1000 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1001 gtk_container_set_border_width (GTK_CONTAINER (content_lavabutton), QUAKE2_FLAG_BUTTON_BORDER);
1003 content_slimebutton = gtk_toggle_button_new_with_label ("Slime");
1004 gtk_signal_connect (GTK_OBJECT (content_slimebutton), "toggled",
1005 GTK_SIGNAL_FUNC (on_content_slimebutton_toggled),
1007 gtk_widget_show (content_slimebutton);
1008 gtk_table_attach (GTK_TABLE (table3), content_slimebutton, 0, 1, 1, 2,
1009 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1010 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1011 gtk_container_set_border_width (GTK_CONTAINER (content_slimebutton), QUAKE2_FLAG_BUTTON_BORDER);
1013 content_waterbutton = gtk_toggle_button_new_with_label ("Water");
1014 gtk_signal_connect (GTK_OBJECT (content_waterbutton), "toggled",
1015 GTK_SIGNAL_FUNC (on_content_waterbutton_toggled),
1017 gtk_widget_show (content_waterbutton);
1018 gtk_table_attach (GTK_TABLE (table3), content_waterbutton, 1, 2, 1, 2,
1019 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1020 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1021 gtk_container_set_border_width (GTK_CONTAINER (content_waterbutton), QUAKE2_FLAG_BUTTON_BORDER);
1023 content_mistbutton = gtk_toggle_button_new_with_label ("Mist");
1024 gtk_signal_connect (GTK_OBJECT (content_mistbutton), "toggled",
1025 GTK_SIGNAL_FUNC (on_content_mistbutton_toggled),
1027 gtk_widget_show (content_mistbutton);
1028 gtk_table_attach (GTK_TABLE (table3), content_mistbutton, 2, 3, 1, 2,
1029 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1030 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1031 gtk_container_set_border_width (GTK_CONTAINER (content_mistbutton), QUAKE2_FLAG_BUTTON_BORDER);
1033 content_areaportalbutton = gtk_toggle_button_new_with_label ("AreaPortal");
1034 gtk_signal_connect (GTK_OBJECT (content_areaportalbutton), "toggled",
1035 GTK_SIGNAL_FUNC (on_content_areaportalbutton_toggled),
1037 gtk_widget_show (content_areaportalbutton);
1038 gtk_table_attach (GTK_TABLE (table3), content_areaportalbutton, 3, 4, 1, 2,
1039 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1040 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1041 gtk_container_set_border_width (GTK_CONTAINER (content_areaportalbutton), QUAKE2_FLAG_BUTTON_BORDER);
1043 content_playerclipbutton = gtk_toggle_button_new_with_label ("PlayerClip");
1044 gtk_signal_connect (GTK_OBJECT (content_playerclipbutton), "toggled",
1045 GTK_SIGNAL_FUNC (on_content_playerclipbutton_toggled),
1047 gtk_widget_show (content_playerclipbutton);
1048 gtk_table_attach (GTK_TABLE (table3), content_playerclipbutton, 0, 1, 2, 3,
1049 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1050 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1051 gtk_container_set_border_width (GTK_CONTAINER (content_playerclipbutton), QUAKE2_FLAG_BUTTON_BORDER);
1053 content_monsterclipbutton = gtk_toggle_button_new_with_label ("MonsterClip");
1054 gtk_signal_connect (GTK_OBJECT (content_monsterclipbutton), "toggled",
1055 GTK_SIGNAL_FUNC (on_content_monsterclipbutton_toggled),
1057 gtk_widget_show (content_monsterclipbutton);
1058 gtk_table_attach (GTK_TABLE (table3), content_monsterclipbutton, 1, 2, 2, 3,
1059 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1060 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1061 gtk_container_set_border_width (GTK_CONTAINER (content_monsterclipbutton), QUAKE2_FLAG_BUTTON_BORDER);
1063 content_current0button = gtk_toggle_button_new_with_label ("Current 0");
1064 gtk_signal_connect (GTK_OBJECT (content_current0button), "toggled",
1065 GTK_SIGNAL_FUNC (on_content_current0button_toggled),
1067 gtk_widget_show (content_current0button);
1068 gtk_table_attach (GTK_TABLE (table3), content_current0button, 2, 3, 2, 3,
1069 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1070 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1071 gtk_container_set_border_width (GTK_CONTAINER (content_current0button), QUAKE2_FLAG_BUTTON_BORDER);
1073 content_current90button = gtk_toggle_button_new_with_label ("Current 90");
1074 gtk_signal_connect (GTK_OBJECT (content_current90button), "toggled",
1075 GTK_SIGNAL_FUNC (on_content_current90button_toggled),
1077 gtk_widget_show (content_current90button);
1078 gtk_table_attach (GTK_TABLE (table3), content_current90button, 3, 4, 2, 3,
1079 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1080 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1081 gtk_container_set_border_width (GTK_CONTAINER (content_current90button), QUAKE2_FLAG_BUTTON_BORDER);
1083 content_current180button = gtk_toggle_button_new_with_label ("Current 180");
1084 gtk_signal_connect (GTK_OBJECT (content_current180button), "toggled",
1085 GTK_SIGNAL_FUNC (on_content_current180button_toggled),
1087 gtk_widget_show (content_current180button);
1088 gtk_table_attach (GTK_TABLE (table3), content_current180button, 0, 1, 3, 4,
1089 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1090 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1091 gtk_container_set_border_width (GTK_CONTAINER (content_current180button), QUAKE2_FLAG_BUTTON_BORDER);
1093 content_current270button = gtk_toggle_button_new_with_label ("Current 270");
1094 gtk_signal_connect (GTK_OBJECT (content_current270button), "toggled",
1095 GTK_SIGNAL_FUNC (on_content_current270button_toggled),
1097 gtk_widget_show (content_current270button);
1098 gtk_table_attach (GTK_TABLE (table3), content_current270button, 1, 2, 3, 4,
1099 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1100 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1101 gtk_container_set_border_width (GTK_CONTAINER (content_current270button), QUAKE2_FLAG_BUTTON_BORDER);
1103 content_currentUPbutton = gtk_toggle_button_new_with_label ("Current UP");
1104 gtk_signal_connect (GTK_OBJECT (content_currentUPbutton), "toggled",
1105 GTK_SIGNAL_FUNC (on_content_currentUPbutton_toggled),
1107 gtk_widget_show (content_currentUPbutton);
1108 gtk_table_attach (GTK_TABLE (table3), content_currentUPbutton, 2, 3, 3, 4,
1109 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1110 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1111 gtk_container_set_border_width (GTK_CONTAINER (content_currentUPbutton), QUAKE2_FLAG_BUTTON_BORDER);
1113 content_currentDOWNbutton = gtk_toggle_button_new_with_label ("Current DOWN");
1114 gtk_signal_connect (GTK_OBJECT (content_currentDOWNbutton), "toggled",
1115 GTK_SIGNAL_FUNC (on_content_currentDOWNbutton_toggled),
1117 gtk_widget_show (content_currentDOWNbutton);
1118 gtk_table_attach (GTK_TABLE (table3), content_currentDOWNbutton, 3, 4, 3, 4,
1119 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1120 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1121 gtk_container_set_border_width (GTK_CONTAINER (content_currentDOWNbutton), QUAKE2_FLAG_BUTTON_BORDER);
1123 content_originbutton = gtk_toggle_button_new_with_label ("Origin");
1124 gtk_signal_connect (GTK_OBJECT (content_originbutton), "toggled",
1125 GTK_SIGNAL_FUNC (on_content_originbutton_toggled),
1127 gtk_widget_show (content_originbutton);
1128 gtk_table_attach (GTK_TABLE (table3), content_originbutton, 0, 1, 4, 5,
1129 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1130 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1131 gtk_container_set_border_width (GTK_CONTAINER (content_originbutton), QUAKE2_FLAG_BUTTON_BORDER);
1133 content_detailbutton = gtk_toggle_button_new_with_label ("Detail");
1134 gtk_signal_connect (GTK_OBJECT (content_detailbutton), "toggled",
1135 GTK_SIGNAL_FUNC (on_content_detailbutton_toggled),
1137 gtk_widget_show (content_detailbutton);
1138 gtk_table_attach (GTK_TABLE (table3), content_detailbutton, 1, 2, 4, 5,
1139 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1140 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1141 gtk_container_set_border_width (GTK_CONTAINER (content_detailbutton), QUAKE2_FLAG_BUTTON_BORDER);
1143 content_translucentbutton = gtk_toggle_button_new_with_label ("Translucent");
1144 gtk_signal_connect (GTK_OBJECT (content_translucentbutton), "toggled",
1145 GTK_SIGNAL_FUNC (on_content_translucentbutton_toggled),
1147 gtk_widget_show (content_translucentbutton);
1148 gtk_table_attach (GTK_TABLE (table3), content_translucentbutton, 2, 3, 4, 5,
1149 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1150 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1151 gtk_container_set_border_width (GTK_CONTAINER (content_translucentbutton), QUAKE2_FLAG_BUTTON_BORDER);
1153 content_ladderbutton = gtk_toggle_button_new_with_label ("Ladder");
1154 gtk_signal_connect (GTK_OBJECT (content_ladderbutton), "toggled",
1155 GTK_SIGNAL_FUNC (on_content_ladderbutton_toggled),
1157 gtk_widget_show (content_ladderbutton);
1158 gtk_table_attach (GTK_TABLE (table3), content_ladderbutton, 3, 4, 4, 5,
1159 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1160 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1161 gtk_container_set_border_width (GTK_CONTAINER (content_ladderbutton), QUAKE2_FLAG_BUTTON_BORDER);
1163 label6 = gtk_label_new ("Content Flags");
1164 gtk_widget_show (label6);
1165 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label6);