… | |
… | |
11 | (map +("($_)" => "!completer $_"), "a" .. "z"), |
11 | (map +("($_)" => "!completer $_"), "a" .. "z"), |
12 | "(!)" => "!completer shout ", |
12 | "(!)" => "!completer shout ", |
13 | "(\")" => "!completer say ", |
13 | "(\")" => "!completer say ", |
14 | "(')" => "!completer", |
14 | "(')" => "!completer", |
15 | |
15 | |
16 | "LShift-tab" => "!toggle-messagewindow", |
16 | # "LShift-tab" => "!toggle-messagewindow", |
17 | "RShift-tab" => "!toggle-messagewindow", |
17 | # "RShift-tab" => "!toggle-messagewindow", |
18 | "tab" => "!toggle-playerbook", |
18 | "tab" => "!toggle-playerbook", |
19 | "f1" => "!toggle-help", |
19 | "f1" => "!toggle-help", |
20 | "f2" => "!toggle-stats", |
20 | "f2" => "!toggle-stats", |
21 | "f3" => "!toggle-skills", |
21 | "f3" => "!toggle-skills", |
22 | "f4" => "!toggle-spells", |
22 | "f4" => "!toggle-spells", |
23 | "f5" => "!toggle-inventory", |
23 | "f5" => "!toggle-inventory", |
24 | "f9" => "!toggle-setup", |
24 | "f9" => "!toggle-setup", |
|
|
25 | |
25 | (map +("LAlt-$_" => "!switch-tab $_"), 0..9), |
26 | (map +("LRAM-$_" => "!switch-tab $_"), 0..9), |
26 | (map +("RAlt-$_" => "!switch-tab $_"), 0..9), |
|
|
27 | "LAlt-x" => "!close-current-tab", |
27 | "LRAM-x" => "!close-current-tab", |
|
|
28 | |
28 | "return" => "!activate-chat", |
29 | "return" => "!activate-chat", |
29 | "." => "!repeat-command", |
30 | "." => "!repeat-command", |
30 | |
31 | |
31 | "," => "take", |
32 | "," => "take", |
32 | "space" => "apply", |
33 | "space" => "apply", |
33 | "enter" => "examine", |
34 | "enter" => "examine", |
34 | "[+]" => "rotateshoottype +", |
35 | "[+]" => "rotateshoottype +", |
35 | "[-]" => "rotateshoottype -", |
36 | "[-]" => "rotateshoottype -", |
|
|
37 | |
36 | "LAlt-e" => "examine", |
38 | "LRAM-e" => "examine", |
37 | "LAlt-s" => "ready_skill find traps", |
39 | "LRAM-s" => "ready_skill find traps", |
38 | "LAlt-d" => "ready_skill disarm traps", |
40 | "LRAM-d" => "ready_skill disarm traps", |
39 | "LAlt-p" => "ready_skill praying", |
41 | "LRAM-p" => "ready_skill praying", |
40 | ); |
42 | ); |
41 | |
43 | |
42 | # allowed modifiers |
44 | # allowed modifiers |
43 | our %MODIFIER = ( |
45 | our %MODIFIER = ( |
44 | "LShift" => DC::KMOD_LSHIFT, |
46 | "LShift" => DC::KMOD_LSHIFT, |
… | |
… | |
51 | "RAlt" => DC::KMOD_RALT, |
53 | "RAlt" => DC::KMOD_RALT, |
52 | # "Alt" => DC::KMOD_LALT | DC::KMOD_RALT, |
54 | # "Alt" => DC::KMOD_LALT | DC::KMOD_RALT, |
53 | "LMeta" => DC::KMOD_LMETA, |
55 | "LMeta" => DC::KMOD_LMETA, |
54 | "RMeta" => DC::KMOD_RMETA, |
56 | "RMeta" => DC::KMOD_RMETA, |
55 | # "Meta" => DC::KMOD_LMETA | DC::KMOD_RMETA, |
57 | # "Meta" => DC::KMOD_LMETA | DC::KMOD_RMETA, |
|
|
58 | "LRAM" => DC::KMOD_LRAM, # left/right/alt/meta |
56 | ); |
59 | ); |
57 | |
60 | |
58 | # allowed modifiers |
61 | # allowed modifiers |
59 | our $MODIFIER_MASK |= $_ for values %MODIFIER; |
62 | our $MODIFIER_MASK |= $_ for values %MODIFIER; |
60 | |
63 | |
… | |
… | |
434 | $REFRESH_MACRO_LIST = $refresh = sub { |
437 | $REFRESH_MACRO_LIST = $refresh = sub { |
435 | $macrolist->clear; |
438 | $macrolist->clear; |
436 | |
439 | |
437 | $macrolist->add_at (0, 1, new DC::UI::Label |
440 | $macrolist->add_at (0, 1, new DC::UI::Label |
438 | text => "Trigger", |
441 | text => "Trigger", |
|
|
442 | tooltip => $tooltip_trigger . $tooltip_common, |
|
|
443 | ); |
|
|
444 | $macrolist->add_at (1, 1, new DC::UI::Label |
|
|
445 | text => "Actions", |
439 | align => 0, |
446 | align => 0, |
440 | tooltip => $tooltip_trigger . $tooltip_common, |
|
|
441 | ); |
|
|
442 | $macrolist->add_at (1, 1, new DC::UI::Label |
|
|
443 | text => "Commands", |
|
|
444 | tooltip => $tooltip_commands . $tooltip_common, |
447 | tooltip => $tooltip_commands . $tooltip_common, |
445 | ); |
448 | ); |
446 | |
449 | |
447 | for my $idx (0 .. $#{$::PROFILE->{macro} || []}) { |
450 | for my $idx (0 .. $#{$::PROFILE->{macro} || []}) { |
448 | my $macro = $::PROFILE->{macro}[$idx]; |
451 | my $macro = $::PROFILE->{macro}[$idx]; |
… | |
… | |
475 | }; |
478 | }; |
476 | |
479 | |
477 | $macrolist->add_at (0, $y, new DC::UI::Label |
480 | $macrolist->add_at (0, $y, new DC::UI::Label |
478 | text => trigger_to_string $macro, |
481 | text => trigger_to_string $macro, |
479 | tooltip => $tooltip_trigger . $tooltip_common, |
482 | tooltip => $tooltip_trigger . $tooltip_common, |
480 | align => 0, |
483 | fg => [1, 0.8, 0.8], |
481 | can_hover => 1, |
484 | can_hover => 1, |
482 | can_events => 1, |
485 | can_events => 1, |
483 | on_button_down => $macro_cb, |
486 | on_button_down => $macro_cb, |
484 | ); |
487 | ); |
485 | |
488 | |
486 | $macrolist->add_at (1, $y, new DC::UI::Label |
489 | $macrolist->add_at (1, $y, new DC::UI::Label |
487 | text => (join "; ", @{ $macro->{action} || [] }), |
490 | text => (join "; ", @{ $macro->{action} || [] }), |
488 | tooltip => $tooltip_commands . $tooltip_common, |
491 | tooltip => $tooltip_commands . $tooltip_common, |
|
|
492 | fg => [0.9, 0.9, 0.9], |
|
|
493 | align => 0, |
489 | expand => 1, |
494 | expand => 1, |
490 | ellipsise => 3, |
495 | ellipsise => 3, |
491 | can_hover => 1, |
496 | can_hover => 1, |
492 | can_events => 1, |
497 | can_events => 1, |
493 | on_button_down => $macro_cb, |
498 | on_button_down => $macro_cb, |