… | |
… | |
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 | |
… | |
… | |
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, |
|
|
348 | ; |
331 | |
349 | |
332 | $vbox->add (new CFClient::UI::Label |
350 | $vbox->add (new CFClient::UI::Label |
333 | max_w => $::WIDTH * 0.4, |
351 | max_w => $::WIDTH * 0.4, |
334 | ellipsise => 0, |
352 | ellipsise => 0, |
335 | text => $prompt); |
353 | text => $prompt); |
… | |
… | |
377 | ); |
395 | ); |
378 | |
396 | |
379 | $entry->focus_in; |
397 | $entry->focus_in; |
380 | } |
398 | } |
381 | |
399 | |
382 | $dialog->show_centered; |
400 | $dialog->show; |
383 | } |
401 | } |
384 | |
402 | |
385 | sub drawinfo { |
403 | sub drawinfo { |
386 | my ($self, $color, $text) = @_; |
404 | my ($self, $color, $text) = @_; |
387 | |
405 | |
… | |
… | |
532 | } |
550 | } |
533 | |
551 | |
534 | sub set_opencont { |
552 | sub set_opencont { |
535 | my ($conn, $tag, $name) = @_; |
553 | my ($conn, $tag, $name) = @_; |
536 | $conn->{open_container} = $tag; |
554 | $conn->{open_container} = $tag; |
537 | $::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 | |
538 | $::INVR->set_items ($conn->{container}{$tag}); |
571 | $::INVR->set_items ($conn->{container}{$tag}); |
539 | } |
572 | } |
540 | |
573 | |
541 | sub update_container { |
574 | sub update_container { |
542 | my ($tag) = @_; |
575 | my ($tag) = @_; |