afegit mode autoplay en debug

This commit is contained in:
2026-04-04 10:42:31 +02:00
parent 4c1ed1cf9b
commit 1a2298963d
4 changed files with 100 additions and 2 deletions

View File

@@ -230,6 +230,8 @@ void Director::loadDebugConfig() {
out << "initial_stage: 0\n";
out << "show_render_info: true\n";
out << "resource_loading: preload\n";
out << "autoplay: false\n";
out << "invincibility: false\n";
out.close();
}
// Usar defaults de DebugConfig
@@ -263,6 +265,16 @@ void Director::loadDebugConfig() {
debug_config.resource_loading = yaml["resource_loading"].get_value<std::string>();
} catch (...) {}
}
if (yaml.contains("autoplay")) {
try {
debug_config.autoplay = yaml["autoplay"].get_value<bool>();
} catch (...) {}
}
if (yaml.contains("invincibility")) {
try {
debug_config.invincibility = yaml["invincibility"].get_value<bool>();
} catch (...) {}
}
} catch (...) {
std::cout << "Error parsing debug.yaml, using defaults" << '\n';
}

View File

@@ -38,6 +38,8 @@ class Director {
int initial_stage = 0;
bool show_render_info = true;
std::string resource_loading;
bool autoplay = false;
bool invincibility = false;
DebugConfig()
: initial_section("game"),