… | |
… | |
191 | my $row = 1; |
191 | my $row = 1; |
192 | |
192 | |
193 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fullscreen"); |
193 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fullscreen"); |
194 | $table->add (1, $row++, new CFClient::UI::CheckBox |
194 | $table->add (1, $row++, new CFClient::UI::CheckBox |
195 | state => $CFG->{fullscreen}, |
195 | state => $CFG->{fullscreen}, |
196 | tooltip => "Bring the client into fullscreen mode", |
196 | tooltip => "Bring the client into fullscreen mode.", |
197 | connect_changed => sub { |
197 | connect_changed => sub { |
198 | my ($self, $value) = @_; |
198 | my ($self, $value) = @_; |
199 | $CFG->{fullscreen} = $value; |
199 | $CFG->{fullscreen} = $value; |
200 | } |
200 | } |
201 | ); |
201 | ); |
… | |
… | |
211 | ); |
211 | ); |
212 | |
212 | |
213 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Map Scale"); |
213 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Map Scale"); |
214 | $table->add (1, $row++, new CFClient::UI::Slider |
214 | $table->add (1, $row++, new CFClient::UI::Slider |
215 | range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], |
215 | range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], |
216 | tooltip => "Enlarge or shrink the displayed map", |
216 | tooltip => "Enlarge or shrink the displayed map. Changes are instant.", |
217 | connect_changed => sub { |
217 | connect_changed => sub { |
218 | my ($self, $value) = @_; |
218 | my ($self, $value) = @_; |
219 | $CFG->{map_scale} = 2 ** $value; |
219 | $CFG->{map_scale} = 2 ** $value; |
220 | } |
220 | } |
221 | ); |
221 | ); |
222 | |
222 | |
223 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War"); |
223 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War"); |
224 | $table->add (1, $row++, new CFClient::UI::CheckBox |
224 | $table->add (1, $row++, new CFClient::UI::CheckBox |
225 | state => $CFG->{fow_enable}, |
225 | state => $CFG->{fow_enable}, |
226 | tooltip => "Fog-of-War marks areas that cannot be seen by the player", |
226 | tooltip => "<b>Fog-of-War</b> marks areas that cannot be seen by the player. Changes are instant.", |
227 | connect_changed => sub { |
227 | connect_changed => sub { |
228 | my ($self, $value) = @_; |
228 | my ($self, $value) = @_; |
229 | $CFG->{fow_enable} = $value; |
229 | $CFG->{fow_enable} = $value; |
230 | } |
230 | } |
231 | ); |
231 | ); |
232 | |
232 | |
233 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity"); |
233 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity"); |
234 | $table->add (1, $row++, new CFClient::UI::Slider |
234 | $table->add (1, $row++, new CFClient::UI::Slider |
235 | range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256], |
235 | range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256], |
236 | tooltip => "The higher the intensity, the lighter the Fog-of-War color", |
236 | tooltip => "<b>Fog of War Lightness.</b> The higher the intensity, the lighter the Fog-of-War color. Changes are instant.", |
237 | connect_changed => sub { |
237 | connect_changed => sub { |
238 | my ($self, $value) = @_; |
238 | my ($self, $value) = @_; |
239 | $CFG->{fow_intensity} = $value; |
239 | $CFG->{fow_intensity} = $value; |
240 | } |
240 | } |
241 | ); |
241 | ); |
242 | |
242 | |
243 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth"); |
243 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth"); |
244 | $table->add (1, $row++, new CFClient::UI::CheckBox |
244 | $table->add (1, $row++, new CFClient::UI::CheckBox |
245 | state => $CFG->{fow_smooth}, |
245 | state => $CFG->{fow_smooth}, |
246 | tooltip => "Smooth the Fog-of-War a bit to make it more realistic", |
246 | tooltip => "Smooth the Fog-of-War a bit to make it more realistic. Changes are instant.", |
247 | connect_changed => sub { |
247 | connect_changed => sub { |
248 | my ($self, $value) = @_; |
248 | my ($self, $value) = @_; |
249 | $CFG->{fow_smooth} = $value; |
249 | $CFG->{fow_smooth} = $value; |
250 | status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::GL_VERSION < 1.2; |
250 | status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::GL_VERSION < 1.2; |
251 | } |
251 | } |
252 | ); |
252 | ); |
253 | |
253 | |
254 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); |
254 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); |
255 | $table->add (1, $row++, new CFClient::UI::Slider |
255 | $table->add (1, $row++, new CFClient::UI::Slider |
256 | range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], |
256 | range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], |
257 | tooltip => "The font size used by most GUI elements", |
257 | tooltip => "The base font size used by most GUI elements that do not have their own setting.", |
258 | connect_changed => sub { $CFG->{gui_fontsize} = $_[1] }, |
258 | connect_changed => sub { $CFG->{gui_fontsize} = $_[1] }, |
259 | ); |
259 | ); |
260 | |
260 | |
261 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Server Log Fontsize"); |
261 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
262 | $table->add (1, $row++, new CFClient::UI::Slider |
262 | $table->add (1, $row++, new CFClient::UI::Slider |
263 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
263 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
264 | tooltip => "The font size used by the server log window only", |
264 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", |
265 | connect_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]) }, |
265 | connect_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]) }, |
266 | ); |
266 | ); |
267 | |
267 | |
268 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize"); |
268 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize"); |
269 | |
269 | |
270 | $table->add (1, $row++, new CFClient::UI::Slider |
270 | $table->add (1, $row++, new CFClient::UI::Slider |
271 | range => [$CFG->{stat_fontsize}, 0.5, 2, 0, 0.1], |
271 | range => [$CFG->{stat_fontsize}, 0.5, 2, 0, 0.1], |
272 | tooltip => "The font size used by the statistics window only", |
272 | tooltip => "The font size used by the <b>statistics window</b> only. Changes are instant.", |
273 | connect_changed => sub { |
273 | connect_changed => sub { |
274 | $CFG->{stat_fontsize} = $_[1]; |
274 | $CFG->{stat_fontsize} = $_[1]; |
275 | &set_stats_window_fontsize; |
275 | &set_stats_window_fontsize; |
276 | } |
276 | } |
277 | ); |
277 | ); |
278 | |
278 | |
279 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
279 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
280 | $table->add (1, $row++, new CFClient::UI::Slider |
280 | $table->add (1, $row++, new CFClient::UI::Slider |
281 | range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], |
281 | range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], |
282 | tooltip => "Adjusts the fontsize of the gauges at the bottom right", |
282 | tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.", |
283 | connect_changed => sub { |
283 | connect_changed => sub { |
284 | $CFG->{gauge_fontsize} = $_[1]; |
284 | $CFG->{gauge_fontsize} = $_[1]; |
285 | &set_gauge_window_fontsize; |
285 | &set_gauge_window_fontsize; |
286 | } |
286 | } |
287 | ); |
287 | ); |
288 | |
288 | |
289 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge size"); |
289 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge size"); |
290 | $table->add (1, $row++, new CFClient::UI::Slider |
290 | $table->add (1, $row++, new CFClient::UI::Slider |
291 | range => [$CFG->{gauge_size}, 0.2, 0.8], |
291 | range => [$CFG->{gauge_size}, 0.2, 0.8], |
292 | tooltip => "Adjust the size of the stats gauges at the bottom right", |
292 | tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.", |
293 | connect_changed => sub { |
293 | connect_changed => sub { |
294 | $CFG->{gauge_size} = $_[1]; |
294 | $CFG->{gauge_size} = $_[1]; |
295 | $GAUGES->{win}->set_size ($WIDTH, int $HEIGHT * $CFG->{gauge_size}); |
295 | $GAUGES->{win}->set_size ($WIDTH, int $HEIGHT * $CFG->{gauge_size}); |
296 | } |
296 | } |
297 | ); |
297 | ); |
… | |
… | |
306 | ); |
306 | ); |
307 | |
307 | |
308 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable"); |
308 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable"); |
309 | $table->add (1, $row++, new CFClient::UI::CheckBox |
309 | $table->add (1, $row++, new CFClient::UI::CheckBox |
310 | state => $CFG->{audio_enable}, |
310 | state => $CFG->{audio_enable}, |
311 | tooltip => "If enabled, sound effects and music will be played. If disabled, no audio will be used and the soundcard will not be opened.", |
311 | tooltip => "<b>Master Audio Enable.</b> If enabled, sound effects and music will be played. If disabled, no audio will be used and the soundcard will not be opened.", |
312 | connect_changed => sub { |
312 | connect_changed => sub { |
313 | $CFG->{audio_enable} = $_[1]; |
313 | $CFG->{audio_enable} = $_[1]; |
314 | } |
314 | } |
315 | ); |
315 | ); |
316 | # $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
316 | # $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
… | |
… | |
319 | # }); |
319 | # }); |
320 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Background Music"); |
320 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Background Music"); |
321 | $table->add (1, $row++, my $hbox = new CFClient::UI::HBox); |
321 | $table->add (1, $row++, my $hbox = new CFClient::UI::HBox); |
322 | $hbox->add (new CFClient::UI::CheckBox |
322 | $hbox->add (new CFClient::UI::CheckBox |
323 | expand => 1, state => $CFG->{bgm_enable}, |
323 | expand => 1, state => $CFG->{bgm_enable}, |
324 | tooltip => "Enable background music playing", |
324 | tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", |
325 | connect_changed => sub { |
325 | connect_changed => sub { |
326 | $CFG->{bgm_enable} = $_[1]; |
326 | $CFG->{bgm_enable} = $_[1]; |
327 | } |
327 | } |
328 | ); |
328 | ); |
329 | $hbox->add (new CFClient::UI::Slider |
329 | $hbox->add (new CFClient::UI::Slider |
330 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
330 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
331 | tooltip => "The volume of the background music", |
331 | tooltip => "The volume of the background music. Changes are instant.", |
332 | connect_changed => sub { |
332 | connect_changed => sub { |
333 | $CFG->{bgm_volume} = $_[1]; |
333 | $CFG->{bgm_volume} = $_[1]; |
334 | CFClient::MixMusic::volume $_[1] * 128; |
334 | CFClient::MixMusic::volume $_[1] * 128; |
335 | } |
335 | } |
336 | ); |
336 | ); |
… | |
… | |
744 | $table->add (1, 7, new CFClient::UI::Slider |
744 | $table->add (1, 7, new CFClient::UI::Slider |
745 | req_w => 100, |
745 | req_w => 100, |
746 | range => [$CFG->{mapsize}, 10, 100, 0, 1], |
746 | range => [$CFG->{mapsize}, 10, 100, 0, 1], |
747 | tooltip => "This is the size of the portion of the map update the server sends you. " |
747 | tooltip => "This is the size of the portion of the map update the server sends you. " |
748 | . "If you set this to a high value you will be able to see further, " |
748 | . "If you set this to a high value you will be able to see further, " |
749 | . "but you also increase bandwidht requirements and latency. " |
749 | . "but you also increase bandwidth requirements and latency. " |
750 | . "This option is only used once at log-in.", |
750 | . "This option is only used once at log-in.", |
751 | connect_changed => sub { |
751 | connect_changed => sub { |
752 | my ($self, $value) = @_; |
752 | my ($self, $value) = @_; |
753 | |
753 | |
754 | $CFG->{mapsize} = $self->{range}[0] = $value = int $value; |
754 | $CFG->{mapsize} = $self->{range}[0] = $value = int $value; |
… | |
… | |
1499 | $self->{faceid}[$facenum] = $id;#d# |
1499 | $self->{faceid}[$facenum] = $id;#d# |
1500 | |
1500 | |
1501 | my $face = $TILECACHE->get ($id); |
1501 | my $face = $TILECACHE->get ($id); |
1502 | |
1502 | |
1503 | if ($face) { |
1503 | if ($face) { |
1504 | $self->face_prefetch; |
1504 | #$self->face_prefetch; |
1505 | $face |
1505 | $face |
1506 | } else { |
1506 | } else { |
1507 | my $tex = $self->{noface}; |
1507 | my $tex = $self->{noface}; |
1508 | $MAP->set_texture ($id, @$tex{qw(name w h s t)}, @{$tex->{minified}}); |
1508 | $MAP->set_texture ($id, @$tex{qw(name w h s t)}, @{$tex->{minified}}); |
1509 | undef |
1509 | undef |
… | |
… | |
1733 | |
1733 | |
1734 | # check once/second for faces that need to be prefetched |
1734 | # check once/second for faces that need to be prefetched |
1735 | # this should, of course, only run on demand, but |
1735 | # this should, of course, only run on demand, but |
1736 | # SDL forces worse things on us.... |
1736 | # SDL forces worse things on us.... |
1737 | |
1737 | |
1738 | Event->timer (after => 1, interval => 1, cb => sub { |
1738 | Event->timer (after => 1, interval => 0.25, cb => sub { |
1739 | $CONN->face_prefetch |
1739 | $CONN->face_prefetch |
1740 | if $CONN; |
1740 | if $CONN; |
1741 | }); |
1741 | }); |
1742 | |
1742 | |
1743 | sub update_floorbox { |
1743 | sub update_floorbox { |