ja tenim el control de la finestra i de la imatge
treballant en les tecles de funcio
This commit is contained in:
@@ -41,6 +41,16 @@ namespace Options {
|
||||
}
|
||||
}
|
||||
|
||||
static void loadWindowConfigFromYaml(const fkyaml::node& yaml) {
|
||||
if (!yaml.contains("window")) return;
|
||||
const auto& node = yaml["window"];
|
||||
|
||||
if (node.contains("zoom"))
|
||||
window.zoom = node["zoom"].get_value<int>();
|
||||
if (node.contains("fullscreen"))
|
||||
window.fullscreen = node["fullscreen"].get_value<bool>();
|
||||
}
|
||||
|
||||
static void loadGameConfigFromYaml(const fkyaml::node& yaml) {
|
||||
if (!yaml.contains("game")) return;
|
||||
const auto& node = yaml["game"];
|
||||
@@ -84,6 +94,7 @@ namespace Options {
|
||||
return true;
|
||||
}
|
||||
|
||||
loadWindowConfigFromYaml(yaml);
|
||||
loadAudioConfigFromYaml(yaml);
|
||||
loadGameConfigFromYaml(yaml);
|
||||
|
||||
@@ -118,6 +129,13 @@ namespace Options {
|
||||
file << "version: \"" << Texts::VERSION << "\"\n";
|
||||
file << "\n";
|
||||
|
||||
// WINDOW
|
||||
file << "# WINDOW\n";
|
||||
file << "window:\n";
|
||||
file << " zoom: " << window.zoom << "\n";
|
||||
file << " fullscreen: " << (window.fullscreen ? "true" : "false") << "\n";
|
||||
file << "\n";
|
||||
|
||||
// AUDIO
|
||||
file << "# AUDIO\n";
|
||||
file << "audio:\n";
|
||||
|
||||
Reference in New Issue
Block a user