@@ -397,47 +397,6 @@ static void SetAlwaysSoftwareLabel(Button* b) {
397397 : _ (" Always use software render: Off" ));
398398}
399399
400- static void runSetMusicVolume (const char * cvar, const char * header) {
401- Menu volumeMenu (globalData.screen , header, true );
402- Button_confirmVolume bConfirm (cvar);
403- Button_increaseVolume plus5 (cvar, 5 );
404- Button_increaseVolume minus5 (cvar, -5 );
405- Button_increaseVolume plus1 (cvar, 1 );
406- Button_increaseVolume minus1 (cvar, -1 );
407- volumeMenu.addButton (&bConfirm);
408- volumeMenu.addButton (&plus5);
409- volumeMenu.addButton (&minus5);
410- volumeMenu.addButton (&plus1);
411- volumeMenu.addButton (&minus1);
412- Button_testSound bTestSound;
413- volumeMenu.addButton (&bTestSound);
414- Button_testMusic bTestMusic;
415- volumeMenu.addButton (&bTestMusic);
416- RunGameState (volumeMenu);
417- }
418-
419- static void SetMusicLabel (Button* b) {
420- if (globalData.MusicEnabled ) {
421- double volume = Config::getInstance ()->getInt (" volume_music" );
422- int volumePct = volume*100.0 /MIX_MAX_VOLUME;
423- b->setLabel (std::string (_ (" Music: " ))+ std::to_string (volumePct)+" %" );
424- }
425- else {
426- b->setLabel (_ (" Music: Off" ) );
427- }
428- }
429-
430- static void SetSoundLabel (Button* b) {
431- if (globalData.SoundEnabled ) {
432- double volume = Config::getInstance ()->getInt (" volume_sound" );
433- int volumePct = volume*100.0 /MIX_MAX_VOLUME;
434- b->setLabel (std::string (_ (" Sound: " ))+ std::to_string (volumePct)+" %" );
435- }
436- else {
437- b->setLabel (_ (" Sound: Off" ) );
438- }
439- }
440-
441400static void SetFullscreenLabel (Button* b) {
442401 b->setLabel (globalData.bFullscreen ? _ (" Fullscreen: On" ) : _ (" Fullscreen: Off" ) );
443402}
@@ -453,22 +412,6 @@ class AlwaysSoftwareRenderButton : public Button {
453412 }
454413};
455414
456- class MusicButton : public Button {
457- virtual void doAction () override {
458- runSetMusicVolume (" volume_music" , _ (" Music volume" ));
459- globalData.MusicEnabled = (Config::getInstance ()->getInt (" volume_music" ) != 0 );
460- SetMusicLabel (this );
461- }
462- };
463-
464- class SoundButton : public Button {
465- virtual void doAction () override {
466- runSetMusicVolume (" volume_sound" , _ (" Sound volume" ));
467- globalData.MusicEnabled = (Config::getInstance ()->getInt (" volume_sound" ) != 0 );
468- SetSoundLabel (this );
469- }
470- };
471-
472415class FullscreenButton : public Button {
473416 virtual void doAction () override {
474417 globalData.bFullscreen = !globalData.bFullscreen ;
0 commit comments