]> www.fi.muni.cz Git - slotcarman.git/blobdiff - SCX/Track.pm
Highlight the best lap
[slotcarman.git] / SCX / Track.pm
index 6ed3d822581242fb96e88dc86d7c9f3b626196e3..097dde88cf565be597ed55bfda6b069f6b44956d 100644 (file)
@@ -145,8 +145,8 @@ sub print_rounds {
        $self->{gui}->rounds($msg);
 }
 
-sub check_best_lap {
-       my ($self, $time, $who) = @_;
+sub notify_best_lap {
+       my ($self, $id, $time, $who) = @_;
 
        return if !defined $time || $time == 0;
 
@@ -157,6 +157,11 @@ sub check_best_lap {
                || $time < $self->{best_lap}) {
                $self->{best_lap} = $time;
                $self->{gui}->best_lap($time, $who);
+
+               for my $car (0..5) {
+                       $self->car($car)->set_global_best($car == $id);
+                       $self->car($car)->print_best_lap;
+               }
                return 1;
        }
        return 0;