… | |
… | |
1921 | sub realloc { |
1921 | sub realloc { |
1922 | my ($self) = @_; |
1922 | my ($self) = @_; |
1923 | |
1923 | |
1924 | delete $self->{ox}; |
1924 | delete $self->{ox}; |
1925 | $self->SUPER::realloc; |
1925 | $self->SUPER::realloc; |
|
|
1926 | } |
|
|
1927 | |
|
|
1928 | sub clear { |
|
|
1929 | my ($self) = @_; |
|
|
1930 | |
|
|
1931 | $self->set_text (""); |
1926 | } |
1932 | } |
1927 | |
1933 | |
1928 | sub set_text { |
1934 | sub set_text { |
1929 | my ($self, $text) = @_; |
1935 | my ($self, $text) = @_; |
1930 | |
1936 | |
… | |
… | |
3583 | |
3589 | |
3584 | if (my $anim = $::CONN->{anim}[$self->{anim}]) { |
3590 | if (my $anim = $::CONN->{anim}[$self->{anim}]) { |
3585 | if ($anim && @$anim) { |
3591 | if ($anim && @$anim) { |
3586 | delete $self->{wait_face}; |
3592 | delete $self->{wait_face}; |
3587 | $self->{face} = $anim->[ $self->{frame} % @$anim ]; |
3593 | $self->{face} = $anim->[ $self->{frame} % @$anim ]; |
3588 | $self->{tex} = $::CONN->{texture}[ $::CONN->{faceid}[$self->{face}] ]; |
3594 | if (my $tex = $self->{tex} = $::CONN->{texture}[ $::CONN->{faceid}[$self->{face}] ]) { |
|
|
3595 | unless ($tex->{name} || $tex->{loading}) { |
|
|
3596 | $tex->upload (sub { $self->reconfigure }); |
|
|
3597 | } |
|
|
3598 | } |
3589 | } |
3599 | } |
3590 | } |
3600 | } |
3591 | } |
3601 | } |
3592 | |
3602 | |
3593 | sub size_request { |
3603 | sub size_request { |
3594 | my ($self) = @_; |
3604 | my ($self) = @_; |
3595 | |
3605 | |
3596 | if ($::CONN) { |
3606 | if ($::CONN) { |
3597 | if (my $faceid = $::CONN->{faceid}[$self->{face}]) { |
3607 | if (my $faceid = $::CONN->{faceid}[$self->{face}]) { |
3598 | if (my $tex = $::CONN->{texture}[$faceid]) { |
3608 | if (my $tex = $self->{tex} = $::CONN->{texture}[$faceid]) { |
3599 | $self->{tex} = $tex; |
3609 | if ($tex->{name}) { |
3600 | return ($self->{size_w} || $tex->{w}, $self->{size_h} || $tex->{h}); |
3610 | return ($self->{size_w} || $tex->{w}, $self->{size_h} || $tex->{h}); |
|
|
3611 | } elsif (!$tex->{loading}) { |
|
|
3612 | $tex->upload (sub { $self->reconfigure }); |
|
|
3613 | } |
3601 | } else { |
3614 | } else { |
3602 | $self->{wait_face} ||= $::CONN->connect_face_update ($faceid, sub { |
3615 | $self->{wait_face} ||= $::CONN->connect_face_update ($faceid, sub { |
3603 | $self->realloc; |
3616 | $self->reconfigure; |
3604 | }); |
3617 | }); |
3605 | } |
3618 | } |
3606 | } |
3619 | } |
3607 | } |
3620 | } |
3608 | |
3621 | |
… | |
… | |
4193 | } |
4206 | } |
4194 | |
4207 | |
4195 | sub update { |
4208 | sub update { |
4196 | my ($self) = @_; |
4209 | my ($self) = @_; |
4197 | |
4210 | |
4198 | $::WANT_REFRESH++; |
4211 | $::WANT_REFRESH->start; |
4199 | } |
4212 | } |
4200 | |
4213 | |
4201 | sub add { |
4214 | sub add { |
4202 | my ($self, @children) = @_; |
4215 | my ($self, @children) = @_; |
4203 | |
4216 | |