… | |
… | |
66 | } |
66 | } |
67 | |
67 | |
68 | sub user_send { |
68 | sub 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 | |
|
|
79 | sub start_record { |
|
|
80 | my ($self) = @_; |
|
|
81 | |
|
|
82 | $self->{record} = []; |
|
|
83 | } |
|
|
84 | |
|
|
85 | sub stop_record { |
|
|
86 | my ($self) = @_; |
|
|
87 | return delete $self->{record}; |
73 | } |
88 | } |
74 | |
89 | |
75 | sub map_scroll { |
90 | sub map_scroll { |
76 | my ($self, $dx, $dy) = @_; |
91 | my ($self, $dx, $dy) = @_; |
77 | |
92 | |
… | |
… | |
537 | } |
552 | } |
538 | |
553 | |
539 | sub set_opencont { |
554 | sub set_opencont { |
540 | my ($conn, $tag, $name) = @_; |
555 | my ($conn, $tag, $name) = @_; |
541 | $conn->{open_container} = $tag; |
556 | $conn->{open_container} = $tag; |
542 | $::INVR_LBL->set_text ($name); |
557 | |
|
|
558 | $::INV_RIGHT_HB->clear (); |
|
|
559 | $::INV_RIGHT_HB->add (new CFClient::UI::Label align => 0, expand => 1, text => $name); |
|
|
560 | |
|
|
561 | if ($tag != 0) { # Floor isn't closable, is it? |
|
|
562 | $::INV_RIGHT_HB->add (new CFClient::UI::Button |
|
|
563 | text => "Close container", |
|
|
564 | tooltip => "Close the currently open container (if one is open)", |
|
|
565 | on_activate => sub { |
|
|
566 | $::CONN->send ("apply $tag") # $::CONN->{open_container}") |
|
|
567 | if $tag != 0; |
|
|
568 | #if $CONN->{open_container} != 0; |
|
|
569 | }, |
|
|
570 | ); |
|
|
571 | } |
|
|
572 | |
543 | $::INVR->set_items ($conn->{container}{$tag}); |
573 | $::INVR->set_items ($conn->{container}{$tag}); |
544 | } |
574 | } |
545 | |
575 | |
546 | sub update_container { |
576 | sub update_container { |
547 | my ($tag) = @_; |
577 | my ($tag) = @_; |