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.47 by root, Fri Jun 2 22:13:47 2006 UTC vs.
Revision 1.50 by root, Sat Jun 3 23:47:47 2006 UTC

56sub button_down { 56sub button_down {
57 my ($self, $ev, $x, $y) = @_; 57 my ($self, $ev, $x, $y) = @_;
58 58
59 $self->focus_in; 59 $self->focus_in;
60 60
61 if ($ev->{button} == 2) { 61 if ($ev->{button} == 1) {
62 my $sw = int $::WIDTH / (32 * $::CFG->{map_scale}) + 0.99;
63 my $sh = int $::HEIGHT / (32 * $::CFG->{map_scale}) + 0.99;
64
65 my $fx = int +($ev->{x} - $::CFG->{map_shift_x}) / (32 * $::CFG->{map_scale}) - 0.5 * $sw + 0.99;
66 my $fy = int +($ev->{y} - $::CFG->{map_shift_y}) / (32 * $::CFG->{map_scale}) - 0.5 * $sh + 0.99;
67
68 $::CONN->send (sprintf "lookat %d %d", $fx, $fy);
69
70 } elsif ($ev->{button} == 2) {
62 my ($ox, $oy) = ($ev->{x}, $ev->{y}); 71 my ($ox, $oy) = ($ev->{x}, $ev->{y});
63 my ($bw, $bh) = ($::CFG->{map_shift_x}, $::CFG->{map_shift_y}); 72 my ($bw, $bh) = ($::CFG->{map_shift_x}, $::CFG->{map_shift_y});
64 73
65 $self->{motion} = sub { 74 $self->{motion} = sub {
66 my ($ev, $x, $y) = @_; 75 my ($ev, $x, $y) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines