--- deliantra/Deliantra-Client/DC/UI.pm 2007/08/19 10:32:49 1.427 +++ deliantra/Deliantra-Client/DC/UI.pm 2007/08/21 00:59:34 1.429 @@ -2655,6 +2655,12 @@ ); } +sub invoke_button_down { + my ($self, $ev, $x, $y) = @_; + + 1 +} + sub invoke_button_up { my ($self, $ev, $x, $y) = @_; @@ -3592,15 +3598,16 @@ sub update_face { my ($self) = @_; - return unless $::CONN; - - if (my $anim = $::CONN->{anim}[$self->{anim}]) { - if ($anim && @$anim) { - delete $self->{wait_face}; - $self->{face} = $anim->[ $self->{frame} % @$anim ]; - if (my $tex = $self->{tex} = $::CONN->{texture}[ $::CONN->{faceid}[$self->{face}] ]) { - unless ($tex->{name} || $tex->{loading}) { - $tex->upload (sub { $self->reconfigure }); + if ($::CONN) { + if (my $anim = $::CONN->{anim}[$self->{anim}]) { + if ($anim && @$anim) { + $self->{face} = $anim->[ $self->{frame} % @$anim ]; + delete $self->{face_change_cb}; + + if (my $tex = $self->{tex} = $::CONN->{texture}[ $::CONN->{face}[$self->{face}]{id} ]) { + unless ($tex->{name} || $tex->{loading}) { + $tex->upload (sub { $self->reconfigure }); + } } } } @@ -3611,18 +3618,16 @@ my ($self) = @_; if ($::CONN) { - if (my $faceid = $::CONN->{faceid}[$self->{face}]) { + if (my $faceid = $::CONN->{face}[$self->{face}]{id}) { if (my $tex = $self->{tex} = $::CONN->{texture}[$faceid]) { if ($tex->{name}) { return ($self->{size_w} || $tex->{w}, $self->{size_h} || $tex->{h}); } elsif (!$tex->{loading}) { $tex->upload (sub { $self->reconfigure }); } - } else { - $self->{wait_face} ||= $::CONN->connect_face_update ($faceid, sub { - $self->reconfigure; - }); } + + $self->{face_change_cb} ||= $::CONN->on_face_change ($self->{face}, sub { $self->reconfigure }); } }