… | |
… | |
167 | }); |
167 | }); |
168 | |
168 | |
169 | $table->add (1, 7, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { |
169 | $table->add (1, 7, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { |
170 | video_shutdown (); |
170 | video_shutdown (); |
171 | video_init (); |
171 | video_init (); |
|
|
172 | }); |
|
|
173 | |
|
|
174 | $table->add (0, 8, new CFClient::UI::Label align => 1, text => "Sound"); |
|
|
175 | $table->add (1, 8, new CFClient::UI::CheckBox state => $CFG->{sound}, connect_changed => sub { |
|
|
176 | my ($self, $value) = @_; |
|
|
177 | $CFG->{sound} = $value; |
|
|
178 | }); |
|
|
179 | $table->add (0, 9, new CFClient::UI::Label align => 1, text => "Bg. Music"); |
|
|
180 | $table->add (1, 9, new CFClient::UI::CheckBox state => $CFG->{bg_music_enable}, connect_changed => sub { |
|
|
181 | my ($self, $value) = @_; |
|
|
182 | $CFG->{bg_music_enable} = $value; |
|
|
183 | }); |
|
|
184 | $table->add (1, 10, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { |
|
|
185 | audio_shutdown (); |
|
|
186 | audio_init (); |
172 | }); |
187 | }); |
173 | |
188 | |
174 | $dialog |
189 | $dialog |
175 | } |
190 | } |
176 | |
191 | |
… | |
… | |
474 | if ($CFG->{sound} || 1) { |
489 | if ($CFG->{sound} || 1) { |
475 | if (open my $fh, "<:utf8", CFClient::find_rcfile "sounds/config") { |
490 | if (open my $fh, "<:utf8", CFClient::find_rcfile "sounds/config") { |
476 | $SDL_MIXER = new SDL::Mixer; |
491 | $SDL_MIXER = new SDL::Mixer; |
477 | $SDL_MIXER->allocate_channels (8); |
492 | $SDL_MIXER->allocate_channels (8); |
478 | |
493 | |
|
|
494 | if ($CFG->{bg_music_enable}) { |
479 | $bgmusic = new SDL::Music CFClient::find_rcfile "music/game3.ogg"; |
495 | $bgmusic = new SDL::Music CFClient::find_rcfile "music/game3.ogg"; |
480 | $SDL_MIXER->play_music ($bgmusic, -1); |
496 | $SDL_MIXER->play_music ($bgmusic, -1); |
|
|
497 | } |
481 | |
498 | |
482 | while (<$fh>) { |
499 | while (<$fh>) { |
483 | next if /^\s*#/; |
500 | next if /^\s*#/; |
484 | next if /^\s*$/; |
501 | next if /^\s*$/; |
485 | |
502 | |