2 "$Id: pickup.c 9200 2008-06-01 17:12:43Z anmaster $";
38 #include <glade/glade.h>
50 #define MAX_PICKUPS 50
61 #define PU_NOTHING 0x00000000
63 #define PU_DEBUG 0x10000000
64 #define PU_INHIBIT 0x20000000
65 #define PU_STOP 0x40000000
66 #define PU_NEWMODE 0x80000000
68 #define PU_RATIO 0x0000000F
70 #define PU_FOOD 0x00000010
71 #define PU_DRINK 0x00000020
72 #define PU_VALUABLES 0x00000040
73 #define PU_BOW 0x00000080
75 #define PU_ARROW 0x00000100
76 #define PU_HELMET 0x00000200
77 #define PU_SHIELD 0x00000400
78 #define PU_ARMOUR 0x00000800
80 #define PU_BOOTS 0x00001000
81 #define PU_GLOVES 0x00002000
82 #define PU_CLOAK 0x00004000
83 #define PU_KEY 0x00008000
85 #define PU_MISSILEWEAPON 0x00010000
86 #define PU_ALLWEAPON 0x00020000
87 #define PU_MAGICAL 0x00040000
88 #define PU_POTION 0x00080000
90 #define PU_SPELLBOOK 0x00100000
91 #define PU_SKILLSCROLL 0x00200000
92 #define PU_READABLES 0x00400000
93 #define PU_MAGIC_DEVICE 0x00800000
95 #define PU_NOT_CURSED 0x01000000
96 #define PU_JEWELS 0x02000000
97 #define PU_FLESH 0x04000000
121 snprintf(modestr,
sizeof(modestr),
"bind pickup %u",
pmode);
123 snprintf(modestr,
sizeof(modestr),
"pickup %u",
pmode);
326 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 0);
333 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 1);
340 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 2);
347 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 3);
354 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 4);
361 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 5);
368 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 6);
375 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 7);
382 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 8);
389 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 9);
396 new_menu_pickup(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)), 10);
414 if (has_init)
return;
431 xml_tree = glade_get_widget_tree(GTK_WIDGET(window_root));
433 glade_xml_get_widget(xml_tree,
"do_not_pickup");
438 glade_xml_get_widget(xml_tree,
"stop_before_pickup1");
443 glade_xml_get_widget(xml_tree,
"body_armor1");
448 glade_xml_get_widget(xml_tree,
"boots1");
453 glade_xml_get_widget(xml_tree,
"cloaks1");
458 glade_xml_get_widget(xml_tree,
"gloves1");
463 glade_xml_get_widget(xml_tree,
"helmets1");
468 glade_xml_get_widget(xml_tree,
"shields1");
473 glade_xml_get_widget(xml_tree,
"skillscrolls1");
478 glade_xml_get_widget(xml_tree,
"normal_book_scrolls1");
483 glade_xml_get_widget(xml_tree,
"spellbooks1");
488 glade_xml_get_widget(xml_tree,
"drinks1");
493 glade_xml_get_widget(xml_tree,
"food1");
498 glade_xml_get_widget(xml_tree,
"flesh1");
503 glade_xml_get_widget(xml_tree,
"keys1");
508 glade_xml_get_widget(xml_tree,
"magical_items");
513 glade_xml_get_widget(xml_tree,
"potions");
518 glade_xml_get_widget(xml_tree,
"valuables");
523 glade_xml_get_widget(xml_tree,
"wands_rods_horns");
528 glade_xml_get_widget(xml_tree,
"jewels1");
533 glade_xml_get_widget(xml_tree,
"all_weapons");
538 glade_xml_get_widget(xml_tree,
"missile_weapons1");
543 glade_xml_get_widget(xml_tree,
"bows1");
548 glade_xml_get_widget(xml_tree,
"arrows1");
553 glade_xml_get_widget(xml_tree,
"ratio_pickup_off1");
558 glade_xml_get_widget(xml_tree,
"ratio_5");
563 glade_xml_get_widget(xml_tree,
"ratio_10");
568 glade_xml_get_widget(xml_tree,
"ratio_15");
573 glade_xml_get_widget(xml_tree,
"ratio_20");
578 glade_xml_get_widget(xml_tree,
"ratio_25");
583 glade_xml_get_widget(xml_tree,
"ratio_30");
588 glade_xml_get_widget(xml_tree,
"ratio_35");
593 glade_xml_get_widget(xml_tree,
"ratio_40");
598 glade_xml_get_widget(xml_tree,
"ratio_45");
603 glade_xml_get_widget(xml_tree,
"ratio_50");
608 glade_xml_get_widget(xml_tree,
"not_cursed1");
619 LOG(
LOG_ERROR,
"pickup.c::pickup_init",
"num_pickups (%d) >= MAX_PICKUPS (%d)\n",
646 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(pickup_mapping[i].menuitem), 1);
648 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(pickup_mapping[i].menuitem), 0);
void on_menu_boots_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_45_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_valuables_activate(GtkMenuItem *menuitem, gpointer user_data)
void pickup_init(GtkWidget *window_root)
void on_menu_ratio_50_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_flesh_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_30_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_helmets_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_normal_book_scrolls_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_all_weapons_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_potions_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_arrows_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_pickup_off_activate(GtkMenuItem *menuitem, gpointer user_data)
void LOG(LogLevel level, const char *origin, const char *format,...)
void on_menu_ratio_10_activate(GtkMenuItem *menuitem, gpointer user_data)
static unsigned int pmode
PickupMapping pickup_mapping[MAX_PICKUPS]
void on_menu_keys_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_spellbooks_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_not_cursed_activate(GtkMenuItem *menuitem, gpointer user_data)
void client_pickup(uint32 pickup)
static void new_menu_pickup(int on, int val)
void on_menu_body_armor_activate(GtkMenuItem *menuitem, gpointer user_data)
int send_command(const char *command, int repeat, int must_send)
void on_menu_cloaks_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_missile_weapons_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_40_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_bows_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_5_activate(GtkMenuItem *menuitem, gpointer user_data)
const char *const rcsid_gtk2_pickup_c
void on_menu_magical_items_activate(GtkMenuItem *menuitem, gpointer user_data)
static unsigned int no_recurse
static unsigned int pickup_mode
void on_menu_gloves_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_20_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_35_activate(GtkMenuItem *menuitem, gpointer user_data)
void draw_info(const char *str, int color)
void on_menu_food_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_skillscrolls_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_25_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_15_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_stop_before_pickup_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_wands_rods_horns_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_drinks_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_jewels_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_shields_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_dont_pickup_activate(GtkMenuItem *menuitem, gpointer user_data)