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.66 by root, Sun Jul 23 16:48:48 2006 UTC vs.
Revision 1.67 by root, Mon Jul 24 08:23:28 2006 UTC

32 @args = (".*") unless @args; 32 @args = (".*") unless @args;
33 33
34 $_ = $_ eq ".*" ? "" : " $_" 34 $_ = $_ eq ".*" ? "" : " $_"
35 for @args; 35 for @args;
36 36
37 my $text = CFClient::Pod::as_xml $head2->content; 37 my $text = CFClient::Pod::as_markup $head2->content;
38 38
39 push @cmd_help, ["$cmd$_", $text] 39 push @cmd_help, ["$cmd$_", $text]
40 for sort { (length $a) <=> (length $b) } 40 for sort { (length $a) <=> (length $b) }
41 @args; 41 @args;
42 } 42 }
602 602
603 $text = CFClient::asxml $text; 603 $text = CFClient::asxml $text;
604 $text =~ s/\[b\](.*?)\[\/b\]/<b>\1<\/b>/g; 604 $text =~ s/\[b\](.*?)\[\/b\]/<b>\1<\/b>/g;
605 $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g; 605 $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g;
606 606
607 $self->{logview}->add_paragraph ($color[$color], $_) 607 $self->{logview}->add_paragraph ({ fg => $color[$color], markup => $_ })
608 for map "<span foreground='#ffffff'>$time</span> $_", split /\n/, $text; 608 for map "<span foreground='#ffffff'>$time</span> $_", split /\n/, $text;
609 $self->{logview}->scroll_to_bottom; 609 $self->{logview}->scroll_to_bottom;
610 610
611 $self->{statusbox}->add ($text, 611 $self->{statusbox}->add ($text,
612 group => $text, 612 group => $text,
649 my ($pom) = @_; 649 my ($pom) = @_;
650 650
651 my %skill_help; 651 my %skill_help;
652 652
653 for my $head2 ($pom->head1->[3]->head2) { 653 for my $head2 ($pom->head1->[3]->head2) {
654 $skill_help{$head2->title} = CFClient::Pod::as_xml $head2->content; 654 $skill_help{$head2->title} = CFClient::Pod::as_markup $head2->content;
655 } 655 }
656 656
657 \%skill_help 657 \%skill_help
658 }; 658 };
659 659
974 $self->{conn}->connect_ext ($self->{token} => sub { $this->feed (@_) }); 974 $self->{conn}->connect_ext ($self->{token} => sub { $this->feed (@_) });
975 $self->{conn}->send ("ext npc_dialog_begin $self->{token} $self->{dx} $self->{dy}"); 975 $self->{conn}->send ("ext npc_dialog_begin $self->{token} $self->{dx} $self->{dy}");
976 976
977 $self->{entry}->grab_focus; 977 $self->{entry}->grab_focus;
978 978
979 $self->{textview}->add_paragraph ([1, 1, 0, 1], "<small>[starting conversation with <b>$self->{title}</b>]</small>\n\n"); 979 $self->{textview}->add_paragraph ({
980 fg => [1, 1, 0, 1],
981 markup => "<small>[starting conversation with <b>$self->{title}</b>]</small>\n\n",
982 });
980 983
981 $self->show; 984 $self->show;
982 $self 985 $self
983}; 986};
984 987
1034 }; 1037 };
1035 1038
1036 chr 0xfffc 1039 chr 0xfffc
1037 }giex; 1040 }giex;
1038 1041
1039 $self->{textview}->add_paragraph ([1, 1, 1, 1], [$msg, @link]); 1042 $self->{textview}->add_paragraph ({ markup => $msg, widget => \@link });
1040 $self->{textview}->scroll_to_bottom; 1043 $self->{textview}->scroll_to_bottom;
1041 $self->update_options; 1044 $self->update_options;
1042 } else { 1045 } else {
1043 $self->destroy; 1046 $self->destroy;
1044 } 1047 }
1047} 1050}
1048 1051
1049sub send { 1052sub send {
1050 my ($self, $msg) = @_; 1053 my ($self, $msg) = @_;
1051 1054
1052 $self->{textview}->add_paragraph ([1, 1, 0, 1], "\n" . CFClient::asxml $msg); 1055 $self->{textview}->add_paragraph ({ markup => "\n" . CFClient::asxml $msg });
1053 $self->{textview}->scroll_to_bottom; 1056 $self->{textview}->scroll_to_bottom;
1054 1057
1055 utf8::encode $msg; 1058 utf8::encode $msg;
1056 $self->{conn}->send ("ext npc_dialog_tell $self->{token} $msg"); 1059 $self->{conn}->send ("ext npc_dialog_tell $self->{token} $msg");
1057} 1060}
1066 $self->{conn}->disconnect_ext ($self->{token}); 1069 $self->{conn}->disconnect_ext ($self->{token});
1067 1070
1068 $self->SUPER::destroy; 1071 $self->SUPER::destroy;
1069} 1072}
1070 1073
10711; 10741

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines