… | |
… | |
8 | title => "Help", |
8 | title => "Help", |
9 | reply => "help ", |
9 | reply => "help ", |
10 | tooltip => "Online Help", |
10 | tooltip => "Online Help", |
11 | }; |
11 | }; |
12 | |
12 | |
|
|
13 | # these commands should be preferred by the client completer |
|
|
14 | # we put them first in their own face. |
|
|
15 | our @PREFERRED = qw(chat say shout tell); |
|
|
16 | |
13 | # considerable duplication between load_doclets and load_topics |
17 | # considerable duplication between load_doclets and load_topics |
14 | sub load_doclets { |
18 | sub load_doclets { |
15 | %DOCLET = (); |
19 | %DOCLET = (); |
16 | |
20 | |
17 | my %command_list; |
21 | my %command_list; |
|
|
22 | my %preferred = map { $_ => undef } @PREFERRED; |
18 | |
23 | |
19 | for ( |
24 | for ( |
20 | [standard => "command_help"], |
25 | [standard => "command_help"], |
21 | [emote => "emote_help"], |
26 | [emote => "emote_help"], |
22 | [dm => "dmcommand_help"], |
27 | [dm => "dmcommand_help"], |
… | |
… | |
58 | } |
63 | } |
59 | } |
64 | } |
60 | |
65 | |
61 | cf::cede_to_tick; |
66 | cf::cede_to_tick; |
62 | |
67 | |
|
|
68 | @$_ = grep !exists $preferred{$_}, @$_ |
|
|
69 | for values %command_list; |
|
|
70 | |
|
|
71 | $command_list{preferred} = \@PREFERRED; |
|
|
72 | |
63 | while (my ($k, $v) = each %command_list) { |
73 | while (my ($k, $v) = each %command_list) { |
|
|
74 | cf::cede_to_tick; |
64 | cf::client::set_command_face $k, $v |
75 | cf::client::set_command_face $k, $v; |
65 | } |
76 | } |
66 | } |
77 | } |
67 | |
78 | |
68 | our $DOCLET_HANDLER = ext::doclet::register command => sub { |
79 | our $DOCLET_HANDLER = ext::doclet::register command => sub { |
69 | my ($pl, $category, $command) = @_; |
80 | my ($pl, $category, $command) = @_; |