ajustos de qualitat, canvi de tecles, persistencia de opcions, etc

This commit is contained in:
2026-04-11 09:16:39 +02:00
parent 3b052ca3a0
commit 49f6ed41e6
19 changed files with 149 additions and 157 deletions

View File

@@ -9,6 +9,9 @@
#include "core/locale/locale.hpp" // Para Locale
#include "core/rendering/render_info.hpp" // Para RenderInfo
#include "core/rendering/screen.hpp" // Para Screen
#ifdef _DEBUG
#include "core/system/debug.hpp" // Para Debug (persistencia de render_info en debug.yaml)
#endif
#include "game/options.hpp" // Para Options, options, OptionsVideo, Section
#include "game/scene_manager.hpp" // Para SceneManager
#include "game/ui/console.hpp" // Para Console
@@ -292,7 +295,16 @@ namespace GlobalInputs {
break;
case InputAction::TOGGLE_INFO:
if (RenderInfo::get() != nullptr) { RenderInfo::get()->toggle(); }
if (RenderInfo::get() != nullptr) {
// Leemos la intención antes del toggle: isActive() incluye la
// animación VANISHING, así que justo después de un toggle ACTIVE→OFF
// seguiría devolviendo true y la persistencia no detectaría el cambio.
const bool WAS_ACTIVE = RenderInfo::get()->isActive();
RenderInfo::get()->toggle();
#ifdef _DEBUG
if (Debug::get() != nullptr) { Debug::get()->setRenderInfoEnabled(!WAS_ACTIVE); }
#endif
}
break;
case InputAction::NONE:

View File

@@ -178,6 +178,13 @@ void Debug::loadFromFile() {
if (needs_save) { saveToFile(); }
}
// Persiste el estado del overlay RenderInfo en debug.yaml
void Debug::setRenderInfoEnabled(bool value) {
if (render_info_enabled_ == value) { return; }
render_info_enabled_ = value;
saveToFile();
}
// Guarda la configuración de debug en debug.yaml
void Debug::saveToFile() const {
std::ofstream file(debug_file_path_);

View File

@@ -49,6 +49,7 @@ class Debug {
void setInitialScene(SceneManager::Scene s) { initial_scene_ = s; } // Establece la escena inicial de debug
[[nodiscard]] auto getLazyLoading() const -> bool { return lazy_loading_; } // Indica si el modo lazy de recursos está activo
[[nodiscard]] auto getRenderInfoEnabled() const -> bool { return render_info_enabled_; } // Indica si el overlay RenderInfo arranca activo
void setRenderInfoEnabled(bool value); // Persiste el estado del overlay RenderInfo en debug.yaml
private:
static Debug* debug; // [SINGLETON] Objeto privado