- canvi de tecles en el editor
- actualitzada la versió de console per lo dels colorins - clang format
This commit is contained in:
@@ -12,7 +12,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
1. **Habitaciones más grandes** — aprovechar el espacio del marcador (scoreboard) para ampliar el área jugable. Esto implica revisar la resolución de canvas, el layout de la HUD y el tamaño de los tilemaps.
|
||||
2. ~~**Nueva física del jugador**~~ ✅ **HECHO** — Player reescrito con pipeline de 6 fases, colisiones tile-based, ~20 métodos eliminados.
|
||||
3. ~~**Motor de colisiones por tiles**~~ ✅ **HECHO** — `TileCollider` con queries directas al grid. Collision tilemap editado desde el editor (tecla 7). Sistema antiguo de superficies preservado pero no usado. Pendiente: tiles kill (5) y conveyor (6).
|
||||
3. ~~**Motor de colisiones por tiles**~~ ✅ **HECHO** — `TileCollider` con queries directas al grid. Collision tilemap editado desde el editor (tecla 8). Sistema antiguo de superficies preservado pero no usado. Pendiente: tiles kill (5) y conveyor (6).
|
||||
4. ~~**Transición de pantalla animada**~~ ✅ **HECHO** — Scroll con easing `cubicInOut` (0.5s), ambas rooms visibles, enemigos activos, jugador puede moverse durante la transición.
|
||||
5. **Paleta Amstrad CPC** — subir de la paleta actual (8-bit indexada limitada) a la paleta del Amstrad CPC (27 colores / más colores que la actual). Afecta a `PaletteManager` y a todos los assets de color.
|
||||
|
||||
|
||||
@@ -489,8 +489,8 @@ void MapEditor::handleEvent(const SDL_Event& event) { // NOLINT(readability-fun
|
||||
return;
|
||||
}
|
||||
|
||||
// 7: alternar entre draw y collision
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_7 && static_cast<int>(event.key.repeat) == 0) {
|
||||
// 8: alternar entre draw y collision
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_8 && static_cast<int>(event.key.repeat) == 0) {
|
||||
setEditingCollision(!editing_collision_);
|
||||
return;
|
||||
}
|
||||
@@ -1520,11 +1520,20 @@ auto MapEditor::getSetCompletions() const -> std::vector<std::string> {
|
||||
auto MapEditor::getAnimationCompletions() const -> std::vector<std::string> {
|
||||
const char* folder = nullptr;
|
||||
switch (selection_.type) {
|
||||
case EntityType::ENEMY: folder = "data/enemies"; break;
|
||||
case EntityType::PLATFORM: folder = "data/platforms"; break;
|
||||
case EntityType::KEY: folder = "data/keys"; break;
|
||||
case EntityType::DOOR: folder = "data/doors"; break;
|
||||
default: return {};
|
||||
case EntityType::ENEMY:
|
||||
folder = "data/enemies";
|
||||
break;
|
||||
case EntityType::PLATFORM:
|
||||
folder = "data/platforms";
|
||||
break;
|
||||
case EntityType::KEY:
|
||||
folder = "data/keys";
|
||||
break;
|
||||
case EntityType::DOOR:
|
||||
folder = "data/doors";
|
||||
break;
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
std::vector<std::string> result;
|
||||
std::error_code ec;
|
||||
|
||||
@@ -592,19 +592,29 @@ namespace Options {
|
||||
const auto& c = yaml["console"];
|
||||
|
||||
if (c.contains("transparent")) {
|
||||
try { console.transparent = c["transparent"].get_value<bool>(); } catch (...) {}
|
||||
try {
|
||||
console.transparent = c["transparent"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (c.contains("bg_color")) {
|
||||
try { console.bg_color = std::clamp(c["bg_color"].get_value<int>(), 0, 255); } catch (...) {}
|
||||
try {
|
||||
console.bg_color = std::clamp(c["bg_color"].get_value<int>(), 0, 255);
|
||||
} catch (...) {}
|
||||
}
|
||||
if (c.contains("msg_color")) {
|
||||
try { console.msg_color = std::clamp(c["msg_color"].get_value<int>(), 0, 255); } catch (...) {}
|
||||
try {
|
||||
console.msg_color = std::clamp(c["msg_color"].get_value<int>(), 0, 255);
|
||||
} catch (...) {}
|
||||
}
|
||||
if (c.contains("prompt_color")) {
|
||||
try { console.prompt_color = std::clamp(c["prompt_color"].get_value<int>(), 0, 255); } catch (...) {}
|
||||
try {
|
||||
console.prompt_color = std::clamp(c["prompt_color"].get_value<int>(), 0, 255);
|
||||
} catch (...) {}
|
||||
}
|
||||
if (c.contains("command_color")) {
|
||||
try { console.command_color = std::clamp(c["command_color"].get_value<int>(), 0, 255); } catch (...) {}
|
||||
try {
|
||||
console.command_color = std::clamp(c["command_color"].get_value<int>(), 0, 255);
|
||||
} catch (...) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ void Game::handleEvents() {
|
||||
GameControl::enter_editor();
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_enabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
}
|
||||
} else if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_8 && static_cast<int>(event.key.repeat) == 0 && MapEditor::get()->isActive()) {
|
||||
} else if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_G && static_cast<int>(event.key.repeat) == 0 && MapEditor::get()->isActive()) {
|
||||
MapEditor::get()->showGrid(!MapEditor::get()->isGridEnabled());
|
||||
} else if (MapEditor::get()->isActive()) {
|
||||
MapEditor::get()->handleEvent(event);
|
||||
|
||||
@@ -58,7 +58,7 @@ class Console {
|
||||
|
||||
// Constantes de consola
|
||||
static constexpr std::string_view CONSOLE_NAME = "Projecte 2026 Console";
|
||||
static constexpr std::string_view CONSOLE_VERSION = "v2.2";
|
||||
static constexpr std::string_view CONSOLE_VERSION = "v2.3";
|
||||
static constexpr int MAX_LINE_CHARS = 32;
|
||||
static constexpr int MAX_HISTORY_SIZE = 20;
|
||||
static constexpr float CURSOR_ON_TIME = 0.5F;
|
||||
|
||||
@@ -954,11 +954,7 @@ static auto cmdSize(const std::vector<std::string>& /*unused*/) -> std::string {
|
||||
// CONSOLE [TRANSPARENT [ON|OFF]|BG|MSG|PROMPT|COMMAND <0-255>]
|
||||
static auto cmdConsole(const std::vector<std::string>& args) -> std::string { // NOLINT(readability-function-cognitive-complexity)
|
||||
if (args.empty()) {
|
||||
return std::string("Console ") + (Options::console.transparent ? "transparent" : "solid")
|
||||
+ " bg:" + std::to_string(Options::console.bg_color)
|
||||
+ " msg:" + std::to_string(Options::console.msg_color)
|
||||
+ " prompt:" + std::to_string(Options::console.prompt_color)
|
||||
+ " cmd:" + std::to_string(Options::console.command_color);
|
||||
return std::string("Console ") + (Options::console.transparent ? "transparent" : "solid") + " bg:" + std::to_string(Options::console.bg_color) + " msg:" + std::to_string(Options::console.msg_color) + " prompt:" + std::to_string(Options::console.prompt_color) + " cmd:" + std::to_string(Options::console.command_color);
|
||||
}
|
||||
|
||||
if (args[0] == "TRANSPARENT") {
|
||||
@@ -1340,7 +1336,7 @@ auto CommandRegistry::generateConsoleHelp() const -> std::string { // NOLINT(re
|
||||
|
||||
if (active_scope_ == "editor" && !editor_cmds.empty()) {
|
||||
result += "Editor:\n" + editor_cmds + "\n";
|
||||
result += "keys: 9=editor 8=grid e=eraser m=map\n";
|
||||
result += "keys: 9=editor g=grid 8=collision e=eraser m=map\n";
|
||||
}
|
||||
|
||||
if (!debug_cmds.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user