--- deliantra/Deliantra-Client/DC/Protocol.pm 2006/05/29 19:30:28 1.9 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2006/05/30 14:59:26 1.12 @@ -341,12 +341,10 @@ $LAST_QUERY = $prompt; my $dialog = new CFClient::UI::FancyFrame + x => "center", + y => "center", title => "Query", child => my $vbox = new CFClient::UI::VBox, - on_visibility_change => sub { - my ($self, $visible) = @_; - $self->center if $visible; - }, ; $vbox->add (new CFClient::UI::Label @@ -554,7 +552,22 @@ sub set_opencont { my ($conn, $tag, $name) = @_; $conn->{open_container} = $tag; - $::INVR_LBL->set_text ($name); + + $::INV_RIGHT_HB->clear (); + $::INV_RIGHT_HB->add (new CFClient::UI::Label align => 0, expand => 1, text => $name); + + if ($tag != 0) { # Floor isn't closable, is it? + $::INV_RIGHT_HB->add (new CFClient::UI::Button + text => "Close container", + tooltip => "Close the currently open container (if one is open)", + on_activate => sub { + $::CONN->send ("apply $tag") # $::CONN->{open_container}") + if $tag != 0; + #if $CONN->{open_container} != 0; + }, + ); + } + $::INVR->set_items ($conn->{container}{$tag}); } @@ -593,6 +606,8 @@ update_container (0); } elsif ($tag == $self->{player}{tag}) { $::INV->set_items ($self->{container}{$tag}) + } else { + update_container ($tag); } # use PApp::Util; warn PApp::Util::dumpval $self->{container}{0}; @@ -610,7 +625,7 @@ } elsif ($_->{container} == $self->{player}{tag}) { $::INV->set_items ($self->{container}{$self->{player}{tag}}) } else { - update_container ($_->{tag}); + update_container ($_->{container}); } } }