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.8 by root, Sun May 28 19:25:55 2006 UTC vs.
Revision 1.12 by elmex, Tue May 30 14:59:26 2006 UTC

66} 66}
67 67
68sub user_send { 68sub user_send {
69 my ($self, $command) = @_; 69 my ($self, $command) = @_;
70 70
71 if ($self->{record}) {
72 push @{$self->{record}}, $command;
73 }
74
71 $self->send_command ($command); 75 $self->send_command ($command);
72 ::status $command; 76 ::status $command;
77}
78
79sub start_record {
80 my ($self) = @_;
81
82 $self->{record} = [];
83}
84
85sub stop_record {
86 my ($self) = @_;
87 return delete $self->{record};
73} 88}
74 89
75sub map_scroll { 90sub map_scroll {
76 my ($self, $dx, $dy) = @_; 91 my ($self, $dx, $dy) = @_;
77 92
324 339
325 $prompt = $LAST_QUERY unless length $prompt; 340 $prompt = $LAST_QUERY unless length $prompt;
326 $LAST_QUERY = $prompt; 341 $LAST_QUERY = $prompt;
327 342
328 my $dialog = new CFClient::UI::FancyFrame 343 my $dialog = new CFClient::UI::FancyFrame
344 x => "center",
345 y => "center",
329 title => "Query", 346 title => "Query",
330 child => my $vbox = new CFClient::UI::VBox, 347 child => my $vbox = new CFClient::UI::VBox,
331 on_visibility_change => sub {
332 my ($self, $visible) = @_;
333 $self->center if $visible;
334 },
335 ; 348 ;
336 349
337 $vbox->add (new CFClient::UI::Label 350 $vbox->add (new CFClient::UI::Label
338 max_w => $::WIDTH * 0.4, 351 max_w => $::WIDTH * 0.4,
339 ellipsise => 0, 352 ellipsise => 0,
537} 550}
538 551
539sub set_opencont { 552sub set_opencont {
540 my ($conn, $tag, $name) = @_; 553 my ($conn, $tag, $name) = @_;
541 $conn->{open_container} = $tag; 554 $conn->{open_container} = $tag;
542 $::INVR_LBL->set_text ($name); 555
556 $::INV_RIGHT_HB->clear ();
557 $::INV_RIGHT_HB->add (new CFClient::UI::Label align => 0, expand => 1, text => $name);
558
559 if ($tag != 0) { # Floor isn't closable, is it?
560 $::INV_RIGHT_HB->add (new CFClient::UI::Button
561 text => "Close container",
562 tooltip => "Close the currently open container (if one is open)",
563 on_activate => sub {
564 $::CONN->send ("apply $tag") # $::CONN->{open_container}")
565 if $tag != 0;
566 #if $CONN->{open_container} != 0;
567 },
568 );
569 }
570
543 $::INVR->set_items ($conn->{container}{$tag}); 571 $::INVR->set_items ($conn->{container}{$tag});
544} 572}
545 573
546sub update_container { 574sub update_container {
547 my ($tag) = @_; 575 my ($tag) = @_;
576 if ($tag == 0) { 604 if ($tag == 0) {
577 update_floorbox; 605 update_floorbox;
578 update_container (0); 606 update_container (0);
579 } elsif ($tag == $self->{player}{tag}) { 607 } elsif ($tag == $self->{player}{tag}) {
580 $::INV->set_items ($self->{container}{$tag}) 608 $::INV->set_items ($self->{container}{$tag})
609 } else {
610 update_container ($tag);
581 } 611 }
582 612
583# use PApp::Util; warn PApp::Util::dumpval $self->{container}{0}; 613# use PApp::Util; warn PApp::Util::dumpval $self->{container}{0};
584} 614}
585 615
593 update_floorbox; 623 update_floorbox;
594 update_container ($_->{tag}); 624 update_container ($_->{tag});
595 } elsif ($_->{container} == $self->{player}{tag}) { 625 } elsif ($_->{container} == $self->{player}{tag}) {
596 $::INV->set_items ($self->{container}{$self->{player}{tag}}) 626 $::INV->set_items ($self->{container}{$self->{player}{tag}})
597 } else { 627 } else {
598 update_container ($_->{tag}); 628 update_container ($_->{container});
599 } 629 }
600 } 630 }
601} 631}
602 632
603sub item_update { 633sub item_update {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines