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.119 by root, Tue Aug 28 01:23:47 2007 UTC vs.
Revision 1.124 by root, Wed Dec 26 18:09:30 2007 UTC

72 print "preparing editor startup...\n"; 72 print "preparing editor startup...\n";
73 73
74 my $server = $editsup->{gameserver} || "default"; 74 my $server = $editsup->{gameserver} || "default";
75 $server =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge; 75 $server =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge;
76 76
77 local $ENV{CROSSFIRE_MAPDIR} = my $mapdir = "$Crossfire::VARDIR/map.$server"; mkdir $mapdir; 77 local $ENV{CROSSFIRE_MAPDIR} = my $mapdir = "$Deliantra::VARDIR/map.$server"; mkdir $mapdir;
78 local $ENV{CROSSFIRE_LIBDIR} = my $libdir = "$Crossfire::VARDIR/lib.$server"; mkdir $libdir; 78 local $ENV{CROSSFIRE_LIBDIR} = my $libdir = "$Deliantra::VARDIR/lib.$server"; mkdir $libdir;
79 79
80 print "map directory is $mapdir\n"; 80 print "map directory is $mapdir\n";
81 print "lib directory is $libdir\n"; 81 print "lib directory is $libdir\n";
82 82
83 my $ua = CFPlus::lwp_useragent; 83 my $ua = CFPlus::lwp_useragent;
120 require File::Path; 120 require File::Path;
121 121
122 File::Path::mkpath (File::Basename::dirname ($mappath)); 122 File::Path::mkpath (File::Basename::dirname ($mappath));
123 open my $fh, ">:raw:perlio", "$mappath.meta" 123 open my $fh, ">:raw:perlio", "$mappath.meta"
124 or die "$mappath.meta: $!\n"; 124 or die "$mappath.meta: $!\n";
125 print $fh CFPlus::to_json $meta; 125 print $fh CFPlus::encode_json $meta;
126 close $fh; 126 close $fh;
127 open my $fh, ">:raw:perlio:utf8", $mappath 127 open my $fh, ">:raw:perlio:utf8", $mappath
128 or die "$mappath: $!\n"; 128 or die "$mappath: $!\n";
129 print $fh $map; 129 print $fh $map;
130 close $fh; 130 close $fh;
326 if ($mod & CFPlus::KMOD_SHIFT) { 326 if ($mod & CFPlus::KMOD_SHIFT) {
327 $self->{shft}++; 327 $self->{shft}++;
328 if ($dir->[0] != $self->{fire_dir}) { 328 if ($dir->[0] != $self->{fire_dir}) {
329 $::CONN->user_send ("fire $dir->[0]"); 329 $::CONN->user_send ("fire $dir->[0]");
330 } 330 }
331 $self->{fire_dir} = $DIR{$sym}[0]; 331 $self->{fire_dir} = $dir->[0];
332 } elsif ($mod & CFPlus::KMOD_CTRL) { 332 } elsif ($mod & CFPlus::KMOD_CTRL) {
333 $self->{ctrl}++; 333 $self->{ctrl}++;
334 $::CONN->user_send ("run $dir->[0]"); 334 $::CONN->user_send ("run $dir->[0]");
335 } else { 335 } else {
336 $::CONN->user_send ("$dir->[1]"); 336 $::CONN->user_send ("$dir->[1]");
354 $::CONN->user_send ("fire_stop"); 354 $::CONN->user_send ("fire_stop");
355 delete $self->{fire_dir}; 355 delete $self->{fire_dir};
356 $res = 1; 356 $res = 1;
357 } 357 }
358 } else { 358 } else {
359 if (exists $DIR{$sym} && delete $self->{shft}) { 359 if (exists $DIR{(!!($mod & CFPlus::KMOD_ALT)) . ",$sym"} && delete $self->{shft}) {
360 $::CONN->user_send ("fire_stop"); 360 $::CONN->user_send ("fire_stop");
361 delete $self->{fire_dir}; 361 delete $self->{fire_dir};
362 $res = 1; 362 $res = 1;
363 } elsif (($sym == CFPlus::SDLK_LSHIFT || $sym == CFPlus::SDLK_RSHIFT) && delete $self->{shft}) { # XXX: is RSHIFT ok? 363 } elsif (($sym == CFPlus::SDLK_LSHIFT || $sym == CFPlus::SDLK_RSHIFT)
364 && delete $self->{shft}) { # XXX: is RSHIFT ok?
364 $::CONN->user_send ("fire_stop"); 365 $::CONN->user_send ("fire_stop");
365 delete $self->{fire_dir}; 366 delete $self->{fire_dir};
366 $res = 1; 367 $res = 1;
367 } 368 }
368 } 369 }
475 $self->{root}->on_post_alloc (prepare => sub { $self->refresh_hook }); 476 $self->{root}->on_post_alloc (prepare => sub { $self->refresh_hook });
476 477
477 return unless $self->{list}; 478 return unless $self->{list};
478 479
479 my $focused = $CFPlus::UI::FOCUS == $self 480 my $focused = $CFPlus::UI::FOCUS == $self
480 || $CFPlus::UI::FOCUS == $::COMPLETER{entry}; 481 || $CFPlus::UI::FOCUS == $::COMPLETER->{entry};
481 482
482 return 483 return
483 unless $focused || !$::FAST; 484 unless $focused || !$::FAST;
484 485
485 glCallList $self->{list}; 486 glCallList $self->{list};
486 487
487 # TNT2 emulates logops in software (or worse :) 488 # TNT2 emulates logops in software (or worse :)
488 unless ($focused) { 489 unless ($focused) {
489 glColor 0.4, 0.2, 0.2, 0.6; 490 glColor_premultiply 0, 0, 1, 0.25;
490 glEnable GL_BLEND; 491 glEnable GL_BLEND;
491 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; 492 glBlendFunc GL_ONE, GL_ONE_MINUS_SRC_ALPHA;
492 glBegin GL_QUADS; 493 glBegin GL_QUADS;
493 glVertex 0, 0; 494 glVertex 0, 0;
494 glVertex 0, $::HEIGHT; 495 glVertex 0, $::HEIGHT;
495 glVertex $::WIDTH, $::HEIGHT; 496 glVertex $::WIDTH, $::HEIGHT;
496 glVertex $::WIDTH, 0; 497 glVertex $::WIDTH, 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines