--- deliantra/Deliantra-Client/bin/cfplus 2006/06/02 16:32:12 1.44 +++ deliantra/Deliantra-Client/bin/cfplus 2006/06/02 18:46:16 1.46 @@ -873,12 +873,7 @@ my ($input, $text) = @_; $input->set_text (''); - if ($text =~ /^\/bind\s+(.*)$/) { - CFClient::Binder::open_binding_dialog (sub { - my ($mod, $sym) = @_; - $::CFG->{bindings}->{$mod}->{$sym} = [$1]; - }); - } elsif ($text =~ /^\/(.*)/) { + if ($text =~ /^\/(.*)/) { $::CONN->user_send ($1); } else { my $say_cmd = $::CFG->{say_command} || 'say'; @@ -938,20 +933,26 @@ title => "Autopickup configuration", x => "center", y => "center", - force_w => $WIDTH * 3/10, + force_w => $WIDTH * 6/10, force_h => $HEIGHT * 9/10; - my $tbl = new CFClient::UI::Table; - my $tblrow = 0; - $PICKUP_CFG->add (my $sw = new CFClient::UI::ScrolledWindow scrolled => $tbl, expand => 1); + $PICKUP_CFG->add (my $vb = new CFClient::UI::VBox); + $vb->add (my $gen_tbl = new CFClient::UI::Table expand => 1); + $vb->add (my $hb = new CFClient::UI::HBox expand => 1); + $hb->add (my $ltbl = new CFClient::UI::Table expand => 1); + $hb->add (my $rtbl = new CFClient::UI::Table expand => 1); + + my $tbl = 0; + my $tblrow = 0; for ( - ["Enable (new) autopickup" => CFClient::Pickup::PU_NEWMODE], + ["General", $gen_tbl], + ["Enable autopickup" => CFClient::Pickup::PU_NEWMODE], ["Inhibit autopickup" => CFClient::Pickup::PU_INHIBIT], ["Stop before pickup" => CFClient::Pickup::PU_STOP], ["Debug autopickup" => CFClient::Pickup::PU_DEBUG], - ["Weapons"], + ["Weapons", $ltbl], ["All weapons" => CFClient::Pickup::PU_ALLWEAPON], ["Missile weapons" => CFClient::Pickup::PU_MISSILEWEAPON], ["Bows" => CFClient::Pickup::PU_BOW], @@ -963,7 +964,7 @@ ["Boots" => CFClient::Pickup::PU_BOOTS], ["Gloves" => CFClient::Pickup::PU_GLOVES], ["Cloaks" => CFClient::Pickup::PU_CLOAK], - ["Readables"], + ["Readables", $rtbl], ["Spellbooks" => CFClient::Pickup::PU_SPELLBOOK], ["Skillscrolls" => CFClient::Pickup::PU_SKILLSCROLL], ["Normal Books/Scrolls" => CFClient::Pickup::PU_READABLES], @@ -979,21 +980,26 @@ ["Jewelery" => CFClient::Pickup::PU_JEWELS], ) { - unless (defined $_->[1]) { - $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => 0); + if (ref $_->[1]) { + $tbl = $_->[1]; + $tblrow = 0; + $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => -1); + } elsif (not defined $_->[1]) { + $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => -1); } else { my $mask = $_->[1]; - $tbl->add (0, $tblrow, new CFClient::UI::Label text => $_->[0], align => -1); + $tbl->add (0, $tblrow, new CFClient::UI::Label text => $_->[0], align => 1, expand => 1); $tbl->add (1, $tblrow++, new CFClient::UI::CheckBox state => $CFG->{pickup} & $mask, on_changed => sub { my ($box, $value) = @_; if ($value) { - $CFG->{pickup} |= $mask; + $::CFG->{pickup} |= $mask; } else { - $CFG->{pickup} = $CFG->{pickup} & ~$mask; + $::CFG->{pickup} = $::CFG->{pickup} & ~$mask; } - $::CONN->send (sprintf "command pickup %u", $CFG->{pickup}); + $::CONN->send (sprintf "command pickup %u", $::CFG->{pickup}) + if defined $::CONN; }); } }