- canvi de tecles en el editor
- actualitzada la versió de console per lo dels colorins - clang format
This commit is contained in:
@@ -5,12 +5,12 @@
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath> // Para std::round
|
||||
#include <cstdio> // Para std::remove (borrar fichero)
|
||||
#include <filesystem> // Para directory_iterator (getAnimationCompletions)
|
||||
#include <fstream> // Para ifstream, ofstream
|
||||
#include <iostream> // Para cout
|
||||
#include <set> // Para set
|
||||
#include <cmath> // Para std::round
|
||||
#include <cstdio> // Para std::remove (borrar fichero)
|
||||
#include <filesystem> // Para directory_iterator (getAnimationCompletions)
|
||||
#include <fstream> // Para ifstream, ofstream
|
||||
#include <iostream> // Para cout
|
||||
#include <set> // Para set
|
||||
#include <system_error> // Para std::error_code
|
||||
|
||||
#include "core/input/mouse.hpp" // Para Mouse
|
||||
@@ -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;
|
||||
|
||||
@@ -226,10 +226,10 @@ class MapEditor {
|
||||
bool active_{false};
|
||||
DragState drag_;
|
||||
Selection selection_; // Entidad seleccionada (unificada: enemy, item o platform)
|
||||
BrushPattern brush_; // Brush activo (vacío = sin brush)
|
||||
BrushPattern brush_; // Brush activo (vacío = sin brush)
|
||||
EyedropperState eyedropper_; // Estado del eyedropper (clic derecho)
|
||||
bool painting_{false}; // true mientras se está pintando con click izquierdo mantenido
|
||||
bool editing_collision_{false}; // true = editando collision tilemap, false = editando draw tilemap
|
||||
bool painting_{false}; // true mientras se está pintando con click izquierdo mantenido
|
||||
bool editing_collision_{false}; // true = editando collision tilemap, false = editando draw tilemap
|
||||
|
||||
// Datos de la habitación
|
||||
Room::Data room_data_;
|
||||
|
||||
@@ -51,9 +51,9 @@ class MiniMap {
|
||||
|
||||
// Tabla de color predominante para un tileset concreto
|
||||
struct TileColorTable {
|
||||
std::vector<Uint8> colors; // tile_index → palette color
|
||||
int tileset_width{0}; // Ancho del tileset en tiles
|
||||
Uint8 transparent{16}; // Color transparente del tileset
|
||||
std::vector<Uint8> colors; // tile_index → palette color
|
||||
int tileset_width{0}; // Ancho del tileset en tiles
|
||||
Uint8 transparent{16}; // Color transparente del tileset
|
||||
};
|
||||
|
||||
auto getOrBuildTileColorTable(const std::string& tileset_name) -> const TileColorTable&;
|
||||
|
||||
Reference in New Issue
Block a user