key_config.cpp i keys.yaml per a centralitzar i no hardcodejar tecles

This commit is contained in:
2026-04-12 15:21:43 +02:00
parent 999cf53821
commit 848b658611
19 changed files with 521 additions and 115 deletions

View File

@@ -43,7 +43,7 @@ static auto parseTokens(const std::string& input) -> std::vector<std::string> {
// Calcula la altura total de la consola para N líneas de mensaje (+ 1 línea de input)
static auto calcTargetHeight(int num_msg_lines) -> float {
constexpr int PADDING_IN_V = Console::TEXT_SIZE / 2;
return static_cast<float>((Console::TEXT_SIZE * (num_msg_lines + 1)) + (PADDING_IN_V * 2));
return static_cast<float>((Console::LINE_HEIGHT * (num_msg_lines + 1)) + (PADDING_IN_V * 2));
}
// Divide text en líneas respetando los \n existentes y haciendo word-wrap por ancho en píxeles
@@ -173,7 +173,7 @@ void Console::redrawText() {
const int VISIBLE = std::min(remaining, static_cast<int>(line.size()));
text_->writeColored(PADDING_IN_H, y_pos, line.substr(0, VISIBLE), MSG_COLOR);
remaining -= VISIBLE;
y_pos += TEXT_SIZE;
y_pos += LINE_HEIGHT;
}
// Línea de input (siempre la última): prompt en PROMPT_COLOR, comando + cursor en COMMAND_COLOR