ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Protocol.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Protocol.pm (file contents):
Revision 1.40 by root, Fri Jun 23 20:28:20 2006 UTC vs.
Revision 1.41 by root, Fri Jun 23 22:35:16 2006 UTC

818 818
819 if ($type eq "msg") { 819 if ($type eq "msg") {
820 my ($msg, @kw) = split /\x00/, $msg; 820 my ($msg, @kw) = split /\x00/, $msg;
821 $self->{kw}{$_} = 1 for @kw; 821 $self->{kw}{$_} = 1 for @kw;
822 822
823 $msg = CFClient::UI::Label::escape $msg; 823 $msg = "\n" . CFClient::UI::Label::escape $msg;
824 my $match = join "|", map "\\b\Q$_\E\\b", sort { (length $b) <=> (length $a) } keys %{ $self->{kw} }; 824 my $match = join "|", map "\\b\Q$_\E\\b", sort { (length $b) <=> (length $a) } keys %{ $self->{kw} };
825 $msg =~ s/($match)/<span foreground='#c0c0ff' underline='none'>$1<\/span>/gi; # underline when http-ready, huh. 825 my @link;
826 $msg =~ s{
827 ($match)
828 }{
829 push @link, new CFClient::UI::Label
830 markup => "<span foreground='#c0c0ff' underline='single'>$1</span>",
831 can_hover => 1,
832 can_events => 1;
833
834 chr 0xfffc
835 }giex;
826 836
827 $self->{textview}->add_paragraph ([1, 1, 1, 1], "\n$msg"); 837 $self->{textview}->add_paragraph ([1, 1, 1, 1], [$msg, @link]);
828 $self->update_options; 838 $self->update_options;
829 } else { 839 } else {
830 $self->destroy; 840 $self->destroy;
831 } 841 }
832 842

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines