… | |
… | |
60 | %{$self->{completer}{command}} = (); |
60 | %{$self->{completer}{command}} = (); |
61 | } |
61 | } |
62 | |
62 | |
63 | sub button_down { |
63 | sub button_down { |
64 | my ($self, $ev, $x, $y) = @_; |
64 | my ($self, $ev, $x, $y) = @_; |
|
|
65 | |
|
|
66 | return unless $::CONN; |
65 | |
67 | |
66 | $self->focus_in; |
68 | $self->focus_in; |
67 | |
69 | |
68 | if ($ev->{button} == 1) { |
70 | if ($ev->{button} == 1) { |
69 | my $x = int +($ev->{x} - $::CFG->{map_shift_x}) / (32 * $::CFG->{map_scale}); |
71 | my $x = int +($ev->{x} - $::CFG->{map_shift_x}) / (32 * $::CFG->{map_scale}); |
… | |
… | |
255 | |
257 | |
256 | my $focused = $CFClient::UI::FOCUS == $self |
258 | my $focused = $CFClient::UI::FOCUS == $self |
257 | || $CFClient::UI::FOCUS == $self->{completer}{entry}; |
259 | || $CFClient::UI::FOCUS == $self->{completer}{entry}; |
258 | |
260 | |
259 | return |
261 | return |
260 | unless $focused || !$::FAST; |
262 | unless $::CONN && ($focused || !$::FAST); |
261 | |
263 | |
262 | if (delete $self->{need_update}) { |
264 | if (delete $self->{need_update}) { |
|
|
265 | $self->{fow_texture} ||= glGenTexture; |
|
|
266 | |
263 | glNewList $self->{list}; |
267 | glNewList $self->{list}; |
264 | |
268 | |
265 | if ($::MAP) { |
269 | if ($::MAP) { |
266 | my $sw = $self->{sw} = int $::WIDTH / (32 * $::CFG->{map_scale}) + 0.99; |
270 | my $sw = $self->{sw} = int $::WIDTH / (32 * $::CFG->{map_scale}) + 0.99; |
267 | my $sh = $self->{sh} = int $::HEIGHT / (32 * $::CFG->{map_scale}) + 0.99; |
271 | my $sh = $self->{sh} = int $::HEIGHT / (32 * $::CFG->{map_scale}) + 0.99; |