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.105 by root, Wed Apr 4 02:54:02 2007 UTC vs.
Revision 1.108 by root, Wed Apr 25 01:12:31 2007 UTC

184 184
185 if ($ev->{button} == 1) { 185 if ($ev->{button} == 1) {
186 $self->grab_focus; 186 $self->grab_focus;
187 return unless $::CONN; 187 return unless $::CONN;
188 188
189 my $x = $self->{dx} + CFPlus::floor +($ev->{x} - $self->{sx0}) / $self->{tilesize}; 189 my $x = $self->{dx} + CFPlus::floor +($ev->{x} - $self->{sx0}) / $self->{ctilesize};
190 my $y = $self->{dy} + CFPlus::floor +($ev->{y} - $self->{sy0}) / $self->{tilesize}; 190 my $y = $self->{dy} + CFPlus::floor +($ev->{y} - $self->{sy0}) / $self->{ctilesize};
191 191
192 $x -= CFPlus::floor $::MAP->w * 0.5; 192 $x -= CFPlus::floor $::MAP->w * 0.5;
193 $y -= CFPlus::floor $::MAP->h * 0.5; 193 $y -= CFPlus::floor $::MAP->h * 0.5;
194 194
195 if ($::CONN) { 195 if ($::CONN) {
308 $self->{need_update} = 1; 308 $self->{need_update} = 1;
309 $self->SUPER::update; 309 $self->SUPER::update;
310} 310}
311 311
312my %DIR = ( 312my %DIR = (
313 CFPlus::SDLK_KP5, [0, "stay fire"],
313 CFPlus::SDLK_KP8, [1, "north"], 314 CFPlus::SDLK_KP8, [1, "north"],
314 CFPlus::SDLK_KP9, [2, "northeast"], 315 CFPlus::SDLK_KP9, [2, "northeast"],
315 CFPlus::SDLK_KP6, [3, "east"], 316 CFPlus::SDLK_KP6, [3, "east"],
316 CFPlus::SDLK_KP3, [4, "southeast"], 317 CFPlus::SDLK_KP3, [4, "southeast"],
317 CFPlus::SDLK_KP2, [5, "south"], 318 CFPlus::SDLK_KP2, [5, "south"],
349 } elsif ($sym == CFPlus::SDLK_F9 && !$mod) { 350 } elsif ($sym == CFPlus::SDLK_F9 && !$mod) {
350 $::SETUP_DIALOG->toggle_visibility; 351 $::SETUP_DIALOG->toggle_visibility;
351 } elsif (!$::CONN) { 352 } elsif (!$::CONN) {
352 return 0; # bindings further down need a valid connection 353 return 0; # bindings further down need a valid connection
353 354
354 } elsif ($sym == CFPlus::SDLK_KP5 && !$mod) {
355 $::CONN->user_send ("stay fire");
356 } elsif ($uni == ord ",") { 355 } elsif ($uni == ord ",") {
357 $::CONN->user_send ("take"); 356 $::CONN->user_send ("take");
358 } elsif ($uni == ord " ") { 357 } elsif ($uni == ord " ") {
359 $::CONN->user_send ("apply"); 358 $::CONN->user_send ("apply");
360 } elsif ($uni == 13) { 359 } elsif ($uni == 13) {
454 453
455 return 454 return
456 unless $focused || !$::FAST; 455 unless $focused || !$::FAST;
457 456
458 if (delete $self->{need_update}) { 457 if (delete $self->{need_update}) {
459 my $tilesize = $self->{tilesize} = (int $self->{tilesize} * $::CFG->{map_scale}) || 1; 458 my $tilesize = $self->{ctilesize} = (int $self->{tilesize} * $::CFG->{map_scale}) || 1;
460 459
461 my $sw = $self->{sw} = 1 + CFPlus::ceil $self->{w} / $tilesize; 460 my $sw = $self->{sw} = 1 + CFPlus::ceil $self->{w} / $tilesize;
462 my $sh = $self->{sh} = 1 + CFPlus::ceil $self->{h} / $tilesize; 461 my $sh = $self->{sh} = 1 + CFPlus::ceil $self->{h} / $tilesize;
463 462
464 my $sx = CFPlus::ceil $::CFG->{map_shift_x} / $tilesize; 463 my $sx = CFPlus::ceil $::CFG->{map_shift_x} / $tilesize;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines