… | |
… | |
82 | $year + 1900, $mon + 1, $mday, $hour, $min, $sec; |
82 | $year + 1900, $mon + 1, $mday, $hour, $min, $sec; |
83 | |
83 | |
84 | print $fh "$ts ", @a, "\n"; |
84 | print $fh "$ts ", @a, "\n"; |
85 | $fh->flush; |
85 | $fh->flush; |
86 | } |
86 | } |
87 | |
|
|
88 | |
|
|
89 | |
87 | |
90 | sub stats_update { |
88 | sub stats_update { |
91 | my ($self, $stats) = @_; |
89 | my ($self, $stats) = @_; |
92 | |
90 | |
93 | if (my $exp = $stats->{+CS_STAT_EXP64}) { |
91 | if (my $exp = $stats->{+CS_STAT_EXP64}) { |
… | |
… | |
537 | |
535 | |
538 | $row++; |
536 | $row++; |
539 | } else { |
537 | } else { |
540 | $::FLOORBOX->add (1, $row, new CFClient::UI::Button |
538 | $::FLOORBOX->add (1, $row, new CFClient::UI::Button |
541 | text => "More...", |
539 | text => "More...", |
542 | on_activate => sub { $::INV_WINDOW->toggle_visibility }, |
540 | on_activate => sub { $::INV_WINDOW->toggle_visibility; 0 }, |
543 | ); |
541 | ); |
544 | last; |
542 | last; |
545 | } |
543 | } |
546 | } |
544 | } |
547 | }); |
545 | }); |
… | |
… | |
562 | tooltip => "Close the currently open container (if one is open)", |
560 | tooltip => "Close the currently open container (if one is open)", |
563 | on_activate => sub { |
561 | on_activate => sub { |
564 | $::CONN->send ("apply $tag") # $::CONN->{open_container}") |
562 | $::CONN->send ("apply $tag") # $::CONN->{open_container}") |
565 | if $tag != 0; |
563 | if $tag != 0; |
566 | #if $CONN->{open_container} != 0; |
564 | #if $CONN->{open_container} != 0; |
|
|
565 | 0 |
567 | }, |
566 | }, |
568 | ); |
567 | ); |
569 | } |
568 | } |
570 | |
569 | |
571 | $::INVR->set_items ($conn->{container}{$tag}); |
570 | $::INVR->set_items ($conn->{container}{$tag}); |
… | |
… | |
763 | |
762 | |
764 | return unless $text =~ /\S/; |
763 | return unless $text =~ /\S/; |
765 | |
764 | |
766 | $entry->set_text (""); |
765 | $entry->set_text (""); |
767 | $this->send ($text); |
766 | $this->send ($text); |
|
|
767 | |
|
|
768 | 0 |
768 | }, |
769 | }, |
769 | ); |
770 | ); |
770 | |
771 | |
771 | $vbox->add ($self->{options} = new CFClient::UI::VBox); |
772 | $vbox->add ($self->{options} = new CFClient::UI::VBox); |
772 | |
773 | |
773 | $self->{close_button} = new CFClient::UI::Button |
774 | $self->{close_button} = new CFClient::UI::Button |
774 | text => "Bye (close)", |
775 | text => "Bye (close)", |
775 | tooltip => "Use this button to end talking to the NPC. This also closes the dialog window.", |
776 | tooltip => "Use this button to end talking to the NPC. This also closes the dialog window.", |
776 | on_activate => sub { $this->destroy }, |
777 | on_activate => sub { $this->destroy; 0 }, |
777 | ; |
778 | ; |
778 | |
779 | |
779 | $self->update_options; |
780 | $self->update_options; |
780 | |
781 | |
781 | $self->{token} = $self->{conn}->ext_token; |
782 | $self->{token} = $self->{conn}->ext_token; |
782 | $self->{conn}->connect_ext ($self->{token} => sub { $this->feed (@_) }); |
783 | $self->{conn}->connect_ext ($self->{token} => sub { $this->feed (@_) }); |
783 | $self->{conn}->send ("ext npc_dialog_begin $self->{token} $self->{dx} $self->{dy}"); |
784 | $self->{conn}->send ("ext npc_dialog_begin $self->{token} $self->{dx} $self->{dy}"); |
784 | |
785 | |
785 | $self->{entry}->focus_in; |
786 | $self->{entry}->grab_focus; |
786 | |
787 | |
787 | $self->{textview}->add_paragraph ([1, 1, 0, 1], "<small>[starting conversation with <b>$self->{title}</b>]</small>\n\n"); |
788 | $self->{textview}->add_paragraph ([1, 1, 0, 1], "<small>[starting conversation with <b>$self->{title}</b>]</small>\n\n"); |
788 | |
789 | |
789 | $self->show; |
790 | $self->show; |
790 | $self |
791 | $self |
… | |
… | |
801 | for my $kw (sort keys %{ $self->{kw} }) { |
802 | for my $kw (sort keys %{ $self->{kw} }) { |
802 | $self->{options}->add (new CFClient::UI::Button |
803 | $self->{options}->add (new CFClient::UI::Button |
803 | text => $kw, |
804 | text => $kw, |
804 | on_activate => sub { |
805 | on_activate => sub { |
805 | $self->send ($kw); |
806 | $self->send ($kw); |
|
|
807 | 0 |
806 | }, |
808 | }, |
807 | ); |
809 | ); |
808 | } |
810 | } |
809 | } |
811 | } |
810 | |
812 | |