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.87 by root, Tue Nov 7 22:41:27 2006 UTC vs.
Revision 1.90 by root, Wed Dec 6 00:15:12 2006 UTC

288 if ($ev->{button} == 1) { 288 if ($ev->{button} == 1) {
289 $::CONN->user_send ("ready_skill $name"); 289 $::CONN->user_send ("ready_skill $name");
290 } elsif ($ev->{button} == 2) { 290 } elsif ($ev->{button} == 2) {
291 $::CONN->user_send ("use_skill $name"); 291 $::CONN->user_send ("use_skill $name");
292 } elsif ($ev->{button} == 3) { 292 } elsif ($ev->{button} == 3) {
293 my $shortname = CFPlus::shorten $name, 14;
293 (new CFPlus::UI::Menu 294 (new CFPlus::UI::Menu
294 items => [ 295 items => [
295 ["bind <i>ready_skill $name</i> to a key" => sub { $::BIND_EDITOR->do_quick_binding (["ready_skill $name"]) }], 296 ["bind <i>ready_skill $shortname</i> to a key" => sub { $::BIND_EDITOR->do_quick_binding (["ready_skill $name"]) }],
296 ["bind <i>use_skill $name</i> to a key" => sub { $::BIND_EDITOR->do_quick_binding (["use_skill $name"]) }], 297 ["bind <i>use_skill $shortname</i> to a key" => sub { $::BIND_EDITOR->do_quick_binding (["use_skill $name"]) }],
297 ], 298 ],
298 )->popup ($ev); 299 )->popup ($ev);
299 } else { 300 } else {
300 return 0; 301 return 0;
301 } 302 }
656 # try to create single paragraphs out of the multiple lines sent by the server 657 # try to create single paragraphs out of the multiple lines sent by the server
657 $spell->{message} =~ s/(?<=\S)\n(?=\w)/ /g; 658 $spell->{message} =~ s/(?<=\S)\n(?=\w)/ /g;
658 $spell->{message} =~ s/\n+$//; 659 $spell->{message} =~ s/\n+$//;
659 $spell->{message} ||= "Server did not provide a description for this spell."; 660 $spell->{message} ||= "Server did not provide a description for this spell.";
660 661
661 $::SPELL_PAGE->add_spell ($spell); 662 $::SPELL_LIST->add_spell ($spell);
662 663
663 $self->{map_widget}->add_command ("invoke $spell->{name}", CFPlus::asxml $spell->{message}); 664 $self->{map_widget}->add_command ("invoke $spell->{name}", CFPlus::asxml $spell->{message});
664 $self->{map_widget}->add_command ("cast $spell->{name}", CFPlus::asxml $spell->{message}); 665 $self->{map_widget}->add_command ("cast $spell->{name}", CFPlus::asxml $spell->{message});
665} 666}
666 667
667sub spell_delete { 668sub spell_delete {
668 my ($self, $spell) = @_; 669 my ($self, $spell) = @_;
669 670
670 $::SPELL_PAGE->remove_spell ($spell); 671 $::SPELL_LIST->remove_spell ($spell);
671} 672}
672 673
673sub setup { 674sub setup {
674 my ($self, $setup) = @_; 675 my ($self, $setup) = @_;
675 676
893 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" 894 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n"
894 . "cfplus support $yesno[$self->{cfplus_ext} > 0]" 895 . "cfplus support $yesno[$self->{cfplus_ext} > 0]"
895 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" 896 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n"
896 . "map size $self->{mapw}×$self->{maph}\n" 897 . "map size $self->{mapw}×$self->{maph}\n"
897 ); 898 );
899
900 ::setup_build_button ($self->{editor_support}->{builder_ui});
898} 901}
899 902
900sub logged_in { 903sub logged_in {
901 my ($self) = @_; 904 my ($self) = @_;
902 905
919 $self->update_server_info; 922 $self->update_server_info;
920 923
921 $self->send_command ("output-sync $::CFG->{output_sync}"); 924 $self->send_command ("output-sync $::CFG->{output_sync}");
922 $self->send_command ("output-count $::CFG->{output_count}"); 925 $self->send_command ("output-count $::CFG->{output_count}");
923 $self->send_command ("pickup $::CFG->{pickup}"); 926 $self->send_command ("pickup $::CFG->{pickup}");
927}
928
929sub buildat {
930 my ($self, $builditem, $x, $y) = @_;
931
932 if ($self->{cfplus_ext}) {
933 $self->send_ext_msg (builder_build => dx => $x, dy => $y, (ref ($builditem) eq 'HASH') ? %$builditem : (item => $builditem));
934 }
924} 935}
925 936
926sub lookat { 937sub lookat {
927 my ($self, $x, $y) = @_; 938 my ($self, $x, $y) = @_;
928 939

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines