… | |
… | |
155 | $hbox->add (new CFClient::UI::Button |
155 | $hbox->add (new CFClient::UI::Button |
156 | text => "No", |
156 | text => "No", |
157 | on_activate => sub { |
157 | on_activate => sub { |
158 | $conn->send ("reply n"); |
158 | $conn->send ("reply n"); |
159 | $dialog->destroy; |
159 | $dialog->destroy; |
|
|
160 | 0 |
160 | } |
161 | } |
161 | ); |
162 | ); |
162 | $hbox->add (new CFClient::UI::Button |
163 | $hbox->add (new CFClient::UI::Button |
163 | text => "Yes", |
164 | text => "Yes", |
164 | on_activate => sub { |
165 | on_activate => sub { |
165 | $conn->send ("reply y"); |
166 | $conn->send ("reply y"); |
166 | destroy_query_dialog $conn; |
167 | destroy_query_dialog $conn; |
|
|
168 | 0 |
167 | }, |
169 | }, |
168 | ); |
170 | ); |
169 | |
171 | |
170 | $dialog->focus_in; |
172 | $dialog->grab_focus; |
171 | |
173 | |
172 | } elsif ($flags & CS_QUERY_SINGLECHAR) { |
174 | } elsif ($flags & CS_QUERY_SINGLECHAR) { |
173 | $dialog->{tooltip} = "Press a key (click on the entry to make sure it has keyboard focus)"; |
175 | $dialog->{tooltip} = "Press a key (click on the entry to make sure it has keyboard focus)"; |
174 | |
176 | |
175 | if ($prompt =~ /Now choose a character|Press any key for the next race/i) { |
177 | if ($prompt =~ /Now choose a character|Press any key for the next race/i) { |
… | |
… | |
185 | $table->add (0, 0, new CFClient::UI::Button |
187 | $table->add (0, 0, new CFClient::UI::Button |
186 | text => "Next Race", |
188 | text => "Next Race", |
187 | on_activate => sub { |
189 | on_activate => sub { |
188 | $conn->send ("reply n"); |
190 | $conn->send ("reply n"); |
189 | destroy_query_dialog $conn; |
191 | destroy_query_dialog $conn; |
|
|
192 | 0 |
190 | }, |
193 | }, |
191 | ); |
194 | ); |
192 | $table->add (2, 0, new CFClient::UI::Button |
195 | $table->add (2, 0, new CFClient::UI::Button |
193 | text => "Accept", |
196 | text => "Accept", |
194 | on_activate => sub { |
197 | on_activate => sub { |
195 | $conn->send ("reply d"); |
198 | $conn->send ("reply d"); |
196 | destroy_query_dialog $conn; |
199 | destroy_query_dialog $conn; |
|
|
200 | 0 |
197 | }, |
201 | }, |
198 | ); |
202 | ); |
199 | |
203 | |
200 | unshift @dialog, new CFClient::UI::Label |
204 | unshift @dialog, new CFClient::UI::Label |
201 | max_w => $::WIDTH * 0.4, |
205 | max_w => $::WIDTH * 0.4, |
… | |
… | |
231 | $table->add (0, 0, new CFClient::UI::Button |
235 | $table->add (0, 0, new CFClient::UI::Button |
232 | text => "Roll Again", |
236 | text => "Roll Again", |
233 | on_activate => sub { |
237 | on_activate => sub { |
234 | $conn->send ("reply y"); |
238 | $conn->send ("reply y"); |
235 | destroy_query_dialog $conn; |
239 | destroy_query_dialog $conn; |
|
|
240 | 0 |
236 | }, |
241 | }, |
237 | ); |
242 | ); |
238 | |
243 | |
239 | # center: swap stats |
244 | # center: swap stats |
240 | my ($sw1, $sw2) = map +(new CFClient::UI::Combobox |
245 | my ($sw1, $sw2) = map +(new CFClient::UI::Combobox |
… | |
… | |
254 | text => "Swap Stats", |
259 | text => "Swap Stats", |
255 | on_activate => sub { |
260 | on_activate => sub { |
256 | $conn->{stat_change_with} = $sw2->{value}; |
261 | $conn->{stat_change_with} = $sw2->{value}; |
257 | $conn->send ("reply $sw1->{value}"); |
262 | $conn->send ("reply $sw1->{value}"); |
258 | destroy_query_dialog $conn; |
263 | destroy_query_dialog $conn; |
|
|
264 | 0 |
259 | }, |
265 | }, |
260 | ); |
266 | ); |
261 | $table->add (2, 1, new CFClient::UI::HBox children => [$sw1, $sw2]); |
267 | $table->add (2, 1, new CFClient::UI::HBox children => [$sw1, $sw2]); |
262 | |
268 | |
263 | # right: accept |
269 | # right: accept |
… | |
… | |
265 | text => "Accept", |
271 | text => "Accept", |
266 | on_activate => sub { |
272 | on_activate => sub { |
267 | $conn->send ("reply n"); |
273 | $conn->send ("reply n"); |
268 | $STATS_WINDOW->hide; |
274 | $STATS_WINDOW->hide; |
269 | destroy_query_dialog $conn; |
275 | destroy_query_dialog $conn; |
|
|
276 | 0 |
270 | }, |
277 | }, |
271 | ); |
278 | ); |
272 | |
279 | |
273 | unshift @dialog, new CFClient::UI::Label |
280 | unshift @dialog, new CFClient::UI::Label |
274 | max_w => $::WIDTH * 0.4, |
281 | max_w => $::WIDTH * 0.4, |
… | |
… | |
284 | |
291 | |
285 | push @dialog, my $entry = new CFClient::UI::Entry |
292 | push @dialog, my $entry = new CFClient::UI::Entry |
286 | on_changed => sub { |
293 | on_changed => sub { |
287 | $conn->send ("reply $_[1]"); |
294 | $conn->send ("reply $_[1]"); |
288 | destroy_query_dialog $conn; |
295 | destroy_query_dialog $conn; |
|
|
296 | 0 |
289 | }, |
297 | }, |
290 | ; |
298 | ; |
291 | |
299 | |
292 | $entry->focus_in; |
300 | $entry->grab_focus; |
293 | |
301 | |
294 | } else { |
302 | } else { |
295 | $dialog->{tooltip} = "Enter the reply and press return (click on the entry to make sure it has keyboard focus)"; |
303 | $dialog->{tooltip} = "Enter the reply and press return (click on the entry to make sure it has keyboard focus)"; |
296 | |
304 | |
297 | push @dialog, my $entry = new CFClient::UI::Entry |
305 | push @dialog, my $entry = new CFClient::UI::Entry |
298 | $flags & CS_QUERY_HIDEINPUT ? (hidden => "*") : (), |
306 | $flags & CS_QUERY_HIDEINPUT ? (hidden => "*") : (), |
299 | on_activate => sub { |
307 | on_activate => sub { |
300 | $conn->send ("reply $_[1]"); |
308 | $conn->send ("reply $_[1]"); |
301 | destroy_query_dialog $conn; |
309 | destroy_query_dialog $conn; |
|
|
310 | 0 |
302 | }, |
311 | }, |
303 | ; |
312 | ; |
304 | |
313 | |
305 | $entry->focus_in; |
314 | $entry->grab_focus; |
306 | } |
315 | } |
307 | |
316 | |
308 | $vbox->add (@dialog); |
317 | $vbox->add (@dialog); |
309 | $dialog->show; |
318 | $dialog->show; |
310 | } |
319 | } |
… | |
… | |
399 | |
408 | |
400 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fullscreen"); |
409 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fullscreen"); |
401 | $table->add (1, $row++, new CFClient::UI::CheckBox |
410 | $table->add (1, $row++, new CFClient::UI::CheckBox |
402 | state => $CFG->{fullscreen}, |
411 | state => $CFG->{fullscreen}, |
403 | tooltip => "Bring the client into fullscreen mode.", |
412 | tooltip => "Bring the client into fullscreen mode.", |
404 | on_changed => sub { |
413 | on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 } |
405 | my ($self, $value) = @_; |
|
|
406 | $CFG->{fullscreen} = $value; |
|
|
407 | } |
|
|
408 | ); |
414 | ); |
409 | |
415 | |
410 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
416 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
411 | $table->add (1, $row++, new CFClient::UI::CheckBox |
417 | $table->add (1, $row++, new CFClient::UI::CheckBox |
412 | state => $CFG->{fast}, |
418 | state => $CFG->{fast}, |
413 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
419 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
414 | on_changed => sub { |
420 | on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 } |
415 | my ($self, $value) = @_; |
|
|
416 | $CFG->{fast} = $value; |
|
|
417 | } |
|
|
418 | ); |
421 | ); |
419 | |
422 | |
420 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Map Scale"); |
423 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Map Scale"); |
421 | $table->add (1, $row++, new CFClient::UI::Slider |
424 | $table->add (1, $row++, new CFClient::UI::Slider |
422 | range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], |
425 | range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], |
423 | tooltip => "Enlarge or shrink the displayed map. Changes are instant.", |
426 | tooltip => "Enlarge or shrink the displayed map. Changes are instant.", |
424 | on_changed => sub { |
427 | on_changed => sub { my ($self, $value) = @_; $CFG->{map_scale} = 2 ** $value; 0 } |
425 | my ($self, $value) = @_; |
|
|
426 | $CFG->{map_scale} = 2 ** $value; |
|
|
427 | } |
|
|
428 | ); |
428 | ); |
429 | |
429 | |
430 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War"); |
430 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War"); |
431 | $table->add (1, $row++, new CFClient::UI::CheckBox |
431 | $table->add (1, $row++, new CFClient::UI::CheckBox |
432 | state => $CFG->{fow_enable}, |
432 | state => $CFG->{fow_enable}, |
433 | tooltip => "<b>Fog-of-War</b> marks areas that cannot be seen by the player. Changes are instant.", |
433 | tooltip => "<b>Fog-of-War</b> marks areas that cannot be seen by the player. Changes are instant.", |
434 | on_changed => sub { |
434 | on_changed => sub { my ($self, $value) = @_; $CFG->{fow_enable} = $value; 0 } |
435 | my ($self, $value) = @_; |
|
|
436 | $CFG->{fow_enable} = $value; |
|
|
437 | } |
|
|
438 | ); |
435 | ); |
439 | |
436 | |
440 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity"); |
437 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity"); |
441 | $table->add (1, $row++, new CFClient::UI::Slider |
438 | $table->add (1, $row++, new CFClient::UI::Slider |
442 | range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256], |
439 | range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256], |
443 | tooltip => "<b>Fog of War Lightness.</b> The higher the intensity, the lighter the Fog-of-War color. Changes are instant.", |
440 | tooltip => "<b>Fog of War Lightness.</b> The higher the intensity, the lighter the Fog-of-War color. Changes are instant.", |
444 | on_changed => sub { |
441 | on_changed => sub { my ($self, $value) = @_; $CFG->{fow_intensity} = $value; 0 } |
445 | my ($self, $value) = @_; |
|
|
446 | $CFG->{fow_intensity} = $value; |
|
|
447 | } |
|
|
448 | ); |
442 | ); |
449 | |
443 | |
450 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth"); |
444 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth"); |
451 | $table->add (1, $row++, new CFClient::UI::CheckBox |
445 | $table->add (1, $row++, new CFClient::UI::CheckBox |
452 | state => $CFG->{fow_smooth}, |
446 | state => $CFG->{fow_smooth}, |
453 | tooltip => "Smooth the Fog-of-War a bit to make it more realistic. Changes are instant.", |
447 | tooltip => "Smooth the Fog-of-War a bit to make it more realistic. Changes are instant.", |
454 | on_changed => sub { |
448 | on_changed => sub { |
455 | my ($self, $value) = @_; |
449 | my ($self, $value) = @_; |
456 | $CFG->{fow_smooth} = $value; |
450 | $CFG->{fow_smooth} = $value; |
457 | status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::OpenGL::GL_VERSION < 1.2; |
451 | status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::OpenGL::GL_VERSION < 1.2; |
|
|
452 | 0 |
458 | } |
453 | } |
459 | ); |
454 | ); |
460 | |
455 | |
461 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); |
456 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); |
462 | $table->add (1, $row++, new CFClient::UI::Slider |
457 | $table->add (1, $row++, new CFClient::UI::Slider |
463 | range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], |
458 | range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], |
464 | tooltip => "The base font size used by most GUI elements that do not have their own setting.", |
459 | tooltip => "The base font size used by most GUI elements that do not have their own setting.", |
465 | on_changed => sub { $CFG->{gui_fontsize} = $_[1] }, |
460 | on_changed => sub { $CFG->{gui_fontsize} = $_[1]; 0 }, |
466 | ); |
461 | ); |
467 | |
462 | |
468 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
463 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
469 | $table->add (1, $row++, new CFClient::UI::Slider |
464 | $table->add (1, $row++, new CFClient::UI::Slider |
470 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
465 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
471 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", |
466 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", |
472 | on_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]) }, |
467 | on_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, |
473 | ); |
468 | ); |
474 | |
469 | |
475 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize"); |
470 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize"); |
476 | |
471 | |
477 | $table->add (1, $row++, new CFClient::UI::Slider |
472 | $table->add (1, $row++, new CFClient::UI::Slider |
478 | range => [$CFG->{stat_fontsize}, 0.5, 2, 0, 0.1], |
473 | range => [$CFG->{stat_fontsize}, 0.5, 2, 0, 0.1], |
479 | tooltip => "The font size used by the <b>statistics window</b> only. Changes are instant.", |
474 | tooltip => "The font size used by the <b>statistics window</b> only. Changes are instant.", |
480 | on_changed => sub { |
475 | on_changed => sub { |
481 | $CFG->{stat_fontsize} = $_[1]; |
476 | $CFG->{stat_fontsize} = $_[1]; |
482 | &set_stats_window_fontsize; |
477 | &set_stats_window_fontsize; |
|
|
478 | 0 |
483 | } |
479 | } |
484 | ); |
480 | ); |
485 | |
481 | |
486 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
482 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
487 | $table->add (1, $row++, new CFClient::UI::Slider |
483 | $table->add (1, $row++, new CFClient::UI::Slider |
488 | range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], |
484 | range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], |
489 | tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.", |
485 | tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.", |
490 | on_changed => sub { |
486 | on_changed => sub { |
491 | $CFG->{gauge_fontsize} = $_[1]; |
487 | $CFG->{gauge_fontsize} = $_[1]; |
492 | &set_gauge_window_fontsize; |
488 | &set_gauge_window_fontsize; |
|
|
489 | 0 |
493 | } |
490 | } |
494 | ); |
491 | ); |
495 | |
492 | |
496 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge size"); |
493 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge size"); |
497 | $table->add (1, $row++, new CFClient::UI::Slider |
494 | $table->add (1, $row++, new CFClient::UI::Slider |
498 | range => [$CFG->{gauge_size}, 0.2, 0.8], |
495 | range => [$CFG->{gauge_size}, 0.2, 0.8], |
499 | tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.", |
496 | tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.", |
500 | on_changed => sub { |
497 | on_changed => sub { |
501 | $CFG->{gauge_size} = $_[1]; |
498 | $CFG->{gauge_size} = $_[1]; |
502 | $GAUGES->{win}->set_size ($WIDTH, int $HEIGHT * $CFG->{gauge_size}); |
499 | $GAUGES->{win}->set_size ($WIDTH, int $HEIGHT * $CFG->{gauge_size}); |
|
|
500 | 0 |
503 | } |
501 | } |
504 | ); |
502 | ); |
505 | |
503 | |
506 | $table->add (1, $row++, new CFClient::UI::Button |
504 | $table->add (1, $row++, new CFClient::UI::Button |
507 | expand => 1, align => 0, text => "Apply", |
505 | expand => 1, align => 0, text => "Apply", |
508 | tooltip => "Apply the video settings", |
506 | tooltip => "Apply the video settings", |
509 | on_activate => sub { |
507 | on_activate => sub { |
510 | video_shutdown (); |
508 | video_shutdown (); |
511 | video_init (); |
509 | video_init (); |
|
|
510 | 0 |
512 | } |
511 | } |
513 | ); |
512 | ); |
514 | |
513 | |
515 | $vbox |
514 | $vbox |
516 | } |
515 | } |
… | |
… | |
524 | |
523 | |
525 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable"); |
524 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable"); |
526 | $table->add (1, $row++, new CFClient::UI::CheckBox |
525 | $table->add (1, $row++, new CFClient::UI::CheckBox |
527 | state => $CFG->{audio_enable}, |
526 | state => $CFG->{audio_enable}, |
528 | 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.", |
527 | 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.", |
529 | on_changed => sub { |
528 | on_changed => sub { $CFG->{audio_enable} = $_[1]; 0 } |
530 | $CFG->{audio_enable} = $_[1]; |
|
|
531 | } |
|
|
532 | ); |
529 | ); |
533 | # $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
530 | # $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
534 | # $table->add (1, 8, new CFClient::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub { |
531 | # $table->add (1, 8, new CFClient::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub { |
535 | # $CFG->{effects_volume} = $_[1]; |
532 | # $CFG->{effects_volume} = $_[1]; |
536 | # }); |
533 | # }); |
537 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Background Music"); |
534 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Background Music"); |
538 | $table->add (1, $row++, my $hbox = new CFClient::UI::HBox); |
535 | $table->add (1, $row++, my $hbox = new CFClient::UI::HBox); |
539 | $hbox->add (new CFClient::UI::CheckBox |
536 | $hbox->add (new CFClient::UI::CheckBox |
540 | expand => 1, state => $CFG->{bgm_enable}, |
537 | expand => 1, state => $CFG->{bgm_enable}, |
541 | tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", |
538 | tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", |
542 | on_changed => sub { |
539 | on_changed => sub { $CFG->{bgm_enable} = $_[1]; 0 } |
543 | $CFG->{bgm_enable} = $_[1]; |
|
|
544 | } |
|
|
545 | ); |
540 | ); |
546 | $hbox->add (new CFClient::UI::Slider |
541 | $hbox->add (new CFClient::UI::Slider |
547 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
542 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
548 | tooltip => "The volume of the background music. Changes are instant.", |
543 | tooltip => "The volume of the background music. Changes are instant.", |
549 | on_changed => sub { |
544 | on_changed => sub { $CFG->{bgm_volume} = $_[1]; CFClient::MixMusic::volume $_[1] * 128; 0 } |
550 | $CFG->{bgm_volume} = $_[1]; |
|
|
551 | CFClient::MixMusic::volume $_[1] * 128; |
|
|
552 | } |
|
|
553 | ); |
545 | ); |
554 | |
546 | |
555 | $table->add (1, $row++, new CFClient::UI::Button |
547 | $table->add (1, $row++, new CFClient::UI::Button |
556 | expand => 1, align => 0, text => "Apply", |
548 | expand => 1, align => 0, text => "Apply", |
557 | tooltip => "Apply the audio settings", |
549 | tooltip => "Apply the audio settings", |
558 | on_activate => sub { |
550 | on_activate => sub { |
559 | audio_shutdown (); |
551 | audio_shutdown (); |
560 | audio_init (); |
552 | audio_init (); |
|
|
553 | 0 |
561 | } |
554 | } |
562 | ); |
555 | ); |
563 | |
556 | |
564 | $vbox |
557 | $vbox |
565 | } |
558 | } |
… | |
… | |
631 | |
624 | |
632 | sub debug_setup { |
625 | sub debug_setup { |
633 | my $table = new CFClient::UI::Table; |
626 | my $table = new CFClient::UI::Table; |
634 | |
627 | |
635 | $table->add (0, 0, new CFClient::UI::Label text => "Widget Borders"); |
628 | $table->add (0, 0, new CFClient::UI::Label text => "Widget Borders"); |
636 | $table->add (1, 0, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 1 }); |
629 | $table->add (1, 0, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 1; 0 }); |
637 | $table->add (0, 1, new CFClient::UI::Label text => "Tooltip Widget Info"); |
630 | $table->add (0, 1, new CFClient::UI::Label text => "Tooltip Widget Info"); |
638 | $table->add (1, 1, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 2 }); |
631 | $table->add (1, 1, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 2; 0 }); |
639 | $table->add (0, 2, new CFClient::UI::Label text => "Show FPS"); |
632 | $table->add (0, 2, new CFClient::UI::Label text => "Show FPS"); |
640 | $table->add (1, 2, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4 }); |
633 | $table->add (1, 2, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4; 0 }); |
641 | $table->add (0, 3, new CFClient::UI::Label text => "Suppress Tooltips"); |
634 | $table->add (0, 3, new CFClient::UI::Label text => "Suppress Tooltips"); |
642 | $table->add (1, 3, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8 }); |
635 | $table->add (1, 3, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 }); |
643 | |
636 | |
644 | my @default_smooth = (0.05, 0.13, 0.05, 0.13, 0.30, 0.13, 0.05, 0.13, 0.05); |
637 | my @default_smooth = (0.05, 0.13, 0.05, 0.13, 0.30, 0.13, 0.05, 0.13, 0.05); |
645 | |
638 | |
646 | for my $x (0..2) { |
639 | for my $x (0..2) { |
647 | for my $y (0 .. 2) { |
640 | for my $y (0 .. 2) { |
… | |
… | |
660 | sub stats_window { |
653 | sub stats_window { |
661 | my $tgw = new CFClient::UI::FancyFrame |
654 | my $tgw = new CFClient::UI::FancyFrame |
662 | y => $HEIGHT * (2/8), |
655 | y => $HEIGHT * (2/8), |
663 | x => "max", |
656 | x => "max", |
664 | title => "Stats", |
657 | title => "Stats", |
665 | name => "stats_window"; |
658 | name => "stats_window", |
|
|
659 | has_close_button => 1; |
666 | |
660 | |
667 | $tgw->add (new CFClient::UI::Window child => my $vb = new CFClient::UI::VBox); |
661 | $tgw->add (new CFClient::UI::Window child => my $vb = new CFClient::UI::VBox); |
668 | $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, |
662 | $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, |
669 | can_hover => 1, can_events => 1, |
663 | can_hover => 1, can_events => 1, |
670 | tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); |
664 | tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); |
… | |
… | |
920 | text => "Use", |
914 | text => "Use", |
921 | tooltip => "Put this server into the <b>Host:Port</b> field", |
915 | tooltip => "Put this server into the <b>Host:Port</b> field", |
922 | on_activate => sub { |
916 | on_activate => sub { |
923 | $HOST_ENTRY->set_text ($CFG->{host} = $host); |
917 | $HOST_ENTRY->set_text ($CFG->{host} = $host); |
924 | $METASERVER->hide; |
918 | $METASERVER->hide; |
|
|
919 | 0 |
925 | }, |
920 | }, |
926 | ), |
921 | ), |
927 | (new CFClient::UI::Empty expand => 1), |
922 | (new CFClient::UI::Empty expand => 1), |
928 | ]); |
923 | ]); |
929 | |
924 | |
… | |
… | |
950 | z => 3, |
945 | z => 3, |
951 | force_h => $::HEIGHT * 0.4, |
946 | force_h => $::HEIGHT * 0.4, |
952 | child => (my $vbox = new CFClient::UI::VBox), |
947 | child => (my $vbox = new CFClient::UI::VBox), |
953 | on_visibility_change => sub { |
948 | on_visibility_change => sub { |
954 | update_metaserver if $_[1]; |
949 | update_metaserver if $_[1]; |
|
|
950 | 0 |
955 | }, |
951 | }, |
956 | ; |
952 | ; |
957 | |
953 | |
958 | $dialog->{table} = new CFClient::UI::Table; |
954 | $dialog->{table} = new CFClient::UI::Table; |
959 | |
955 | |
… | |
… | |
977 | text => $CFG->{host}, |
973 | text => $CFG->{host}, |
978 | tooltip => "The hostname or ip address of the Crossfire(+) server to connect to", |
974 | tooltip => "The hostname or ip address of the Crossfire(+) server to connect to", |
979 | on_changed => sub { |
975 | on_changed => sub { |
980 | my ($self, $value) = @_; |
976 | my ($self, $value) = @_; |
981 | $CFG->{host} = $value; |
977 | $CFG->{host} = $value; |
|
|
978 | 0 |
982 | } |
979 | } |
983 | ); |
980 | ); |
984 | |
981 | |
985 | $METASERVER = metaserver_dialog; |
982 | $METASERVER = metaserver_dialog; |
986 | |
983 | |
987 | $vbox->add (new CFClient::UI::Button |
984 | $vbox->add (new CFClient::UI::Button |
988 | expand => 1, |
985 | expand => 1, |
989 | text => "Server List", |
986 | text => "Server List", |
990 | other => $METASERVER, |
987 | other => $METASERVER, |
991 | tooltip => "Show a list of available crossfire servers", |
988 | tooltip => "Show a list of available crossfire servers", |
992 | on_activate => sub { $METASERVER->toggle_visibility }, |
989 | on_activate => sub { $METASERVER->toggle_visibility; 0 }, |
993 | on_visibility_change => sub { $METASERVER->hide unless $_[1] }, |
990 | on_visibility_change => sub { $METASERVER->hide unless $_[1]; 0 }, |
994 | ); |
991 | ); |
995 | } |
992 | } |
996 | |
993 | |
997 | $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username"); |
994 | $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username"); |
998 | $table->add (1, 4, new CFClient::UI::Entry |
995 | $table->add (1, 4, new CFClient::UI::Entry |
999 | text => $CFG->{user}, |
996 | text => $CFG->{user}, |
1000 | tooltip => "The name of your character on the server", |
997 | tooltip => "The name of your character on the server", |
1001 | on_changed => sub { |
998 | on_changed => sub { my ($self, $value) = @_; $CFG->{user} = $value; 0 } |
1002 | my ($self, $value) = @_; |
|
|
1003 | $CFG->{user} = $value; |
|
|
1004 | } |
|
|
1005 | ); |
999 | ); |
1006 | |
1000 | |
1007 | $table->add (0, 5, new CFClient::UI::Label valign => 0, align => 1, text => "Password"); |
1001 | $table->add (0, 5, new CFClient::UI::Label valign => 0, align => 1, text => "Password"); |
1008 | $table->add (1, 5, new CFClient::UI::Entry |
1002 | $table->add (1, 5, new CFClient::UI::Entry |
1009 | text => $CFG->{password}, |
1003 | text => $CFG->{password}, |
1010 | hidden => 1, |
1004 | hidden => 1, |
1011 | tooltip => "The password for your character", |
1005 | tooltip => "The password for your character", |
1012 | on_changed => sub { |
1006 | on_changed => sub { my ($self, $value) = @_; $CFG->{password} = $value; 0 } |
1013 | my ($self, $value) = @_; |
|
|
1014 | $CFG->{password} = $value; |
|
|
1015 | } |
|
|
1016 | ); |
1007 | ); |
1017 | |
1008 | |
1018 | $table->add (0, 7, new CFClient::UI::Label valign => 0, align => 1, text => "Map Size"); |
1009 | $table->add (0, 7, new CFClient::UI::Label valign => 0, align => 1, text => "Map Size"); |
1019 | $table->add (1, 7, new CFClient::UI::Slider |
1010 | $table->add (1, 7, new CFClient::UI::Slider |
1020 | force_w => 100, |
1011 | force_w => 100, |
1021 | range => [$CFG->{mapsize}, 10, 100, 0, 1], |
1012 | range => [$CFG->{mapsize}, 10, 100, 0, 1], |
1022 | tooltip => "This is the size of the portion of the map update the server sends you. " |
1013 | tooltip => "This is the size of the portion of the map update the server sends you. " |
1023 | . "If you set this to a high value you will be able to see further, " |
1014 | . "If you set this to a high value you will be able to see further, " |
1024 | . "but you also increase bandwidth requirements and latency. " |
1015 | . "but you also increase bandwidth requirements and latency. " |
1025 | . "This option is only used once at log-in.", |
1016 | . "This option is only used once at log-in.", |
1026 | on_changed => sub { |
1017 | on_changed => sub { my ($self, $value) = @_; $CFG->{mapsize} = $self->{range}[0] = $value = int $value; 0 }, |
1027 | my ($self, $value) = @_; |
|
|
1028 | |
|
|
1029 | $CFG->{mapsize} = $self->{range}[0] = $value = int $value; |
|
|
1030 | }, |
|
|
1031 | ); |
1018 | ); |
1032 | |
1019 | |
1033 | $table->add (0, 8, new CFClient::UI::Label valign => 0, align => 1, text => "Face Prefetch"); |
1020 | $table->add (0, 8, new CFClient::UI::Label valign => 0, align => 1, text => "Face Prefetch"); |
1034 | $table->add (1, 8, new CFClient::UI::CheckBox |
1021 | $table->add (1, 8, new CFClient::UI::CheckBox |
1035 | state => $CFG->{face_prefetch}, |
1022 | state => $CFG->{face_prefetch}, |
… | |
… | |
1038 | . "This might increase or create lag, but increases the chances " |
1025 | . "This might increase or create lag, but increases the chances " |
1039 | . "of faces being ready for display when you encounter them. " |
1026 | . "of faces being ready for display when you encounter them. " |
1040 | . "It also uses up server bandwidth on every connect, " |
1027 | . "It also uses up server bandwidth on every connect, " |
1041 | . "so only set it if you really need to prefetch images. " |
1028 | . "so only set it if you really need to prefetch images. " |
1042 | . "This option can be set and unset any time.", |
1029 | . "This option can be set and unset any time.", |
1043 | on_changed => sub { $CFG->{face_prefetch} = $_[1] }, |
1030 | on_changed => sub { $CFG->{face_prefetch} = $_[1]; 0 }, |
1044 | ); |
1031 | ); |
1045 | |
1032 | |
1046 | $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Output-Count"); |
1033 | $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Output-Count"); |
1047 | $table->add (1, 9, new CFClient::UI::Entry |
1034 | $table->add (1, 9, new CFClient::UI::Entry |
1048 | text => $CFG->{output_count}, |
1035 | text => $CFG->{output_count}, |
1049 | tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", |
1036 | tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", |
1050 | on_changed => sub { $CFG->{output_count} = $_[1] }, |
1037 | on_changed => sub { $CFG->{output_count} = $_[1]; 0 }, |
1051 | ); |
1038 | ); |
1052 | |
1039 | |
1053 | $table->add (0, 10, new CFClient::UI::Label valign => 0, align => 1, text => "Output-Sync"); |
1040 | $table->add (0, 10, new CFClient::UI::Label valign => 0, align => 1, text => "Output-Sync"); |
1054 | $table->add (1, 10, new CFClient::UI::Entry |
1041 | $table->add (1, 10, new CFClient::UI::Entry |
1055 | text => $CFG->{output_sync}, |
1042 | text => $CFG->{output_sync}, |
1056 | tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", |
1043 | tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", |
1057 | on_changed => sub { $CFG->{output_sync} = $_[1] }, |
1044 | on_changed => sub { $CFG->{output_sync} = $_[1]; 0 }, |
1058 | ); |
1045 | ); |
1059 | |
1046 | |
1060 | $table->add (1, 11, $LOGIN_BUTTON = new CFClient::UI::Button |
1047 | $table->add (1, 11, $LOGIN_BUTTON = new CFClient::UI::Button |
1061 | expand => 1, |
1048 | expand => 1, |
1062 | align => 0, |
1049 | align => 0, |
1063 | text => "Login", |
1050 | text => "Login", |
1064 | on_activate => sub { |
1051 | on_activate => sub { |
1065 | $CONN ? stop_game |
1052 | $CONN ? stop_game |
1066 | : start_game; |
1053 | : start_game; |
|
|
1054 | 0 |
1067 | }, |
1055 | }, |
1068 | ); |
1056 | ); |
1069 | |
1057 | |
1070 | $table->add (0, 12, new CFClient::UI::Label valign => 0, align => 1, text => "Chat Command"); |
1058 | $table->add (0, 12, new CFClient::UI::Label valign => 0, align => 1, text => "Chat Command"); |
1071 | $table->add (1, 12, my $saycmd = new CFClient::UI::Entry |
1059 | $table->add (1, 12, my $saycmd = new CFClient::UI::Entry |
… | |
… | |
1074 | . "Usually you want to enter something like 'say' or 'shout' or 'gsay' here. " |
1062 | . "Usually you want to enter something like 'say' or 'shout' or 'gsay' here. " |
1075 | . "But you could also set it to <b>tell <i>playername</i></b> to only chat with that user.", |
1063 | . "But you could also set it to <b>tell <i>playername</i></b> to only chat with that user.", |
1076 | on_changed => sub { |
1064 | on_changed => sub { |
1077 | my ($self, $value) = @_; |
1065 | my ($self, $value) = @_; |
1078 | $CFG->{say_command} = $value; |
1066 | $CFG->{say_command} = $value; |
|
|
1067 | 0 |
1079 | } |
1068 | } |
1080 | ); |
1069 | ); |
1081 | |
1070 | |
1082 | $vbox->add (new CFClient::UI::Label |
1071 | $vbox->add (new CFClient::UI::Label |
1083 | text => "Server Info", |
1072 | text => "Server Info", |
… | |
… | |
1099 | bg => [0, 0, 0, 0.75], |
1088 | bg => [0, 0, 0, 0.75], |
1100 | x => "max", |
1089 | x => "max", |
1101 | y => 0, |
1090 | y => 0, |
1102 | force_w => $::WIDTH * 0.4, |
1091 | force_w => $::WIDTH * 0.4, |
1103 | force_h => $::HEIGHT * 0.5, |
1092 | force_h => $::HEIGHT * 0.5, |
1104 | child => (my $vbox = new CFClient::UI::VBox); |
1093 | child => (my $vbox = new CFClient::UI::VBox), |
|
|
1094 | has_close_button => 1; |
1105 | |
1095 | |
1106 | $vbox->add ($LOGVIEW); |
1096 | $vbox->add ($LOGVIEW); |
1107 | |
1097 | |
1108 | $vbox->add (my $input = new CFClient::UI::Entry |
1098 | $vbox->add (my $input = new CFClient::UI::Entry |
1109 | tooltip => "<b>Chat Box</b>. If you enter a text and press return/enter here, the current <i>communication command</i> " |
1099 | tooltip => "<b>Chat Box</b>. If you enter a text and press return/enter here, the current <i>communication command</i> " |
… | |
… | |
1117 | |
1107 | |
1118 | if ($prev_focus == $MAPWIDGET && $input->{auto_activated}) { |
1108 | if ($prev_focus == $MAPWIDGET && $input->{auto_activated}) { |
1119 | $input->{refocus_map} = 1; |
1109 | $input->{refocus_map} = 1; |
1120 | } |
1110 | } |
1121 | delete $input->{auto_activated}; |
1111 | delete $input->{auto_activated}; |
|
|
1112 | |
|
|
1113 | 0 |
1122 | }, |
1114 | }, |
1123 | on_activate => sub { |
1115 | on_activate => sub { |
1124 | my ($input, $text) = @_; |
1116 | my ($input, $text) = @_; |
1125 | $input->set_text (''); |
1117 | $input->set_text (''); |
1126 | |
1118 | |
… | |
… | |
1132 | } |
1124 | } |
1133 | if ($input->{refocus_map}) { |
1125 | if ($input->{refocus_map}) { |
1134 | delete $input->{refocus_map}; |
1126 | delete $input->{refocus_map}; |
1135 | $MAPWIDGET->focus_in |
1127 | $MAPWIDGET->focus_in |
1136 | } |
1128 | } |
|
|
1129 | |
|
|
1130 | 0 |
1137 | }, |
1131 | }, |
1138 | on_escape => sub { |
1132 | on_escape => sub { |
1139 | $MAPWIDGET->focus_in |
1133 | $MAPWIDGET->grab_focus; |
|
|
1134 | |
|
|
1135 | 0 |
1140 | }, |
1136 | }, |
1141 | ); |
1137 | ); |
1142 | |
1138 | |
1143 | $CONSOLE = { |
1139 | $CONSOLE = { |
1144 | window => $window, |
1140 | window => $window, |
… | |
… | |
1166 | ); |
1162 | ); |
1167 | $vb->add (my $hb = new CFClient::UI::HBox expand => 1); |
1163 | $vb->add (my $hb = new CFClient::UI::HBox expand => 1); |
1168 | $hb->add (new CFClient::UI::Button |
1164 | $hb->add (new CFClient::UI::Button |
1169 | text => "Ok", |
1165 | text => "Ok", |
1170 | expand => 1, |
1166 | expand => 1, |
1171 | on_activate => sub { $QUIT_DIALOG->hide }, |
1167 | on_activate => sub { $QUIT_DIALOG->hide; 0 }, |
1172 | ); |
1168 | ); |
1173 | $hb->add (new CFClient::UI::Button |
1169 | $hb->add (new CFClient::UI::Button |
1174 | text => "Quit anyway", |
1170 | text => "Quit anyway", |
1175 | expand => 1, |
1171 | expand => 1, |
1176 | on_activate => sub { exit }, |
1172 | on_activate => sub { exit }, |
… | |
… | |
1243 | $::CFG->{pickup} &= ~$mask; |
1239 | $::CFG->{pickup} &= ~$mask; |
1244 | } |
1240 | } |
1245 | |
1241 | |
1246 | $::CONN->send_command ("pickup $::CFG->{pickup}") |
1242 | $::CONN->send_command ("pickup $::CFG->{pickup}") |
1247 | if defined $::CONN; |
1243 | if defined $::CONN; |
|
|
1244 | |
|
|
1245 | 0 |
1248 | }); |
1246 | }); |
1249 | } |
1247 | } |
1250 | } |
1248 | } |
1251 | |
1249 | |
1252 | $table->add (2, 18, new CFClient::UI::ValSlider |
1250 | $table->add (2, 18, new CFClient::UI::ValSlider |
… | |
… | |
1263 | $table->add (3, 18, new CFClient::UI::Button |
1261 | $table->add (3, 18, new CFClient::UI::Button |
1264 | text => "set", |
1262 | text => "set", |
1265 | on_activate => sub { |
1263 | on_activate => sub { |
1266 | $::CONN->send_command ("pickup $::CFG->{pickup}") |
1264 | $::CONN->send_command ("pickup $::CFG->{pickup}") |
1267 | if defined $::CONN; |
1265 | if defined $::CONN; |
1268 | 1; |
1266 | 0 |
1269 | }); |
1267 | }); |
1270 | |
1268 | |
1271 | $table |
1269 | $table |
1272 | } |
1270 | } |
1273 | |
1271 | |
… | |
… | |
1276 | x => "center", |
1274 | x => "center", |
1277 | y => "center", |
1275 | y => "center", |
1278 | force_w => $WIDTH * 9/10, |
1276 | force_w => $WIDTH * 9/10, |
1279 | force_h => $HEIGHT * 9/10, |
1277 | force_h => $HEIGHT * 9/10, |
1280 | title => "Inventory", |
1278 | title => "Inventory", |
|
|
1279 | has_close_button => 1, |
1281 | ; |
1280 | ; |
1282 | |
1281 | |
1283 | $invwin->add (my $hb = new CFClient::UI::HBox homogeneous => 1); |
1282 | $invwin->add (my $hb = new CFClient::UI::HBox homogeneous => 1); |
1284 | |
1283 | |
1285 | $hb->add (my $vb1 = new CFClient::UI::VBox); |
1284 | $hb->add (my $vb1 = new CFClient::UI::VBox); |
… | |
… | |
1321 | text => "delete", |
1320 | text => "delete", |
1322 | tooltip => "Deletes the binding", |
1321 | tooltip => "Deletes the binding", |
1323 | on_activate => sub { |
1322 | on_activate => sub { |
1324 | $binding_list->remove ($hb); |
1323 | $binding_list->remove ($hb); |
1325 | delete $::CFG->{bindings}->{$mod}->{$sym}; |
1324 | delete $::CFG->{bindings}->{$mod}->{$sym}; |
|
|
1325 | 0 |
1326 | }); |
1326 | }); |
1327 | |
1327 | |
1328 | $hb->add (new CFClient::UI::Button |
1328 | $hb->add (new CFClient::UI::Button |
1329 | text => "edit", |
1329 | text => "edit", |
1330 | tooltip => "Edits the binding", |
1330 | tooltip => "Edits the binding", |
… | |
… | |
1343 | $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); |
1343 | $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); |
1344 | $SETUP_DIALOG->show; |
1344 | $SETUP_DIALOG->show; |
1345 | }); |
1345 | }); |
1346 | $::BIND_EDITOR->show; |
1346 | $::BIND_EDITOR->show; |
1347 | $SETUP_DIALOG->hide; |
1347 | $SETUP_DIALOG->hide; |
|
|
1348 | 0 |
1348 | }); |
1349 | }); |
1349 | |
1350 | |
1350 | $hb->add (new CFClient::UI::Label text => "(Key: $nam)"); |
1351 | $hb->add (new CFClient::UI::Label text => "(Key: $nam)"); |
1351 | $hb->add (new CFClient::UI::Label text => $lbl, expand => 1); |
1352 | $hb->add (new CFClient::UI::Label text => $lbl, expand => 1); |
1352 | } |
1353 | } |
… | |
… | |
1361 | state => $CFG->{shift_fire_stop}, |
1362 | state => $CFG->{shift_fire_stop}, |
1362 | tooltip => "If this checkbox is enabled you will stop fire only if you stop pressing shift", |
1363 | tooltip => "If this checkbox is enabled you will stop fire only if you stop pressing shift", |
1363 | on_changed => sub { |
1364 | on_changed => sub { |
1364 | my ($cbox, $value) = @_; |
1365 | my ($cbox, $value) = @_; |
1365 | $CFG->{shift_fire_stop} = $value; |
1366 | $CFG->{shift_fire_stop} = $value; |
|
|
1367 | 0 |
1366 | }); |
1368 | }); |
1367 | |
1369 | |
1368 | $vb->add ($binding_list); |
1370 | $vb->add ($binding_list); |
1369 | $vb->add (my $hb = new CFClient::UI::HBox); |
1371 | $vb->add (my $hb = new CFClient::UI::HBox); |
1370 | |
1372 | |
… | |
… | |
1386 | $SETUP_DIALOG->show; |
1388 | $SETUP_DIALOG->show; |
1387 | }, |
1389 | }, |
1388 | ); |
1390 | ); |
1389 | $SETUP_DIALOG->hide; |
1391 | $SETUP_DIALOG->hide; |
1390 | $::BIND_EDITOR->show; |
1392 | $::BIND_EDITOR->show; |
|
|
1393 | 0 |
1391 | }, |
1394 | }, |
1392 | ); |
1395 | ); |
1393 | |
1396 | |
1394 | $hb->add (new CFClient::UI::Button |
1397 | $hb->add (new CFClient::UI::Button |
1395 | text => "close", |
1398 | text => "close", |
1396 | tooltip => "Closes the binding window", |
1399 | tooltip => "Closes the binding window", |
1397 | expand => 1, |
1400 | expand => 1, |
1398 | on_activate => sub { |
1401 | on_activate => sub { |
1399 | $SETUP_DIALOG->hide; |
1402 | $SETUP_DIALOG->hide; |
|
|
1403 | 0 |
1400 | } |
1404 | } |
1401 | ); |
1405 | ); |
1402 | |
1406 | |
1403 | $refresh->(); |
1407 | $refresh->(); |
1404 | |
1408 | |
… | |
… | |
1442 | |
1446 | |
1443 | $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) |
1447 | $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) |
1444 | for @$pom; |
1448 | for @$pom; |
1445 | |
1449 | |
1446 | $viewer->set_offset (0); |
1450 | $viewer->set_offset (0); |
|
|
1451 | 0 |
1447 | }, |
1452 | }, |
1448 | on_visibility_change => sub { |
1453 | on_visibility_change => sub { |
1449 | my ($self, $visible) = @_; |
1454 | my ($self, $visible) = @_; |
1450 | return unless $visible; |
1455 | return unless $visible; |
1451 | return if $self->{value}; |
1456 | return if $self->{value}; |
1452 | $self->set_value ("intro"); |
1457 | $self->set_value ("intro"); |
|
|
1458 | 0 |
1453 | }, |
1459 | }, |
1454 | ); |
1460 | ); |
1455 | |
1461 | |
1456 | $win |
1462 | $win |
1457 | } |
1463 | } |
… | |
… | |
1515 | name => "mapmap", |
1521 | name => "mapmap", |
1516 | x => 0, |
1522 | x => 0, |
1517 | y => $FONTSIZE + 8, |
1523 | y => $FONTSIZE + 8, |
1518 | border_bg => [1, 1, 1, 192/255], |
1524 | border_bg => [1, 1, 1, 192/255], |
1519 | bg => [1, 1, 1, 0], |
1525 | bg => [1, 1, 1, 0], |
1520 | no_close_button => 1, |
|
|
1521 | child => ($MAPMAP = new CFClient::MapWidget::MapMap |
1526 | child => ($MAPMAP = new CFClient::MapWidget::MapMap |
1522 | tooltip => "<b>Map</b>. On servers that support this feature, this will display an overview of the surrounding areas.", |
1527 | tooltip => "<b>Map</b>. On servers that support this feature, this will display an overview of the surrounding areas.", |
1523 | ), |
1528 | ), |
1524 | )->show; |
1529 | )->show; |
1525 | |
1530 | |
… | |
… | |
1527 | $MAPWIDGET->connect (activate_console => sub { |
1532 | $MAPWIDGET->connect (activate_console => sub { |
1528 | my ($mapwidget, $preset) = @_; |
1533 | my ($mapwidget, $preset) = @_; |
1529 | |
1534 | |
1530 | if ($CONSOLE) { |
1535 | if ($CONSOLE) { |
1531 | $CONSOLE->{input}->{auto_activated} = 1; |
1536 | $CONSOLE->{input}->{auto_activated} = 1; |
1532 | $CONSOLE->{input}->focus_in; |
1537 | $CONSOLE->{input}->grab_focus; |
1533 | |
1538 | |
1534 | if ($preset && $CONSOLE->{input}->get_text eq '') { |
1539 | if ($preset && $CONSOLE->{input}->get_text eq '') { |
1535 | $CONSOLE->{input}->set_text ($preset); |
1540 | $CONSOLE->{input}->set_text ($preset); |
1536 | } |
1541 | } |
1537 | } |
1542 | } |
1538 | }); |
1543 | }); |
1539 | $MAPWIDGET->show; |
1544 | $MAPWIDGET->show; |
1540 | $MAPWIDGET->focus_in; |
1545 | $MAPWIDGET->grab_focus; |
1541 | |
1546 | |
1542 | $LOGVIEW = new CFClient::UI::TextScroller |
1547 | $LOGVIEW = new CFClient::UI::TextScroller |
1543 | expand => 1, |
1548 | expand => 1, |
1544 | font => $FONT_FIXED, |
1549 | font => $FONT_FIXED, |
1545 | fontsize => $::CFG->{log_fontsize}, |
1550 | fontsize => $::CFG->{log_fontsize}, |
… | |
… | |
1555 | x => 'center', |
1560 | x => 'center', |
1556 | y => 'center', |
1561 | y => 'center', |
1557 | z => 2, |
1562 | z => 2, |
1558 | force_w => $::WIDTH * 0.6, |
1563 | force_w => $::WIDTH * 0.6, |
1559 | force_h => $::HEIGHT * 0.6, |
1564 | force_h => $::HEIGHT * 0.6, |
|
|
1565 | has_close_button => 1, |
1560 | ; |
1566 | ; |
1561 | |
1567 | |
1562 | $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new CFClient::UI::Notebook expand => 1, debug => 1, |
1568 | $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new CFClient::UI::Notebook expand => 1, debug => 1, |
1563 | filter => new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1569 | filter => new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1564 | |
1570 | |
… | |
… | |
1603 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
1609 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
1604 | on_activate => sub { |
1610 | on_activate => sub { |
1605 | $::CFG->{layout} = CFClient::UI::get_layout; |
1611 | $::CFG->{layout} = CFClient::UI::get_layout; |
1606 | CFClient::write_cfg "$Crossfire::VARDIR/cfplusrc"; |
1612 | CFClient::write_cfg "$Crossfire::VARDIR/cfplusrc"; |
1607 | status "Configuration Saved"; |
1613 | status "Configuration Saved"; |
|
|
1614 | 0 |
1608 | }, |
1615 | }, |
1609 | ); |
1616 | ); |
1610 | |
1617 | |
1611 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Help!", other => help_window, |
1618 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Help!", other => help_window, |
1612 | tooltip => "View Documentation"); |
1619 | tooltip => "View Documentation"); |
… | |
… | |
1618 | if ($CONN) { |
1625 | if ($CONN) { |
1619 | open_quit_dialog; |
1626 | open_quit_dialog; |
1620 | } else { |
1627 | } else { |
1621 | exit; |
1628 | exit; |
1622 | } |
1629 | } |
|
|
1630 | 0 |
1623 | }, |
1631 | }, |
1624 | ); |
1632 | ); |
1625 | |
1633 | |
1626 | $BUTTONBAR->show; |
1634 | $BUTTONBAR->show; |
1627 | $SETUP_DIALOG->show; |
1635 | $SETUP_DIALOG->show; |