… | |
… | |
204 | glTranslate $sx0 - 32, $sy0 - 32, 0; |
204 | glTranslate $sx0 - 32, $sy0 - 32, 0; |
205 | |
205 | |
206 | my ($w, $h, $data) = $::MAP->draw ($sx, $sy, 0, 0, $sw + 1, $sh + 1); |
206 | my ($w, $h, $data) = $::MAP->draw ($sx, $sy, 0, 0, $sw + 1, $sh + 1); |
207 | |
207 | |
208 | if ($::CFG->{fow_enable}) { |
208 | if ($::CFG->{fow_enable}) { |
209 | if ($::CFG->{fow_smooth} && $CFClient::GL_VERSION >= 1.2) { # smooth fog of war |
209 | if ($::CFG->{fow_smooth} && $CFClient::OpenGL::GL_VERSION >= 1.2) { # smooth fog of war |
210 | glConvolutionParameter (GL_CONVOLUTION_2D, GL_CONVOLUTION_BORDER_MODE, GL_CONSTANT_BORDER); |
210 | glConvolutionParameter (GL_CONVOLUTION_2D, GL_CONVOLUTION_BORDER_MODE, GL_CONSTANT_BORDER); |
211 | glConvolutionFilter2D ( |
211 | glConvolutionFilter2D ( |
212 | GL_CONVOLUTION_2D, |
212 | GL_CONVOLUTION_2D, |
213 | GL_ALPHA, |
213 | GL_ALPHA, |
214 | 3, 3, |
214 | 3, 3, |
… | |
… | |
267 | glVertex $::WIDTH, $::HEIGHT; |
267 | glVertex $::WIDTH, $::HEIGHT; |
268 | glVertex $::WIDTH, 0; |
268 | glVertex $::WIDTH, 0; |
269 | glEnd; |
269 | glEnd; |
270 | glDisable GL_BLEND; |
270 | glDisable GL_BLEND; |
271 | |
271 | |
272 | $self->{out_of_focus} ||= do { |
272 | # $self->{out_of_focus} ||= do { |
273 | my $label = new CFClient::UI::Label |
273 | # my $label = new CFClient::UI::Label |
274 | x => 0, |
274 | # x => 0, |
275 | y => 0, |
275 | # y => 0, |
276 | z => 1, |
276 | # z => 1, |
277 | ellipsise => 0, |
277 | # ellipsise => 0, |
278 | text => "map out of focus (click map to play)"; |
278 | # text => "map out of focus (click map to play)"; |
279 | |
279 | # |
280 | $label->show; |
280 | # $label->show; |
281 | $label->update; |
281 | # $label->update; |
282 | |
282 | # |
283 | $CFClient::UI::ROOT->on_post_alloc ("$self$label" => sub { |
283 | # $CFClient::UI::ROOT->on_post_alloc ("$self$label" => sub { |
284 | $label->move ( |
284 | # $label->move ( |
285 | ($::WIDTH - $label->{w}) * 0.5, |
285 | # ($::WIDTH - $label->{w}) * 0.5, |
286 | ($::HEIGHT - $label->{h}) * 0.5, |
286 | # ($::HEIGHT - $label->{h}) * 0.5, |
287 | ); |
287 | # ); |
288 | }); |
288 | # }); |
289 | |
289 | # |
290 | $label |
290 | # $label |
291 | }; |
291 | # }; |
292 | } |
292 | } |
293 | } |
293 | } |
294 | |
294 | |
295 | sub DESTROY { |
295 | sub DESTROY { |
296 | my $self = shift; |
296 | my $self = shift; |
… | |
… | |
406 | fontsize => $_, |
406 | fontsize => $_, |
407 | ), (0.8) x 16 |
407 | ), (0.8) x 16 |
408 | ]; |
408 | ]; |
409 | |
409 | |
410 | $self->{entry} = new CFClient::UI::Entry |
410 | $self->{entry} = new CFClient::UI::Entry |
411 | connect_changed => sub { |
411 | on_changed => sub { |
412 | $self->update_labels; |
412 | $self->update_labels; |
413 | }, |
413 | }, |
414 | connect_key_down => sub { |
414 | on_key_down => sub { |
415 | my ($entry, $ev) = @_; |
415 | my ($entry, $ev) = @_; |
416 | |
416 | |
417 | my $self = $entry->{parent}{parent}; |
417 | my $self = $entry->{parent}{parent}; |
418 | |
418 | |
419 | if ($ev->{sym} == 13) { |
419 | if ($ev->{sym} == 13) { |
… | |
… | |
521 | |
521 | |
522 | @match = map $self->{command}{$_->[0]}, |
522 | @match = map $self->{command}{$_->[0]}, |
523 | sort { |
523 | sort { |
524 | $a->[1] <=> $b->[1] |
524 | $a->[1] <=> $b->[1] |
525 | or $self->{command}{$a->[0]}[4] <=> $self->{command}{$b->[0]}[4] |
525 | or $self->{command}{$a->[0]}[4] <=> $self->{command}{$b->[0]}[4] |
526 | or (length $a->[0]) <=> (length $b->[0]) |
526 | or (length $b->[0]) <=> (length $a->[0]) |
527 | } @match; |
527 | } @match; |
528 | } |
528 | } |
529 | |
529 | |
530 | $self->{last_search} = $cmd; |
530 | $self->{last_search} = $text; |
531 | $self->{last_match} = \@match; |
531 | $self->{last_match} = \@match; |
532 | |
532 | |
533 | $self->{select_offset} = 0; |
533 | $self->{select_offset} = 0; |
534 | } |
534 | } |
535 | |
535 | |