… | |
… | |
10 | our @ISA = CFClient::UI::Base::; |
10 | our @ISA = CFClient::UI::Base::; |
11 | |
11 | |
12 | sub new { |
12 | sub new { |
13 | my $class = shift; |
13 | my $class = shift; |
14 | |
14 | |
15 | $class->SUPER::new ( |
15 | my $self = $class->SUPER::new ( |
16 | z => -1, |
16 | z => -1, |
17 | can_focus => 1, |
17 | can_focus => 1, |
18 | list => glGenList, |
18 | list => glGenList, |
19 | @_ |
19 | @_ |
20 | ) |
20 | ); |
|
|
21 | |
|
|
22 | $self->add_command ("killpets", "kills all your summoned and charmed creates"); |
|
|
23 | |
|
|
24 | $self |
21 | } |
25 | } |
22 | |
26 | |
23 | sub DESTROY { |
27 | sub DESTROY { |
24 | my $self = shift; |
28 | my $self = shift; |
25 | |
29 | |
… | |
… | |
237 | sub add_command { |
241 | sub add_command { |
238 | my ($self, $command, $tooltip, $widget, $cb) = @_; |
242 | my ($self, $command, $tooltip, $widget, $cb) = @_; |
239 | |
243 | |
240 | (my $abbrev = $command) =~ s/(\S)[^[:space:]_]*[[:space:]_]+/$1/g; |
244 | (my $abbrev = $command) =~ s/(\S)[^[:space:]_]*[[:space:]_]+/$1/g; |
241 | |
245 | |
|
|
246 | $self->{command} = [ |
242 | push @{$self->{command}}, [$abbrev, $command, $tooltip, $widget, $cb]; |
247 | [$abbrev, $command, $tooltip, $widget, $cb], |
|
|
248 | grep $_->[1] ne $command, @{ $self->{command} }, |
|
|
249 | ]; |
243 | } |
250 | } |
244 | |
251 | |
245 | package CFClient::MapWidget::MapMap; |
252 | package CFClient::MapWidget::MapMap; |
246 | |
253 | |
247 | our @ISA = CFClient::UI::Base::; |
254 | our @ISA = CFClient::UI::Base::; |
… | |
… | |
363 | my @found; |
370 | my @found; |
364 | |
371 | |
365 | for (@$command) { |
372 | for (@$command) { |
366 | if ($_->[0] =~ $search_abbrev) { |
373 | if ($_->[0] =~ $search_abbrev) { |
367 | push @found, [$_->[0], $_]; |
374 | push @found, [$_->[0], $_]; |
368 | } elsif ($_->[1] =~ $search_full) { |
375 | } elsif (2 < length $self->{search} and $_->[1] =~ $search_full) { |
369 | push @found, [$_->[1], $_]; |
376 | push @found, [$_->[1], $_]; |
370 | } |
377 | } |
371 | } |
378 | } |
372 | |
379 | |
373 | @found = sort { $a->[0] cmp $b->[0] } @found; |
380 | @found = sort { $a->[0] cmp $b->[0] } @found; |