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.124 by root, Mon Apr 17 19:50:23 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
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;
501 my ($widget) = @_; 513 my ($widget) = @_;
502 delete $animate_object{$widget}; 514 delete $animate_object{$widget};
503} 515}
504 516
505@conn::ISA = Crossfire::Protocol::; 517@conn::ISA = Crossfire::Protocol::;
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}
506 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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines