--- deliantra/Deliantra-Client/DC/Protocol.pm 2006/07/16 23:43:46 1.60 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2006/07/22 12:18:02 1.62 @@ -587,7 +587,7 @@ [0.18, 0.54, 0.34], [0.56, 0.73, 0.56], [0.80, 0.80, 0.80], - [0.55, 0.41, 0.13], + [0.75, 0.61, 0.20], [0.99, 0.77, 0.26], [0.74, 0.65, 0.41], ); @@ -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}) { @@ -987,6 +994,9 @@ if ($type eq "msg") { my ($msg, @kw) = split /\x00/, $msg; + + utf8::decode $_ for ($msg, @kw); + $self->{kw}{$_} = 1 for @kw; $msg = "\n" . CFClient::UI::Label::escape $msg; @@ -1023,9 +1033,11 @@ sub send { my ($self, $msg) = @_; - $self->{conn}->send ("ext npc_dialog_tell $self->{token} $msg"); $self->{textview}->add_paragraph ([1, 1, 0, 1], "\n" . CFClient::UI::Label::escape $msg); $self->{textview}->scroll_to_bottom; + + utf8::encode $msg; + $self->{conn}->send ("ext npc_dialog_tell $self->{token} $msg"); } sub destroy {