--- deliantra/Deliantra-Client/DC/Protocol.pm 2008/03/25 19:28:54 1.191 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2008/05/08 21:30:23 1.196 @@ -66,6 +66,11 @@ $_->destroy for values %{delete $ws->{w} || {}}; } + + delete $self->{items}; + $::INV->clear; + $::INVR_HB->clear; + $::FLOORBOX->clear; }); $self->{map_widget}->add_command (@$_) @@ -1028,6 +1033,8 @@ s/(.*?)<\/fg>/$2<\/span>/gs; s/(.*?)<\/fg>/$2<\/span>/gs; + s/\s+$//; + $_ } @@ -1172,7 +1179,8 @@ my @add; my $row; - for (sort { $a->{count} <=> $b->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { + for (sort { $b->{count} <=> $a->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { + next if $_->{tag} & 0x80000000; if ($row < 6) { local $_->{face_widget}; # hack to force recreation of widget local $_->{desc_widget}; # hack to force recreation of widget @@ -1209,7 +1217,7 @@ $conn->{open_container} = $tag; update_floorbox; - $::INVR_HB->clear (); + $::INVR_HB->clear; $::INVR_HB->add (new DC::UI::Label expand => 1, text => $name); if ($tag != 0) { # Floor isn't closable, is it? @@ -1275,10 +1283,10 @@ sub item_update { my ($self, $item) = @_; - #d# print "item_update: $item->{tag} in $item->{container} ($self->{player}{tag}) ($::CONN->{open_container})\n"; + #print "item_update: $item->{tag} in $item->{container} pt($self->{player}{tag}) oc($::CONN->{open_container}) f($item->{flags})\n"; DC::Item::update_widgets $item; - + if ($item->{tag} == $::CONN->{open_container} && not ($item->{flags} & F_OPEN)) { set_opencont ($::CONN, 0, "Floor"); @@ -1468,7 +1476,7 @@ $self->{options}->clear; $self->{options}->add ($self->{bye_button}); - for my $kw (sort keys %{ $self->[DC::Pod::N_KW] }) { + for my $kw (sort keys %{ $self->{kw} }) { $self->{options}->add (new DC::UI::Button text => $kw, on_activate => sub { @@ -1487,12 +1495,12 @@ if ($type eq "update") { my (%info) = @arg; - $self->[DC::Pod::N_KW]{$_} = 1 for @{$info{add_topics} || []}; - $self->[DC::Pod::N_KW]{$_} = 0 for @{$info{del_topics} || []}; + $self->{kw}{$_} = 1 for @{$info{add_topics} || []}; + $self->{kw}{$_} = 0 for @{$info{del_topics} || []}; if (exists $info{msg}) { my $text = "\n" . DC::Protocol::sanitise_xml $info{msg}; - my $match = join "|", map "\\b\Q$_\E\\b", sort { (length $b) <=> (length $a) } keys %{ $self->[DC::Pod::N_KW] }; + my $match = join "|", map "\\b\Q$_\E\\b", sort { (length $b) <=> (length $a) } keys %{ $self->{kw} }; my @link; $text =~ s{ ($match)