MCPcopy Create free account
hub / github.com/EasyRPG/Player / SaveConfig

Method SaveConfig

src/scene_settings.cpp:652–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652bool 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}

Callers

nothing calls this directly

Calls 3

WriteToStreamMethod · 0.80
GetConfigMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected