drag'n drop de enemics, boundaries i items

This commit is contained in:
2026-04-02 10:53:21 +02:00
parent b6fec3eba7
commit b31346830f
15 changed files with 321 additions and 83 deletions

View File

@@ -4,13 +4,13 @@
#include <string> // Para to_string
#include "core/rendering/screen.hpp" // Para Screen
#include "core/rendering/surface.hpp" // Para Surface
#include "core/rendering/text.hpp" // Para Text
#include "core/rendering/screen.hpp" // Para Screen
#include "core/rendering/surface.hpp" // Para Surface
#include "core/rendering/text.hpp" // Para Text
#include "core/resources/resource_cache.hpp" // Para Resource::Cache
#include "game/options.hpp" // Para Options::game
#include "utils/defines.hpp" // Para Tile::SIZE
#include "utils/utils.hpp" // Para stringToColor
#include "game/options.hpp" // Para Options::game
#include "utils/defines.hpp" // Para Tile::SIZE
#include "utils/utils.hpp" // Para stringToColor
// Constructor
EditorStatusBar::EditorStatusBar(const std::string& room_number, const std::string& room_name)
@@ -39,6 +39,11 @@ void EditorStatusBar::setMouseTile(int tile_x, int tile_y) {
mouse_tile_y_ = tile_y;
}
// Establece la información de la entidad seleccionada
void EditorStatusBar::setSelectionInfo(const std::string& info) {
selection_info_ = info;
}
// Dibuja los elementos en la surface
void EditorStatusBar::fillTexture() {
auto previous_renderer = Screen::get()->getRendererSurface();
@@ -60,8 +65,12 @@ void EditorStatusBar::fillTexture() {
text->writeColored(LEFT_X, LINE2_Y, "TILE:", LABEL_COLOR);
text->writeColored(LEFT_X + 48, LINE2_Y, TILE_X_STR + "," + TILE_Y_STR, VALUE_COLOR);
// Indicador de modo editor
text->writeColored(176, LINE2_Y, "EDITOR", stringToColor("bright_green"));
// Info de selección o indicador de modo editor
if (!selection_info_.empty()) {
text->writeColored(LEFT_X + 112, LINE2_Y, selection_info_, stringToColor("bright_yellow"));
} else {
text->writeColored(176, LINE2_Y, "EDITOR", stringToColor("bright_green"));
}
Screen::get()->setRendererSurface(previous_renderer);
}