… | |
… | |
3 | use strict; |
3 | use strict; |
4 | use utf8; |
4 | use utf8; |
5 | |
5 | |
6 | use List::Util qw(min max); |
6 | use List::Util qw(min max); |
7 | |
7 | |
|
|
8 | use CFClient; |
8 | use CFClient::OpenGL; |
9 | use CFClient::OpenGL; |
|
|
10 | use CFClient::UI; |
9 | |
11 | |
10 | our @ISA = CFClient::UI::Base::; |
12 | our @ISA = CFClient::UI::Base::; |
11 | |
13 | |
12 | my $magicmap_tex = |
14 | my $magicmap_tex = |
13 | new_from_file CFClient::Texture CFClient::find_rcfile "magicmap.png", |
15 | new_from_file CFClient::Texture CFClient::find_rcfile "magicmap.png", |
… | |
… | |
112 | [ |
114 | [ |
113 | $::PICKUP_ENABLE->{state} |
115 | $::PICKUP_ENABLE->{state} |
114 | ? "Disable automatic pickup" |
116 | ? "Disable automatic pickup" |
115 | : "Enable automatic pickup", |
117 | : "Enable automatic pickup", |
116 | sub { $::PICKUP_ENABLE->toggle } |
118 | sub { $::PICKUP_ENABLE->toggle } |
|
|
119 | ], |
|
|
120 | ["Quit", |
|
|
121 | sub { |
|
|
122 | if ($::CONN) { |
|
|
123 | &::open_quit_dialog; |
|
|
124 | } else { |
|
|
125 | exit; |
|
|
126 | } |
|
|
127 | } |
117 | ], |
128 | ], |
118 | ], |
129 | ], |
119 | )->popup ($ev); |
130 | )->popup ($ev); |
120 | } |
131 | } |
121 | |
132 | |
… | |
… | |
525 | my ($entry, $ev, $x, $y) = @_; |
536 | my ($entry, $ev, $x, $y) = @_; |
526 | |
537 | |
527 | if ($ev->{button} == 3) { |
538 | if ($ev->{button} == 3) { |
528 | (new CFClient::UI::Menu |
539 | (new CFClient::UI::Menu |
529 | items => [ |
540 | items => [ |
530 | ["bind <i>" . (CFClient::UI::Label::escape $self->{select}) . "</i> to a key" |
541 | ["bind <i>" . (CFClient::asxml $self->{select}) . "</i> to a key" |
531 | => sub { $::BIND_EDITOR->do_quick_binding ([$self->{select}], sub { $entry->grab_focus }) }] |
542 | => sub { $::BIND_EDITOR->do_quick_binding ([$self->{select}], sub { $entry->grab_focus }) }] |
532 | ], |
543 | ], |
533 | )->popup ($ev); |
544 | )->popup ($ev); |
534 | return 1; |
545 | return 1; |
535 | } |
546 | } |