… | |
… | |
651 | |
651 | |
652 | sub update_containers { |
652 | sub update_containers { |
653 | my ($self) = @_; |
653 | my ($self) = @_; |
654 | |
654 | |
655 | $CFClient::UI::ROOT->on_refresh ("update_containers_$self" => sub { |
655 | $CFClient::UI::ROOT->on_refresh ("update_containers_$self" => sub { |
656 | for my $tag (keys %{ delete $self->{update_container} }) { |
656 | my $todo = delete $self->{update_container} |
|
|
657 | or return; |
|
|
658 | |
|
|
659 | for my $tag (keys %$todo) { |
657 | if ($tag == 0) { |
660 | if ($tag == 0) { |
658 | update_floorbox; |
661 | update_floorbox; |
659 | $::INVR->set_items ($self->{container}{0}) |
662 | $::INVR->set_items ($self->{container}{0}) |
660 | if $tag == $self->{open_container}; |
663 | if $tag == $self->{open_container}; |
661 | } elsif ($tag == $self->{player}{tag}) { |
664 | } elsif ($tag == $self->{player}{tag}) { |
… | |
… | |
705 | set_opencont ($::CONN, $item->{tag}, CFClient::Item::desc_string $item); |
708 | set_opencont ($::CONN, $item->{tag}, CFClient::Item::desc_string $item); |
706 | |
709 | |
707 | } else { |
710 | } else { |
708 | $self->{update_container}{$item->{container}}++; |
711 | $self->{update_container}{$item->{container}}++; |
709 | $self->update_containers; |
712 | $self->update_containers; |
710 | # if ($item->{container} == 0) { |
|
|
711 | # update_floorbox; |
|
|
712 | # update_container (0); |
|
|
713 | # } elsif ($item->{container} == $self->{player}{tag}) { |
|
|
714 | # $::INV->set_items ($self->{container}{$item->{container}}) |
|
|
715 | # } |
|
|
716 | } |
713 | } |
717 | } |
714 | } |
718 | |
715 | |
719 | sub player_update { |
716 | sub player_update { |
720 | my ($self, $player) = @_; |
717 | my ($self, $player) = @_; |