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.25 by root, Wed May 17 15:18:57 2006 UTC vs.
Revision 1.30 by root, Fri May 19 18:39:08 2006 UTC

78 $self->SUPER::update; 78 $self->SUPER::update;
79} 79}
80 80
81sub draw { 81sub draw {
82 my ($self) = @_; 82 my ($self) = @_;
83
84 return
85 unless $CFClient::UI::FOCUS == $self || !$::FAST;
83 86
84 if (delete $self->{need_update}) { 87 if (delete $self->{need_update}) {
85 glNewList $self->{list}; 88 glNewList $self->{list};
86 89
87 if ($::MAP) { 90 if ($::MAP) {
112 0.05, 0.13, 0.05, 115 0.05, 0.13, 0.05,
113 ); 116 );
114 glEnable GL_CONVOLUTION_2D; 117 glEnable GL_CONVOLUTION_2D;
115 } 118 }
116 119
120 undef $self->{fow_texture};#d# remove
117 $self->{fow_texture} = new CFClient::Texture 121 $self->{fow_texture} = new CFClient::Texture
118 w => $w, 122 w => $w,
119 h => $h, 123 h => $h,
120 data => $data, 124 data => $data,
121 internalformat => GL_ALPHA, 125 internalformat => GL_ALPHA,
143 147
144 glPushMatrix; 148 glPushMatrix;
145 glCallList $self->{list}; 149 glCallList $self->{list};
146 glPopMatrix; 150 glPopMatrix;
147 151
152 # TNT2 emulates logops in software (or worse :)
148 if ($CFClient::UI::FOCUS != $self) { 153 if ($CFClient::UI::FOCUS != $self) {
149 glColor 64/255, 64/255, 64/255; 154 glColor 0.4, 0.2, 0.2, 0.9;
150 glLogicOp GL_AND; 155 glEnable GL_BLEND;
151 glEnable GL_COLOR_LOGIC_OP; 156 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
152 glBegin GL_QUADS; 157 glBegin GL_QUADS;
153 glVertex 0, 0; 158 glVertex 0, 0;
154 glVertex 0, $::HEIGHT; 159 glVertex 0, $::HEIGHT;
155 glVertex $::WIDTH, $::HEIGHT; 160 glVertex $::WIDTH, $::HEIGHT;
156 glVertex $::WIDTH, 0; 161 glVertex $::WIDTH, 0;
157 glEnd; 162 glEnd;
158 glDisable GL_COLOR_LOGIC_OP; 163 glDisable GL_BLEND;
159 } 164 }
160} 165}
161 166
162my %DIR = ( 167my %DIR = (
163 CFClient::SDLK_KP8, [1, "north"], 168 CFClient::SDLK_KP8, [1, "north"],
186 191
187 if ($sym == CFClient::SDLK_KP5) { 192 if ($sym == CFClient::SDLK_KP5) {
188 $::CONN->user_send ("stay fire"); 193 $::CONN->user_send ("stay fire");
189 } elsif ($uni == ord ",") { 194 } elsif ($uni == ord ",") {
190 $::CONN->user_send ("take"); 195 $::CONN->user_send ("take");
191 } elsif ($uni == ord "\t") { 196 } elsif ($uni == ord "\t" or $uni == ord " ") {
192 $::CONN->user_send ("apply"); 197 $::CONN->user_send ("apply");
198 } elsif ($sym == CFClient::SDLK_KP_PLUS || $uni == ord "+") {
199 $::CONN->user_send ("rotateshoottype +");
200 } elsif ($sym == CFClient::SDLK_KP_MINUS || $uni == ord "-") {
201 $::CONN->user_send ("rotateshoottype -");
193 } elsif ($uni == ord "'") { 202 } elsif ($uni == ord "'") {
194 $self->emit ('activate_console'); 203 $self->emit ('activate_console');
195 } elsif ($uni == ord "/") { 204 } elsif ($uni == ord "/") {
196 $self->emit (activate_console => '/'); 205 $self->emit (activate_console => '/');
197 } elsif (exists $DIR{$sym}) { 206 } elsif (exists $DIR{$sym}) {
249 258
250 $tooltip = "<big>$data</big>\n\n$tooltip"; 259 $tooltip = "<big>$data</big>\n\n$tooltip";
251 260
252 $tooltip =~ s/\s+$//; 261 $tooltip =~ s/\s+$//;
253 262
254 $self->{command}{$command} = [$data, $tooltip, $widget, $cb]; 263 $self->{command}{$command} = [$data, $tooltip, $widget, $cb, ++$self->{command_id}];
255} 264}
256 265
257sub clr_commands { 266sub clr_commands {
258 my ($self) = @_; 267 my ($self) = @_;
259 268
362 CFClient::UI::Label->new ( 371 CFClient::UI::Label->new (
363 can_hover => 1, 372 can_hover => 1,
364 can_events => 1, 373 can_events => 1,
365 tooltip_width => 0.33, 374 tooltip_width => 0.33,
366 fontsize => $_, 375 fontsize => $_,
367 ), (0.8) x 6 376 ), (0.8) x 16
368 ]; 377 ];
369 378
370 $self->{entry} = new CFClient::UI::Entry 379 $self->{entry} = new CFClient::UI::Entry
371 connect_changed => sub { 380 connect_changed => sub {
372 $self->update_labels; 381 $self->update_labels;
446 } 455 }
447 456
448 @match = map $self->{command}{$_->[0]}, 457 @match = map $self->{command}{$_->[0]},
449 sort { 458 sort {
450 $a->[1] <=> $b->[1] 459 $a->[1] <=> $b->[1]
451 or (length $a->[0]) <=> (length $b->[0]) 460 or $self->{command}{$a->[0]}[4] <=> $self->{command}{$b->[0]}[4]
452 } @match; 461 } @match;
453 462
454 $self->{last_search} = $cmd; 463 $self->{last_search} = $cmd;
455 $self->{last_match} = \@match; 464 $self->{last_match} = \@match;
456 465

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines