- afegides claus i portes al editor
- fix: crear una nova habitació no modificava la memoria, soles els fitxers
This commit is contained in:
@@ -9,8 +9,10 @@
|
||||
|
||||
#include "game/editor/mini_map.hpp" // Para MiniMap
|
||||
#include "game/editor/tile_picker.hpp" // Para TilePicker
|
||||
#include "game/entities/door.hpp" // Para Door::Data
|
||||
#include "game/entities/enemy.hpp" // Para Enemy::Data
|
||||
#include "game/entities/item.hpp" // Para Item::Data
|
||||
#include "game/entities/key.hpp" // Para Key::Data
|
||||
#include "game/entities/moving_platform.hpp" // Para MovingPlatform::Data
|
||||
#include "game/entities/player.hpp" // Para Player::SpawnData
|
||||
#include "game/gameplay/room.hpp" // Para Room::Data
|
||||
@@ -23,7 +25,9 @@ class EditorStatusBar;
|
||||
enum class EntityType { NONE,
|
||||
ENEMY,
|
||||
ITEM,
|
||||
PLATFORM };
|
||||
PLATFORM,
|
||||
KEY,
|
||||
DOOR };
|
||||
|
||||
// Seleccion unificada: una sola entidad seleccionada a la vez
|
||||
struct Selection {
|
||||
@@ -90,6 +94,20 @@ class MapEditor {
|
||||
auto duplicatePlatform() -> std::string;
|
||||
[[nodiscard]] auto hasSelectedPlatform() const -> bool { return selection_.is(EntityType::PLATFORM); }
|
||||
|
||||
// Comandos para llaves
|
||||
auto setKeyProperty(const std::string& property, const std::string& value) -> std::string;
|
||||
auto addKey() -> std::string;
|
||||
auto deleteKey() -> std::string;
|
||||
auto duplicateKey() -> std::string;
|
||||
[[nodiscard]] auto hasSelectedKey() const -> bool { return selection_.is(EntityType::KEY); }
|
||||
|
||||
// Comandos para puertas
|
||||
auto setDoorProperty(const std::string& property, const std::string& value) -> std::string;
|
||||
auto addDoor() -> std::string;
|
||||
auto deleteDoor() -> std::string;
|
||||
auto duplicateDoor() -> std::string;
|
||||
[[nodiscard]] auto hasSelectedDoor() const -> bool { return selection_.is(EntityType::DOOR); }
|
||||
|
||||
// Seleccion unificada
|
||||
[[nodiscard]] auto getSelectionType() const -> EntityType { return selection_.type; }
|
||||
|
||||
@@ -136,6 +154,12 @@ class MapEditor {
|
||||
void renderGrid() const;
|
||||
void handleMouseDown(float game_x, float game_y);
|
||||
void handleMouseUp();
|
||||
|
||||
// Reconstruye todas las puertas vivas desde room_data_, limpiando primero
|
||||
// los WALLs antiguos del CollisionMap. Lo usa setDoorProperty cuando un
|
||||
// cambio (id, animation) requiere recrear el Door y mantener los tiles
|
||||
// sincronizados.
|
||||
void rebuildDoors();
|
||||
void updateDrag();
|
||||
auto commitEntityDrag() -> bool;
|
||||
void moveEntityVisual();
|
||||
|
||||
Reference in New Issue
Block a user