--- deliantra/Deliantra-Client/DC/Protocol.pm 2006/06/05 21:10:04 1.21 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2006/06/06 02:55:50 1.22 @@ -349,64 +349,7 @@ $prompt = $LAST_QUERY unless length $prompt; $LAST_QUERY = $prompt; - my $dialog = new CFClient::UI::FancyFrame - x => "center", - y => "center", - title => "Query", - child => my $vbox = new CFClient::UI::VBox, - ; - - $vbox->add (new CFClient::UI::Label - max_w => $::WIDTH * 0.4, - ellipsise => 0, - text => $prompt); - - if ($flags & CS_QUERY_YESNO) { - $vbox->add (my $hbox = new CFClient::UI::HBox); - $hbox->add (new CFClient::UI::Button - text => "No", - on_activate => sub { - $self->send ("reply n"); - $dialog->destroy; - $self->{map_widget}->focus_in; - } - ); - $hbox->add (new CFClient::UI::Button - text => "Yes", - on_activate => sub { - $self->send ("reply y"); - $dialog->destroy; - }, - ); - - $dialog->focus_in; - - } elsif ($flags & CS_QUERY_SINGLECHAR) { - $dialog->{tooltip} = "Press a key (click on the entry to make sure it has keyboard focus)"; - $vbox->add (my $entry = new CFClient::UI::Entry - on_changed => sub { - $self->send ("reply $_[1]"); - $dialog->destroy; - }, - ); - - $entry->focus_in; - - } else { - $dialog->{tooltip} = "Enter the reply and press return (click on the entry to make sure it has keyboard focus)"; - - $vbox->add (my $entry = new CFClient::UI::Entry - $flags & CS_QUERY_HIDEINPUT ? (hiddenchar => "*") : (), - on_activate => sub { - $self->send ("reply $_[1]"); - $dialog->destroy; - }, - ); - - $entry->focus_in; - } - - $dialog->show; + $self->{query}-> ($self, $flags, $prompt); } sub drawinfo {