merdetes pa debugar a gust

This commit is contained in:
2025-11-14 17:58:32 +01:00
parent 8893e8f05b
commit 710e7cc8c1
9 changed files with 89 additions and 42 deletions

View File

@@ -190,7 +190,7 @@ void Game::updateDebugInfo() {
// Pone la información de debug en pantalla
void Game::renderDebugInfo() {
if (!Debug::get()->getEnabled()) {
if (!Debug::get()->isEnabled()) {
return;
}
@@ -221,34 +221,36 @@ void Game::renderDebugInfo() {
void Game::handleDebugEvents(const SDL_Event& event) {
if (event.type == SDL_EVENT_KEY_DOWN && static_cast<int>(event.key.repeat) == 0) {
switch (event.key.key) {
case SDL_SCANCODE_G:
case SDLK_F12:
Debug::get()->toggleEnabled();
Options::cheats.invincible = static_cast<Options::Cheat::State>(Debug::get()->getEnabled());
board_->music = !Debug::get()->getEnabled();
Notifier::get()->show({"DEBUG " + std::string(Debug::get()->isEnabled() ? "ENABLED" : "DISABLED")}, Notifier::TextAlign::CENTER);
room_->redrawMap(); // Redibuja el tilemap para mostrar/ocultar líneas de colisión
Options::cheats.invincible = static_cast<Options::Cheat::State>(Debug::get()->isEnabled());
board_->music = !Debug::get()->isEnabled();
board_->music ? Audio::get()->resumeMusic() : Audio::get()->pauseMusic();
break;
case SDL_SCANCODE_R:
case SDLK_R:
Resource::Cache::get()->reload();
break;
case SDL_SCANCODE_W:
case SDLK_W:
changeRoom(room_->getRoom(Room::Border::TOP));
break;
case SDL_SCANCODE_A:
case SDLK_A:
changeRoom(room_->getRoom(Room::Border::LEFT));
break;
case SDL_SCANCODE_S:
case SDLK_S:
changeRoom(room_->getRoom(Room::Border::BOTTOM));
break;
case SDL_SCANCODE_D:
case SDLK_D:
changeRoom(room_->getRoom(Room::Border::RIGHT));
break;
case SDL_SCANCODE_7:
case SDLK_7:
Notifier::get()->show({"ACHIEVEMENT UNLOCKED!", "I LIKE MY MULTICOLOURED FRIENDS"}, Notifier::TextAlign::CENTER, Notifier::DURATION_CHEEVO, -1, false, "F7");
break;