… | |
… | |
78 | $self->SUPER::update; |
78 | $self->SUPER::update; |
79 | } |
79 | } |
80 | |
80 | |
81 | sub draw { |
81 | sub draw { |
82 | my ($self) = @_; |
82 | my ($self) = @_; |
|
|
83 | |
|
|
84 | return |
|
|
85 | unless $CFClient::UI::FOCUS == $self || !$::FAST; |
83 | |
86 | |
84 | if (delete $self->{need_update}) { |
87 | if (delete $self->{need_update}) { |
85 | glNewList $self->{list}; |
88 | glNewList $self->{list}; |
86 | |
89 | |
87 | if ($::MAP) { |
90 | if ($::MAP) { |
… | |
… | |
188 | $::CONN->user_send ("stay fire"); |
191 | $::CONN->user_send ("stay fire"); |
189 | } elsif ($uni == ord ",") { |
192 | } elsif ($uni == ord ",") { |
190 | $::CONN->user_send ("take"); |
193 | $::CONN->user_send ("take"); |
191 | } elsif ($uni == ord "\t") { |
194 | } elsif ($uni == ord "\t") { |
192 | $::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 -"); |
193 | } elsif ($uni == ord "'") { |
200 | } elsif ($uni == ord "'") { |
194 | $self->emit ('activate_console'); |
201 | $self->emit ('activate_console'); |
195 | } elsif ($uni == ord "/") { |
202 | } elsif ($uni == ord "/") { |
196 | $self->emit (activate_console => '/'); |
203 | $self->emit (activate_console => '/'); |
197 | } elsif (exists $DIR{$sym}) { |
204 | } elsif (exists $DIR{$sym}) { |
… | |
… | |
249 | |
256 | |
250 | $tooltip = "<big>$data</big>\n\n$tooltip"; |
257 | $tooltip = "<big>$data</big>\n\n$tooltip"; |
251 | |
258 | |
252 | $tooltip =~ s/\s+$//; |
259 | $tooltip =~ s/\s+$//; |
253 | |
260 | |
254 | $self->{command}{$command} = [$data, $tooltip, $widget, $cb]; |
261 | $self->{command}{$command} = [$data, $tooltip, $widget, $cb, ++$self->{command_id}]; |
255 | } |
262 | } |
256 | |
263 | |
257 | sub clr_commands { |
264 | sub clr_commands { |
258 | my ($self) = @_; |
265 | my ($self) = @_; |
259 | |
266 | |
… | |
… | |
362 | CFClient::UI::Label->new ( |
369 | CFClient::UI::Label->new ( |
363 | can_hover => 1, |
370 | can_hover => 1, |
364 | can_events => 1, |
371 | can_events => 1, |
365 | tooltip_width => 0.33, |
372 | tooltip_width => 0.33, |
366 | fontsize => $_, |
373 | fontsize => $_, |
367 | ), (0.8) x 6 |
374 | ), (0.8) x 16 |
368 | ]; |
375 | ]; |
369 | |
376 | |
370 | $self->{entry} = new CFClient::UI::Entry |
377 | $self->{entry} = new CFClient::UI::Entry |
371 | connect_changed => sub { |
378 | connect_changed => sub { |
372 | $self->update_labels; |
379 | $self->update_labels; |
… | |
… | |
446 | } |
453 | } |
447 | |
454 | |
448 | @match = map $self->{command}{$_->[0]}, |
455 | @match = map $self->{command}{$_->[0]}, |
449 | sort { |
456 | sort { |
450 | $a->[1] <=> $b->[1] |
457 | $a->[1] <=> $b->[1] |
451 | or (length $a->[0]) <=> (length $b->[0]) |
458 | or $self->{command}{$a->[0]}[4] <=> $self->{command}{$b->[0]}[4] |
452 | } @match; |
459 | } @match; |
453 | |
460 | |
454 | $self->{last_search} = $cmd; |
461 | $self->{last_search} = $cmd; |
455 | $self->{last_match} = \@match; |
462 | $self->{last_match} = \@match; |
456 | |
463 | |