el fitxer de parametres es guarda en options/config.txt

This commit is contained in:
2025-08-17 21:42:26 +02:00
parent 1e9e664012
commit 2819b3628e
4 changed files with 6 additions and 2 deletions

View File

@@ -134,6 +134,7 @@ auto saveToFile() -> bool {
file << "game.difficulty=" << static_cast<int>(settings.difficulty) << "\n";
file << "game.autofire=" << boolToString(settings.autofire) << "\n";
file << "game.shutdown_enabled=" << boolToString(settings.shutdown_enabled) << "\n";
file << "game.params_file=" << settings.params_file << "\n";
// Opciones de mandos
file << "\n## CONTROLLERS\n";
@@ -208,6 +209,7 @@ auto set(const std::string& var, const std::string& value) -> bool {
}},
{"game.autofire", [](const auto& val) { settings.autofire = stringToBool(val); }},
{"game.shutdown_enabled", [](const auto& val) { settings.shutdown_enabled = stringToBool(val); }},
{"game.params_file", [](const auto& val) { settings.params_file = val; }},
// Teclado
{"keyboard.player", [](const auto& val) { keyboard.player_id = static_cast<Player::Id>(stoi(val)); }}};