… | |
… | |
628 | [0.75, 0.61, 0.20], |
628 | [0.75, 0.61, 0.20], |
629 | [0.99, 0.77, 0.26], |
629 | [0.99, 0.77, 0.26], |
630 | [0.74, 0.65, 0.41], |
630 | [0.74, 0.65, 0.41], |
631 | ); |
631 | ); |
632 | |
632 | |
|
|
633 | my $fg = $color[$color % @color]; |
|
|
634 | |
633 | $self->logprint ("info: ", $text); |
635 | $self->logprint ("info: ", $text); |
634 | |
636 | |
635 | # try to create single paragraphs of multiple lines sent by the server |
637 | # try to create single paragraphs of multiple lines sent by the server |
636 | $text =~ s/(?<=\S)\n(?=\w)/ /g; |
638 | $text =~ s/(?<=\S)\n(?=\w)/ /g; |
637 | |
639 | |
638 | $text = CFPlus::asxml $text; |
640 | $text = CFPlus::asxml $text; |
639 | $text =~ s/\[b\](.*?)\[\/b\]/<b>\1<\/b>/g; |
641 | $text =~ s/\[b\](.*?)\[\/b\]/<b>\1<\/b>/g; |
640 | $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g; |
642 | $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g; |
641 | |
643 | |
642 | ::message ({ fg => $color[$color], markup => $_ }) |
644 | ::message ({ fg => $fg, markup => $_ }) |
643 | for split /\n/, $text; |
645 | for split /\n/, $text; |
644 | |
646 | |
645 | $self->{statusbox}->add ($text, |
647 | $self->{statusbox}->add ($text, |
646 | group => $text, |
648 | group => $text, |
647 | fg => $color[$color], |
649 | fg => $fg, |
648 | timeout => $color >= 2 ? 180 : 10, |
650 | timeout => $color >= 2 ? 180 : 10, |
649 | tooltip_font => $::FONT_FIXED, |
651 | tooltip_font => $::FONT_FIXED, |
650 | ); |
652 | ); |
651 | } |
653 | } |
652 | |
654 | |