… | |
… | |
191 | $::CONN->user_send ("stay fire"); |
191 | $::CONN->user_send ("stay fire"); |
192 | } elsif ($uni == ord ",") { |
192 | } elsif ($uni == ord ",") { |
193 | $::CONN->user_send ("take"); |
193 | $::CONN->user_send ("take"); |
194 | } elsif ($uni == ord "\t") { |
194 | } elsif ($uni == ord "\t") { |
195 | $::CONN->user_send ("apply"); |
195 | $::CONN->user_send ("apply"); |
|
|
196 | } elsif ($sym == CFClient::SDLK_KP_PLUS || $uni == ord "+") { |
|
|
197 | $::CONN->user_send ("rotateshoottype +"); |
|
|
198 | } elsif ($sym == CFClient::SDLK_KP_MINUS || $uni == ord "-") { |
|
|
199 | $::CONN->user_send ("rotateshoottype -"); |
196 | } elsif ($uni == ord "'") { |
200 | } elsif ($uni == ord "'") { |
197 | $self->emit ('activate_console'); |
201 | $self->emit ('activate_console'); |
198 | } elsif ($uni == ord "/") { |
202 | } elsif ($uni == ord "/") { |
199 | $self->emit (activate_console => '/'); |
203 | $self->emit (activate_console => '/'); |
200 | } elsif (exists $DIR{$sym}) { |
204 | } elsif (exists $DIR{$sym}) { |
… | |
… | |
252 | |
256 | |
253 | $tooltip = "<big>$data</big>\n\n$tooltip"; |
257 | $tooltip = "<big>$data</big>\n\n$tooltip"; |
254 | |
258 | |
255 | $tooltip =~ s/\s+$//; |
259 | $tooltip =~ s/\s+$//; |
256 | |
260 | |
257 | $self->{command}{$command} = [$data, $tooltip, $widget, $cb]; |
261 | $self->{command}{$command} = [$data, $tooltip, $widget, $cb, ++$self->{command_id}]; |
258 | } |
262 | } |
259 | |
263 | |
260 | sub clr_commands { |
264 | sub clr_commands { |
261 | my ($self) = @_; |
265 | my ($self) = @_; |
262 | |
266 | |
… | |
… | |
365 | CFClient::UI::Label->new ( |
369 | CFClient::UI::Label->new ( |
366 | can_hover => 1, |
370 | can_hover => 1, |
367 | can_events => 1, |
371 | can_events => 1, |
368 | tooltip_width => 0.33, |
372 | tooltip_width => 0.33, |
369 | fontsize => $_, |
373 | fontsize => $_, |
370 | ), (0.8) x 6 |
374 | ), (0.8) x 16 |
371 | ]; |
375 | ]; |
372 | |
376 | |
373 | $self->{entry} = new CFClient::UI::Entry |
377 | $self->{entry} = new CFClient::UI::Entry |
374 | connect_changed => sub { |
378 | connect_changed => sub { |
375 | $self->update_labels; |
379 | $self->update_labels; |
… | |
… | |
449 | } |
453 | } |
450 | |
454 | |
451 | @match = map $self->{command}{$_->[0]}, |
455 | @match = map $self->{command}{$_->[0]}, |
452 | sort { |
456 | sort { |
453 | $a->[1] <=> $b->[1] |
457 | $a->[1] <=> $b->[1] |
454 | or (length $a->[0]) <=> (length $b->[0]) |
458 | or $self->{command}{$a->[0]}[4] <=> $self->{command}{$b->[0]}[4] |
455 | } @match; |
459 | } @match; |
456 | |
460 | |
457 | $self->{last_search} = $cmd; |
461 | $self->{last_search} = $cmd; |
458 | $self->{last_match} = \@match; |
462 | $self->{last_match} = \@match; |
459 | |
463 | |