ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/pclient
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/pclient (file contents):
Revision 1.120 by root, Mon Apr 17 07:51:24 2006 UTC vs.
Revision 1.124 by root, Mon Apr 17 19:50:23 2006 UTC

300 300
301sub message_window { 301sub message_window {
302 my $window = new CFClient::UI::FancyFrame 302 my $window = new CFClient::UI::FancyFrame
303 border_bg => [1, 1, 1, 0.5], 303 border_bg => [1, 1, 1, 0.5],
304 bg => [0.3, 0.3, 0.3, 0.8], 304 bg => [0.3, 0.3, 0.3, 0.8],
305 user_w => $::WIDTH/4, 305 user_w => int $::WIDTH / 3,
306 user_h => $::HEIGHT, 306 user_h => int $::HEIGHT / 5,
307 child => (my $vbox = new CFClient::UI::VBox); 307 child => (my $vbox = new CFClient::UI::VBox);
308 308
309 $vbox->add ($LOGVIEW = new CFClient::UI::TextView 309 $vbox->add ($LOGVIEW = new CFClient::UI::TextView
310 expand => 1, 310 expand => 1,
311 fontsize => $::CFG->{log_fontsize}, 311 fontsize => $::CFG->{log_fontsize},
312 ); 312 );
313 313
314 $vbox->add (my $input = new CFClient::UI::LineEntry 314 $vbox->add (my $input = new CFClient::UI::Entry
315 connect_focus_in => sub { 315 connect_focus_in => sub {
316 my ($input, $prev_focus) = @_; 316 my ($input, $prev_focus) = @_;
317 317
318 delete $input->{refocus_map}; 318 delete $input->{refocus_map};
319 319
325 connect_activate => sub { 325 connect_activate => sub {
326 my ($input, $text) = @_; 326 my ($input, $text) = @_;
327 $input->set_text (''); 327 $input->set_text ('');
328 328
329 if ($text =~ /^\/(.*)/) { 329 if ($text =~ /^\/(.*)/) {
330 $::CONN->user_send ("command $1"); 330 $::CONN->user_send ($1);
331 } else { 331 } else {
332 my $say_cmd = $::CFG->{say_command} || 'say'; 332 my $say_cmd = $::CFG->{say_command} || 'say';
333 $::CONN->user_send ("command $say_cmd $text"); 333 $::CONN->user_send ("$say_cmd $text");
334 } 334 }
335 if ($input->{refocus_map}) { 335 if ($input->{refocus_map}) {
336 delete $input->{refocus_map}; 336 delete $input->{refocus_map};
337 $MAPWIDGET->focus_in 337 $MAPWIDGET->focus_in
338 } 338 }
404 padding => 0, 404 padding => 0,
405 y => $HEIGHT * 44 / 45 - $FONTSIZE; 405 y => $HEIGHT * 44 / 45 - $FONTSIZE;
406 $CFClient::UI::ROOT->add ($STATUS_LINE); 406 $CFClient::UI::ROOT->add ($STATUS_LINE);
407 407
408 $ALT_ENTER_MESSAGE = new CFClient::UI::Label 408 $ALT_ENTER_MESSAGE = new CFClient::UI::Label
409 padding => 0, 409 padding => 0,
410 y => $HEIGHT * 44 / 45, 410 y => $HEIGHT * 44 / 45,
411 height => $HEIGHT / 45, 411 fontsize => $HEIGHT / 45,
412 text => "Use <b>Alt-Enter</b> to toggle fullscreen mode"; 412 markup => "Use <b>Alt-Enter</b> to toggle fullscreen mode";
413 $CFClient::UI::ROOT->add ($ALT_ENTER_MESSAGE); 413 $CFClient::UI::ROOT->add ($ALT_ENTER_MESSAGE);
414 414
415 $CFClient::UI::ROOT->add ($MAPWIDGET = new CFClient::UI::MapWidget); 415 $CFClient::UI::ROOT->add ($MAPWIDGET = new CFClient::UI::MapWidget);
416 $MAPWIDGET->focus_in; 416 $MAPWIDGET->focus_in;
417 $MAPWIDGET->connect (activate_console => sub { 417 $MAPWIDGET->connect (activate_console => sub {
505@conn::ISA = Crossfire::Protocol::; 505@conn::ISA = Crossfire::Protocol::;
506 506
507sub conn::user_send { 507sub conn::user_send {
508 my ($self, $command) = @_; 508 my ($self, $command) = @_;
509 509
510 $self->send ($command); 510 $self->send_command ($command);
511 status $command; 511 status $command;
512} 512}
513 513
514sub conn::map_scroll { 514sub conn::map_scroll {
515 my ($self, $dx, $dy) = @_; 515 my ($self, $dx, $dy) = @_;
567} 567}
568 568
569sub conn::flood_fill { 569sub conn::flood_fill {
570 my ($self, $path, $hash, $flags, $x0, $y0, $x1, $y1) = @_; 570 my ($self, $path, $hash, $flags, $x0, $y0, $x1, $y1) = @_;
571 571
572 # the server doe snot allow map paths > 6 572 # the server does not allow map paths > 6
573 return if 6 <= length $path; 573 return if 6 <= length $path;
574 574
575 for my $tile (1..4) { 575 for my $tile (1..4) {
576 next if $self->{neigh}{$hash}[$tile]; 576 next if $self->{neigh}{$hash}[$tile];
577 next unless $flags & (1 << ($tile - 1)); 577 next unless $flags & (1 << ($tile - 1));
579 my $neigh = $self->{neigh}{$hash} ||= []; 579 my $neigh = $self->{neigh}{$hash} ||= [];
580 580
581 $self->send_mapinfo ("spatial $path$tile", sub { 581 $self->send_mapinfo ("spatial $path$tile", sub {
582 my ($mode, $flags, $x, $y, $w, $h, $hash) = @_; 582 my ($mode, $flags, $x, $y, $w, $h, $hash) = @_;
583 583
584 warn "map<$path>_$tile=<$mode,$x,$y,$w,$h,$hash>\n";#d# 584 #warn "map<$path>_$tile=<$mode,$x,$y,$w,$h,$hash>\n";#d#
585 return if $mode ne "spatial"; 585 return if $mode ne "spatial";
586 586
587 $x += $MAP->ox; 587 $x += $MAP->ox;
588 $y += $MAP->oy; 588 $y += $MAP->oy;
589 589
590 $self->load_map ($hash, $x, $y); 590 $self->load_map ($hash, $x, $y)
591 unless $self->{neigh}{$hash}[5]++;#d#
591 592
592 $neigh->[$tile] = [$x, $y, $w, $h]; 593 $neigh->[$tile] = [$x, $y, $w, $h];
593 594
594 $self->flood_fill ("$path$tile", $hash, $flags, $x0, $y0, $x1, $y1) 595 $self->flood_fill ("$path$tile", $hash, $flags, $x0, $y0, $x1, $y1)
595 if $x >= $x0 && $x + $w < $x1 && $y >= $y0 && $y + $h < $y1; 596 if $x >= $x0 && $x + $w < $x1 && $y >= $y0 && $y + $h < $y1;
778 779
779@SDL_MODES or CFClient::fatal "Unable to find a usable video mode\n(hardware accelerated opengl fullscreen)"; 780@SDL_MODES or CFClient::fatal "Unable to find a usable video mode\n(hardware accelerated opengl fullscreen)";
780 781
781$CFG->{sdl_mode} = 0 if $CFG->{sdl_mode} > @SDL_MODES; 782$CFG->{sdl_mode} = 0 if $CFG->{sdl_mode} > @SDL_MODES;
782 783
783init_screen;
784
785{ 784{
786 my @fonts = map CFClient::find_rcfile $_, qw(uifont.ttf uifontb.ttf uifonti.ttf uifontbi.ttf); 785 my @fonts = map CFClient::find_rcfile $_, qw(uifont.ttf uifontb.ttf uifonti.ttf uifontbi.ttf);
787 786
788 CFClient::add_font $_ for @fonts; 787 CFClient::add_font $_ for @fonts;
789 CFClient::set_font $fonts[0]; 788 CFClient::set_font $fonts[0];
790} 789}
791 790
791init_screen;
792
792Event::loop; 793Event::loop;
793 794
794 795

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines