… | |
… | |
207 | title => "Server Query", |
207 | title => "Server Query", |
208 | child => my $vbox = new CFPlus::UI::VBox, |
208 | child => my $vbox = new CFPlus::UI::VBox, |
209 | ; |
209 | ; |
210 | |
210 | |
211 | my @dialog = my $label = new CFPlus::UI::Label |
211 | my @dialog = my $label = new CFPlus::UI::Label |
212 | max_w => $::WIDTH * 0.4, |
212 | max_w => $::WIDTH * 0.8, |
213 | ellipsise => 0, |
213 | ellipsise => 0, |
214 | text => $prompt; |
214 | text => $prompt; |
215 | |
215 | |
216 | if ($flags & CS_QUERY_YESNO) { |
216 | if ($flags & CS_QUERY_YESNO) { |
217 | push @dialog, my $hbox = new CFPlus::UI::HBox; |
217 | push @dialog, my $hbox = new CFPlus::UI::HBox; |
… | |
… | |
234 | ); |
234 | ); |
235 | |
235 | |
236 | $dialog->grab_focus; |
236 | $dialog->grab_focus; |
237 | |
237 | |
238 | } elsif ($flags & CS_QUERY_SINGLECHAR) { |
238 | } elsif ($flags & CS_QUERY_SINGLECHAR) { |
239 | $dialog->{tooltip} = "#charcreation_focus"; |
|
|
240 | |
|
|
241 | if ($prompt =~ /Now choose a character|Press any key for the next race/i) { |
239 | if ($prompt =~ /Now choose a character|Press any key for the next race/i) { |
242 | $MESSAGE_WINDOW->show; |
240 | $dialog->{tooltip} = "#charcreation_focus"; |
243 | |
241 | |
244 | unshift @dialog, new CFPlus::UI::Label |
242 | unshift @dialog, new CFPlus::UI::Label |
245 | max_w => $::WIDTH * 0.4, |
243 | max_w => $::WIDTH * 0.8, |
246 | ellipsise => 0, |
244 | ellipsise => 0, |
247 | markup => "\nOr use your keyboard and the text entry below:\n"; |
245 | markup => "\nOr use your keyboard and the text entry below:\n"; |
248 | |
246 | |
249 | unshift @dialog, my $table = new CFPlus::UI::Table; |
247 | unshift @dialog, my $table = new CFPlus::UI::Table; |
250 | |
248 | |
… | |
… | |
262 | $conn->send ("reply d"); |
260 | $conn->send ("reply d"); |
263 | destroy_query_dialog $conn; |
261 | destroy_query_dialog $conn; |
264 | 0 |
262 | 0 |
265 | }, |
263 | }, |
266 | ); |
264 | ); |
|
|
265 | |
|
|
266 | if ($conn->{chargen_race_description}) { |
|
|
267 | unshift @dialog, new CFPlus::UI::Label |
|
|
268 | max_w => $::WIDTH * 0.8, |
|
|
269 | ellipsise => 0, |
|
|
270 | markup => "<span foreground='#ccccff'>$conn->{chargen_race_description}</span>", |
|
|
271 | ; |
|
|
272 | } |
|
|
273 | |
|
|
274 | unshift @dialog, new CFPlus::UI::Face |
|
|
275 | face => $conn->{player}{face}, |
|
|
276 | bg => [.2, .2, .2, 1], |
|
|
277 | min_w => 64, |
|
|
278 | min_h => 64, |
|
|
279 | ; |
|
|
280 | |
|
|
281 | if ($conn->{chargen_race_title}) { |
|
|
282 | unshift @dialog, new CFPlus::UI::Label |
|
|
283 | allign => 1, |
|
|
284 | ellipsise => 0, |
|
|
285 | markup => "<span foreground='#ccccff' size='large'>Race: $conn->{chargen_race_title}</span>", |
|
|
286 | ; |
|
|
287 | } |
267 | |
288 | |
268 | unshift @dialog, new CFPlus::UI::Label |
289 | unshift @dialog, new CFPlus::UI::Label |
269 | max_w => $::WIDTH * 0.4, |
290 | max_w => $::WIDTH * 0.4, |
270 | ellipsise => 0, |
291 | ellipsise => 0, |
271 | markup => (CFPlus::Pod::section_label ui => "chargen_race"), |
292 | markup => (CFPlus::Pod::section_label ui => "chargen_race"), |
… | |
… | |
420 | statusbox => $STATUSBOX, |
441 | statusbox => $STATUSBOX, |
421 | map => $MAP, |
442 | map => $MAP, |
422 | mapmap => $MAPMAP, |
443 | mapmap => $MAPMAP, |
423 | query => \&server_query, |
444 | query => \&server_query, |
424 | |
445 | |
|
|
446 | setup_req => { |
|
|
447 | smoothing => $CFG->{map_smoothing}*1, |
|
|
448 | }, |
|
|
449 | |
425 | sound_play => sub { |
450 | sound_play => sub { |
426 | my ($x, $y, $soundnum, $type) = @_; |
451 | my ($x, $y, $soundnum, $type) = @_; |
427 | |
452 | |
428 | $SDL_MIXER |
453 | $SDL_MIXER |
429 | or return; |
454 | or return; |
… | |
… | |
501 | state => $CFG->{fast}, |
526 | state => $CFG->{fast}, |
502 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
527 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
503 | on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 } |
528 | on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 } |
504 | ); |
529 | ); |
505 | |
530 | |
|
|
531 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); |
|
|
532 | $table->add (1, $row++, new CFPlus::UI::Slider |
|
|
533 | range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], |
|
|
534 | tooltip => "The base font size used by most GUI elements that do not have their own setting.", |
|
|
535 | on_changed => sub { $CFG->{gui_fontsize} = $_[1]; 0 }, |
|
|
536 | ); |
|
|
537 | |
|
|
538 | $table->add (1, $row++, new CFPlus::UI::Button |
|
|
539 | expand => 1, align => 0, text => "Apply", |
|
|
540 | tooltip => "Apply the video settings above.", |
|
|
541 | on_activate => sub { |
|
|
542 | video_shutdown (); |
|
|
543 | video_init (); |
|
|
544 | 0 |
|
|
545 | } |
|
|
546 | ); |
|
|
547 | |
506 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Map Scale"); |
548 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Map Scale"); |
507 | $table->add (1, $row++, new CFPlus::UI::Slider |
549 | $table->add (1, $row++, new CFPlus::UI::Slider |
508 | range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], |
550 | range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], |
509 | tooltip => "Enlarge or shrink the displayed map. Changes are instant.", |
551 | tooltip => "Enlarge or shrink the displayed map. Changes are instant.", |
510 | on_changed => sub { my ($self, $value) = @_; $CFG->{map_scale} = 2 ** $value; 0 } |
552 | on_changed => sub { my ($self, $value) = @_; $CFG->{map_scale} = 2 ** $value; 0 } |
|
|
553 | ); |
|
|
554 | |
|
|
555 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Smoothing"); |
|
|
556 | $table->add (1, $row++, new CFPlus::UI::CheckBox |
|
|
557 | state => $CFG->{map_smoothing}, |
|
|
558 | tooltip => "<b>Map Smoothing</b> tries to make tile borders less square. " |
|
|
559 | . "This increases load on the graphics subsystem and works only with 2.x servers. " |
|
|
560 | . "Changes take effect at next connection only.", |
|
|
561 | on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 } |
511 | ); |
562 | ); |
512 | |
563 | |
513 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fog of War"); |
564 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fog of War"); |
514 | $table->add (1, $row++, new CFPlus::UI::CheckBox |
565 | $table->add (1, $row++, new CFPlus::UI::CheckBox |
515 | state => $CFG->{fow_enable}, |
566 | state => $CFG->{fow_enable}, |
… | |
… | |
534 | status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFPlus::OpenGL::GL_VERSION < 1.2; |
585 | status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFPlus::OpenGL::GL_VERSION < 1.2; |
535 | 0 |
586 | 0 |
536 | } |
587 | } |
537 | ); |
588 | ); |
538 | |
589 | |
539 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); |
|
|
540 | $table->add (1, $row++, new CFPlus::UI::Slider |
|
|
541 | range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], |
|
|
542 | tooltip => "The base font size used by most GUI elements that do not have their own setting.", |
|
|
543 | on_changed => sub { $CFG->{gui_fontsize} = $_[1]; 0 }, |
|
|
544 | ); |
|
|
545 | |
|
|
546 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
590 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
547 | $table->add (1, $row++, new CFPlus::UI::Slider |
591 | $table->add (1, $row++, new CFPlus::UI::Slider |
548 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
592 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
549 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", |
593 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", |
550 | on_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, |
594 | on_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, |
… | |
… | |
566 | range => [$CFG->{gauge_size}, 0.2, 0.8], |
610 | range => [$CFG->{gauge_size}, 0.2, 0.8], |
567 | tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.", |
611 | tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.", |
568 | on_changed => sub { |
612 | on_changed => sub { |
569 | $CFG->{gauge_size} = $_[1]; |
613 | $CFG->{gauge_size} = $_[1]; |
570 | $GAUGES->{win}->set_size ($WIDTH, int $HEIGHT * $CFG->{gauge_size}); |
614 | $GAUGES->{win}->set_size ($WIDTH, int $HEIGHT * $CFG->{gauge_size}); |
571 | 0 |
|
|
572 | } |
|
|
573 | ); |
|
|
574 | |
|
|
575 | $table->add (1, $row++, new CFPlus::UI::Button |
|
|
576 | expand => 1, align => 0, text => "Apply", |
|
|
577 | tooltip => "Apply the video settings", |
|
|
578 | on_activate => sub { |
|
|
579 | video_shutdown (); |
|
|
580 | video_init (); |
|
|
581 | 0 |
615 | 0 |
582 | } |
616 | } |
583 | ); |
617 | ); |
584 | |
618 | |
585 | $vbox |
619 | $vbox |
… | |
… | |
1098 | : start_game; |
1132 | : start_game; |
1099 | 0 |
1133 | 0 |
1100 | }, |
1134 | }, |
1101 | ); |
1135 | ); |
1102 | |
1136 | |
|
|
1137 | $vbox->add (new CFPlus::UI::FancyFrame |
|
|
1138 | label => "Server Info", |
|
|
1139 | child => ($SERVER_INFO = new CFPlus::UI::Label ellipsise => 0), |
|
|
1140 | ); |
|
|
1141 | |
|
|
1142 | $vbox |
|
|
1143 | } |
|
|
1144 | |
|
|
1145 | sub client_setup { |
|
|
1146 | my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1]; |
|
|
1147 | |
|
|
1148 | my $row = 0; |
|
|
1149 | |
1103 | $table->add (0, 13, new CFPlus::UI::Label valign => 0, align => 1, text => "Chat Command"); |
1150 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Chat Command"); |
1104 | $table->add (1, 13, my $saycmd = new CFPlus::UI::Entry |
1151 | $table->add (1, $row++, my $saycmd = new CFPlus::UI::Entry |
1105 | text => $CFG->{say_command}, |
1152 | text => $CFG->{say_command}, |
1106 | tooltip => "This is the command that will be used if you write a line in the message window entry or press <b>\"</b> in the map window. " |
1153 | tooltip => "This is the command that will be used if you write a line in the message window entry or press <b>\"</b> in the map window. " |
1107 | . "Usually you want to enter something like 'say' or 'shout' or 'gsay' here. " |
1154 | . "Usually you want to enter something like 'say' or 'shout' or 'gsay' here. " |
1108 | . "But you could also set it to <b>tell <i>playername</i></b> to only chat with that user.", |
1155 | . "But you could also set it to <b>tell <i>playername</i></b> to only chat with that user.", |
1109 | on_changed => sub { |
1156 | on_changed => sub { |
1110 | my ($self, $value) = @_; |
1157 | my ($self, $value) = @_; |
1111 | $CFG->{say_command} = $value; |
1158 | $CFG->{say_command} = $value; |
1112 | 0 |
1159 | 0 |
1113 | } |
1160 | } |
1114 | ); |
1161 | ); |
1115 | |
1162 | |
1116 | $table->add (0, 14, new CFPlus::UI::Label valign => 0, align => 1, text => "Tip of the day"); |
1163 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Tip of the day"); |
1117 | $table->add (1, 14, my $saycmd = new CFPlus::UI::CheckBox |
1164 | $table->add (1, $row++, new CFPlus::UI::CheckBox |
1118 | state => $CFG->{show_tips}, |
1165 | state => $CFG->{show_tips}, |
1119 | tooltip => "Show the <b>Tip of the day</b> window at startup?", |
1166 | tooltip => "Show the <b>Tip of the day</b> window at startup?", |
1120 | on_changed => sub { |
1167 | on_changed => sub { |
1121 | my ($self, $value) = @_; |
1168 | my ($self, $value) = @_; |
1122 | $CFG->{show_tips} = $value; |
1169 | $CFG->{show_tips} = $value; |
1123 | 0 |
1170 | 0 |
1124 | } |
1171 | } |
1125 | ); |
1172 | ); |
1126 | |
1173 | |
1127 | $vbox->add (new CFPlus::UI::FancyFrame |
1174 | $table->add (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Messages Window Size"); |
1128 | label => "Server Info", |
1175 | $table->add (1, $row++, my $saycmd = new CFPlus::UI::Entry |
1129 | child => ($SERVER_INFO = new CFPlus::UI::Label ellipsise => 0), |
1176 | text => $CFG->{logview_max_par}, |
|
|
1177 | tooltip => "This is maximum number of messages remembered in the <b>Messages</b> window. If the server " |
|
|
1178 | . "sends more messages than this number, older messages get removed to save memory and " |
|
|
1179 | . "computing time. A value of <b>0</b> disables this feature, but that is not recommended.", |
|
|
1180 | on_changed => sub { |
|
|
1181 | my ($self, $value) = @_; |
|
|
1182 | $LOGVIEW->{max_par} = $CFG->{logview_max_par} = $value*1; |
|
|
1183 | 0 |
|
|
1184 | }, |
1130 | ); |
1185 | ); |
1131 | |
1186 | |
1132 | $vbox |
1187 | $table |
1133 | } |
1188 | } |
1134 | |
1189 | |
1135 | sub message_window { |
1190 | sub message_window { |
1136 | my $window = new CFPlus::UI::Toplevel |
1191 | my $window = new CFPlus::UI::Toplevel |
1137 | name => "message_window", |
1192 | name => "message_window", |
… | |
… | |
1574 | |
1629 | |
1575 | sub show_tip_of_the_day { |
1630 | sub show_tip_of_the_day { |
1576 | # find all tips |
1631 | # find all tips |
1577 | my @tod = CFPlus::Pod::find tip_of_the_day => "*"; |
1632 | my @tod = CFPlus::Pod::find tip_of_the_day => "*"; |
1578 | |
1633 | |
1579 | my $todindex = $CFPlus::DB_STATE->get ("tip_of_the_day"); |
1634 | CFPlus::DB::get state => "tip_of_the_day", sub { |
|
|
1635 | my ($todindex) = @_; |
1580 | $todindex = 0 if $todindex >= @tod; |
1636 | $todindex = 0 if $todindex >= @tod; |
1581 | $CFPlus::DB_STATE->put (tip_of_the_day => $todindex + 1); |
1637 | CFPlus::DB::put state => tip_of_the_day => $todindex + 1, sub { }; |
1582 | |
1638 | |
1583 | # create dialog |
1639 | # create dialog |
1584 | my $dialog; |
1640 | my $dialog; |
1585 | |
1641 | |
1586 | my $close = sub { |
1642 | my $close = sub { |
1587 | $dialog->destroy; |
1643 | $dialog->destroy; |
|
|
1644 | }; |
|
|
1645 | |
|
|
1646 | $dialog = new CFPlus::UI::Toplevel |
|
|
1647 | x => "center", |
|
|
1648 | y => "center", |
|
|
1649 | z => 3, |
|
|
1650 | name => 'tip_of_the_day', |
|
|
1651 | force_w => int $WIDTH * 4/9, |
|
|
1652 | force_h => int $WIDTH * 2/9, |
|
|
1653 | title => "Tip of the day #" . (1 + $todindex), |
|
|
1654 | child => my $vbox = new CFPlus::UI::VBox, |
|
|
1655 | has_close_button => 1, |
|
|
1656 | on_delete => $close, |
|
|
1657 | ; |
|
|
1658 | |
|
|
1659 | $vbox->add (my $viewer = new CFPlus::UI::TextScroller |
|
|
1660 | expand => 1, fontsize => 0.8, padding_x => 4, padding_y => 4); |
|
|
1661 | $viewer->add_paragraph (CFPlus::Pod::as_paragraphs CFPlus::Pod::section_of $tod[$todindex]); |
|
|
1662 | |
|
|
1663 | $vbox->add (my $table = new CFPlus::UI::Table col_expand => [0, 1]); |
|
|
1664 | |
|
|
1665 | $table->add (0, 0, new CFPlus::UI::Button |
|
|
1666 | text => "Close", |
|
|
1667 | tooltip => "Close the tip of the day window. To never see it again, disable the tip of the day in the <b>Server Setup</b>.", |
|
|
1668 | on_activate => $close, |
|
|
1669 | ); |
|
|
1670 | |
|
|
1671 | $table->add (2, 0, new CFPlus::UI::Button |
|
|
1672 | text => "Next", |
|
|
1673 | tooltip => "Show the next <b>Tip of the day</b>.", |
|
|
1674 | on_activate => sub { |
|
|
1675 | $close->(); |
|
|
1676 | &show_tip_of_the_day; |
|
|
1677 | }, |
|
|
1678 | ); |
|
|
1679 | |
|
|
1680 | $dialog->show; |
1588 | }; |
1681 | }; |
1589 | |
|
|
1590 | $dialog = new CFPlus::UI::Toplevel |
|
|
1591 | x => "center", |
|
|
1592 | y => "center", |
|
|
1593 | z => 3, |
|
|
1594 | name => 'tip_of_the_day', |
|
|
1595 | force_w => int $WIDTH * 4/9, |
|
|
1596 | force_h => int $WIDTH * 2/9, |
|
|
1597 | title => "Tip of the day #" . (1 + $todindex), |
|
|
1598 | child => my $vbox = new CFPlus::UI::VBox, |
|
|
1599 | has_close_button => 1, |
|
|
1600 | on_delete => $close, |
|
|
1601 | ; |
|
|
1602 | |
|
|
1603 | $vbox->add (my $viewer = new CFPlus::UI::TextScroller |
|
|
1604 | expand => 1, fontsize => 0.8, padding_x => 4, padding_y => 4); |
|
|
1605 | $viewer->add_paragraph (CFPlus::Pod::as_paragraphs CFPlus::Pod::section_of $tod[$todindex]); |
|
|
1606 | |
|
|
1607 | $vbox->add (my $table = new CFPlus::UI::Table col_expand => [0, 1]); |
|
|
1608 | |
|
|
1609 | $table->add (0, 0, new CFPlus::UI::Button |
|
|
1610 | text => "Close", |
|
|
1611 | tooltip => "Close the tip of the day window. To never see it again, disable the tip of the day in the <b>Server Setup</b>.", |
|
|
1612 | on_activate => $close, |
|
|
1613 | ); |
|
|
1614 | |
|
|
1615 | $table->add (2, 0, new CFPlus::UI::Button |
|
|
1616 | text => "Next", |
|
|
1617 | tooltip => "Show the next <b>Tip of the day</b>.", |
|
|
1618 | on_activate => sub { |
|
|
1619 | $close->(); |
|
|
1620 | &show_tip_of_the_day; |
|
|
1621 | }, |
|
|
1622 | ); |
|
|
1623 | |
|
|
1624 | $dialog->show; |
|
|
1625 | } |
1682 | } |
1626 | |
1683 | |
1627 | sub sdl_init { |
1684 | sub sdl_init { |
1628 | CFPlus::SDL_Init |
1685 | CFPlus::SDL_Init |
1629 | and die "SDL::Init failed!\n"; |
1686 | and die "SDL::Init failed!\n"; |
… | |
… | |
1709 | font => $FONT_FIXED, |
1766 | font => $FONT_FIXED, |
1710 | fontsize => $::CFG->{log_fontsize}, |
1767 | fontsize => $::CFG->{log_fontsize}, |
1711 | indent => -4, |
1768 | indent => -4, |
1712 | can_hover => 1, |
1769 | can_hover => 1, |
1713 | can_events => 1, |
1770 | can_events => 1, |
|
|
1771 | max_par => $CFG->{logview_max_par}, |
1714 | tooltip => "<b>Server Log</b>. This text viewer contains all the messages sent by the server.", |
1772 | tooltip => "<b>Server Log</b>. This text viewer contains all recent messages sent by the server.", |
1715 | ; |
1773 | ; |
1716 | |
1774 | |
1717 | $SETUP_DIALOG = new CFPlus::UI::Toplevel |
1775 | $SETUP_DIALOG = new CFPlus::UI::Toplevel |
1718 | title => "Setup", |
1776 | title => "Setup", |
1719 | name => "setup_dialog", |
1777 | name => "setup_dialog", |
… | |
… | |
1730 | $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new CFPlus::UI::Notebook expand => 1, debug => 1, |
1788 | $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new CFPlus::UI::Notebook expand => 1, debug => 1, |
1731 | filter => new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1789 | filter => new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1732 | |
1790 | |
1733 | $SETUP_NOTEBOOK->add (Server => $SETUP_SERVER = server_setup, |
1791 | $SETUP_NOTEBOOK->add (Server => $SETUP_SERVER = server_setup, |
1734 | "Configure the server to play on, your username, password and other server-related options."); |
1792 | "Configure the server to play on, your username, password and other server-related options."); |
|
|
1793 | $SETUP_NOTEBOOK->add (Client => client_setup, |
|
|
1794 | "Configure various client-specific settings."); |
1735 | $SETUP_NOTEBOOK->add (Pickup => autopickup_setup, |
1795 | $SETUP_NOTEBOOK->add (Pickup => autopickup_setup, |
1736 | "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them."); |
1796 | "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them."); |
1737 | $SETUP_NOTEBOOK->add (Graphics => graphics_setup, |
1797 | $SETUP_NOTEBOOK->add (Graphics => graphics_setup, |
1738 | "Configure the video mode, performance, fonts and other graphical aspects of the game."); |
1798 | "Configure the video mode, performance, fonts and other graphical aspects of the game."); |
1739 | $SETUP_NOTEBOOK->add (Audio => audio_setup, |
1799 | $SETUP_NOTEBOOK->add (Audio => audio_setup, |
… | |
… | |
2040 | if $CONN; |
2100 | if $CONN; |
2041 | }); |
2101 | }); |
2042 | |
2102 | |
2043 | %SDL_CB = ( |
2103 | %SDL_CB = ( |
2044 | CFPlus::SDL_QUIT => sub { |
2104 | CFPlus::SDL_QUIT => sub { |
2045 | Event::unloop -1; |
2105 | exit; |
2046 | }, |
2106 | }, |
2047 | CFPlus::SDL_VIDEORESIZE => sub { |
2107 | CFPlus::SDL_VIDEORESIZE => sub { |
2048 | }, |
2108 | }, |
2049 | CFPlus::SDL_VIDEOEXPOSE => sub { |
2109 | CFPlus::SDL_VIDEOEXPOSE => sub { |
2050 | CFPlus::UI::full_refresh; |
2110 | CFPlus::UI::full_refresh; |
… | |
… | |
2088 | CFPlus::DB::Server::run; |
2148 | CFPlus::DB::Server::run; |
2089 | |
2149 | |
2090 | CFPlus::UI::set_layout ($::CFG->{layout}); |
2150 | CFPlus::UI::set_layout ($::CFG->{layout}); |
2091 | |
2151 | |
2092 | my %DEF_CFG = ( |
2152 | my %DEF_CFG = ( |
2093 | sdl_mode => 0, |
2153 | sdl_mode => 0, |
2094 | width => 640, |
2154 | width => 640, |
2095 | height => 480, |
2155 | height => 480, |
2096 | fullscreen => 0, |
2156 | fullscreen => 0, |
2097 | fast => 0, |
2157 | fast => 0, |
2098 | map_scale => 1, |
2158 | map_scale => 1, |
2099 | fow_enable => 1, |
2159 | fow_enable => 1, |
2100 | fow_intensity => 0.45, |
2160 | fow_intensity => 0.45, |
2101 | fow_smooth => 0, |
2161 | fow_smooth => 0, |
|
|
2162 | map_smoothing => 1, |
2102 | gui_fontsize => 1, |
2163 | gui_fontsize => 1, |
2103 | log_fontsize => 0.7, |
2164 | log_fontsize => 0.7, |
2104 | gauge_fontsize => 1, |
2165 | gauge_fontsize => 1, |
2105 | gauge_size => 0.35, |
2166 | gauge_size => 0.35, |
2106 | stat_fontsize => 0.7, |
2167 | stat_fontsize => 0.7, |
2107 | mapsize => 100, |
2168 | mapsize => 100, |
2108 | say_command => 'chat', |
2169 | say_command => 'chat', |
2109 | audio_enable => 1, |
2170 | audio_enable => 1, |
2110 | bgm_enable => 1, |
2171 | bgm_enable => 1, |
2111 | bgm_volume => 0.25, |
2172 | bgm_volume => 0.25, |
2112 | face_prefetch => 0, |
2173 | face_prefetch => 0, |
2113 | output_sync => 1, |
2174 | output_sync => 1, |
2114 | output_count => 1, |
2175 | output_count => 1, |
2115 | output_rate => "", |
2176 | output_rate => "", |
2116 | pickup => 0, |
2177 | pickup => 0, |
2117 | inv_sort => "mtime", |
2178 | inv_sort => "mtime", |
2118 | default => "profile", # default profile |
2179 | default => "profile", # default profile |
2119 | show_tips => 1, |
2180 | show_tips => 1, |
|
|
2181 | logview_max_par => 1000, |
2120 | ); |
2182 | ); |
2121 | |
2183 | |
2122 | while (my ($k, $v) = each %DEF_CFG) { |
2184 | while (my ($k, $v) = each %DEF_CFG) { |
2123 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2185 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2124 | } |
2186 | } |
… | |
… | |
2193 | |
2255 | |
2194 | Event::loop; |
2256 | Event::loop; |
2195 | #CFPlus::SDL_Quit; |
2257 | #CFPlus::SDL_Quit; |
2196 | #CFPlus::_exit 0; |
2258 | #CFPlus::_exit 0; |
2197 | |
2259 | |
|
|
2260 | END { |
2198 | END { CFPlus::SDL_Quit } |
2261 | CFPlus::SDL_Quit; |
|
|
2262 | CFPlus::DB::Server::stop; |
|
|
2263 | } |
2199 | |
2264 | |
2200 | =head1 NAME |
2265 | =head1 NAME |
2201 | |
2266 | |
2202 | cfplus - A Crossfire+ and Crossfire game client |
2267 | cfplus - A Crossfire+ and Crossfire game client |
2203 | |
2268 | |