- afegides opcions persistents al editor

- afegida rejilla
This commit is contained in:
2026-04-02 17:38:03 +02:00
parent 44b6f6830d
commit 3c3e012386
7 changed files with 144 additions and 5 deletions

View File

@@ -43,6 +43,11 @@ class MapEditor {
// Comandos para propiedades de la habitación
auto setRoomProperty(const std::string& property, const std::string& value) -> std::string;
// Opciones del editor (llamados desde console_commands / teclas)
auto showInfo(bool show) -> std::string;
auto showGrid(bool show) -> std::string;
[[nodiscard]] auto isGridEnabled() const -> bool { return settings_.grid; }
// Comandos para items
auto setItemProperty(const std::string& property, const std::string& value) -> std::string;
auto addItem() -> std::string;
@@ -57,6 +62,15 @@ class MapEditor {
MapEditor(); // Constructor
~MapEditor(); // Destructor
// Opciones persistentes del editor
struct Settings {
bool grid{false};
bool show_render_info{false};
};
Settings settings_;
void loadSettings();
void saveSettings();
// Tipos para drag & drop y selección
enum class DragTarget { NONE,
PLAYER,
@@ -80,6 +94,7 @@ class MapEditor {
void renderEnemyBoundaries();
void renderBoundaryMarker(float x, float y, Uint8 color);
void renderSelectionHighlight();
void renderGrid();
void handleMouseDown(float game_x, float game_y);
void handleMouseUp();
void updateDrag();
@@ -124,8 +139,9 @@ class MapEditor {
int mouse_tile_x_{0};
int mouse_tile_y_{0};
// Estado previo de invencibilidad
// Estado previo (para restaurar al salir)
Options::Cheat::State invincible_before_editor_{Options::Cheat::State::DISABLED};
bool render_info_before_editor_{false};
};
#endif // _DEBUG