… | |
… | |
14 | |
14 | |
15 | my $self = $class->SUPER::new ( |
15 | my $self = $class->SUPER::new ( |
16 | z => -1, |
16 | z => -1, |
17 | can_focus => 1, |
17 | can_focus => 1, |
18 | list => glGenList, |
18 | list => glGenList, |
|
|
19 | |
|
|
20 | smooth_matrix => [ |
|
|
21 | 0.05, 0.13, 0.05, |
|
|
22 | 0.13, 0.30, 0.13, |
|
|
23 | 0.05, 0.13, 0.05, |
|
|
24 | ], |
|
|
25 | |
19 | @_ |
26 | @_ |
20 | ); |
27 | ); |
21 | |
28 | |
22 | $self->{completer} = new CFClient::MapWidget::Command:: |
29 | $self->{completer} = new CFClient::MapWidget::Command:: |
23 | command => $self->{command}, |
30 | command => $self->{command}, |
… | |
… | |
252 | glConvolutionFilter2D ( |
259 | glConvolutionFilter2D ( |
253 | GL_CONVOLUTION_2D, |
260 | GL_CONVOLUTION_2D, |
254 | GL_ALPHA, |
261 | GL_ALPHA, |
255 | 3, 3, |
262 | 3, 3, |
256 | GL_ALPHA, GL_FLOAT, |
263 | GL_ALPHA, GL_FLOAT, |
257 | pack "f*", |
264 | (pack "f*", @{ $self->{smooth_matrix} }), |
258 | 0.05, 0.13, 0.05, |
|
|
259 | 0.13, 0.30, 0.13, |
|
|
260 | 0.05, 0.13, 0.05, |
|
|
261 | ); |
265 | ); |
262 | glEnable GL_CONVOLUTION_2D; |
266 | glEnable GL_CONVOLUTION_2D; |
263 | } |
267 | } |
264 | |
268 | |
265 | $self->{fow_texture_name} ||= glGenTexture; |
269 | $self->{fow_texture_name} ||= glGenTexture; |
… | |
… | |
459 | |
463 | |
460 | if ($ev->{sym} == 13) { |
464 | if ($ev->{sym} == 13) { |
461 | if (exists $self->{select}) { |
465 | if (exists $self->{select}) { |
462 | $self->{last_command} = $self->{select}; |
466 | $self->{last_command} = $self->{select}; |
463 | $::CONN->user_send ($self->{select}); |
467 | $::CONN->user_send ($self->{select}); |
|
|
468 | |
|
|
469 | unshift @{$self->{history}}, $self->{select}; |
|
|
470 | $self->{hist_ptr} = 0; |
|
|
471 | |
464 | $self->hide; |
472 | $self->hide; |
465 | } |
473 | } |
466 | } elsif ($ev->{sym} == 27) { |
474 | } elsif ($ev->{sym} == 27) { |
|
|
475 | $self->{hist_ptr} = 0; |
467 | $self->hide; |
476 | $self->hide; |
468 | return; |
477 | return; |
469 | } elsif ($ev->{sym} == CFClient::SDLK_DOWN) { |
478 | } elsif ($ev->{sym} == CFClient::SDLK_DOWN) { |
|
|
479 | if ($self->{hist_ptr} > 1) { |
|
|
480 | $self->{hist_ptr}--; |
|
|
481 | $self->{entry}->set_text ($self->{history}->[$self->{hist_ptr} - 1]); |
|
|
482 | } elsif ($self->{hist_ptr} > 0) { |
|
|
483 | $self->{hist_ptr}--; |
|
|
484 | $self->{entry}->set_text ($self->{hist_saveback}); |
|
|
485 | } else { |
470 | ++$self->{select_offset} |
486 | ++$self->{select_offset} |
471 | if $self->{select_offset} < $#{ $self->{last_match} || [] }; |
487 | if $self->{select_offset} < $#{ $self->{last_match} || [] }; |
|
|
488 | } |
472 | $self->update_labels; |
489 | $self->update_labels; |
473 | } elsif ($ev->{sym} == CFClient::SDLK_UP) { |
490 | } elsif ($ev->{sym} == CFClient::SDLK_UP) { |
|
|
491 | if ($self->{select_offset}) { |
474 | --$self->{select_offset} |
492 | --$self->{select_offset} |
|
|
493 | } else { |
|
|
494 | unless ($self->{hist_ptr}) { |
|
|
495 | $self->{hist_saveback} = $self->{entry}->get_text; |
|
|
496 | } |
|
|
497 | if ($self->{hist_ptr} <= $#{$self->{history}}) { |
475 | if $self->{select_offset}; |
498 | $self->{hist_ptr}++; |
|
|
499 | } |
|
|
500 | $self->{entry}->set_text ($self->{history}->[$self->{hist_ptr} - 1]) |
|
|
501 | if exists $self->{history}->[$self->{hist_ptr} - 1]; |
|
|
502 | } |
476 | $self->update_labels; |
503 | $self->update_labels; |
477 | } else { |
504 | } else { |
478 | return 0; |
505 | return 0; |
479 | } |
506 | } |
480 | |
507 | |