tecla 9 per entrar i eixir del editor
This commit is contained in:
@@ -168,7 +168,16 @@ void Game::handleEvents() {
|
||||
GlobalEvents::handle(event);
|
||||
#ifdef _DEBUG
|
||||
if (!Console::get()->isActive()) {
|
||||
if (MapEditor::get()->isActive()) {
|
||||
// Tecla 9: toggle editor (funciona tanto dentro como fuera del editor)
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_9 && static_cast<int>(event.key.repeat) == 0) {
|
||||
if (MapEditor::get()->isActive()) {
|
||||
GameControl::exit_editor();
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_disabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
} else {
|
||||
GameControl::enter_editor();
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_enabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
}
|
||||
} else if (MapEditor::get()->isActive()) {
|
||||
MapEditor::get()->handleEvent(event);
|
||||
} else {
|
||||
handleDebugEvents(event);
|
||||
|
||||
Reference in New Issue
Block a user