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.123 by root, Mon Apr 17 19:36:27 2006 UTC vs.
Revision 1.125 by elmex, Mon Apr 17 20:29:37 2006 UTC

48our $MAPWIDGET; 48our $MAPWIDGET;
49our $BUTTONBAR; 49our $BUTTONBAR;
50our $LOGVIEW; 50our $LOGVIEW;
51our $CONSOLE; 51our $CONSOLE;
52our $METASERVER; 52our $METASERVER;
53
54our $GAUGES;
53 55
54our $SDL_ACTIVE; 56our $SDL_ACTIVE;
55our $SDL_EV; 57our $SDL_EV;
56our %SDL_CB; 58our %SDL_CB;
57 59
300 302
301sub message_window { 303sub message_window {
302 my $window = new CFClient::UI::FancyFrame 304 my $window = new CFClient::UI::FancyFrame
303 border_bg => [1, 1, 1, 0.5], 305 border_bg => [1, 1, 1, 0.5],
304 bg => [0.3, 0.3, 0.3, 0.8], 306 bg => [0.3, 0.3, 0.3, 0.8],
305 user_w => $::WIDTH/4, 307 user_w => int $::WIDTH / 3,
306 user_h => $::HEIGHT, 308 user_h => int $::HEIGHT / 5,
307 child => (my $vbox = new CFClient::UI::VBox); 309 child => (my $vbox = new CFClient::UI::VBox);
308 310
309 $vbox->add ($LOGVIEW = new CFClient::UI::TextView 311 $vbox->add ($LOGVIEW = new CFClient::UI::TextView
310 expand => 1, 312 expand => 1,
311 fontsize => $::CFG->{log_fontsize}, 313 fontsize => $::CFG->{log_fontsize},
437 CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; 439 CFClient::write_cfg "$Crossfire::VARDIR/pclientrc";
438 status "Configuration Saved"; 440 status "Configuration Saved";
439 }); 441 });
440 442
441 $BUTTONBAR->{children}[1]->emit ("activate"); # pop up server setup 443 $BUTTONBAR->{children}[1]->emit ("activate"); # pop up server setup
444
445 my $tgw = new CFClient::UI::FancyFrame (x => $WIDTH - 150, y => 0);
446 $tgw->add (my $hb = new CFClient::UI::HBox (req_w => 60, req_h => 150));
447 $hb->add (my $fg = new CFClient::UI::VGauge (w => 30, h => 150, gauge => 'food', expand => 1));
448 $hb->add (my $mg = new CFClient::UI::VGauge (w => 30, h => 150, gauge => 'mana', expand => 1));
449 $hb->add (my $hg = new CFClient::UI::VGauge (w => 30, h => 150, gauge => 'hp', expand => 1));
450 $hb->add (my $gg = new CFClient::UI::VGauge (w => 30, h => 150, gauge => 'grace', expand => 1));
451
452 $GAUGES = { food => $fg, mana => $mg, hp => $hg, grace => $gg };
453 $CFClient::UI::ROOT->add ($tgw);
442} 454}
443 455
444sub destroy_screen { 456sub destroy_screen {
445 $CFClient::UI::ROOT->{children} = []; 457 $CFClient::UI::ROOT->{children} = [];
446 undef $SDL_ACTIVE; 458 undef $SDL_ACTIVE;
502 delete $animate_object{$widget}; 514 delete $animate_object{$widget};
503} 515}
504 516
505@conn::ISA = Crossfire::Protocol::; 517@conn::ISA = Crossfire::Protocol::;
506 518
519sub conn::stats_update {
520 my ($self, $stats) = @_;
521
522 # i love text protocols!!!
523 # FIXME: the stats are somehow weird
524 my $hp = $stats->{1};
525 my $hp_m = $stats->{2};
526 my $sp = $stats->{3};
527 my $sp_m = $stats->{4};
528 my $fo = $stats->{18};
529 my $fo_m = 1000;
530 my $gr = $stats->{23};
531 my $gr_m = $stats->{24};
532
533 #d# warn "DATA $hp $hp_m $sp $sp_m $fo $fo_m $gr $gr_m\n";
534 $GAUGES->{hp}->set_value ($hp, $hp_m);
535 $GAUGES->{mana}->set_value ($sp, $sp_m);
536 $GAUGES->{food}->set_value ($fo, $fo_m);
537 $GAUGES->{grace}->set_value ($gr, $gr_m);
538}
539
507sub conn::user_send { 540sub conn::user_send {
508 my ($self, $command) = @_; 541 my ($self, $command) = @_;
509 542
510 $self->send_command ($command); 543 $self->send_command ($command);
511 status $command; 544 status $command;
585 return if $mode ne "spatial"; 618 return if $mode ne "spatial";
586 619
587 $x += $MAP->ox; 620 $x += $MAP->ox;
588 $y += $MAP->oy; 621 $y += $MAP->oy;
589 622
590 $self->load_map ($hash, $x, $y); 623 $self->load_map ($hash, $x, $y)
624 unless $self->{neigh}{$hash}[5]++;#d#
591 625
592 $neigh->[$tile] = [$x, $y, $w, $h]; 626 $neigh->[$tile] = [$x, $y, $w, $h];
593 627
594 $self->flood_fill ("$path$tile", $hash, $flags, $x0, $y0, $x1, $y1) 628 $self->flood_fill ("$path$tile", $hash, $flags, $x0, $y0, $x1, $y1)
595 if $x >= $x0 && $x + $w < $x1 && $y >= $y0 && $y + $h < $y1; 629 if $x >= $x0 && $x + $w < $x1 && $y >= $y0 && $y + $h < $y1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines