key_config.cpp i keys.yaml per a centralitzar i no hardcodejar tecles
This commit is contained in:
@@ -10,9 +10,10 @@
|
||||
#include <queue> // Para queue (BFS)
|
||||
#include <set> // Para set
|
||||
|
||||
#include "core/input/key_config.hpp" // Para KeyConfig
|
||||
#include "core/rendering/screen.hpp" // Para Screen
|
||||
#include "core/rendering/surface.hpp" // Para Surface
|
||||
#include "core/rendering/screenshot.hpp" // Para Screenshot::save
|
||||
#include "core/rendering/surface.hpp" // Para Surface
|
||||
#include "core/rendering/text.hpp" // Para Text (números de room)
|
||||
#include "core/resources/resource_cache.hpp" // Para Resource::Cache
|
||||
#include "game/gameplay/room.hpp" // Para Room::Data
|
||||
@@ -365,13 +366,15 @@ void MiniMap::render(const std::string& current_room) {
|
||||
// Maneja eventos del minimapa (drag para explorar, click para navegar)
|
||||
void MiniMap::handleEvent(const SDL_Event& event, const std::string& current_room) {
|
||||
// Toggle de números de room
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_N && static_cast<int>(event.key.repeat) == 0) {
|
||||
const auto* kc = KeyConfig::get();
|
||||
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == kc->key("MINIMAP", "numbers") && static_cast<int>(event.key.repeat) == 0) {
|
||||
show_numbers_ = !show_numbers_;
|
||||
return;
|
||||
}
|
||||
|
||||
// Captura del minimapa
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_S && static_cast<int>(event.key.repeat) == 0) {
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == kc->key("MINIMAP", "capture") && static_cast<int>(event.key.repeat) == 0) {
|
||||
if (map_surface_) {
|
||||
// Renderizar números sobre map_surface_ si están activos
|
||||
if (show_numbers_) {
|
||||
|
||||
Reference in New Issue
Block a user