ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/MapWidget.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/MapWidget.pm (file contents):
Revision 1.11 by root, Mon Apr 24 03:33:51 2006 UTC vs.
Revision 1.15 by root, Mon Apr 24 13:01:13 2006 UTC

1package CFClient::MapWidget; 1package CFClient::MapWidget;
2 2
3use strict; 3use strict;
4use utf8;
4 5
5use List::Util qw(min max); 6use List::Util qw(min max);
6 7
7use CFClient::OpenGL; 8use CFClient::OpenGL;
8 9
214 my $mod = $ev->{mod}; 215 my $mod = $ev->{mod};
215 my $sym = $ev->{sym}; 216 my $sym = $ev->{sym};
216 217
217 if ($sym == CFClient::SDLK_KP5) { 218 if ($sym == CFClient::SDLK_KP5) {
218 $::CONN->user_send ("stay fire"); 219 $::CONN->user_send ("stay fire");
220 } elsif ($sym == ord ",") {
221 $::CONN->user_send ("take");
219 } elsif ($sym == ord "a") { 222 } elsif ($sym == ord "a") {
220 $::CONN->user_send ("apply"); 223 $::CONN->user_send ("apply");
221 } elsif ($sym == ord "'") { 224 } elsif ($sym == ord "'") {
222 $self->emit ('activate_console'); 225 $self->emit ('activate_console');
223 } elsif ($sym == ord "/") { 226 } elsif ($sym == ord "/") {
245 (delete $self->{command_widget})->hide; 248 (delete $self->{command_widget})->hide;
246 $self->focus_in; 249 $self->focus_in;
247 }, 250 },
248 ; 251 ;
249 $self->{command_widget}->key_down ($ev); 252 $self->{command_widget}->key_down ($ev);
253 return unless $self->{command_widget};
250 $self->{command_widget}->show; 254 $self->{command_widget}->show;
251 $self->{command_widget}->focus_in; 255 $self->{command_widget}->focus_in;
252 } 256 }
253} 257}
254 258
316 my @found; 320 my @found;
317 321
318 for (@$command) { 322 for (@$command) {
319 if ($_->[0] =~ $search_abbrev) { 323 if ($_->[0] =~ $search_abbrev) {
320 push @found, [$_->[0], $_]; 324 push @found, [$_->[0], $_];
321 } elsif ($_[1] =~ $search_full) { 325 } elsif ($_->[1] =~ $search_full) {
322 push @found, [$_->[1], $_]; 326 push @found, [$_->[1], $_];
323 } 327 }
324 } 328 }
325 329
326 @found = sort { $a->[0] cmp $b->[0] } @found; 330 @found = sort { $a->[0] cmp $b->[0] } @found;
353 $self->emit (execute => $self->{select}); 357 $self->emit (execute => $self->{select});
354 $self->emit ("close"); 358 $self->emit ("close");
355 } 359 }
356 } elsif ($ev->{sym} == 27) { 360 } elsif ($ev->{sym} == 27) {
357 $self->emit ("close"); 361 $self->emit ("close");
362 return;
358 } elsif ((chr $ev->{unicode}) =~ /^[[:alpha:]]$/) { 363 } elsif ((chr $ev->{unicode}) =~ /^[[:alpha:]]$/) {
359 $self->{search} .= chr $ev->{unicode}; 364 $self->{search} .= chr $ev->{unicode};
360 $self->update_labels; 365 $self->update_labels;
361 } 366 }
362 367

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines