Crossfire Client, Branches  R11627
pickup.c
Go to the documentation of this file.
1 const char * const rcsid_gtk2_pickup_c =
2  "$Id: pickup.c 9200 2008-06-01 17:12:43Z anmaster $";
3 
4 /*
5  Crossfire client, a client program for the crossfire program.
6 
7  Copyright (C) 2005-2007 Mark Wedel & Crossfire Development Team
8 
9  This program is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 
23  The author can be reached via e-mail to crossfire@metalforge.org
24 */
25 
33 #ifdef HAVE_CONFIG_H
34 # include <config.h>
35 #endif
36 
37 #include <gtk/gtk.h>
38 #include <glade/glade.h>
39 
40 #include "main.h"
41 #include "client.h"
42 #include "image.h"
43 #include "gtk2proto.h"
44 
45 typedef struct {
46  GtkWidget *menuitem;
49 
50 #define MAX_PICKUPS 50
51 
53 static int num_pickups=0;
54 
55 /*
56  * Definitions for detailed pickup descriptions. The objective is to define
57  * intelligent groups of items that the user can pick up or leave as he likes.
58  */
59 
60 /* High bit as flag for new pickup options */
61 #define PU_NOTHING 0x00000000
62 
63 #define PU_DEBUG 0x10000000
64 #define PU_INHIBIT 0x20000000
65 #define PU_STOP 0x40000000
66 #define PU_NEWMODE 0x80000000
67 
68 #define PU_RATIO 0x0000000F
69 
70 #define PU_FOOD 0x00000010
71 #define PU_DRINK 0x00000020
72 #define PU_VALUABLES 0x00000040
73 #define PU_BOW 0x00000080
74 
75 #define PU_ARROW 0x00000100
76 #define PU_HELMET 0x00000200
77 #define PU_SHIELD 0x00000400
78 #define PU_ARMOUR 0x00000800
79 
80 #define PU_BOOTS 0x00001000
81 #define PU_GLOVES 0x00002000
82 #define PU_CLOAK 0x00004000
83 #define PU_KEY 0x00008000
84 
85 #define PU_MISSILEWEAPON 0x00010000
86 #define PU_ALLWEAPON 0x00020000
87 #define PU_MAGICAL 0x00040000
88 #define PU_POTION 0x00080000
89 
90 #define PU_SPELLBOOK 0x00100000
91 #define PU_SKILLSCROLL 0x00200000
92 #define PU_READABLES 0x00400000
93 #define PU_MAGIC_DEVICE 0x00800000
94 
95 #define PU_NOT_CURSED 0x01000000
96 #define PU_JEWELS 0x02000000
97 #define PU_FLESH 0x04000000
98 
99 static unsigned int pmode=0, no_recurse=0;
100 
108 static void new_menu_pickup(int on, int val)
109 {
110  char modestr[128];
111 
112  if (no_recurse) return;
113 
114  if (on)
115  pmode |= val | PU_NEWMODE;
116  else
117  pmode &= ~val;
118 
119  draw_info("To set this pickup mode to a key, use:",NDI_BLACK);
120 
121  snprintf(modestr, sizeof(modestr), "bind pickup %u",pmode);
122  draw_info(modestr,NDI_BLACK);
123  snprintf(modestr, sizeof(modestr), "pickup %u",pmode);
124  send_command(modestr, -1, 0);
125 }
126 
127 void
128 on_menu_dont_pickup_activate (GtkMenuItem *menuitem,
129  gpointer user_data)
130 {
131  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_INHIBIT);
132 }
133 
134 void
135 on_menu_stop_before_pickup_activate (GtkMenuItem *menuitem,
136  gpointer user_data)
137 {
138  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_STOP);
139 }
140 
141 /***************************************************************************
142  * armor pickup options
143  **************************************************************************/
144 
145 void
146 on_menu_body_armor_activate (GtkMenuItem *menuitem,
147  gpointer user_data)
148 {
149  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_ARMOUR);
150 }
151 
152 void
153 on_menu_boots_activate (GtkMenuItem *menuitem,
154  gpointer user_data)
155 {
156  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_BOOTS);
157 }
158 
159 void
160 on_menu_cloaks_activate (GtkMenuItem *menuitem,
161  gpointer user_data)
162 {
163  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_CLOAK);
164 }
165 
166 void
167 on_menu_gloves_activate (GtkMenuItem *menuitem,
168  gpointer user_data)
169 {
170  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_GLOVES);
171 }
172 
173 void
174 on_menu_helmets_activate (GtkMenuItem *menuitem,
175  gpointer user_data)
176 {
177  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_HELMET);
178 }
179 
180 void
181 on_menu_shields_activate (GtkMenuItem *menuitem,
182  gpointer user_data)
183 {
184  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_SHIELD);
185 }
186 
187 /***************************************************************************
188  * Books submenu
189  ****************************************************************************/
190 
191 void
192 on_menu_skillscrolls_activate (GtkMenuItem *menuitem,
193  gpointer user_data)
194 {
195  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_SKILLSCROLL);
196 }
197 
198 
199 void
201  gpointer user_data)
202 {
203  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_READABLES);
204 }
205 
206 
207 void
208 on_menu_spellbooks_activate (GtkMenuItem *menuitem,
209  gpointer user_data)
210 {
211  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_SPELLBOOK);
212 }
213 
214 /***************************************************************************/
215 
216 void
217 on_menu_drinks_activate (GtkMenuItem *menuitem,
218  gpointer user_data)
219 {
220  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_DRINK);
221 }
222 
223 void
224 on_menu_food_activate (GtkMenuItem *menuitem,
225  gpointer user_data)
226 {
227  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_FOOD);
228 }
229 
230 void
231 on_menu_keys_activate (GtkMenuItem *menuitem,
232  gpointer user_data)
233 {
234  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_KEY);
235 }
236 
237 void
238 on_menu_magical_items_activate (GtkMenuItem *menuitem,
239  gpointer user_data)
240 {
241  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_MAGICAL);
242 }
243 
244 void
245 on_menu_potions_activate (GtkMenuItem *menuitem,
246  gpointer user_data)
247 {
248  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_POTION);
249 }
250 
251 void
252 on_menu_valuables_activate (GtkMenuItem *menuitem,
253  gpointer user_data)
254 {
255  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_VALUABLES);
256 }
257 
258 void
259 on_menu_wands_rods_horns_activate (GtkMenuItem *menuitem,
260  gpointer user_data)
261 {
262  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_MAGIC_DEVICE);
263 }
264 
265 void
266 on_menu_not_cursed_activate (GtkMenuItem *menuitem,
267  gpointer user_data)
268 {
269  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_NOT_CURSED);
270 }
271 
272 void
273 on_menu_jewels_activate (GtkMenuItem *menuitem,
274  gpointer user_data)
275 {
276  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_JEWELS);
277 }
278 
279 void
280 on_menu_flesh_activate (GtkMenuItem *menuitem,
281  gpointer user_data)
282 {
283  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_FLESH);
284 }
285 
286 /***************************************************************************
287  * Weapons submenu
288  ***************************************************************************/
289 
290 void
291 on_menu_all_weapons_activate (GtkMenuItem *menuitem,
292  gpointer user_data)
293 {
294  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_ALLWEAPON);
295 }
296 
297 void
298 on_menu_missile_weapons_activate (GtkMenuItem *menuitem,
299  gpointer user_data)
300 {
301  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_MISSILEWEAPON);
302 }
303 
304 void
305 on_menu_bows_activate (GtkMenuItem *menuitem,
306  gpointer user_data)
307 {
308  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_BOW);
309 }
310 
311 void
312 on_menu_arrows_activate (GtkMenuItem *menuitem,
313  gpointer user_data)
314 {
315  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), PU_ARROW);
316 }
317 
318 /***************************************************************************
319  * Weight/value submenu
320  ***************************************************************************/
321 
322 void
323 on_menu_ratio_pickup_off_activate (GtkMenuItem *menuitem,
324  gpointer user_data)
325 {
326  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 0);
327 }
328 
329 void
330 on_menu_ratio_5_activate (GtkMenuItem *menuitem,
331  gpointer user_data)
332 {
333  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 1);
334 }
335 
336 void
337 on_menu_ratio_10_activate (GtkMenuItem *menuitem,
338  gpointer user_data)
339 {
340  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 2);
341 }
342 
343 void
344 on_menu_ratio_15_activate (GtkMenuItem *menuitem,
345  gpointer user_data)
346 {
347  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 3);
348 }
349 
350 void
351 on_menu_ratio_20_activate (GtkMenuItem *menuitem,
352  gpointer user_data)
353 {
354  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 4);
355 }
356 
357 void
358 on_menu_ratio_25_activate (GtkMenuItem *menuitem,
359  gpointer user_data)
360 {
361  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 5);
362 }
363 
364 void
365 on_menu_ratio_30_activate (GtkMenuItem *menuitem,
366  gpointer user_data)
367 {
368  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 6);
369 }
370 
371 void
372 on_menu_ratio_35_activate (GtkMenuItem *menuitem,
373  gpointer user_data)
374 {
375  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 7);
376 }
377 
378 void
379 on_menu_ratio_40_activate (GtkMenuItem *menuitem,
380  gpointer user_data)
381 {
382  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 8);
383 }
384 
385 void
386 on_menu_ratio_45_activate (GtkMenuItem *menuitem,
387  gpointer user_data)
388 {
389  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 9);
390 }
391 
392 void
393 on_menu_ratio_50_activate (GtkMenuItem *menuitem,
394  gpointer user_data)
395 {
396  new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 10);
397 }
398 
405 void pickup_init(GtkWidget *window_root)
406 {
407  static int has_init=0;
408  GladeXML *xml_tree;
409 
410  /*
411  * There isn't really any harm doing this multiple times, but isn't any
412  * point either.
413  */
414  if (has_init) return;
415  has_init=1;
416 
417  /*
418  * The order here really doesn't make much difference. I suppose order
419  * could either be in pickup modes (PU_...) or the list of items in the
420  * menu tree. I chose the later, as easier to make sure all the items are
421  * accounted for.
422  *
423  * In practice, with these values now set up, we could use a single
424  * function to hande all the events from the menubar instead of the values
425  * above - that function basically takes the structure that was clicked,
426  * and finds the value in this array that corresponds to it. But that code
427  * currently works fine and isn't really outdated, so isn't a big reason to
428  * change it.
429  */
430 
431  xml_tree = glade_get_widget_tree(GTK_WIDGET(window_root));
432  pickup_mapping[num_pickups].menuitem =
433  glade_xml_get_widget(xml_tree, "do_not_pickup");
434  pickup_mapping[num_pickups].pickup_mode = PU_INHIBIT;
435  num_pickups++;
436 
437  pickup_mapping[num_pickups].menuitem =
438  glade_xml_get_widget(xml_tree, "stop_before_pickup1");
439  pickup_mapping[num_pickups].pickup_mode = PU_STOP;
440  num_pickups++;
441 
442  pickup_mapping[num_pickups].menuitem =
443  glade_xml_get_widget(xml_tree, "body_armor1");
444  pickup_mapping[num_pickups].pickup_mode = PU_ARMOUR;
445  num_pickups++;
446 
447  pickup_mapping[num_pickups].menuitem =
448  glade_xml_get_widget(xml_tree, "boots1");
449  pickup_mapping[num_pickups].pickup_mode = PU_BOOTS;
450  num_pickups++;
451 
452  pickup_mapping[num_pickups].menuitem =
453  glade_xml_get_widget(xml_tree, "cloaks1");
454  pickup_mapping[num_pickups].pickup_mode = PU_CLOAK;
455  num_pickups++;
456 
457  pickup_mapping[num_pickups].menuitem =
458  glade_xml_get_widget(xml_tree, "gloves1");
459  pickup_mapping[num_pickups].pickup_mode = PU_GLOVES;
460  num_pickups++;
461 
462  pickup_mapping[num_pickups].menuitem =
463  glade_xml_get_widget(xml_tree, "helmets1");
464  pickup_mapping[num_pickups].pickup_mode = PU_HELMET;
465  num_pickups++;
466 
467  pickup_mapping[num_pickups].menuitem =
468  glade_xml_get_widget(xml_tree, "shields1");
469  pickup_mapping[num_pickups].pickup_mode = PU_SHIELD;
470  num_pickups++;
471 
472  pickup_mapping[num_pickups].menuitem =
473  glade_xml_get_widget(xml_tree, "skillscrolls1");
474  pickup_mapping[num_pickups].pickup_mode = PU_SKILLSCROLL;
475  num_pickups++;
476 
477  pickup_mapping[num_pickups].menuitem =
478  glade_xml_get_widget(xml_tree, "normal_book_scrolls1");
479  pickup_mapping[num_pickups].pickup_mode = PU_READABLES;
480  num_pickups++;
481 
482  pickup_mapping[num_pickups].menuitem =
483  glade_xml_get_widget(xml_tree, "spellbooks1");
484  pickup_mapping[num_pickups].pickup_mode = PU_SPELLBOOK;
485  num_pickups++;
486 
487  pickup_mapping[num_pickups].menuitem =
488  glade_xml_get_widget(xml_tree, "drinks1");
489  pickup_mapping[num_pickups].pickup_mode = PU_DRINK;
490  num_pickups++;
491 
492  pickup_mapping[num_pickups].menuitem =
493  glade_xml_get_widget(xml_tree, "food1");
494  pickup_mapping[num_pickups].pickup_mode = PU_FOOD;
495  num_pickups++;
496 
497  pickup_mapping[num_pickups].menuitem =
498  glade_xml_get_widget(xml_tree, "flesh1");
499  pickup_mapping[num_pickups].pickup_mode = PU_FLESH;
500  num_pickups++;
501 
502  pickup_mapping[num_pickups].menuitem =
503  glade_xml_get_widget(xml_tree, "keys1");
504  pickup_mapping[num_pickups].pickup_mode = PU_KEY;
505  num_pickups++;
506 
507  pickup_mapping[num_pickups].menuitem =
508  glade_xml_get_widget(xml_tree, "magical_items");
509  pickup_mapping[num_pickups].pickup_mode = PU_MAGICAL;
510  num_pickups++;
511 
512  pickup_mapping[num_pickups].menuitem =
513  glade_xml_get_widget(xml_tree, "potions");
514  pickup_mapping[num_pickups].pickup_mode = PU_POTION;
515  num_pickups++;
516 
517  pickup_mapping[num_pickups].menuitem =
518  glade_xml_get_widget(xml_tree, "valuables");
519  pickup_mapping[num_pickups].pickup_mode = PU_VALUABLES;
520  num_pickups++;
521 
522  pickup_mapping[num_pickups].menuitem =
523  glade_xml_get_widget(xml_tree, "wands_rods_horns");
524  pickup_mapping[num_pickups].pickup_mode = PU_MAGIC_DEVICE;
525  num_pickups++;
526 
527  pickup_mapping[num_pickups].menuitem =
528  glade_xml_get_widget(xml_tree, "jewels1");
529  pickup_mapping[num_pickups].pickup_mode = PU_JEWELS;
530  num_pickups++;
531 
532  pickup_mapping[num_pickups].menuitem =
533  glade_xml_get_widget(xml_tree, "all_weapons");
534  pickup_mapping[num_pickups].pickup_mode = PU_ALLWEAPON;
535  num_pickups++;
536 
537  pickup_mapping[num_pickups].menuitem =
538  glade_xml_get_widget(xml_tree, "missile_weapons1");
539  pickup_mapping[num_pickups].pickup_mode = PU_MISSILEWEAPON;
540  num_pickups++;
541 
542  pickup_mapping[num_pickups].menuitem =
543  glade_xml_get_widget(xml_tree, "bows1");
544  pickup_mapping[num_pickups].pickup_mode = PU_BOW;
545  num_pickups++;
546 
547  pickup_mapping[num_pickups].menuitem =
548  glade_xml_get_widget(xml_tree, "arrows1");
549  pickup_mapping[num_pickups].pickup_mode = PU_ARROW;
550  num_pickups++;
551 
552  pickup_mapping[num_pickups].menuitem =
553  glade_xml_get_widget(xml_tree, "ratio_pickup_off1");
554  pickup_mapping[num_pickups].pickup_mode = ~PU_RATIO;
555  num_pickups++;
556 
557  pickup_mapping[num_pickups].menuitem =
558  glade_xml_get_widget(xml_tree, "ratio_5");
559  pickup_mapping[num_pickups].pickup_mode = 1;
560  num_pickups++;
561 
562  pickup_mapping[num_pickups].menuitem =
563  glade_xml_get_widget(xml_tree, "ratio_10");
564  pickup_mapping[num_pickups].pickup_mode = 2;
565  num_pickups++;
566 
567  pickup_mapping[num_pickups].menuitem =
568  glade_xml_get_widget(xml_tree, "ratio_15");
569  pickup_mapping[num_pickups].pickup_mode = 3;
570  num_pickups++;
571 
572  pickup_mapping[num_pickups].menuitem =
573  glade_xml_get_widget(xml_tree, "ratio_20");
574  pickup_mapping[num_pickups].pickup_mode = 4;
575  num_pickups++;
576 
577  pickup_mapping[num_pickups].menuitem =
578  glade_xml_get_widget(xml_tree, "ratio_25");
579  pickup_mapping[num_pickups].pickup_mode = 5;
580  num_pickups++;
581 
582  pickup_mapping[num_pickups].menuitem =
583  glade_xml_get_widget(xml_tree, "ratio_30");
584  pickup_mapping[num_pickups].pickup_mode = 6;
585  num_pickups++;
586 
587  pickup_mapping[num_pickups].menuitem =
588  glade_xml_get_widget(xml_tree, "ratio_35");
589  pickup_mapping[num_pickups].pickup_mode = 7;
590  num_pickups++;
591 
592  pickup_mapping[num_pickups].menuitem =
593  glade_xml_get_widget(xml_tree, "ratio_40");
594  pickup_mapping[num_pickups].pickup_mode = 8;
595  num_pickups++;
596 
597  pickup_mapping[num_pickups].menuitem =
598  glade_xml_get_widget(xml_tree, "ratio_45");
599  pickup_mapping[num_pickups].pickup_mode = 9;
600  num_pickups++;
601 
602  pickup_mapping[num_pickups].menuitem =
603  glade_xml_get_widget(xml_tree, "ratio_50");
604  pickup_mapping[num_pickups].pickup_mode = 10;
605  num_pickups++;
606 
607  pickup_mapping[num_pickups].menuitem =
608  glade_xml_get_widget(xml_tree, "not_cursed1");
609  pickup_mapping[num_pickups].pickup_mode = PU_NOT_CURSED;
610  num_pickups++;
611 
612  /*
613  * Do some bounds checking. We could actually set this exactly right,
614  * since additional menu entries are not likely to be added often. We exit
615  * because if we overrun that structure, we've screwed up memory and will
616  * likely crash or otherwise have odd behaviour.
617  */
618  if (num_pickups>=MAX_PICKUPS) {
619  LOG(LOG_ERROR, "pickup.c::pickup_init", "num_pickups (%d) >= MAX_PICKUPS (%d)\n",
621  exit(1);
622  }
623 
624 }
625 
629 void client_pickup(uint32 pickup)
630 {
631  int i;
632 
633  /*
634  * no_recurse is used to limit callbacks - otherwise what happens is when
635  * we call set_active below, it emits the appropriate signal, which results
636  * in new_menu_pickup() getting called, which then sends a new pickup
637  * command to the server, which then results in server sending data to
638  * client, etc.
639  */
640  no_recurse=1;
641  pmode=pickup;
642 
643  for (i=0; i < num_pickups; i++) {
644  if ((pickup & ~PU_RATIO) & pickup_mapping[i].pickup_mode ||
645  (pickup & PU_RATIO) == pickup_mapping[i].pickup_mode) {
646  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(pickup_mapping[i].menuitem), 1);
647  } else {
648  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(pickup_mapping[i].menuitem), 0);
649  }
650  }
651  no_recurse=0;
652 }
#define PU_JEWELS
Definition: pickup.c:96
#define PU_ARROW
Definition: pickup.c:75
#define PU_GLOVES
Definition: pickup.c:81
void on_menu_boots_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:153
void on_menu_ratio_45_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:386
void on_menu_valuables_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:252
void pickup_init(GtkWidget *window_root)
Definition: pickup.c:405
#define PU_SPELLBOOK
Definition: pickup.c:90
#define PU_POTION
Definition: pickup.c:88
void on_menu_ratio_50_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:393
#define PU_INHIBIT
Definition: pickup.c:64
#define PU_MAGIC_DEVICE
Definition: pickup.c:93
#define PU_NEWMODE
Definition: pickup.c:66
void on_menu_flesh_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:280
#define PU_KEY
Definition: pickup.c:83
void on_menu_ratio_30_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:365
#define PU_CLOAK
Definition: pickup.c:82
void on_menu_helmets_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:174
void on_menu_normal_book_scrolls_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:200
void on_menu_all_weapons_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:291
void on_menu_potions_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:245
#define PU_SHIELD
Definition: pickup.c:77
void on_menu_arrows_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:312
#define PU_RATIO
Definition: pickup.c:68
void on_menu_ratio_pickup_off_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:323
void LOG(LogLevel level, const char *origin, const char *format,...)
Definition: misc.c:178
void on_menu_ratio_10_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:337
static unsigned int pmode
Definition: pickup.c:99
#define PU_SKILLSCROLL
Definition: pickup.c:91
PickupMapping pickup_mapping[MAX_PICKUPS]
Definition: pickup.c:52
void on_menu_keys_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:231
void on_menu_spellbooks_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:208
void on_menu_not_cursed_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:266
GtkWidget * window_root
Definition: main.c:56
void client_pickup(uint32 pickup)
Definition: pickup.c:629
#define PU_FLESH
Definition: pickup.c:97
#define PU_DRINK
Definition: pickup.c:71
static void new_menu_pickup(int on, int val)
Definition: pickup.c:108
void on_menu_body_armor_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:146
int send_command(const char *command, int repeat, int must_send)
Definition: player.c:195
#define PU_STOP
Definition: pickup.c:65
#define PU_ALLWEAPON
Definition: pickup.c:86
void on_menu_cloaks_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:160
void on_menu_missile_weapons_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:298
void on_menu_ratio_40_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:379
#define PU_BOW
Definition: pickup.c:73
uint32 pickup_mode
Definition: pickup.c:47
#define PU_READABLES
Definition: pickup.c:92
void on_menu_bows_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:305
void on_menu_ratio_5_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:330
const char *const rcsid_gtk2_pickup_c
Definition: pickup.c:1
#define PU_MAGICAL
Definition: pickup.c:87
#define PU_VALUABLES
Definition: pickup.c:72
void on_menu_magical_items_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:238
static unsigned int no_recurse
Definition: pickup.c:99
#define PU_ARMOUR
Definition: pickup.c:78
static unsigned int pickup_mode
Definition: gx11.c:308
void on_menu_gloves_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:167
unsigned int uint32
Definition: client-types.h:77
void on_menu_ratio_20_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:351
#define PU_BOOTS
Definition: pickup.c:80
#define PU_FOOD
Definition: pickup.c:70
static int has_init
Definition: spells.c:63
#define PU_NOT_CURSED
Definition: pickup.c:95
void on_menu_ratio_35_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:372
void draw_info(const char *str, int color)
Definition: gx11.c:1773
void on_menu_food_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:224
#define PU_HELMET
Definition: pickup.c:76
GtkWidget * menuitem
Definition: pickup.c:46
void on_menu_skillscrolls_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:192
void on_menu_ratio_25_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:358
#define NDI_BLACK
Definition: newclient.h:201
void on_menu_ratio_15_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:344
void on_menu_stop_before_pickup_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:135
static int num_pickups
Definition: pickup.c:53
void on_menu_wands_rods_horns_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:259
#define MAX_PICKUPS
Definition: pickup.c:50
void on_menu_drinks_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:217
void on_menu_jewels_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:273
void on_menu_shields_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:181
void on_menu_dont_pickup_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: pickup.c:128
#define PU_MISSILEWEAPON
Definition: pickup.c:85