ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.42 by root, Fri Jun 2 06:22:55 2006 UTC vs.
Revision 1.43 by elmex, Fri Jun 2 16:27:28 2006 UTC

108 108
109our $BIND_WINDOW; 109our $BIND_WINDOW;
110our $BIND_EDITOR; 110our $BIND_EDITOR;
111 111
112our $SPELL_LIST; 112our $SPELL_LIST;
113our $PICKUP_CFG;
113 114
114sub status { 115sub status {
115 $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); 116 $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]);
116} 117}
117 118
930 } 931 }
931 932
932 $QUIT_DIALOG->show; 933 $QUIT_DIALOG->show;
933} 934}
934 935
936sub make_pickup_cfg_window {
937 $PICKUP_CFG = new CFClient::UI::FancyFrame
938 x => "center",
939 y => "center",
940 force_w => $WIDTH * 3/10,
941 force_h => $HEIGHT * 9/10;
942
943 my $tbl = new CFClient::UI::Table;
944 my $tblrow = 0;
945 $PICKUP_CFG->add (my $sw = new CFClient::UI::ScrolledWindow scrolled => $tbl);
946
947 for (
948 ["General"],
949 ["Enable (new) autopickup" => CFClient::Pickup::PU_NEWMODE],
950 ["Inhibit autopickup" => CFClient::Pickup::PU_INHIBIT],
951 ["Stop before pickup" => CFClient::Pickup::PU_STOP],
952 ["Debug autopickup" => CFClient::Pickup::PU_DEBUG],
953 ["Weapons"],
954 ["All weapons" => CFClient::Pickup::PU_ALLWEAPON],
955 ["Missile weapons" => CFClient::Pickup::PU_MISSILEWEAPON],
956 ["Bows" => CFClient::Pickup::PU_BOW],
957 ["Arrows" => CFClient::Pickup::PU_ARROW],
958 ["Armour"],
959 ["Helmets" => CFClient::Pickup::PU_HELMET],
960 ["Shields" => CFClient::Pickup::PU_SHIELD],
961 ["Body Armour" => CFClient::Pickup::PU_ARMOUR],
962 ["Boots" => CFClient::Pickup::PU_BOOTS],
963 ["Gloves" => CFClient::Pickup::PU_GLOVES],
964 ["Cloaks" => CFClient::Pickup::PU_CLOAK],
965 ["Readables"],
966 ["Spellbooks" => CFClient::Pickup::PU_SPELLBOOK],
967 ["Skillscrolls" => CFClient::Pickup::PU_SKILLSCROLL],
968 ["Normal Books/Scrolls" => CFClient::Pickup::PU_READABLES],
969 ["Misc"],
970 ["Food" => CFClient::Pickup::PU_FOOD],
971 ["Drinks" => CFClient::Pickup::PU_DRINK],
972 ["Valuables (Money, Gems)" => CFClient::Pickup::PU_VALUABLES],
973 ["Keys" => CFClient::Pickup::PU_KEY],
974 ["Magical Items" => CFClient::Pickup::PU_MAGICAL],
975 ["Potions" => CFClient::Pickup::PU_POTION],
976 ["Magic Devices" => CFClient::Pickup::PU_MAGIC_DEVICE],
977 ["Ignore cursed" => CFClient::Pickup::PU_NOT_CURSED],
978 ["Jewelery" => CFClient::Pickup::PU_JEWELS],
979 )
980 {
981 unless (defined $_->[1]) {
982 $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => 0);
983 } else {
984 my $mask = $_->[1];
985 $tbl->add (0, $tblrow, new CFClient::UI::Label text => $_->[0], align => -1);
986 $tbl->add (1, $tblrow++, new CFClient::UI::CheckBox
987 state => $CFG->{pickup} & $mask,
988 on_changed => sub {
989 my ($box, $value) = @_;
990 if ($value) {
991 $CFG->{pickup} |= $mask;
992 } else {
993 $CFG->{pickup} = $CFG->{pickup} & ~$mask;
994 }
995 $::CONN->send (sprintf "command pickup %u", $CFG->{pickup});
996 });
997 }
998 }
999
1000 $PICKUP_CFG
1001}
1002
935sub make_inventory_window { 1003sub make_inventory_window {
936 my $invwin = $INV_WINDOW = new CFClient::UI::FancyFrame 1004 my $invwin = $INV_WINDOW = new CFClient::UI::FancyFrame
937 x => "center", 1005 x => "center",
938 y => "center", 1006 y => "center",
939 force_w => $WIDTH * 9/10, 1007 force_w => $WIDTH * 9/10,
1238 1306
1239 $BUTTONBAR->add (new CFClient::UI::Flopper 1307 $BUTTONBAR->add (new CFClient::UI::Flopper
1240 text => "Spells", 1308 text => "Spells",
1241 other => make_spell_list, 1309 other => make_spell_list,
1242 tooltip => "The spell list"); 1310 tooltip => "The spell list");
1311
1312 $BUTTONBAR->add (new CFClient::UI::Flopper
1313 text => "Pickup",
1314 other => make_pickup_cfg_window,
1315 tooltip => "The pickup dialog");
1316
1243 1317
1244 $BUTTONBAR->add (new CFClient::UI::Button 1318 $BUTTONBAR->add (new CFClient::UI::Button
1245 text => "Quit", 1319 text => "Quit",
1246 tooltip => "Terminates the program", 1320 tooltip => "Terminates the program",
1247 on_activate => sub { 1321 on_activate => sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines