… | |
… | |
339 | ::toggle_player_page ($::SPELL_PAGE); |
339 | ::toggle_player_page ($::SPELL_PAGE); |
340 | } elsif ($sym == CFPlus::SDLK_F5 && !$mod) { |
340 | } elsif ($sym == CFPlus::SDLK_F5 && !$mod) { |
341 | ::toggle_player_page ($::INVENTORY_PAGE); |
341 | ::toggle_player_page ($::INVENTORY_PAGE); |
342 | } elsif ($sym == CFPlus::SDLK_F9 && !$mod) { |
342 | } elsif ($sym == CFPlus::SDLK_F9 && !$mod) { |
343 | $::SETUP_DIALOG->toggle_visibility; |
343 | $::SETUP_DIALOG->toggle_visibility; |
|
|
344 | } elsif ($uni >= ord "0" && $uni <= ord "9" && $mod & CFPlus::KMOD_ALT) { |
|
|
345 | $::MESSAGE_WINDOW->user_switch_to_page (chr $uni); |
344 | } elsif (!$::CONN) { |
346 | } elsif (!$::CONN) { |
345 | return 0; # bindings further down need a valid connection |
347 | return 0; # bindings further down need a valid connection |
346 | |
348 | |
347 | } elsif ($uni == ord ",") { |
349 | } elsif ($uni == ord ",") { |
348 | $::CONN->user_send ("take"); |
350 | $::CONN->user_send ("take"); |
349 | } elsif ($uni == ord " ") { |
351 | } elsif ($uni == ord " ") { |
350 | $::CONN->user_send ("apply"); |
352 | $::CONN->user_send ("apply"); |
351 | } elsif ($uni == 13) { |
353 | } elsif ($uni == 13) { |
352 | $::CONN->user_send ("examine"); |
354 | $::MESSAGE_WINDOW->activate_current; |
353 | } elsif ($uni == ord ".") { |
355 | } elsif ($uni == ord ".") { |
354 | $::CONN->user_send ($self->{completer}{last_command}) |
356 | $::CONN->user_send ($self->{completer}{last_command}) |
355 | if exists $self->{completer}{last_command}; |
357 | if exists $self->{completer}{last_command}; |
356 | } elsif (my @macros = CFPlus::Macro::match_event $ev) { |
358 | } elsif (my @macros = CFPlus::Macro::match_event $ev) { |
357 | $::CONN->macro_send ($_) for @macros; |
359 | $::CONN->macro_send ($_) for @macros; |
… | |
… | |
444 | } |
446 | } |
445 | |
447 | |
446 | sub refresh_hook { |
448 | sub refresh_hook { |
447 | my ($self) = @_; |
449 | my ($self) = @_; |
448 | |
450 | |
449 | if ($::MAP) { |
451 | if ($::MAP && $::CONN) { |
450 | if (delete $self->{need_update}) { |
452 | if (delete $self->{need_update}) { |
451 | my $tilesize = $self->{ctilesize} = (int $self->{tilesize} * $::CFG->{map_scale}) || 1; |
453 | my $tilesize = $self->{ctilesize} = (int $self->{tilesize} * $::CFG->{map_scale}) || 1; |
452 | |
454 | |
453 | my $sw = $self->{sw} = 1 + CFPlus::ceil $self->{w} / $tilesize; |
455 | my $sw = $self->{sw} = 1 + CFPlus::ceil $self->{w} / $tilesize; |
454 | my $sh = $self->{sh} = 1 + CFPlus::ceil $self->{h} / $tilesize; |
456 | my $sh = $self->{sh} = 1 + CFPlus::ceil $self->{h} / $tilesize; |