--- deliantra/Deliantra-Client/DC.pm 2006/07/12 17:20:04 1.98 +++ deliantra/Deliantra-Client/DC.pm 2006/07/22 12:18:01 1.101 @@ -287,7 +287,11 @@ sub do_n_dialog { my ($cb) = @_; - my $w = new CFClient::UI::FancyFrame; + my $w = new CFClient::UI::FancyFrame + on_delete => sub { $_[0]->destroy; 1 }, + has_close_button => 1, + ; + $w->add (my $vb = new CFClient::UI::VBox x => "center", y => "center"); $vb->add (new CFClient::UI::Label text => "Enter item count:"); $vb->add (my $entry = new CFClient::UI::Entry @@ -297,12 +301,14 @@ $last_enter_count = $entry->get_text; $cb->($last_enter_count); $w->hide; - $w = undef; - } + $w->destroy; + + 0 + }, + on_escape => sub { $w->destroy; 1 }, ); $entry->grab_focus; $w->show; - } sub update_widgets { @@ -332,9 +338,20 @@ } elsif ($ev->{button} == 2) { $::CONN->send ("apply $self->{tag}"); } elsif ($ev->{button} == 3) { + my $move_prefix = $::CONN->{open_container} ? 'put' : 'drop'; + if ($self->{container} == $::CONN->{open_container}) { + $move_prefix = "take"; + } + my @menu_items = ( ["examine", sub { $::CONN->send ("examine $self->{tag}") }], ["mark", sub { $::CONN->send ("mark ". pack "N", $self->{tag}) }], + ["ignite/thaw", # first try of an easier use of flint&steel + sub { + $::CONN->send ("mark ". pack "N", $self->{tag}); + $::CONN->send ("command apply flint and steel"); + } + ], ["apply", sub { $::CONN->send ("apply $self->{tag}") }], ( $self->{flags} & F_LOCKED @@ -343,8 +360,8 @@ ) : ( ["lock", sub { $::CONN->send ("lock " . pack "CN", 1, $self->{tag}) }], - ["drop", sub { $::CONN->send ("move $::CONN->{open_container} $self->{tag} 0") }], - ["move n", + ["$move_prefix all", sub { $::CONN->send ("move $targ $self->{tag} 0") }], + ["$move_prefix n", sub { do_n_dialog (sub { $::CONN->send ("move $targ $self->{tag} $_[0]") }) }