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.26 by root, Wed May 17 16:17:01 2006 UTC vs.
Revision 1.29 by root, Thu May 18 16:42:26 2006 UTC

146 146
147 glPushMatrix; 147 glPushMatrix;
148 glCallList $self->{list}; 148 glCallList $self->{list};
149 glPopMatrix; 149 glPopMatrix;
150 150
151 # TNT2 emulates logops in software (or worse :)
151 if ($CFClient::UI::FOCUS != $self) { 152 if ($CFClient::UI::FOCUS != $self) {
152 glColor 64/255, 64/255, 64/255; 153 glColor 0.4, 0.2, 0.2, 0.9;
153 glLogicOp GL_AND; 154 glEnable GL_BLEND;
154 glEnable GL_COLOR_LOGIC_OP; 155 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
155 glBegin GL_QUADS; 156 glBegin GL_QUADS;
156 glVertex 0, 0; 157 glVertex 0, 0;
157 glVertex 0, $::HEIGHT; 158 glVertex 0, $::HEIGHT;
158 glVertex $::WIDTH, $::HEIGHT; 159 glVertex $::WIDTH, $::HEIGHT;
159 glVertex $::WIDTH, 0; 160 glVertex $::WIDTH, 0;
160 glEnd; 161 glEnd;
161 glDisable GL_COLOR_LOGIC_OP; 162 glDisable GL_BLEND;
162 } 163 }
163} 164}
164 165
165my %DIR = ( 166my %DIR = (
166 CFClient::SDLK_KP8, [1, "north"], 167 CFClient::SDLK_KP8, [1, "north"],
189 190
190 if ($sym == CFClient::SDLK_KP5) { 191 if ($sym == CFClient::SDLK_KP5) {
191 $::CONN->user_send ("stay fire"); 192 $::CONN->user_send ("stay fire");
192 } elsif ($uni == ord ",") { 193 } elsif ($uni == ord ",") {
193 $::CONN->user_send ("take"); 194 $::CONN->user_send ("take");
194 } elsif ($uni == ord "\t") { 195 } elsif ($uni == ord "\t" or $uni == ord " ") {
195 $::CONN->user_send ("apply"); 196 $::CONN->user_send ("apply");
197 } elsif ($sym == CFClient::SDLK_KP_PLUS || $uni == ord "+") {
198 $::CONN->user_send ("rotateshoottype +");
199 } elsif ($sym == CFClient::SDLK_KP_MINUS || $uni == ord "-") {
200 $::CONN->user_send ("rotateshoottype -");
196 } elsif ($uni == ord "'") { 201 } elsif ($uni == ord "'") {
197 $self->emit ('activate_console'); 202 $self->emit ('activate_console');
198 } elsif ($uni == ord "/") { 203 } elsif ($uni == ord "/") {
199 $self->emit (activate_console => '/'); 204 $self->emit (activate_console => '/');
200 } elsif (exists $DIR{$sym}) { 205 } elsif (exists $DIR{$sym}) {
252 257
253 $tooltip = "<big>$data</big>\n\n$tooltip"; 258 $tooltip = "<big>$data</big>\n\n$tooltip";
254 259
255 $tooltip =~ s/\s+$//; 260 $tooltip =~ s/\s+$//;
256 261
257 $self->{command}{$command} = [$data, $tooltip, $widget, $cb]; 262 $self->{command}{$command} = [$data, $tooltip, $widget, $cb, ++$self->{command_id}];
258} 263}
259 264
260sub clr_commands { 265sub clr_commands {
261 my ($self) = @_; 266 my ($self) = @_;
262 267
365 CFClient::UI::Label->new ( 370 CFClient::UI::Label->new (
366 can_hover => 1, 371 can_hover => 1,
367 can_events => 1, 372 can_events => 1,
368 tooltip_width => 0.33, 373 tooltip_width => 0.33,
369 fontsize => $_, 374 fontsize => $_,
370 ), (0.8) x 6 375 ), (0.8) x 16
371 ]; 376 ];
372 377
373 $self->{entry} = new CFClient::UI::Entry 378 $self->{entry} = new CFClient::UI::Entry
374 connect_changed => sub { 379 connect_changed => sub {
375 $self->update_labels; 380 $self->update_labels;
449 } 454 }
450 455
451 @match = map $self->{command}{$_->[0]}, 456 @match = map $self->{command}{$_->[0]},
452 sort { 457 sort {
453 $a->[1] <=> $b->[1] 458 $a->[1] <=> $b->[1]
454 or (length $a->[0]) <=> (length $b->[0]) 459 or $self->{command}{$a->[0]}[4] <=> $self->{command}{$b->[0]}[4]
455 } @match; 460 } @match;
456 461
457 $self->{last_search} = $cmd; 462 $self->{last_search} = $cmd;
458 $self->{last_match} = \@match; 463 $self->{last_match} = \@match;
459 464

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines