… | |
… | |
569 | } |
569 | } |
570 | |
570 | |
571 | $::INVR->set_items ($conn->{container}{$tag}); |
571 | $::INVR->set_items ($conn->{container}{$tag}); |
572 | } |
572 | } |
573 | |
573 | |
574 | sub update_container { |
|
|
575 | my ($tag) = @_; |
|
|
576 | |
|
|
577 | $::INVR->set_items ($::CONN->{container}{$::CONN->{open_container}}) |
|
|
578 | if $tag == $::CONN->{open_container}; |
|
|
579 | } |
|
|
580 | |
|
|
581 | sub container_add { |
|
|
582 | my ($self, $tag, $items) = @_; |
|
|
583 | |
|
|
584 | $self->{update_container}{$tag}++; |
|
|
585 | $self->update_containers; |
|
|
586 | } |
|
|
587 | |
|
|
588 | sub update_containers { |
574 | sub update_containers { |
589 | my ($self) = @_; |
575 | my ($self) = @_; |
590 | |
576 | |
591 | $CFClient::UI::ROOT->on_refresh ("update_containers_$self" => sub { |
577 | $CFClient::UI::ROOT->on_refresh ("update_containers_$self" => sub { |
|
|
578 | # TODO: scara had a bug where $self->{uipdate_container} was not defined |
|
|
579 | # but this should not possibly happen? |
592 | for my $tag (keys %{ delete $self->{update_container} }) { |
580 | for my $tag (keys %{ delete $self->{update_container} }) { |
593 | if ($tag == 0) { |
581 | if ($tag == 0) { |
594 | update_floorbox; |
582 | update_floorbox; |
595 | update_container (0); |
583 | $::INVR->set_items ($self->{container}{0}) |
|
|
584 | if $tag == $self->{open_container}; |
596 | } elsif ($tag == $self->{player}{tag}) { |
585 | } elsif ($tag == $self->{player}{tag}) { |
597 | $::INV->set_items ($self->{container}{$tag}) |
586 | $::INV->set_items ($self->{container}{$tag}) |
598 | } else { |
587 | } else { |
599 | update_container ($tag); |
588 | $::INVR->set_items ($self->{container}{$tag}) |
|
|
589 | if $tag == $self->{open_container}; |
600 | } |
590 | } |
601 | } |
591 | } |
602 | }); |
592 | }); |
|
|
593 | } |
|
|
594 | |
|
|
595 | sub container_add { |
|
|
596 | my ($self, $tag, $items) = @_; |
|
|
597 | |
|
|
598 | $self->{update_container}{$tag}++; |
|
|
599 | $self->update_containers; |
603 | } |
600 | } |
604 | |
601 | |
605 | sub container_clear { |
602 | sub container_clear { |
606 | my ($self, $tag) = @_; |
603 | my ($self, $tag) = @_; |
607 | |
604 | |