ja es pot escriure en la consola
This commit is contained in:
@@ -445,7 +445,7 @@ void Screen::renderInfo() const {
|
||||
|
||||
const int LINE_HEIGHT = text_->getCharacterSize() - 3;
|
||||
const int X = 0;
|
||||
int y = 0;
|
||||
int y = (Console::get() != nullptr) ? Console::get()->getVisibleHeight() : 0;
|
||||
|
||||
// FPS
|
||||
const std::string FPS_TEXT = std::to_string(fps_.last_value) + " fps";
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "core/input/mouse.hpp"
|
||||
#include "game/options.hpp" // Para Options, options, OptionsGame, OptionsAudio
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
#include "game/ui/console.hpp" // Para Console
|
||||
|
||||
namespace GlobalEvents {
|
||||
// Comprueba los eventos que se pueden producir en cualquier sección del juego
|
||||
@@ -17,6 +18,14 @@ namespace GlobalEvents {
|
||||
// reLoadTextures();
|
||||
}
|
||||
|
||||
// Enrutar eventos de texto a la consola cuando está activa
|
||||
if (Console::get() != nullptr && Console::get()->isActive()) {
|
||||
if (event.type == SDL_EVENT_TEXT_INPUT || event.type == SDL_EVENT_KEY_DOWN) {
|
||||
Console::get()->handleEvent(event);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Mouse::handleEvent(event);
|
||||
}
|
||||
} // namespace GlobalEvents
|
||||
Reference in New Issue
Block a user