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.38 by root, Thu May 25 02:23:14 2006 UTC vs.
Revision 1.42 by root, Mon May 29 18:33:23 2006 UTC

39 my ($self, $command, $tooltip, $widget, $cb) = @_; 39 my ($self, $command, $tooltip, $widget, $cb) = @_;
40 40
41 (my $data = $command) =~ s/\\//g; 41 (my $data = $command) =~ s/\\//g;
42 42
43 $tooltip =~ s/^\s+//; 43 $tooltip =~ s/^\s+//;
44
45 $tooltip = "<big>$data</big>\n\n$tooltip"; 44 $tooltip = "<big>$data</big>\n\n$tooltip";
46
47 $tooltip =~ s/\s+$//; 45 $tooltip =~ s/\s+$//;
48 46
49 $self->{completer}{command}{$command} = [$data, $tooltip, $widget, $cb, ++$self->{command_id}]; 47 $self->{completer}{command}{$command} = [$data, $tooltip, $widget, $cb, ++$self->{command_id}];
50} 48}
51 49
136 $::CONN->user_send ("apply"); 134 $::CONN->user_send ("apply");
137 } elsif ($uni == ord ".") { 135 } elsif ($uni == ord ".") {
138 $::CONN->user_send ($self->{completer}{last_command}) 136 $::CONN->user_send ($self->{completer}{last_command})
139 if exists $self->{completer}{last_command}; 137 if exists $self->{completer}{last_command};
140 } elsif ($uni == ord "\t") { 138 } elsif ($uni == ord "\t") {
141 # TODO: toggle inventory 139 $::INV_WINDOW->toggle_visibility;
142 } elsif ($sym == CFClient::SDLK_KP_PLUS || $uni == ord "+") { 140 } elsif ($sym == CFClient::SDLK_KP_PLUS || $uni == ord "+") {
143 $::CONN->user_send ("rotateshoottype +"); 141 $::CONN->user_send ("rotateshoottype +");
144 } elsif ($sym == CFClient::SDLK_KP_MINUS || $uni == ord "-") { 142 } elsif ($sym == CFClient::SDLK_KP_MINUS || $uni == ord "-") {
145 $::CONN->user_send ("rotateshoottype -"); 143 $::CONN->user_send ("rotateshoottype -");
146 } elsif ($uni == ord '"') { 144 } elsif ($uni == ord '"') {
157 $self->{ctrl}++; 155 $self->{ctrl}++;
158 $::CONN->user_send ("run $DIR{$sym}[0]"); 156 $::CONN->user_send ("run $DIR{$sym}[0]");
159 } else { 157 } else {
160 $::CONN->user_send ("$DIR{$sym}[1]"); 158 $::CONN->user_send ("$DIR{$sym}[1]");
161 } 159 }
162 } elsif ($ev->{unicode}) { 160 } elsif ((ord 'a') <= $uni && $uni <= (ord 'z')) {
163 $self->{completer}->key_down ($ev); 161 $self->{completer}->key_down ($ev);
164 $self->{completer}->show; 162 $self->{completer}->show;
165 } 163 }
166} 164}
167 165
204 glTranslate $sx0 - 32, $sy0 - 32, 0; 202 glTranslate $sx0 - 32, $sy0 - 32, 0;
205 203
206 my ($w, $h, $data) = $::MAP->draw ($sx, $sy, 0, 0, $sw + 1, $sh + 1); 204 my ($w, $h, $data) = $::MAP->draw ($sx, $sy, 0, 0, $sw + 1, $sh + 1);
207 205
208 if ($::CFG->{fow_enable}) { 206 if ($::CFG->{fow_enable}) {
209 if ($::CFG->{fow_smooth} && $CFClient::GL_VERSION >= 1.2) { # smooth fog of war 207 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); 208 glConvolutionParameter (GL_CONVOLUTION_2D, GL_CONVOLUTION_BORDER_MODE, GL_CONSTANT_BORDER);
211 glConvolutionFilter2D ( 209 glConvolutionFilter2D (
212 GL_CONVOLUTION_2D, 210 GL_CONVOLUTION_2D,
213 GL_ALPHA, 211 GL_ALPHA,
214 3, 3, 212 3, 3,
406 fontsize => $_, 404 fontsize => $_,
407 ), (0.8) x 16 405 ), (0.8) x 16
408 ]; 406 ];
409 407
410 $self->{entry} = new CFClient::UI::Entry 408 $self->{entry} = new CFClient::UI::Entry
411 connect_changed => sub { 409 on_changed => sub {
412 $self->update_labels; 410 $self->update_labels;
413 }, 411 },
414 connect_key_down => sub { 412 on_key_down => sub {
415 my ($entry, $ev) = @_; 413 my ($entry, $ev) = @_;
416 414
417 my $self = $entry->{parent}{parent}; 415 my $self = $entry->{parent}{parent};
418 416
419 if ($ev->{sym} == 13) { 417 if ($ev->{sym} == 13) {
521 519
522 @match = map $self->{command}{$_->[0]}, 520 @match = map $self->{command}{$_->[0]},
523 sort { 521 sort {
524 $a->[1] <=> $b->[1] 522 $a->[1] <=> $b->[1]
525 or $self->{command}{$a->[0]}[4] <=> $self->{command}{$b->[0]}[4] 523 or $self->{command}{$a->[0]}[4] <=> $self->{command}{$b->[0]}[4]
526 or (length $a->[0]) <=> (length $b->[0]) 524 or (length $b->[0]) <=> (length $a->[0])
527 } @match; 525 } @match;
528 } 526 }
529 527
530 $self->{last_search} = $cmd; 528 $self->{last_search} = $text;
531 $self->{last_match} = \@match; 529 $self->{last_match} = \@match;
532 530
533 $self->{select_offset} = 0; 531 $self->{select_offset} = 0;
534 } 532 }
535 533

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines