--- deliantra/Deliantra-Client/DC/Protocol.pm 2006/07/23 08:58:44 1.64 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2006/07/23 16:48:48 1.66 @@ -7,6 +7,7 @@ use CFClient; use CFClient::UI; +use CFClient::Pod; use base 'Crossfire::Protocol::Base'; @@ -17,7 +18,7 @@ $self->{map_widget}->clr_commands; - my $cmd_help = CFClient::load_pod CFClient::find_rcfile "pod/command_help.pod", command_help => 1, sub { + my $cmd_help = CFClient::Pod::load CFClient::find_rcfile "pod/command_help.pod", command_help => 1, sub { my ($pom) = @_; my @cmd_help; @@ -33,7 +34,7 @@ $_ = $_ eq ".*" ? "" : " $_" for @args; - my $text = CFClient::pod_to_pango $head2->content; + my $text = CFClient::Pod::as_xml $head2->content; push @cmd_help, ["$cmd$_", $text] for sort { (length $a) <=> (length $b) } @@ -262,7 +263,7 @@ $sktbl->add (4, 0, new CFClient::UI::Label text => "Lvl.", align => 1); $sktbl->add (5, 0, new CFClient::UI::Label text => "Skill", expand => 1); - my ($x, $y) = (1, 0); + my ($x, $y) = (0, 1); for ( sort { $stats->{$b->[0]}[1] <=> $stats->{$a->[0]}[1] or $a->[1] cmp $b->[1] } map [$_, $self->{skill_info}{$_}], @@ -599,7 +600,7 @@ # try to create single paragraphs of multiple lines sent by the server $text =~ s/(?<=\S)\n(?=\w)/ /g; - $text = CFClient::UI::Label::escape $text; + $text = CFClient::asxml $text; $text =~ s/\[b\](.*?)\[\/b\]/\1<\/b>/g; $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/\2<\/span>/g; @@ -624,15 +625,15 @@ sub spell_add { my ($self, $spell) = @_; - # try to create single paragraphs of multiple lines sent by the server + # try to create single paragraphs out of the multiple lines sent by the server $spell->{message} =~ s/(?<=\S)\n(?=\w)/ /g; $spell->{message} =~ s/\n+$//; $spell->{message} ||= "Server did not provide a description for this spell."; $::SPELL_PAGE->add_spell ($spell); - $self->{map_widget}->add_command ("invoke $spell->{name}", CFClient::UI::Label::escape $spell->{message}); - $self->{map_widget}->add_command ("cast $spell->{name}", CFClient::UI::Label::escape $spell->{message}); + $self->{map_widget}->add_command ("invoke $spell->{name}", CFClient::asxml $spell->{message}); + $self->{map_widget}->add_command ("cast $spell->{name}", CFClient::asxml $spell->{message}); } sub spell_delete { @@ -644,13 +645,13 @@ sub addme_success { my ($self) = @_; - my $skill_help = CFClient::load_pod CFClient::find_rcfile "pod/skill_help.pod", skill_help => 1, sub { + my $skill_help = CFClient::Pod::load CFClient::find_rcfile "pod/skill_help.pod", skill_help => 1, sub { my ($pom) = @_; my %skill_help; for my $head2 ($pom->head1->[3]->head2) { - $skill_help{$head2->title} = CFClient::pod_to_pango $head2->content; + $skill_help{$head2->title} = CFClient::Pod::as_xml $head2->content; } \%skill_help @@ -658,10 +659,10 @@ for my $skill (values %{$self->{skill_info}}) { $self->{map_widget}->add_command ("ready_skill $skill", - (CFClient::UI::Label::escape "Ready the skill '$skill'\n\n") + (CFClient::asxml "Ready the skill '$skill'\n\n") . $skill_help->{$skill}); $self->{map_widget}->add_command ("use_skill $skill", - (CFClient::UI::Label::escape "Immediately use the skill '$skill'\n\n") + (CFClient::asxml "Immediately use the skill '$skill'\n\n") . $skill_help->{$skill}); } } @@ -696,14 +697,14 @@ $self->send ("requestinfo image_sums $face $face"); - $self->{statusbox}->add (CFClient::UI::Label::escape "prefetching $todo", + $self->{statusbox}->add (CFClient::asxml "prefetching $todo", group => "prefetch", timeout => 3, fg => [1, 1, 0, 0.5]); } elsif (!exists $self->{num_faces}) { $self->send ("requestinfo image_info"); $self->{num_faces} = 0; - $self->{statusbox}->add (CFClient::UI::Label::escape "starting to prefetch", + $self->{statusbox}->add (CFClient::asxml "starting to prefetch", group => "prefetch", timeout => 3, fg => [1, 1, 0, 0.5]); } } @@ -1014,7 +1015,7 @@ $self->{kw}{$_} = 1 for @kw; - $msg = "\n" . CFClient::UI::Label::escape $msg; + $msg = "\n" . CFClient::UI::asxml $msg; my $match = join "|", map "\\b\Q$_\E\\b", sort { (length $b) <=> (length $a) } keys %{ $self->{kw} }; my @link; $msg =~ s{ @@ -1048,7 +1049,7 @@ sub send { my ($self, $msg) = @_; - $self->{textview}->add_paragraph ([1, 1, 0, 1], "\n" . CFClient::UI::Label::escape $msg); + $self->{textview}->add_paragraph ([1, 1, 0, 1], "\n" . CFClient::asxml $msg); $self->{textview}->scroll_to_bottom; utf8::encode $msg;