config: opció gameplay.pause_countdown per saltar el compte enrere de pausa
This commit is contained in:
@@ -20,6 +20,7 @@ namespace Options {
|
||||
Audio audio;
|
||||
Loading loading;
|
||||
Settings settings;
|
||||
Gameplay gameplay;
|
||||
std::vector<InputDevice> inputs;
|
||||
|
||||
std::vector<PostFXPreset> postfx_presets;
|
||||
@@ -150,6 +151,12 @@ namespace Options {
|
||||
parseIntField(st, "player_selected", settings.player_selected);
|
||||
}
|
||||
|
||||
void loadGameplayFromYaml(const fkyaml::node &yaml) {
|
||||
if (!yaml.contains("gameplay")) { return; }
|
||||
const auto &gp = yaml["gameplay"];
|
||||
parseBoolField(gp, "pause_countdown", gameplay.pause_countdown);
|
||||
}
|
||||
|
||||
void loadInputsFromYaml(const fkyaml::node &yaml) {
|
||||
if (!yaml.contains("input") || inputs.size() < 2) { return; }
|
||||
const auto &ins = yaml["input"];
|
||||
@@ -177,6 +184,7 @@ namespace Options {
|
||||
video = Video{};
|
||||
audio = Audio{};
|
||||
loading = Loading{};
|
||||
gameplay = Gameplay{};
|
||||
|
||||
// Preserva config_file si ja s'ha establert abans.
|
||||
const std::string PREV_CONFIG_FILE = settings.config_file;
|
||||
@@ -236,6 +244,7 @@ namespace Options {
|
||||
loadAudioFromYaml(yaml);
|
||||
loadLoadingFromYaml(yaml);
|
||||
loadSettingsFromYaml(yaml);
|
||||
loadGameplayFromYaml(yaml);
|
||||
loadInputsFromYaml(yaml);
|
||||
|
||||
} catch (const fkyaml::exception &e) {
|
||||
@@ -312,6 +321,11 @@ namespace Options {
|
||||
file << " language: " << static_cast<int>(settings.language) << "\n";
|
||||
file << " player_selected: " << settings.player_selected << "\n\n";
|
||||
|
||||
// GAMEPLAY
|
||||
file << "# GAMEPLAY\n";
|
||||
file << "gameplay:\n";
|
||||
file << " pause_countdown: " << boolToString(gameplay.pause_countdown) << "\n\n";
|
||||
|
||||
// INPUT
|
||||
file << "# INPUT DEVICES (device_type: "
|
||||
<< static_cast<int>(Input::Device::KEYBOARD) << "=KEYBOARD, "
|
||||
|
||||
Reference in New Issue
Block a user