… | |
… | |
25 | |
25 | |
26 | my $cmd = $1; |
26 | my $cmd = $1; |
27 | my @args = split /\|/, $2; |
27 | my @args = split /\|/, $2; |
28 | @args = (".*") unless @args; |
28 | @args = (".*") unless @args; |
29 | |
29 | |
|
|
30 | $_ = $_ eq ".*" ? "" : " $_" |
|
|
31 | for @args; |
|
|
32 | |
30 | my $text = CFClient::pod_to_pango $head2->content; |
33 | my $text = CFClient::pod_to_pango $head2->content; |
31 | |
34 | |
32 | for my $arg (@args) { |
|
|
33 | $arg = $arg eq ".*" ? "" : " $arg"; |
|
|
34 | |
|
|
35 | $self->{map_widget}->add_command ("$cmd$arg", $text); |
35 | $self->{map_widget}->add_command ("$cmd$_", $text) |
36 | } |
36 | for sort { (length $a) <=> (length $b) } |
|
|
37 | @args; |
37 | } |
38 | } |
38 | |
39 | |
39 | $self->{noface} = new_from_file CFClient::Texture |
40 | $self->{noface} = new_from_file CFClient::Texture |
40 | CFClient::find_rcfile "noface.png", minify => 1, mipmap => 1; |
41 | CFClient::find_rcfile "noface.png", minify => 1, mipmap => 1; |
41 | |
42 | |
… | |
… | |
54 | sub stats_update { |
55 | sub stats_update { |
55 | my ($self, $stats) = @_; |
56 | my ($self, $stats) = @_; |
56 | |
57 | |
57 | if (my $exp = $stats->{+CS_STAT_EXP64}) { |
58 | if (my $exp = $stats->{+CS_STAT_EXP64}) { |
58 | my $diff = $exp - $self->{prev_exp}; |
59 | my $diff = $exp - $self->{prev_exp}; |
59 | $::STATUSBOX->add ("$diff experience gained", group => "experience $diff", fg => [0.5, 1, 0.5, 0.8], timeout => 5) |
60 | $self->{statusbox}->add ("$diff experience gained", group => "experience $diff", fg => [0.5, 1, 0.5, 0.8], timeout => 5) |
60 | if exists $self->{prev_exp} && $diff; |
61 | if exists $self->{prev_exp} && $diff; |
61 | $self->{prev_exp} = $exp; |
62 | $self->{prev_exp} = $exp; |
62 | } |
63 | } |
63 | |
64 | |
64 | ::update_stats_window ($stats); |
65 | ::update_stats_window ($stats); |
… | |
… | |
407 | $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g; |
408 | $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g; |
408 | |
409 | |
409 | $self->{logview}->add_paragraph ($color[$color], |
410 | $self->{logview}->add_paragraph ($color[$color], |
410 | join "\n", map "$time $_", split /\n/, $text); |
411 | join "\n", map "$time $_", split /\n/, $text); |
411 | |
412 | |
412 | $::STATUSBOX->add ($text, |
413 | $self->{statusbox}->add ($text, |
413 | group => $text, |
414 | group => $text, |
414 | fg => $color[$color], |
415 | fg => $color[$color], |
415 | timeout => 10, |
416 | timeout => 10, |
416 | tooltip_font => $::FONT_FIXED, |
417 | tooltip_font => $::FONT_FIXED, |
417 | ); |
418 | ); |
… | |
… | |
489 | |
490 | |
490 | my ($face) = splice @{ $self->{face_prefetch} }, + rand @{ $self->{face_prefetch} }, 1, (); |
491 | my ($face) = splice @{ $self->{face_prefetch} }, + rand @{ $self->{face_prefetch} }, 1, (); |
491 | |
492 | |
492 | $self->send ("requestinfo image_sums $face $face"); |
493 | $self->send ("requestinfo image_sums $face $face"); |
493 | |
494 | |
494 | $::STATUSBOX->add (CFClient::UI::Label::escape "prefetching $todo", |
495 | $self->{statusbox}->add (CFClient::UI::Label::escape "prefetching $todo", |
495 | group => "prefetch", timeout => 2, fg => [1, 1, 0, 0.5]); |
496 | group => "prefetch", timeout => 2, fg => [1, 1, 0, 0.5]); |
496 | } elsif (!exists $self->{num_faces}) { |
497 | } elsif (!exists $self->{num_faces}) { |
497 | $self->send ("requestinfo image_info"); |
498 | $self->send ("requestinfo image_info"); |
498 | |
499 | |
499 | $self->{num_faces} = 0; |
500 | $self->{num_faces} = 0; |
500 | |
501 | |
501 | $::STATUSBOX->add (CFClient::UI::Label::escape "starting to prefetch", |
502 | $self->{statusbox}->add (CFClient::UI::Label::escape "starting to prefetch", |
502 | group => "prefetch", timeout => 2, fg => [1, 1, 0, 0.5]); |
503 | group => "prefetch", timeout => 2, fg => [1, 1, 0, 0.5]); |
503 | } |
504 | } |
504 | } |
505 | } |
505 | |
506 | |
506 | sub update_floorbox { |
507 | sub update_floorbox { |