| 650 | } |
| 651 | |
| 652 | bool Scene_Settings::SaveConfig(bool silent) { |
| 653 | auto cfg_out = Game_Config::GetGlobalConfigFileOutput(); |
| 654 | |
| 655 | if (!cfg_out) { |
| 656 | if (silent) { |
| 657 | Output::Debug("Saving configuration file failed!"); |
| 658 | } else { |
| 659 | Output::Warning("Saving configuration file failed!"); |
| 660 | } |
| 661 | return false; |
| 662 | } |
| 663 | |
| 664 | Game_Config cfg; |
| 665 | cfg.video = DisplayUi->GetConfig(); |
| 666 | cfg.audio = Audio().GetConfig(); |
| 667 | cfg.input = Input::GetInputSource()->GetConfig(); |
| 668 | cfg.player = Player::player_config; |
| 669 | |
| 670 | cfg.WriteToStream(cfg_out); |
| 671 | |
| 672 | AsyncHandler::SaveFilesystem(); |
| 673 | |
| 674 | if (silent) { |
| 675 | Output::Debug("Configuration saved to {}", cfg_out.GetName()); |
| 676 | } else { |
| 677 | Output::Info("Configuration saved to {}", cfg_out.GetName()); |
| 678 | } |
| 679 | |
| 680 | return true; |
| 681 | } |
nothing calls this directly
no test coverage detected