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.43 by elmex, Fri Jun 2 16:27:28 2006 UTC vs.
Revision 1.48 by root, Fri Jun 2 21:46:45 2006 UTC

557 update_stats_window ({}); 557 update_stats_window ({});
558 558
559 $tgw 559 $tgw
560} 560}
561 561
562sub formsep { 562sub formsep($) {
563 reverse join ",", grep length, split /(...)/, reverse $_[0] * 1 563 scalar reverse join ",", unpack "(A3)*", reverse $_[0] * 1
564} 564}
565 565
566sub update_stats_window { 566sub update_stats_window {
567 my ($stats) = @_; 567 my ($stats) = @_;
568 568
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 }
933 $QUIT_DIALOG->show; 928 $QUIT_DIALOG->show;
934} 929}
935 930
936sub make_pickup_cfg_window { 931sub make_pickup_cfg_window {
937 $PICKUP_CFG = new CFClient::UI::FancyFrame 932 $PICKUP_CFG = new CFClient::UI::FancyFrame
933 title => "Autopickup configuration",
938 x => "center", 934 x => "center",
939 y => "center", 935 y => "center",
940 force_w => $WIDTH * 3/10, 936 force_w => $WIDTH * 6/10,
941 force_h => $HEIGHT * 9/10; 937 force_h => $HEIGHT * 9/10;
942 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);
943 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;
944 my $tblrow = 0; 947 my $tblrow = 0;
945 $PICKUP_CFG->add (my $sw = new CFClient::UI::ScrolledWindow scrolled => $tbl);
946 948
947 for ( 949 for (
948 ["General"], 950 ["General", $gen_tbl],
949 ["Enable (new) autopickup" => CFClient::Pickup::PU_NEWMODE], 951 ["Enable autopickup" => CFClient::Pickup::PU_NEWMODE],
950 ["Inhibit autopickup" => CFClient::Pickup::PU_INHIBIT], 952 ["Inhibit autopickup" => CFClient::Pickup::PU_INHIBIT],
951 ["Stop before pickup" => CFClient::Pickup::PU_STOP], 953 ["Stop before pickup" => CFClient::Pickup::PU_STOP],
952 ["Debug autopickup" => CFClient::Pickup::PU_DEBUG], 954 ["Debug autopickup" => CFClient::Pickup::PU_DEBUG],
953 ["Weapons"], 955 ["Weapons", $ltbl],
954 ["All weapons" => CFClient::Pickup::PU_ALLWEAPON], 956 ["All weapons" => CFClient::Pickup::PU_ALLWEAPON],
955 ["Missile weapons" => CFClient::Pickup::PU_MISSILEWEAPON], 957 ["Missile weapons" => CFClient::Pickup::PU_MISSILEWEAPON],
956 ["Bows" => CFClient::Pickup::PU_BOW], 958 ["Bows" => CFClient::Pickup::PU_BOW],
957 ["Arrows" => CFClient::Pickup::PU_ARROW], 959 ["Arrows" => CFClient::Pickup::PU_ARROW],
958 ["Armour"], 960 ["Armour"],
960 ["Shields" => CFClient::Pickup::PU_SHIELD], 962 ["Shields" => CFClient::Pickup::PU_SHIELD],
961 ["Body Armour" => CFClient::Pickup::PU_ARMOUR], 963 ["Body Armour" => CFClient::Pickup::PU_ARMOUR],
962 ["Boots" => CFClient::Pickup::PU_BOOTS], 964 ["Boots" => CFClient::Pickup::PU_BOOTS],
963 ["Gloves" => CFClient::Pickup::PU_GLOVES], 965 ["Gloves" => CFClient::Pickup::PU_GLOVES],
964 ["Cloaks" => CFClient::Pickup::PU_CLOAK], 966 ["Cloaks" => CFClient::Pickup::PU_CLOAK],
965 ["Readables"], 967 ["Readables", $rtbl],
966 ["Spellbooks" => CFClient::Pickup::PU_SPELLBOOK], 968 ["Spellbooks" => CFClient::Pickup::PU_SPELLBOOK],
967 ["Skillscrolls" => CFClient::Pickup::PU_SKILLSCROLL], 969 ["Skillscrolls" => CFClient::Pickup::PU_SKILLSCROLL],
968 ["Normal Books/Scrolls" => CFClient::Pickup::PU_READABLES], 970 ["Normal Books/Scrolls" => CFClient::Pickup::PU_READABLES],
969 ["Misc"], 971 ["Misc"],
970 ["Food" => CFClient::Pickup::PU_FOOD], 972 ["Food" => CFClient::Pickup::PU_FOOD],
976 ["Magic Devices" => CFClient::Pickup::PU_MAGIC_DEVICE], 978 ["Magic Devices" => CFClient::Pickup::PU_MAGIC_DEVICE],
977 ["Ignore cursed" => CFClient::Pickup::PU_NOT_CURSED], 979 ["Ignore cursed" => CFClient::Pickup::PU_NOT_CURSED],
978 ["Jewelery" => CFClient::Pickup::PU_JEWELS], 980 ["Jewelery" => CFClient::Pickup::PU_JEWELS],
979 ) 981 )
980 { 982 {
981 unless (defined $_->[1]) { 983 if (ref $_->[1]) {
984 $tbl = $_->[1];
985 $tblrow = 0;
982 $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);
983 } else { 989 } else {
984 my $mask = $_->[1]; 990 my $mask = $_->[1];
985 $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);
986 $tbl->add (1, $tblrow++, new CFClient::UI::CheckBox 992 $tbl->add (1, $tblrow++, new CFClient::UI::CheckBox
987 state => $CFG->{pickup} & $mask, 993 state => $CFG->{pickup} & $mask,
988 on_changed => sub { 994 on_changed => sub {
989 my ($box, $value) = @_; 995 my ($box, $value) = @_;
990 if ($value) { 996 if ($value) {
991 $CFG->{pickup} |= $mask; 997 $::CFG->{pickup} |= $mask;
992 } else { 998 } else {
993 $CFG->{pickup} = $CFG->{pickup} & ~$mask; 999 $::CFG->{pickup} = $::CFG->{pickup} & ~$mask;
994 } 1000 }
995 $::CONN->send (sprintf "command pickup %u", $CFG->{pickup}); 1001 $::CONN->send (sprintf "command pickup %u", $::CFG->{pickup})
1002 if defined $::CONN;
996 }); 1003 });
997 } 1004 }
998 } 1005 }
999 1006
1000 $PICKUP_CFG 1007 $PICKUP_CFG
1225 force_y => "max", 1232 force_y => "max",
1226 child => $STATUSBOX, 1233 child => $STATUSBOX,
1227 )->show; 1234 )->show;
1228 1235
1229 CFClient::UI::FancyFrame->new ( 1236 CFClient::UI::FancyFrame->new (
1230 title => "Mini Map", 1237 title => "Map",
1231 name => "mapmap", 1238 name => "mapmap",
1232 x => 0, 1239 x => 0,
1233 y => $FONTSIZE + 8, 1240 y => $FONTSIZE + 8,
1234 border_bg => [1, 1, 1, 192/255], 1241 border_bg => [1, 1, 1, 192/255],
1235 bg => [1, 1, 1, 0], 1242 bg => [1, 1, 1, 0],

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines