- afegits comandos de GameControl per activar trucos o canviar de habitacio

- modificat el comando debug, ja no activa el overlay sino el mode debug
- nou alias show info i hide info
This commit is contained in:
2026-03-28 13:27:33 +01:00
parent dfb0d2134f
commit 3a5ff06dab
3 changed files with 147 additions and 10 deletions

View File

@@ -32,6 +32,7 @@
#ifdef _DEBUG
#include "core/system/debug.hpp" // Para Debug
#include "game/game_control.hpp" // Para GameControl
#endif
// Constructor
@@ -58,12 +59,31 @@ Game::Game(Mode mode)
Cheevos::get()->enable(!Options::cheats.enabled()); // Deshabilita los logros si hay trucos activados
Cheevos::get()->clearUnobtainableState();
#ifdef _DEBUG
GameControl::change_room = [this](const std::string& r) -> bool { return this->changeRoom(r); };
GameControl::refresh_player_color = [this]() -> void { player_->setColor(); };
GameControl::toggle_debug_mode = [this]() -> void {
Debug::get()->toggleEnabled();
room_->redrawMap();
Options::cheats.invincible = static_cast<Options::Cheat::State>(Debug::get()->isEnabled());
player_->setColor();
scoreboard_data_->music = !Debug::get()->isEnabled();
scoreboard_data_->music ? Audio::get()->resumeMusic() : Audio::get()->pauseMusic();
};
#endif
SceneManager::current = (mode_ == Mode::GAME) ? SceneManager::Scene::GAME : SceneManager::Scene::DEMO;
SceneManager::options = SceneManager::Options::NONE;
}
Game::~Game() {
ItemTracker::destroy();
#ifdef _DEBUG
GameControl::change_room = nullptr;
GameControl::refresh_player_color = nullptr;
GameControl::toggle_debug_mode = nullptr;
#endif
}
// Comprueba los eventos de la cola