--- deliantra/Deliantra-Client/DC/Protocol.pm 2006/07/19 23:00:07 1.61 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2006/07/22 12:18:02 1.62 @@ -711,11 +711,11 @@ sub update_floorbox { $CFClient::UI::ROOT->on_refresh ($::FLOORBOX => sub { return unless $::CONN; - + $::FLOORBOX->clear; my $row; - for (sort { $a->{count} <=> $b->{count} } values %{ $::CONN->{container}{0} }) { + for (sort { $a->{count} <=> $b->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { if ($row < 6) { local $_->{face_widget}; # hack to force recreation of widget local $_->{desc_widget}; # hack to force recreation of widget @@ -733,14 +733,21 @@ last; } } + if ($::CONN->{open_container}) { + $::FLOORBOX->add (1, $row++, new CFClient::UI::Button + text => "Close container", + on_activate => sub { $::CONN->send ("apply $::CONN->{open_container}") } + ); + } }); - + $::WANT_REFRESH++; } sub set_opencont { my ($conn, $tag, $name) = @_; $conn->{open_container} = $tag; + update_floorbox; $::INV_RIGHT_HB->clear (); $::INV_RIGHT_HB->add (new CFClient::UI::Label align => 0, expand => 1, text => $name); @@ -769,8 +776,8 @@ or return; for my $tag (keys %$todo) { + update_floorbox if $tag == 0 or $tag == $self->{open_container}; if ($tag == 0) { - update_floorbox; $::INVR->set_items ($self->{container}{0}) if $tag == $self->{open_container}; } elsif ($tag == $self->{player}{tag}) {