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.44 by elmex, Fri Jun 2 16:32:12 2006 UTC vs.
Revision 1.46 by elmex, Fri Jun 2 18:46:16 2006 UTC

871 }, 871 },
872 on_activate => sub { 872 on_activate => sub {
873 my ($input, $text) = @_; 873 my ($input, $text) = @_;
874 $input->set_text (''); 874 $input->set_text ('');
875 875
876 if ($text =~ /^\/bind\s+(.*)$/) {
877 CFClient::Binder::open_binding_dialog (sub {
878 my ($mod, $sym) = @_;
879 $::CFG->{bindings}->{$mod}->{$sym} = [$1];
880 });
881 } elsif ($text =~ /^\/(.*)/) { 876 if ($text =~ /^\/(.*)/) {
882 $::CONN->user_send ($1); 877 $::CONN->user_send ($1);
883 } else { 878 } else {
884 my $say_cmd = $::CFG->{say_command} || 'say'; 879 my $say_cmd = $::CFG->{say_command} || 'say';
885 $::CONN->user_send ("$say_cmd $text"); 880 $::CONN->user_send ("$say_cmd $text");
886 } 881 }
936sub make_pickup_cfg_window { 931sub make_pickup_cfg_window {
937 $PICKUP_CFG = new CFClient::UI::FancyFrame 932 $PICKUP_CFG = new CFClient::UI::FancyFrame
938 title => "Autopickup configuration", 933 title => "Autopickup configuration",
939 x => "center", 934 x => "center",
940 y => "center", 935 y => "center",
941 force_w => $WIDTH * 3/10, 936 force_w => $WIDTH * 6/10,
942 force_h => $HEIGHT * 9/10; 937 force_h => $HEIGHT * 9/10;
943 938
939
940 $PICKUP_CFG->add (my $vb = new CFClient::UI::VBox);
941 $vb->add (my $gen_tbl = new CFClient::UI::Table expand => 1);
942 $vb->add (my $hb = new CFClient::UI::HBox expand => 1);
944 my $tbl = new CFClient::UI::Table; 943 $hb->add (my $ltbl = new CFClient::UI::Table expand => 1);
944 $hb->add (my $rtbl = new CFClient::UI::Table expand => 1);
945
946 my $tbl = 0;
945 my $tblrow = 0; 947 my $tblrow = 0;
946 948
947 $PICKUP_CFG->add (my $sw = new CFClient::UI::ScrolledWindow scrolled => $tbl, expand => 1);
948
949 for ( 949 for (
950 ["General", $gen_tbl],
950 ["Enable (new) autopickup" => CFClient::Pickup::PU_NEWMODE], 951 ["Enable autopickup" => CFClient::Pickup::PU_NEWMODE],
951 ["Inhibit autopickup" => CFClient::Pickup::PU_INHIBIT], 952 ["Inhibit autopickup" => CFClient::Pickup::PU_INHIBIT],
952 ["Stop before pickup" => CFClient::Pickup::PU_STOP], 953 ["Stop before pickup" => CFClient::Pickup::PU_STOP],
953 ["Debug autopickup" => CFClient::Pickup::PU_DEBUG], 954 ["Debug autopickup" => CFClient::Pickup::PU_DEBUG],
954 ["Weapons"], 955 ["Weapons", $ltbl],
955 ["All weapons" => CFClient::Pickup::PU_ALLWEAPON], 956 ["All weapons" => CFClient::Pickup::PU_ALLWEAPON],
956 ["Missile weapons" => CFClient::Pickup::PU_MISSILEWEAPON], 957 ["Missile weapons" => CFClient::Pickup::PU_MISSILEWEAPON],
957 ["Bows" => CFClient::Pickup::PU_BOW], 958 ["Bows" => CFClient::Pickup::PU_BOW],
958 ["Arrows" => CFClient::Pickup::PU_ARROW], 959 ["Arrows" => CFClient::Pickup::PU_ARROW],
959 ["Armour"], 960 ["Armour"],
961 ["Shields" => CFClient::Pickup::PU_SHIELD], 962 ["Shields" => CFClient::Pickup::PU_SHIELD],
962 ["Body Armour" => CFClient::Pickup::PU_ARMOUR], 963 ["Body Armour" => CFClient::Pickup::PU_ARMOUR],
963 ["Boots" => CFClient::Pickup::PU_BOOTS], 964 ["Boots" => CFClient::Pickup::PU_BOOTS],
964 ["Gloves" => CFClient::Pickup::PU_GLOVES], 965 ["Gloves" => CFClient::Pickup::PU_GLOVES],
965 ["Cloaks" => CFClient::Pickup::PU_CLOAK], 966 ["Cloaks" => CFClient::Pickup::PU_CLOAK],
966 ["Readables"], 967 ["Readables", $rtbl],
967 ["Spellbooks" => CFClient::Pickup::PU_SPELLBOOK], 968 ["Spellbooks" => CFClient::Pickup::PU_SPELLBOOK],
968 ["Skillscrolls" => CFClient::Pickup::PU_SKILLSCROLL], 969 ["Skillscrolls" => CFClient::Pickup::PU_SKILLSCROLL],
969 ["Normal Books/Scrolls" => CFClient::Pickup::PU_READABLES], 970 ["Normal Books/Scrolls" => CFClient::Pickup::PU_READABLES],
970 ["Misc"], 971 ["Misc"],
971 ["Food" => CFClient::Pickup::PU_FOOD], 972 ["Food" => CFClient::Pickup::PU_FOOD],
977 ["Magic Devices" => CFClient::Pickup::PU_MAGIC_DEVICE], 978 ["Magic Devices" => CFClient::Pickup::PU_MAGIC_DEVICE],
978 ["Ignore cursed" => CFClient::Pickup::PU_NOT_CURSED], 979 ["Ignore cursed" => CFClient::Pickup::PU_NOT_CURSED],
979 ["Jewelery" => CFClient::Pickup::PU_JEWELS], 980 ["Jewelery" => CFClient::Pickup::PU_JEWELS],
980 ) 981 )
981 { 982 {
982 unless (defined $_->[1]) { 983 if (ref $_->[1]) {
984 $tbl = $_->[1];
985 $tblrow = 0;
983 $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => 0); 986 $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => -1);
987 } elsif (not defined $_->[1]) {
988 $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => -1);
984 } else { 989 } else {
985 my $mask = $_->[1]; 990 my $mask = $_->[1];
986 $tbl->add (0, $tblrow, new CFClient::UI::Label text => $_->[0], align => -1); 991 $tbl->add (0, $tblrow, new CFClient::UI::Label text => $_->[0], align => 1, expand => 1);
987 $tbl->add (1, $tblrow++, new CFClient::UI::CheckBox 992 $tbl->add (1, $tblrow++, new CFClient::UI::CheckBox
988 state => $CFG->{pickup} & $mask, 993 state => $CFG->{pickup} & $mask,
989 on_changed => sub { 994 on_changed => sub {
990 my ($box, $value) = @_; 995 my ($box, $value) = @_;
991 if ($value) { 996 if ($value) {
992 $CFG->{pickup} |= $mask; 997 $::CFG->{pickup} |= $mask;
993 } else { 998 } else {
994 $CFG->{pickup} = $CFG->{pickup} & ~$mask; 999 $::CFG->{pickup} = $::CFG->{pickup} & ~$mask;
995 } 1000 }
996 $::CONN->send (sprintf "command pickup %u", $CFG->{pickup}); 1001 $::CONN->send (sprintf "command pickup %u", $::CFG->{pickup})
1002 if defined $::CONN;
997 }); 1003 });
998 } 1004 }
999 } 1005 }
1000 1006
1001 $PICKUP_CFG 1007 $PICKUP_CFG

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines