2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include <gdk/gdkkeysyms.h>
24 #include <glib/gi18n.h>
26 #include "surfdlg_plugin.h"
28 #include "surfaceflagsdialog_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 if ( gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (toggle_button)) )
85 gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), FALSE);
89 void clear_all_inconsistent(void)
91 clear_inconsistent( surface_lightbutton );
92 clear_inconsistent( surface_slickbutton );
93 clear_inconsistent( surface_skybutton );
94 clear_inconsistent( surface_warpbutton );
95 clear_inconsistent( surface_trans33button );
96 clear_inconsistent( surface_trans66button );
97 clear_inconsistent( surface_flowingbutton );
98 clear_inconsistent( surface_nodrawbutton );
99 clear_inconsistent( surface_hintbutton );
100 clear_inconsistent( surface_skipbutton );
102 clear_inconsistent( content_solidbutton );
103 clear_inconsistent( content_windowbutton );
104 clear_inconsistent( content_auxbutton );
105 clear_inconsistent( content_lavabutton );
106 clear_inconsistent( content_slimebutton );
107 clear_inconsistent( content_waterbutton );
108 clear_inconsistent( content_mistbutton );
109 clear_inconsistent( content_areaportalbutton );
110 clear_inconsistent( content_playerclipbutton );
111 clear_inconsistent( content_monsterclipbutton );
112 clear_inconsistent( content_current0button );
113 clear_inconsistent( content_current90button );
114 clear_inconsistent( content_current180button );
115 clear_inconsistent( content_current270button );
116 clear_inconsistent( content_currentUPbutton );
117 clear_inconsistent( content_currentDOWNbutton );
118 clear_inconsistent( content_originbutton );
119 clear_inconsistent( content_detailbutton );
120 clear_inconsistent( content_translucentbutton );
121 clear_inconsistent( content_ladderbutton );
124 void clear_all_buttons_and_values()
126 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_lightbutton ), FALSE);
127 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE);
128 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE);
129 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE);
130 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE);
131 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE);
132 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE);
133 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE);
134 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), FALSE);
135 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), FALSE);
137 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE);
138 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE);
139 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), FALSE);
140 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE);
141 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE);
142 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE);
143 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE);
144 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE);
145 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE);
146 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE);
147 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE);
148 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE);
149 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE);
150 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE);
151 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE);
152 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE);
153 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE);
154 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE);
155 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), FALSE);
156 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE);
158 gtk_entry_set_text( (GtkEntry *)value_entry, "");
161 void SetFlagButtons_Quake2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty)
166 int diff_contents = 0;
168 gboolean diff_value = FALSE;
170 texdef_t* tmp_texdef;
171 texdef_to_face_t* temp_texdef_face_list;
174 setup_buttons = TRUE;
175 working_surface_flags = 0;
177 working_content_flags = 0;
183 tmp_texdef = &texdef_face_list->texdef;
184 contents = tmp_texdef->contents;
185 flags = tmp_texdef->flags;
186 value = tmp_texdef->value;
188 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value);
189 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value);
191 for (temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
193 tmp_texdef = &temp_texdef_face_list->texdef;
194 diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent
195 diff_flags |= flags ^ tmp_texdef->flags;
196 if (tmp_texdef->value != value)
199 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value);
200 Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value);
207 clear_all_inconsistent();
209 // If no faces/brushes are selected, clear everything and bail
212 clear_all_buttons_and_values();
213 setup_buttons = FALSE;
217 // Set surface buttons to reflect brush/face flags, contents, and values
218 if(diff_flags & QUAKE2_SURF_LIGHT)
219 set_inconsistent(surface_lightbutton);
220 else if(flags & QUAKE2_SURF_LIGHT)
221 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), TRUE);
223 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), FALSE);
225 if(diff_flags & QUAKE2_SURF_SLICK)
226 set_inconsistent(surface_slickbutton);
227 else if(flags & QUAKE2_SURF_SLICK)
228 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), TRUE);
230 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE);
232 if(diff_flags & QUAKE2_SURF_SKY)
233 set_inconsistent(surface_skybutton);
234 else if(flags & QUAKE2_SURF_SKY)
235 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), TRUE);
237 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE);
239 if(diff_flags & QUAKE2_SURF_WARP)
240 set_inconsistent(surface_warpbutton);
241 else if(flags & QUAKE2_SURF_WARP)
242 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), TRUE);
244 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE);
246 if(diff_flags & QUAKE2_SURF_TRANS33)
247 set_inconsistent(surface_trans33button);
248 else if(flags & QUAKE2_SURF_TRANS33)
249 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), TRUE);
251 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE);
253 if(diff_flags & QUAKE2_SURF_TRANS66)
254 set_inconsistent(surface_trans66button);
255 else if(flags & QUAKE2_SURF_TRANS66)
256 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), TRUE);
258 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE);
260 if(diff_flags & QUAKE2_SURF_FLOWING)
261 set_inconsistent(surface_flowingbutton);
262 else if(flags & QUAKE2_SURF_FLOWING)
263 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), TRUE);
265 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE);
267 if(diff_flags & QUAKE2_SURF_NODRAW)
268 set_inconsistent(surface_nodrawbutton);
269 else if(flags & QUAKE2_SURF_NODRAW)
270 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), TRUE);
272 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE);
274 if(diff_flags & QUAKE2_SURF_HINT)
275 set_inconsistent(surface_hintbutton);
276 else if(flags & QUAKE2_SURF_HINT)
277 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), TRUE);
279 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), FALSE);
281 if(diff_flags & QUAKE2_SURF_SKIP)
282 set_inconsistent(surface_skipbutton);
283 else if(flags & QUAKE2_SURF_SKIP)
284 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), TRUE);
286 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), FALSE);
288 // Set content buttons to reflect brush values
289 if(diff_contents & QUAKE2_CONTENTS_SOLID)
290 set_inconsistent(content_solidbutton);
291 else if(contents & QUAKE2_CONTENTS_SOLID)
292 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), TRUE);
294 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE);
296 if(diff_contents & QUAKE2_CONTENTS_WINDOW)
297 set_inconsistent(content_windowbutton);
298 else if(contents & QUAKE2_CONTENTS_WINDOW)
299 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), TRUE);
301 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE);
303 if(diff_contents & QUAKE2_CONTENTS_AUX)
304 set_inconsistent(content_auxbutton);
305 else if(contents & QUAKE2_CONTENTS_AUX)
306 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), TRUE);
308 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), FALSE);
310 if(diff_contents & QUAKE2_CONTENTS_LAVA)
311 set_inconsistent(content_lavabutton);
312 else if(contents & QUAKE2_CONTENTS_LAVA)
313 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), TRUE);
315 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE);
317 if(diff_contents & QUAKE2_CONTENTS_SLIME)
318 set_inconsistent(content_slimebutton);
319 else if(contents & QUAKE2_CONTENTS_SLIME)
320 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), TRUE);
322 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE);
324 if(diff_contents & QUAKE2_CONTENTS_WATER)
325 set_inconsistent(content_waterbutton);
326 else if(contents & QUAKE2_CONTENTS_WATER)
327 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), TRUE);
329 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE);
331 if(diff_contents & QUAKE2_CONTENTS_MIST)
332 set_inconsistent(content_mistbutton);
333 else if(contents & QUAKE2_CONTENTS_MIST)
334 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), TRUE);
336 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE);
338 if(diff_contents & QUAKE2_CONTENTS_AREAPORTAL)
339 set_inconsistent(content_areaportalbutton);
340 else if(contents & QUAKE2_CONTENTS_AREAPORTAL)
341 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), TRUE);
343 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE);
345 if(diff_contents & QUAKE2_CONTENTS_PLAYERCLIP)
346 set_inconsistent(content_playerclipbutton);
347 else if(contents & QUAKE2_CONTENTS_PLAYERCLIP)
348 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), TRUE);
350 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE);
352 if(diff_contents & QUAKE2_CONTENTS_MONSTERCLIP)
353 set_inconsistent(content_monsterclipbutton);
354 else if(contents & QUAKE2_CONTENTS_MONSTERCLIP)
355 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), TRUE);
357 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE);
359 if(diff_contents & QUAKE2_CONTENTS_CURRENT_0)
360 set_inconsistent(content_current0button);
361 else if(contents & QUAKE2_CONTENTS_CURRENT_0)
362 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), TRUE);
364 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE);
366 if(diff_contents & QUAKE2_CONTENTS_CURRENT_90)
367 set_inconsistent(content_current90button);
368 else if(contents & QUAKE2_CONTENTS_CURRENT_90)
369 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), TRUE);
371 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE);
373 if(diff_contents & QUAKE2_CONTENTS_CURRENT_180)
374 set_inconsistent(content_current180button);
375 else if(contents & QUAKE2_CONTENTS_CURRENT_180)
376 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), TRUE);
378 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE);
380 if(diff_contents & QUAKE2_CONTENTS_CURRENT_270)
381 set_inconsistent(content_current270button);
382 else if(contents & QUAKE2_CONTENTS_CURRENT_270)
383 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), TRUE);
385 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE);
387 if(diff_contents & QUAKE2_CONTENTS_CURRENT_UP)
388 set_inconsistent(content_currentUPbutton);
389 else if(contents & QUAKE2_CONTENTS_CURRENT_UP)
390 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), TRUE);
392 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE);
394 if(diff_contents & QUAKE2_CONTENTS_CURRENT_DOWN)
395 set_inconsistent(content_currentDOWNbutton);
396 else if(contents & QUAKE2_CONTENTS_CURRENT_DOWN)
397 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), TRUE);
399 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE);
401 if(diff_contents & QUAKE2_CONTENTS_ORIGIN)
402 set_inconsistent(content_originbutton);
403 else if(contents & QUAKE2_CONTENTS_ORIGIN)
404 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), TRUE);
406 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE);
408 if(diff_contents & QUAKE2_CONTENTS_DETAIL)
409 set_inconsistent(content_detailbutton);
410 else if(contents & QUAKE2_CONTENTS_DETAIL)
411 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), TRUE);
413 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE);
415 if(diff_contents & QUAKE2_CONTENTS_TRANSLUCENT)
416 set_inconsistent(content_translucentbutton);
417 else if(contents & QUAKE2_CONTENTS_TRANSLUCENT)
418 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), TRUE);
420 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), FALSE);
422 if(diff_contents & QUAKE2_CONTENTS_LADDER)
423 set_inconsistent(content_ladderbutton);
424 else if(contents & QUAKE2_CONTENTS_LADDER)
425 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), TRUE);
427 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE);
431 gtk_entry_set_text( (GtkEntry *)value_entry, "");
434 working_value = value;
435 sprintf( tex_buff, "%d", value);
436 gtk_entry_set_text( (GtkEntry *)value_entry, tex_buff);
439 setup_buttons = FALSE;
442 void SetChangeInFlags_Face_Quake2 (texdef_to_face_t *texdef_face_list)
444 texdef_to_face_t *temp_texdef_face_list;
445 texdef_t *tmp_texdef;
447 for (temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
449 tmp_texdef = &temp_texdef_face_list->texdef;
450 tmp_texdef->flags = (tmp_texdef->flags & ~surface_mask) | working_surface_flags;
451 tmp_texdef->contents = (tmp_texdef->contents & ~content_mask) | working_content_flags;
452 tmp_texdef->value = working_value;
453 Sys_Printf("content_flag: %d content_mask: %d\n",working_content_flags,content_mask);
454 Sys_Printf("content: %d\n",tmp_texdef->contents);
458 inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to)
461 if (!setup_buttons) // If we're setting up the buttons, we really don't need to
462 { // set flags that are already set
464 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) // Clear out inconsistent, if set
465 clear_inconsistent(GTK_WIDGET (togglebutton));
467 surface_mask |= sur_flag;
470 working_surface_flags |= sur_flag;
472 working_surface_flags &= ~sur_flag;
476 inline void change_contentflag (GtkWidget *togglebutton, int content_flag, gboolean change_flag_to)
479 if ( (!setup_buttons) ) // If we're setting up the buttons, we really don't need to
480 { // set flags that are already set
482 if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton)))
483 clear_inconsistent(togglebutton);
484 //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces.
486 content_mask |= content_flag;
489 working_content_flags |= content_flag;
491 working_content_flags &= ~content_flag;
493 Sys_Printf("content_flag: %d content_mask: %d\n",content_flag,content_mask);
497 // Surface Flags Callbacks
499 on_surface_lightbutton_toggled (GtkToggleButton *togglebutton,
502 change_surfaceflag(surface_lightbutton, QUAKE2_SURF_LIGHT, (GTK_TOGGLE_BUTTON (surface_lightbutton)->active));
507 on_surface_slickbutton_toggled (GtkToggleButton *togglebutton,
510 change_surfaceflag(surface_slickbutton, QUAKE2_SURF_SLICK, (GTK_TOGGLE_BUTTON (surface_slickbutton)->active));
515 on_surface_skybutton_toggled (GtkToggleButton *togglebutton,
518 change_surfaceflag(surface_skybutton, QUAKE2_SURF_SKY, (GTK_TOGGLE_BUTTON (surface_skybutton)->active));
522 on_surface_warpbutton_toggled (GtkToggleButton *togglebutton,
525 change_surfaceflag(surface_warpbutton, QUAKE2_SURF_WARP, (GTK_TOGGLE_BUTTON (surface_warpbutton)->active));
529 on_surface_trans33button_toggled (GtkToggleButton *togglebutton,
532 change_surfaceflag(surface_trans33button, QUAKE2_SURF_TRANS33, (GTK_TOGGLE_BUTTON (surface_trans33button)->active));
536 on_surface_trans66button_toggled (GtkToggleButton *togglebutton,
539 change_surfaceflag(surface_trans66button, QUAKE2_SURF_TRANS66, (GTK_TOGGLE_BUTTON (surface_trans66button)->active));
543 on_surface_flowingbutton_toggled (GtkToggleButton *togglebutton,
546 change_surfaceflag(surface_flowingbutton, QUAKE2_SURF_FLOWING, (GTK_TOGGLE_BUTTON (surface_flowingbutton)->active));
550 on_surface_nodrawbutton_toggled (GtkToggleButton *togglebutton,
553 change_surfaceflag(surface_nodrawbutton, QUAKE2_SURF_NODRAW, (GTK_TOGGLE_BUTTON (surface_nodrawbutton)->active));
557 on_surface_hintbutton_toggled (GtkToggleButton *togglebutton,
560 change_surfaceflag(surface_hintbutton, QUAKE2_SURF_HINT, (GTK_TOGGLE_BUTTON (surface_hintbutton)->active));
564 on_surface_skipbutton_toggled (GtkToggleButton *togglebutton,
567 change_surfaceflag(surface_skipbutton, QUAKE2_SURF_SKIP, (GTK_TOGGLE_BUTTON (surface_skipbutton)->active));
570 // Content Flags Callbacks
572 on_content_solidbutton_toggled (GtkToggleButton *togglebutton,
575 change_contentflag(content_solidbutton, QUAKE2_CONTENTS_SOLID, (GTK_TOGGLE_BUTTON (content_solidbutton)->active));
579 on_content_windowbutton_toggled (GtkToggleButton *togglebutton,
582 change_contentflag(content_windowbutton, QUAKE2_CONTENTS_WINDOW, (GTK_TOGGLE_BUTTON (content_windowbutton)->active));
586 on_content_auxbutton_toggled (GtkToggleButton *togglebutton,
589 change_contentflag(content_auxbutton, QUAKE2_CONTENTS_AUX, (GTK_TOGGLE_BUTTON (content_auxbutton)->active));
593 on_content_lavabutton_toggled (GtkToggleButton *togglebutton,
596 change_contentflag(content_lavabutton, QUAKE2_CONTENTS_LAVA, (GTK_TOGGLE_BUTTON (content_lavabutton)->active));
600 on_content_slimebutton_toggled (GtkToggleButton *togglebutton,
603 change_contentflag(content_slimebutton, QUAKE2_CONTENTS_SLIME, (GTK_TOGGLE_BUTTON (content_slimebutton)->active));
607 on_content_waterbutton_toggled (GtkToggleButton *togglebutton,
610 change_contentflag(content_waterbutton, QUAKE2_CONTENTS_WATER, (GTK_TOGGLE_BUTTON (content_waterbutton)->active));
614 on_content_mistbutton_toggled (GtkToggleButton *togglebutton,
617 change_contentflag(content_mistbutton, QUAKE2_CONTENTS_MIST, (GTK_TOGGLE_BUTTON (content_mistbutton)->active));
621 on_content_areaportalbutton_toggled (GtkToggleButton *togglebutton,
624 change_contentflag(content_areaportalbutton, QUAKE2_CONTENTS_AREAPORTAL, (GTK_TOGGLE_BUTTON (content_areaportalbutton)->active));
628 on_content_playerclipbutton_toggled (GtkToggleButton *togglebutton,
631 change_contentflag(content_playerclipbutton, QUAKE2_CONTENTS_PLAYERCLIP, (GTK_TOGGLE_BUTTON (content_playerclipbutton)->active));
635 on_content_monsterclipbutton_toggled (GtkToggleButton *togglebutton,
638 change_contentflag(content_monsterclipbutton, QUAKE2_CONTENTS_MONSTERCLIP, (GTK_TOGGLE_BUTTON (content_monsterclipbutton)->active));
642 on_content_current0button_toggled (GtkToggleButton *togglebutton,
645 change_contentflag(content_current0button, QUAKE2_CONTENTS_CURRENT_0, (GTK_TOGGLE_BUTTON (content_current0button)->active));
649 on_content_current90button_toggled (GtkToggleButton *togglebutton,
652 change_contentflag(content_current90button, QUAKE2_CONTENTS_CURRENT_90, (GTK_TOGGLE_BUTTON (content_current90button)->active));
656 on_content_current180button_toggled (GtkToggleButton *togglebutton,
659 change_contentflag(content_current180button, QUAKE2_CONTENTS_CURRENT_180, (GTK_TOGGLE_BUTTON (content_current180button)->active));
663 on_content_current270button_toggled (GtkToggleButton *togglebutton,
666 change_contentflag(content_current270button, QUAKE2_CONTENTS_CURRENT_270, (GTK_TOGGLE_BUTTON (content_current270button)->active));
670 on_content_currentUPbutton_toggled (GtkToggleButton *togglebutton,
673 change_contentflag(content_currentUPbutton, QUAKE2_CONTENTS_CURRENT_UP, (GTK_TOGGLE_BUTTON (content_currentUPbutton)->active));
677 on_content_currentDOWNbutton_toggled (GtkToggleButton *togglebutton,
680 change_contentflag(content_currentDOWNbutton, QUAKE2_CONTENTS_CURRENT_DOWN, (GTK_TOGGLE_BUTTON (content_currentDOWNbutton)->active));
684 on_content_originbutton_toggled (GtkToggleButton *togglebutton,
687 change_contentflag(content_originbutton, QUAKE2_CONTENTS_ORIGIN, (GTK_TOGGLE_BUTTON (content_originbutton)->active));
691 on_content_detailbutton_toggled (GtkToggleButton *togglebutton,
694 change_contentflag(content_detailbutton, QUAKE2_CONTENTS_DETAIL, (GTK_TOGGLE_BUTTON (content_detailbutton)->active));
698 on_content_translucentbutton_toggled (GtkToggleButton *togglebutton,
701 change_contentflag(content_translucentbutton, QUAKE2_CONTENTS_TRANSLUCENT, (GTK_TOGGLE_BUTTON (content_translucentbutton)->active));
705 on_content_ladderbutton_toggled (GtkToggleButton *togglebutton,
708 change_contentflag(content_ladderbutton, QUAKE2_CONTENTS_LADDER, (GTK_TOGGLE_BUTTON (content_ladderbutton)->active));
711 // Value Entry Callback
713 on_value_entry_changed (GtkEditable *editable,
716 if ( (!setup_buttons) ) // If we're setting up the buttons, don't change value
717 working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable) );
721 on_value_entry_insert_text (GtkEditable *editable,
723 gint new_text_length,
730 // Limit input to digits, throwing out anything else
731 // Modified from Gtk FAQ for text filtering of GtkEntry
732 result = g_new (gchar, new_text_length);
734 for (i=0; i < new_text_length; i++) {
735 if (!isdigit(new_text[i]))
737 result[count++] = new_text[i];
741 gtk_signal_handler_block_by_func (GTK_OBJECT (editable),
742 GTK_SIGNAL_FUNC (on_value_entry_insert_text),
744 gtk_editable_insert_text (editable, result, count, position);
745 gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable),
746 GTK_SIGNAL_FUNC (on_value_entry_insert_text),
749 gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text");
755 on_surfacebutton_clicked (GtkButton *button,
758 gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 0);
762 on_contentbutton_clicked (GtkButton *button,
765 gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 1);
769 #define QUAKE2_FLAG_BUTTON_BORDER 3
771 GtkWidget* Create_Quake2FlagsDialog (GtkWidget* surfacedialog_widget)
781 GtkWidget *hseparator1;
782 GtkWidget *value_label;
787 frame1 = gtk_frame_new (_("Flags"));
788 gtk_widget_show (frame1);
789 gtk_container_add (GTK_CONTAINER (surfacedialog_widget), frame1);
791 vbox1 = gtk_vbox_new (FALSE, 0);
792 gtk_widget_show (vbox1);
793 gtk_container_add (GTK_CONTAINER (frame1), vbox1);
795 notebook1 = gtk_notebook_new ();
796 gtk_widget_show (notebook1);
797 gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0);
798 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook1), TRUE);
799 gtk_container_set_border_width (GTK_CONTAINER (notebook1), 5);
801 vbox2 = gtk_vbox_new (FALSE, 0);
802 gtk_widget_show (vbox2);
803 gtk_container_add (GTK_CONTAINER (notebook1), vbox2);
805 table4 = gtk_table_new (3, 4, FALSE);
806 gtk_widget_show (table4);
807 gtk_box_pack_start (GTK_BOX (vbox2), table4, TRUE, TRUE, 0);
809 surface_lightbutton = gtk_toggle_button_new_with_label (_("Light"));
810 gtk_signal_connect (GTK_OBJECT (surface_lightbutton), "toggled",
811 GTK_SIGNAL_FUNC (on_surface_lightbutton_toggled),
813 gtk_widget_show (surface_lightbutton);
814 gtk_table_attach (GTK_TABLE (table4), surface_lightbutton, 0, 1, 0, 1,
815 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
816 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
817 gtk_container_set_border_width (GTK_CONTAINER (surface_lightbutton), QUAKE2_FLAG_BUTTON_BORDER);
819 surface_slickbutton = gtk_toggle_button_new_with_label (_("Slick"));
820 gtk_signal_connect (GTK_OBJECT (surface_slickbutton), "toggled",
821 GTK_SIGNAL_FUNC (on_surface_slickbutton_toggled),
823 gtk_widget_show (surface_slickbutton);
824 gtk_table_attach (GTK_TABLE (table4), surface_slickbutton, 1, 2, 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_slickbutton), QUAKE2_FLAG_BUTTON_BORDER);
829 surface_skybutton = gtk_toggle_button_new_with_label (_("Sky"));
830 gtk_signal_connect (GTK_OBJECT (surface_skybutton), "toggled",
831 GTK_SIGNAL_FUNC (on_surface_skybutton_toggled),
833 gtk_widget_show (surface_skybutton);
834 gtk_table_attach (GTK_TABLE (table4), surface_skybutton, 2, 3, 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_skybutton), QUAKE2_FLAG_BUTTON_BORDER);
839 surface_warpbutton = gtk_toggle_button_new_with_label (_("Warp"));
840 gtk_signal_connect (GTK_OBJECT (surface_warpbutton), "toggled",
841 GTK_SIGNAL_FUNC (on_surface_warpbutton_toggled),
843 gtk_widget_show (surface_warpbutton);
844 gtk_table_attach (GTK_TABLE (table4), surface_warpbutton, 3, 4, 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_warpbutton), QUAKE2_FLAG_BUTTON_BORDER);
849 surface_trans33button = gtk_toggle_button_new_with_label (_("Trans 33"));
850 gtk_signal_connect (GTK_OBJECT (surface_trans33button), "toggled",
851 GTK_SIGNAL_FUNC (on_surface_trans33button_toggled),
853 gtk_widget_show (surface_trans33button);
854 gtk_table_attach (GTK_TABLE (table4), surface_trans33button, 0, 1, 1, 2,
855 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
856 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
857 gtk_container_set_border_width (GTK_CONTAINER (surface_trans33button), QUAKE2_FLAG_BUTTON_BORDER);
859 surface_trans66button = gtk_toggle_button_new_with_label (_("Trans 66"));
860 gtk_signal_connect (GTK_OBJECT (surface_trans66button), "toggled",
861 GTK_SIGNAL_FUNC (on_surface_trans66button_toggled),
863 gtk_widget_show (surface_trans66button);
864 gtk_table_attach (GTK_TABLE (table4), surface_trans66button, 1, 2, 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_trans66button), QUAKE2_FLAG_BUTTON_BORDER);
869 surface_flowingbutton = gtk_toggle_button_new_with_label (_("Flowing"));
870 gtk_signal_connect (GTK_OBJECT (surface_flowingbutton), "toggled",
871 GTK_SIGNAL_FUNC (on_surface_flowingbutton_toggled),
873 gtk_widget_show (surface_flowingbutton);
874 gtk_table_attach (GTK_TABLE (table4), surface_flowingbutton, 2, 3, 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_flowingbutton), QUAKE2_FLAG_BUTTON_BORDER);
879 surface_nodrawbutton = gtk_toggle_button_new_with_label (_("NoDraw"));
880 gtk_signal_connect (GTK_OBJECT (surface_nodrawbutton), "toggled",
881 GTK_SIGNAL_FUNC (on_surface_nodrawbutton_toggled),
883 gtk_widget_show (surface_nodrawbutton);
884 gtk_table_attach (GTK_TABLE (table4), surface_nodrawbutton, 3, 4, 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_nodrawbutton), QUAKE2_FLAG_BUTTON_BORDER);
889 surface_hintbutton = gtk_toggle_button_new_with_label (_("Hint"));
890 gtk_signal_connect (GTK_OBJECT (surface_hintbutton), "toggled",
891 GTK_SIGNAL_FUNC (on_surface_hintbutton_toggled),
893 gtk_widget_show (surface_hintbutton);
894 gtk_table_attach (GTK_TABLE (table4), surface_hintbutton, 0, 1, 2, 3,
895 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
896 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
897 gtk_container_set_border_width (GTK_CONTAINER (surface_hintbutton), QUAKE2_FLAG_BUTTON_BORDER);
899 surface_skipbutton = gtk_toggle_button_new_with_label (_("Skip"));
900 gtk_signal_connect (GTK_OBJECT (surface_skipbutton), "toggled",
901 GTK_SIGNAL_FUNC (on_surface_skipbutton_toggled),
903 gtk_widget_show (surface_skipbutton);
904 gtk_table_attach (GTK_TABLE (table4), surface_skipbutton, 3, 4, 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_skipbutton), QUAKE2_FLAG_BUTTON_BORDER);
909 hseparator1 = gtk_hseparator_new ();
910 gtk_widget_show (hseparator1);
911 gtk_box_pack_start (GTK_BOX (vbox2), hseparator1, FALSE, FALSE, 0);
912 gtk_widget_set_usize (hseparator1, -2, 5);
914 hbox2 = gtk_hbox_new (FALSE, 0);
915 gtk_widget_show (hbox2);
916 gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
918 hbox3 = gtk_hbox_new (FALSE, 0);
919 gtk_widget_show (hbox3);
920 gtk_box_pack_start (GTK_BOX (hbox2), hbox3, TRUE, TRUE, 0);
922 vbox4 = gtk_vbox_new (FALSE, 0);
923 gtk_widget_show (vbox4);
924 gtk_box_pack_start (GTK_BOX (hbox3), vbox4, TRUE, TRUE, 0);
926 value_label = gtk_label_new (_("Value: "));
927 gtk_widget_show (value_label);
928 gtk_box_pack_start (GTK_BOX (hbox3), value_label, FALSE, FALSE, 0);
930 value_entry = gtk_entry_new ();
931 gtk_signal_connect (GTK_OBJECT (value_entry), "changed",
932 GTK_SIGNAL_FUNC (on_value_entry_changed),
934 gtk_signal_connect (GTK_OBJECT (value_entry), "insert_text",
935 GTK_SIGNAL_FUNC (on_value_entry_insert_text),
937 gtk_entry_set_max_length( (GtkEntry *)value_entry, 11);
938 gtk_widget_show (value_entry);
939 gtk_box_pack_start (GTK_BOX (hbox3), value_entry, TRUE, TRUE, 0);
941 vbox3 = gtk_vbox_new (FALSE, 0);
942 gtk_widget_show (vbox3);
943 gtk_box_pack_start (GTK_BOX (hbox3), vbox3, TRUE, TRUE, 0);
945 label5 = gtk_label_new (_("Surface Flags"));
946 gtk_widget_show (label5);
947 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label5);
949 table3 = gtk_table_new (5, 4, FALSE);
950 gtk_widget_show (table3);
951 gtk_container_add (GTK_CONTAINER (notebook1), table3);
953 content_solidbutton = gtk_toggle_button_new_with_label (_("Solid"));
954 gtk_signal_connect (GTK_OBJECT (content_solidbutton), "toggled",
955 GTK_SIGNAL_FUNC (on_content_solidbutton_toggled),
957 gtk_widget_show (content_solidbutton);
958 gtk_table_attach (GTK_TABLE (table3), content_solidbutton, 0, 1, 0, 1,
959 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
960 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
961 gtk_container_set_border_width (GTK_CONTAINER (content_solidbutton), QUAKE2_FLAG_BUTTON_BORDER);
963 content_windowbutton = gtk_toggle_button_new_with_label (_("Window"));
964 gtk_signal_connect (GTK_OBJECT (content_windowbutton), "toggled",
965 GTK_SIGNAL_FUNC (on_content_windowbutton_toggled),
967 gtk_widget_show (content_windowbutton);
968 gtk_table_attach (GTK_TABLE (table3), content_windowbutton, 1, 2, 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_windowbutton), QUAKE2_FLAG_BUTTON_BORDER);
973 content_auxbutton = gtk_toggle_button_new_with_label (_("Aux"));
974 gtk_signal_connect (GTK_OBJECT (content_auxbutton), "toggled",
975 GTK_SIGNAL_FUNC (on_content_auxbutton_toggled),
977 gtk_widget_show (content_auxbutton);
978 gtk_table_attach (GTK_TABLE (table3), content_auxbutton, 2, 3, 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_auxbutton), QUAKE2_FLAG_BUTTON_BORDER);
983 content_lavabutton = gtk_toggle_button_new_with_label (_("Lava"));
984 gtk_signal_connect (GTK_OBJECT (content_lavabutton), "toggled",
985 GTK_SIGNAL_FUNC (on_content_lavabutton_toggled),
987 gtk_widget_show (content_lavabutton);
988 gtk_table_attach (GTK_TABLE (table3), content_lavabutton, 3, 4, 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_lavabutton), QUAKE2_FLAG_BUTTON_BORDER);
993 content_slimebutton = gtk_toggle_button_new_with_label (_("Slime"));
994 gtk_signal_connect (GTK_OBJECT (content_slimebutton), "toggled",
995 GTK_SIGNAL_FUNC (on_content_slimebutton_toggled),
997 gtk_widget_show (content_slimebutton);
998 gtk_table_attach (GTK_TABLE (table3), content_slimebutton, 0, 1, 1, 2,
999 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1000 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1001 gtk_container_set_border_width (GTK_CONTAINER (content_slimebutton), QUAKE2_FLAG_BUTTON_BORDER);
1003 content_waterbutton = gtk_toggle_button_new_with_label (_("Water"));
1004 gtk_signal_connect (GTK_OBJECT (content_waterbutton), "toggled",
1005 GTK_SIGNAL_FUNC (on_content_waterbutton_toggled),
1007 gtk_widget_show (content_waterbutton);
1008 gtk_table_attach (GTK_TABLE (table3), content_waterbutton, 1, 2, 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_waterbutton), QUAKE2_FLAG_BUTTON_BORDER);
1013 content_mistbutton = gtk_toggle_button_new_with_label (_("Mist"));
1014 gtk_signal_connect (GTK_OBJECT (content_mistbutton), "toggled",
1015 GTK_SIGNAL_FUNC (on_content_mistbutton_toggled),
1017 gtk_widget_show (content_mistbutton);
1018 gtk_table_attach (GTK_TABLE (table3), content_mistbutton, 2, 3, 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_mistbutton), QUAKE2_FLAG_BUTTON_BORDER);
1023 content_areaportalbutton = gtk_toggle_button_new_with_label (_("AreaPortal"));
1024 gtk_signal_connect (GTK_OBJECT (content_areaportalbutton), "toggled",
1025 GTK_SIGNAL_FUNC (on_content_areaportalbutton_toggled),
1027 gtk_widget_show (content_areaportalbutton);
1028 gtk_table_attach (GTK_TABLE (table3), content_areaportalbutton, 3, 4, 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_areaportalbutton), QUAKE2_FLAG_BUTTON_BORDER);
1033 content_playerclipbutton = gtk_toggle_button_new_with_label (_("PlayerClip"));
1034 gtk_signal_connect (GTK_OBJECT (content_playerclipbutton), "toggled",
1035 GTK_SIGNAL_FUNC (on_content_playerclipbutton_toggled),
1037 gtk_widget_show (content_playerclipbutton);
1038 gtk_table_attach (GTK_TABLE (table3), content_playerclipbutton, 0, 1, 2, 3,
1039 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1040 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1041 gtk_container_set_border_width (GTK_CONTAINER (content_playerclipbutton), QUAKE2_FLAG_BUTTON_BORDER);
1043 content_monsterclipbutton = gtk_toggle_button_new_with_label (_("MonsterClip"));
1044 gtk_signal_connect (GTK_OBJECT (content_monsterclipbutton), "toggled",
1045 GTK_SIGNAL_FUNC (on_content_monsterclipbutton_toggled),
1047 gtk_widget_show (content_monsterclipbutton);
1048 gtk_table_attach (GTK_TABLE (table3), content_monsterclipbutton, 1, 2, 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_monsterclipbutton), QUAKE2_FLAG_BUTTON_BORDER);
1053 content_current0button = gtk_toggle_button_new_with_label (_("Current 0"));
1054 gtk_signal_connect (GTK_OBJECT (content_current0button), "toggled",
1055 GTK_SIGNAL_FUNC (on_content_current0button_toggled),
1057 gtk_widget_show (content_current0button);
1058 gtk_table_attach (GTK_TABLE (table3), content_current0button, 2, 3, 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_current0button), QUAKE2_FLAG_BUTTON_BORDER);
1063 content_current90button = gtk_toggle_button_new_with_label (_("Current 90"));
1064 gtk_signal_connect (GTK_OBJECT (content_current90button), "toggled",
1065 GTK_SIGNAL_FUNC (on_content_current90button_toggled),
1067 gtk_widget_show (content_current90button);
1068 gtk_table_attach (GTK_TABLE (table3), content_current90button, 3, 4, 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_current90button), QUAKE2_FLAG_BUTTON_BORDER);
1073 content_current180button = gtk_toggle_button_new_with_label (_("Current 180"));
1074 gtk_signal_connect (GTK_OBJECT (content_current180button), "toggled",
1075 GTK_SIGNAL_FUNC (on_content_current180button_toggled),
1077 gtk_widget_show (content_current180button);
1078 gtk_table_attach (GTK_TABLE (table3), content_current180button, 0, 1, 3, 4,
1079 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1080 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1081 gtk_container_set_border_width (GTK_CONTAINER (content_current180button), QUAKE2_FLAG_BUTTON_BORDER);
1083 content_current270button = gtk_toggle_button_new_with_label (_("Current 270"));
1084 gtk_signal_connect (GTK_OBJECT (content_current270button), "toggled",
1085 GTK_SIGNAL_FUNC (on_content_current270button_toggled),
1087 gtk_widget_show (content_current270button);
1088 gtk_table_attach (GTK_TABLE (table3), content_current270button, 1, 2, 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_current270button), QUAKE2_FLAG_BUTTON_BORDER);
1093 content_currentUPbutton = gtk_toggle_button_new_with_label (_("Current UP"));
1094 gtk_signal_connect (GTK_OBJECT (content_currentUPbutton), "toggled",
1095 GTK_SIGNAL_FUNC (on_content_currentUPbutton_toggled),
1097 gtk_widget_show (content_currentUPbutton);
1098 gtk_table_attach (GTK_TABLE (table3), content_currentUPbutton, 2, 3, 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_currentUPbutton), QUAKE2_FLAG_BUTTON_BORDER);
1103 content_currentDOWNbutton = gtk_toggle_button_new_with_label (_("Current DOWN"));
1104 gtk_signal_connect (GTK_OBJECT (content_currentDOWNbutton), "toggled",
1105 GTK_SIGNAL_FUNC (on_content_currentDOWNbutton_toggled),
1107 gtk_widget_show (content_currentDOWNbutton);
1108 gtk_table_attach (GTK_TABLE (table3), content_currentDOWNbutton, 3, 4, 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_currentDOWNbutton), QUAKE2_FLAG_BUTTON_BORDER);
1113 content_originbutton = gtk_toggle_button_new_with_label (_("Origin"));
1114 gtk_signal_connect (GTK_OBJECT (content_originbutton), "toggled",
1115 GTK_SIGNAL_FUNC (on_content_originbutton_toggled),
1117 gtk_widget_show (content_originbutton);
1118 gtk_table_attach (GTK_TABLE (table3), content_originbutton, 0, 1, 4, 5,
1119 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1120 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1121 gtk_container_set_border_width (GTK_CONTAINER (content_originbutton), QUAKE2_FLAG_BUTTON_BORDER);
1123 content_detailbutton = gtk_toggle_button_new_with_label (_("Detail"));
1124 gtk_signal_connect (GTK_OBJECT (content_detailbutton), "toggled",
1125 GTK_SIGNAL_FUNC (on_content_detailbutton_toggled),
1127 gtk_widget_show (content_detailbutton);
1128 gtk_table_attach (GTK_TABLE (table3), content_detailbutton, 1, 2, 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_detailbutton), QUAKE2_FLAG_BUTTON_BORDER);
1133 content_translucentbutton = gtk_toggle_button_new_with_label (_("Translucent"));
1134 gtk_signal_connect (GTK_OBJECT (content_translucentbutton), "toggled",
1135 GTK_SIGNAL_FUNC (on_content_translucentbutton_toggled),
1137 gtk_widget_show (content_translucentbutton);
1138 gtk_table_attach (GTK_TABLE (table3), content_translucentbutton, 2, 3, 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_translucentbutton), QUAKE2_FLAG_BUTTON_BORDER);
1143 content_ladderbutton = gtk_toggle_button_new_with_label (_("Ladder"));
1144 gtk_signal_connect (GTK_OBJECT (content_ladderbutton), "toggled",
1145 GTK_SIGNAL_FUNC (on_content_ladderbutton_toggled),
1147 gtk_widget_show (content_ladderbutton);
1148 gtk_table_attach (GTK_TABLE (table3), content_ladderbutton, 3, 4, 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_ladderbutton), QUAKE2_FLAG_BUTTON_BORDER);
1153 label6 = gtk_label_new (_("Content Flags"));
1154 gtk_widget_show (label6);
1155 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label6);