ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.180 by root, Sat Jul 21 13:37:09 2007 UTC vs.
Revision 1.185 by elmex, Tue Jul 24 18:39:39 2007 UTC

82use CFPlus; 82use CFPlus;
83use CFPlus::OpenGL (); 83use CFPlus::OpenGL ();
84use CFPlus::Protocol; 84use CFPlus::Protocol;
85use CFPlus::DB; 85use CFPlus::DB;
86use CFPlus::UI; 86use CFPlus::UI;
87use CFPlus::UI::Canvas;
87use CFPlus::UI::Inventory; 88use CFPlus::UI::Inventory;
88use CFPlus::UI::SpellList; 89use CFPlus::UI::SpellList;
90use CFPlus::UI::MessageWindow;
89use CFPlus::Pod; 91use CFPlus::Pod;
90use CFPlus::MapWidget; 92use CFPlus::MapWidget;
91use CFPlus::Macro; 93use CFPlus::Macro;
92 94
93$SIG{QUIT} = sub { Carp::cluck "QUIT" }; 95$SIG{QUIT} = sub { Carp::cluck "QUIT" };
125 127
126our $MAP; 128our $MAP;
127our $MAPMAP; 129our $MAPMAP;
128our $MAPWIDGET; 130our $MAPWIDGET;
129our $BUTTONBAR; 131our $BUTTONBAR;
130our $LOGVIEW;
131our $CONSOLE;
132our $METASERVER; 132our $METASERVER;
133our $LOGIN_BUTTON; 133our $LOGIN_BUTTON;
134our $QUIT_DIALOG; 134our $QUIT_DIALOG;
135our $HOST_ENTRY; 135our $HOST_ENTRY;
136our $FULLSCREEN_ENABLE; 136our $FULLSCREEN_ENABLE;
191 $DEBUG_STATUS->set_text ($_[0]); 191 $DEBUG_STATUS->set_text ($_[0]);
192} 192}
193 193
194sub message { 194sub message {
195 my ($para) = @_; 195 my ($para) = @_;
196 196 $MESSAGE_WINDOW->message ($para);
197 my $time = sprintf "%02d:%02d:%02d", (localtime time)[2,1,0];
198
199 $para->{markup} = "<span foreground='#ffffff'>$time</span> $para->{markup}";
200
201 $LOGVIEW->add_paragraph ($para);
202 $LOGVIEW->scroll_to_bottom;
203} 197}
204 198
205sub destroy_query_dialog { 199sub destroy_query_dialog {
206 (delete $_[0]{query_dialog})->destroy 200 (delete $_[0]{query_dialog})->destroy
207 if $_[0]{query_dialog}; 201 if $_[0]{query_dialog};
460 maph => $mapsize, 454 maph => $mapsize,
461 455
462 client => "cfplus $CFPlus::VERSION $] $^O", 456 client => "cfplus $CFPlus::VERSION $] $^O",
463 457
464 map_widget => $MAPWIDGET, 458 map_widget => $MAPWIDGET,
465 logview => $LOGVIEW,
466 statusbox => $STATUSBOX, 459 statusbox => $STATUSBOX,
467 map => $MAP, 460 map => $MAP,
468 mapmap => $MAPMAP, 461 mapmap => $MAPMAP,
469 query => \&server_query, 462 query => \&server_query,
470 463
499 $LOGIN_BUTTON->set_text ("Login"); 492 $LOGIN_BUTTON->set_text ("Login");
500 $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER); 493 $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER);
501 $SETUP_DIALOG->show; 494 $SETUP_DIALOG->show;
502 $PL_WINDOW->hide; 495 $PL_WINDOW->hide;
503 $SPELL_LIST->clear_spells; 496 $SPELL_LIST->clear_spells;
497 $MESSAGE_WINDOW->clear_channels;
504 $CFPlus::UI::ROOT->emit (stop_game => ! ! $CONN); 498 $CFPlus::UI::ROOT->emit (stop_game => ! ! $CONN);
505 499
506 &audio_music_set ([]); 500 &audio_music_set ([]);
507 501
508 return unless $CONN; 502 return unless $CONN;
613 607
614 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Message Fontsize"); 608 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Message Fontsize");
615 $table->add_at (1, $row++, new CFPlus::UI::Slider 609 $table->add_at (1, $row++, new CFPlus::UI::Slider
616 range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], 610 range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1],
617 tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", 611 tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.",
618 on_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, 612 on_changed => sub { $MESSAGE_WINDOW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 },
619 ); 613 );
620 614
621 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); 615 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Gauge fontsize");
622 $table->add_at (1, $row++, new CFPlus::UI::Slider 616 $table->add_at (1, $row++, new CFPlus::UI::Slider
623 range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], 617 range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1],
752 $table->add_at (1, 3, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 }); 746 $table->add_at (1, 3, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 });
753 $table->add_at (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } ); 747 $table->add_at (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } );
754 748
755 $table->add_at (0, 5, new CFPlus::UI::TextEdit text => "line1\0152\0153");#d# 749 $table->add_at (0, 5, new CFPlus::UI::TextEdit text => "line1\0152\0153");#d#
756 750
757 $table->add_at (7,7, my $t = new CFPlus::UI::Table); 751 $table->add_at (7,7, my $t = new CFPlus::UI::Table expand => 0);
758 $t->add_at (0,0, new CFPlus::UI::Label text => "a a a a", rowspan => 1, colspan => 2); 752 $t->add_at (0,0, new CFPlus::UI::Label text => "a a a a", rowspan => 1, colspan => 2);
759 $t->add_at (2,0, new CFPlus::UI::Label text => "b\nb", rowspan => 2, colspan => 1); 753 $t->add_at (2,0, new CFPlus::UI::Label text => "b\nb", rowspan => 2, colspan => 1);
760 $t->add_at (1,2, new CFPlus::UI::Label text => "c c c c", rowspan => 1, colspan => 2); 754 $t->add_at (1,2, new CFPlus::UI::Label text => "c c c c", rowspan => 1, colspan => 2);
761 $t->add_at (0,1, new CFPlus::UI::Label text => "d\nd", rowspan => 2, colspan => 1); 755 $t->add_at (0,1, new CFPlus::UI::Label text => "d\nd", rowspan => 2, colspan => 1);
762 $t->add_at (1,1, new CFPlus::UI::Label text => "e"); 756 $t->add_at (1,1, new CFPlus::UI::Label text => "e");
757
758 $table->add_at (7, 6, my $c = new CFPlus::UI::Canvas);
759
760 $c->add_items ({
761 type => "line_loop",
762 color => [0, 1, 0],
763 width => 9,
764 coord_mode => "abs",
765 coord => [[10, 5], [5, 50], [20, 5], [5, 60]],
766 });
767
768 $c->add_items ({
769 type => "lines",
770 color => [1, 1, 0],
771 width => 2,
772 coord_mode => "rel",
773 coord => [[0,0], [1,1], [1,0], [0,1]],
774 });
775
776 $c->add_items ({
777 type => "polygon",
778 color => [0, 0.43, 0],
779 width => 2,
780 coord_mode => "rel",
781 coord => [[0,0.2], [1,.4], [1,.6], [0,.8]],
782 });
763 783
764 $table 784 $table
765} 785}
766 786
767sub stats_window { 787sub stats_window {
1165sub client_setup { 1185sub client_setup {
1166 my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1]; 1186 my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1];
1167 1187
1168 my $row = 0; 1188 my $row = 0;
1169 1189
1170 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Chat Command");
1171 $table->add_at (1, $row++, my $saycmd = new CFPlus::UI::Entry
1172 text => $CFG->{say_command},
1173 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. "
1174 . "Usually you want to enter something like 'say' or 'shout' or 'gsay' here. "
1175 . "But you could also set it to <b>tell <i>playername</i></b> to only chat with that user.",
1176 on_changed => sub {
1177 my ($self, $value) = @_;
1178 $CFG->{say_command} = $value;
1179 0
1180 }
1181 );
1182
1183 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Tip of the day"); 1190 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Tip of the day");
1184 $table->add_at (1, $row++, new CFPlus::UI::CheckBox 1191 $table->add_at (1, $row++, new CFPlus::UI::CheckBox
1185 state => $CFG->{show_tips}, 1192 state => $CFG->{show_tips},
1186 tooltip => "Show the <b>Tip of the day</b> window at startup?", 1193 tooltip => "Show the <b>Tip of the day</b> window at startup?",
1187 on_changed => sub { 1194 on_changed => sub {
1197 tooltip => "This is maximum number of messages remembered in the <b>Messages</b> window. If the server " 1204 tooltip => "This is maximum number of messages remembered in the <b>Messages</b> window. If the server "
1198 . "sends more messages than this number, older messages get removed to save memory and " 1205 . "sends more messages than this number, older messages get removed to save memory and "
1199 . "computing time. A value of <b>0</b> disables this feature, but that is not recommended.", 1206 . "computing time. A value of <b>0</b> disables this feature, but that is not recommended.",
1200 on_changed => sub { 1207 on_changed => sub {
1201 my ($self, $value) = @_; 1208 my ($self, $value) = @_;
1202 $LOGVIEW->{max_par} = $CFG->{logview_max_par} = $value*1; 1209 $MESSAGE_WINDOW->set_max_para ($CFG->{logview_max_par} = $value*1);
1203 0 1210 0
1204 }, 1211 },
1205 ); 1212 );
1206 1213
1207 $table 1214 $table
1208}
1209
1210sub message_window {
1211 my $window = new CFPlus::UI::Toplevel
1212 name => "message_window",
1213 title => "Messages",
1214 border_bg => [1, 1, 1, 1],
1215 x => "max",
1216 y => 0,
1217 force_w => $::WIDTH * 0.4,
1218 force_h => $::HEIGHT * 0.5,
1219 child => (my $vbox = new CFPlus::UI::VBox),
1220 has_close_button => 1;
1221
1222 $vbox->add ($LOGVIEW);
1223
1224 $vbox->add (my $input = new CFPlus::UI::Entry
1225 tooltip => "<b>Chat Box</b>. If you enter a text and press return/enter here, the current <i>communication command</i> "
1226 . "from the client setup will be prepended (e.g. <b>shout</b>, <b>chat</b>...). "
1227 . "If you prepend a slash (/), you will submit a command instead (similar to IRC). "
1228 . "A better way to submit commands (and the occasional chat command) is often the map command completer.",
1229 on_focus_in => sub {
1230 my ($input, $prev_focus) = @_;
1231
1232 delete $input->{refocus_map};
1233
1234 if ($prev_focus == $MAPWIDGET && $input->{auto_activated}) {
1235 $input->{refocus_map} = 1;
1236 }
1237 delete $input->{auto_activated};
1238
1239 0
1240 },
1241 on_activate => sub {
1242 my ($input, $text) = @_;
1243 $input->set_text ('');
1244
1245 if ($text =~ /^\/(.*)/) {
1246 $::CONN->user_send ($1);
1247 } else {
1248 my $say_cmd = $::CFG->{say_command} || 'say';
1249 $::CONN->user_send ("$say_cmd $text");
1250 }
1251 if ($input->{refocus_map}) {
1252 delete $input->{refocus_map};
1253 $MAPWIDGET->focus_in
1254 }
1255
1256 0
1257 },
1258 on_escape => sub {
1259 $MAPWIDGET->grab_focus;
1260
1261 0
1262 },
1263 );
1264
1265 $CONSOLE = {
1266 window => $window,
1267 input => $input,
1268 };
1269
1270 $window
1271} 1215}
1272 1216
1273sub autopickup_setup { 1217sub autopickup_setup {
1274 my $r = new CFPlus::UI::ScrolledWindow ( 1218 my $r = new CFPlus::UI::ScrolledWindow (
1275 expand => 1, 1219 expand => 1,
1461 1405
1462 my $ntb = 1406 my $ntb =
1463 $PL_NOTEBOOK = 1407 $PL_NOTEBOOK =
1464 new CFPlus::UI::Notebook expand => 1; 1408 new CFPlus::UI::Notebook expand => 1;
1465 1409
1466 $ntb->add ( 1410 $ntb->add_tab (
1467 "Statistics (F2)" => $STATS_PAGE = stats_window, 1411 "Statistics (F2)" => $STATS_PAGE = stats_window,
1468 "Shows statistics, where all your Stats and Resistances are shown." 1412 "Shows statistics, where all your Stats and Resistances are shown."
1469 ); 1413 );
1470 $ntb->add ( 1414 $ntb->add_tab (
1471 "Skills (F3)" => $SKILL_PAGE = skill_window, 1415 "Skills (F3)" => $SKILL_PAGE = skill_window,
1472 "Shows all your Skills." 1416 "Shows all your Skills."
1473 ); 1417 );
1474 1418
1475 my $spellsw = $SPELL_PAGE = new CFPlus::UI::ScrolledWindow (expand => 1, scroll_y => 1); 1419 my $spellsw = $SPELL_PAGE = new CFPlus::UI::ScrolledWindow (expand => 1, scroll_y => 1);
1476 $spellsw->add ($SPELL_LIST = new CFPlus::UI::SpellList); 1420 $spellsw->add ($SPELL_LIST = new CFPlus::UI::SpellList);
1477 $ntb->add ( 1421 $ntb->add_tab (
1478 "Spellbook (F4)" => $spellsw, 1422 "Spellbook (F4)" => $spellsw,
1479 "Displays all spells you have and lets you edit keyboard shortcuts for them." 1423 "Displays all spells you have and lets you edit keyboard shortcuts for them."
1480 ); 1424 );
1481 $ntb->add ( 1425 $ntb->add_tab (
1482 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget, 1426 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget,
1483 "Toggles the inventory window, where you can manage your loot (or treasures :). " 1427 "Toggles the inventory window, where you can manage your loot (or treasures :). "
1484 . "You can also hit the <b>Tab</b>-key to show/hide the Inventory." 1428 . "You can also hit the <b>Tab</b>-key to show/hide the Inventory."
1485 ); 1429 );
1486 $ntb->add (Pickup => autopickup_setup, 1430 $ntb->add_tab (Pickup => autopickup_setup,
1487 "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them."); 1431 "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them.");
1488 1432
1489 $ntb->set_current_page ($INVENTORY_PAGE); 1433 $ntb->set_current_page ($INVENTORY_PAGE);
1490 1434
1491 $plwin->add ($ntb); 1435 $plwin->add ($ntb);
1774 1718
1775 $MAPWIDGET = new CFPlus::MapWidget; 1719 $MAPWIDGET = new CFPlus::MapWidget;
1776 $MAPWIDGET->connect (activate_console => sub { 1720 $MAPWIDGET->connect (activate_console => sub {
1777 my ($mapwidget, $preset) = @_; 1721 my ($mapwidget, $preset) = @_;
1778 1722
1779 if ($CONSOLE) { 1723 $MESSAGE_WINDOW->activate_console ($preset)
1780 $CONSOLE->{input}->{auto_activated} = 1; 1724 if $MESSAGE_WINDOW;
1781 $CONSOLE->{input}->grab_focus;
1782
1783 if ($preset && $CONSOLE->{input}->get_text eq '') {
1784 $CONSOLE->{input}->set_text ($preset);
1785 }
1786 }
1787 }); 1725 });
1788 $MAPWIDGET->show; 1726 $MAPWIDGET->show;
1789 $MAPWIDGET->grab_focus; 1727 $MAPWIDGET->grab_focus;
1790
1791 $LOGVIEW = new CFPlus::UI::TextScroller
1792 expand => 1,
1793 font => $FONT_FIXED,
1794 fontsize => $::CFG->{log_fontsize},
1795 indent => -4,
1796 can_hover => 1,
1797 can_events => 1,
1798 max_par => $CFG->{logview_max_par},
1799 tooltip => "<b>Server Log</b>. This text viewer contains all recent messages sent by the server.",
1800 ;
1801 1728
1802 $SETUP_DIALOG = new CFPlus::UI::Toplevel 1729 $SETUP_DIALOG = new CFPlus::UI::Toplevel
1803 title => "Setup", 1730 title => "Setup",
1804 name => "setup_dialog", 1731 name => "setup_dialog",
1805 x => 'center', 1732 x => 'center',
1809 force_h => $::HEIGHT * 0.6, 1736 force_h => $::HEIGHT * 0.6,
1810 has_close_button => 1, 1737 has_close_button => 1,
1811 ; 1738 ;
1812 1739
1813 $METASERVER = metaserver_dialog; 1740 $METASERVER = metaserver_dialog;
1741 $MESSAGE_WINDOW = new CFPlus::UI::MessageWindow;
1814 1742
1815 $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new CFPlus::UI::Notebook expand => 1, debug => 1, 1743 $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new CFPlus::UI::Notebook expand => 1, debug => 1,
1816 filter => new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); 1744 filter => new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1);
1817 1745
1818 $SETUP_NOTEBOOK->add (Server => $SETUP_SERVER = server_setup, 1746 $SETUP_NOTEBOOK->add_tab (Server => $SETUP_SERVER = server_setup,
1819 "Configure the server to play on, your username, password and other server-related options."); 1747 "Configure the server to play on, your username, password and other server-related options.");
1820 $SETUP_NOTEBOOK->add (Client => client_setup, 1748 $SETUP_NOTEBOOK->add_tab (Client => client_setup,
1821 "Configure various client-specific settings."); 1749 "Configure various client-specific settings.");
1822 $SETUP_NOTEBOOK->add (Graphics => graphics_setup, 1750 $SETUP_NOTEBOOK->add_tab (Graphics => graphics_setup,
1823 "Configure the video mode, performance, fonts and other graphical aspects of the game."); 1751 "Configure the video mode, performance, fonts and other graphical aspects of the game.");
1824 $SETUP_NOTEBOOK->add (Audio => audio_setup, 1752 $SETUP_NOTEBOOK->add_tab (Audio => audio_setup,
1825 "Configure the use of audio, sound effects and background music."); 1753 "Configure the use of audio, sound effects and background music.");
1826 $SETUP_NOTEBOOK->add (Keyboard => $SETUP_KEYBOARD = keyboard_setup, 1754 $SETUP_NOTEBOOK->add_tab (Keyboard => $SETUP_KEYBOARD = keyboard_setup,
1827 "Lets you define, edit and delete key bindings." 1755 "Lets you define, edit and delete key bindings."
1828 . "There is a shortcut for making bindings: <b>Control-Insert</b> opens the binding editor " 1756 . "There is a shortcut for making bindings: <b>Control-Insert</b> opens the binding editor "
1829 . "with nothing set and the recording started. After doing the actions you " 1757 . "with nothing set and the recording started. After doing the actions you "
1830 . "want to record press <b>Insert</b> and you will be asked to press a key-combo. " 1758 . "want to record press <b>Insert</b> and you will be asked to press a key-combo. "
1831 . "After pressing the combo the binding will be saved automatically and the " 1759 . "After pressing the combo the binding will be saved automatically and the "
1832 . "binding editor closes"); 1760 . "binding editor closes");
1833 $SETUP_NOTEBOOK->add (Debug => debug_setup, 1761 $SETUP_NOTEBOOK->add_tab (Debug => debug_setup,
1834 "Some debuggin' options. Do not ask."); 1762 "Some debuggin' options. Do not ask.");
1835 1763
1836 $BUTTONBAR = new CFPlus::UI::Buttonbar x => 0, y => 0, z => 200; # put on top 1764 $BUTTONBAR = new CFPlus::UI::Buttonbar x => 0, y => 0, z => 200; # put on top
1837 1765
1838 $BUTTONBAR->add (new CFPlus::UI::Flopper text => "Setup", other => $SETUP_DIALOG, 1766 $BUTTONBAR->add (new CFPlus::UI::Flopper text => "Setup", other => $SETUP_DIALOG,
1839 tooltip => "Toggles a dialog where you can configure all aspects of this client."); 1767 tooltip => "Toggles a dialog where you can configure all aspects of this client.");
1840 1768
1841 $BUTTONBAR->add (new CFPlus::UI::Flopper text => "Message Window", other => $MESSAGE_WINDOW = message_window, 1769 $BUTTONBAR->add (new CFPlus::UI::Flopper text => "Message Window", other => $MESSAGE_WINDOW,
1842 tooltip => "Toggles the server message log, where the client collects <i>all</i> messages from the server."); 1770 tooltip => "Toggles the server message log, where the client collects <i>all</i> messages from the server.");
1843 1771
1844 make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D 1772 make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D
1845 1773
1846 $BUTTONBAR->add (new CFPlus::UI::Flopper text => "Playerbook", other => player_window, 1774 $BUTTONBAR->add (new CFPlus::UI::Flopper text => "Playerbook", other => player_window,
2029sub audio_music_start { 1957sub audio_music_start {
2030 my $path = $MUSIC_PLAYING->{path} 1958 my $path = $MUSIC_PLAYING->{path}
2031 or return; 1959 or return;
2032 1960
2033 CFPlus::DB::prefetch_file $path, 1024_000, sub { 1961 CFPlus::DB::prefetch_file $path, 1024_000, sub {
1962 return unless $SDL_MIXER;
1963
2034 # music might have changed... 1964 # music might have changed...
2035 $path eq $MUSIC_PLAYING->{path} 1965 $path eq $MUSIC_PLAYING->{path}
2036 or return &audio_music_start (); 1966 or return &audio_music_start ();
2037 1967
2038 $MUSIC_PLAYER = new_from_file CFPlus::MixMusic $path; 1968 $MUSIC_PLAYER = new_from_file CFPlus::MixMusic $path;
2053 } 1983 }
2054} 1984}
2055 1985
2056sub audio_music_changed { 1986sub audio_music_changed {
2057 return unless $CFG->{bgm_enable}; 1987 return unless $CFG->{bgm_enable};
1988 return unless $SDL_MIXER;
2058 1989
2059 # default MUSIC_WANT == MUSIC_DEFAULT 1990 # default MUSIC_WANT == MUSIC_DEFAULT
2060 @MUSIC_WANT = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_WANT; 1991 @MUSIC_WANT = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_WANT;
2061 1992
2062 # if the currently playing song is acceptable, let it continue 1993 # if the currently playing song is acceptable, let it continue
2122 }; 2053 };
2123 } 2054 }
2124 } else { 2055 } else {
2125 status "unable to open sound config: $!"; 2056 status "unable to open sound config: $!";
2126 } 2057 }
2058 } else {
2059 undef $SDL_MIXER;
2127 } 2060 }
2128} 2061}
2129 2062
2130sub audio_shutdown { 2063sub audio_shutdown {
2131 CFPlus::Mix_CloseAudio if $SDL_MIXER; 2064 CFPlus::Mix_CloseAudio if $SDL_MIXER;
2255 log_fontsize => 0.7, 2188 log_fontsize => 0.7,
2256 gauge_fontsize => 1, 2189 gauge_fontsize => 1,
2257 gauge_size => 0.35, 2190 gauge_size => 0.35,
2258 stat_fontsize => 0.7, 2191 stat_fontsize => 0.7,
2259 mapsize => 100, 2192 mapsize => 100,
2260 say_command => 'chat',
2261 audio_enable => 1, 2193 audio_enable => 1,
2262 bgm_enable => 1, 2194 bgm_enable => 1,
2263 bgm_volume => 0.25, 2195 bgm_volume => 0.25,
2264 face_prefetch => 0, 2196 face_prefetch => 0,
2265 output_sync => 1, 2197 output_sync => 1,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines