ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/MapWidget.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/MapWidget.pm (file contents):
Revision 1.64 by root, Sun Jun 18 17:23:35 2006 UTC vs.
Revision 1.66 by root, Sun Jun 18 19:13:20 2006 UTC

70 return unless $::CONN; 70 return unless $::CONN;
71 71
72 $self->grab_focus; 72 $self->grab_focus;
73 73
74 if ($ev->{button} == 1) { 74 if ($ev->{button} == 1) {
75 my $x = CFClient::floor +($ev->{x} - $self->{sx0}) / $self->{tilesize} - $self->{sx}; 75 my $x = 1 + CFClient::floor +($ev->{x} - $self->{sx0}) / $self->{tilesize} - $self->{sx};
76 my $y = CFClient::floor +($ev->{y} - $self->{sy0}) / $self->{tilesize} - $self->{sy}; 76 my $y = 1 + CFClient::floor +($ev->{y} - $self->{sy0}) / $self->{tilesize} - $self->{sy};
77 77
78 $x -= int 0.5 * $self->{sw}; 78 $x -= int 0.5 * $self->{sw};
79 $y -= int 0.5 * $self->{sh}; 79 $y -= int 0.5 * $self->{sh};
80 80
81 $::CONN->lookat ($x, $y) 81 $::CONN->lookat ($x, $y)
120 1 120 1
121} 121}
122 122
123sub size_request { 123sub size_request {
124 ( 124 (
125 1 + 32 * int $::WIDTH / 32, 125 32 * CFClient::ceil $::WIDTH / 32,
126 1 + 32 * int $::HEIGHT / 32, 126 32 * CFClient::ceil $::HEIGHT / 32,
127 ) 127 )
128} 128}
129 129
130sub update { 130sub update {
131 my ($self) = @_; 131 my ($self) = @_;
206 $::BIND_EDITOR->ask_for_bind_and_commit; 206 $::BIND_EDITOR->ask_for_bind_and_commit;
207 $::BIND_EDITOR->hide; 207 $::BIND_EDITOR->hide;
208 } elsif (my $bind_cmd = $::CFG->{profile}{default}{bindings}{$mod}{$sym}) { 208 } elsif (my $bind_cmd = $::CFG->{profile}{default}{bindings}{$mod}{$sym}) {
209 $::CONN->user_send ($_) for @$bind_cmd; 209 $::CONN->user_send ($_) for @$bind_cmd;
210 } elsif ((ord 'a') <= $uni && $uni <= (ord 'z')) { 210 } elsif ((ord 'a') <= $uni && $uni <= (ord 'z')) {
211 $self->{completer}->key_down ($ev); 211 $self->{completer}->invoke_key_down ($ev);
212 $self->{completer}->show; 212 $self->{completer}->show;
213 } else { 213 } else {
214 return 0; 214 return 0;
215 } 215 }
216 216
513 $self->hide; 513 $self->hide;
514 } 514 }
515 } elsif ($ev->{sym} == 27) { 515 } elsif ($ev->{sym} == 27) {
516 $self->{hist_ptr} = 0; 516 $self->{hist_ptr} = 0;
517 $self->hide; 517 $self->hide;
518 return;
519 } elsif ($ev->{sym} == CFClient::SDLK_DOWN) { 518 } elsif ($ev->{sym} == CFClient::SDLK_DOWN) {
520 if ($self->{hist_ptr} > 1) { 519 if ($self->{hist_ptr} > 1) {
521 $self->{hist_ptr}--; 520 $self->{hist_ptr}--;
522 $self->{entry}->set_text ($self->{history}->[$self->{hist_ptr} - 1]); 521 $self->{entry}->set_text ($self->{history}->[$self->{hist_ptr} - 1]);
523 } elsif ($self->{hist_ptr} > 0) { 522 } elsif ($self->{hist_ptr} > 0) {
588} 587}
589 588
590sub invoke_key_down { 589sub invoke_key_down {
591 my ($self, $ev) = @_; 590 my ($self, $ev) = @_;
592 591
593 $self->{entry}->key_down ($ev) 592 $self->{entry}->emit (key_down => $ev)
594} 593}
595 594
596sub update_labels { 595sub update_labels {
597 my ($self) = @_; 596 my ($self) = @_;
598 597
685 $label->set_text (""); 684 $label->set_text ("");
686 $label->set_tooltip (""); 685 $label->set_tooltip ("");
687 } 686 }
688 687
689 $self->update; 688 $self->update;
690 ###
691} 689}
692 690
693sub _draw { 691sub _draw {
694 my ($self) = @_; 692 my ($self) = @_;
695 693

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines