faltava definir comandos
en color diferent el element seleccionat
This commit is contained in:
@@ -989,9 +989,15 @@ void MapEditor::renderEntityBoundaries() {
|
||||
auto game_surface = Screen::get()->getRendererSurface();
|
||||
if (!game_surface) { return; }
|
||||
|
||||
const Uint8 COLOR_BOUND1 = 11;
|
||||
const Uint8 COLOR_BOUND2 = 13;
|
||||
const Uint8 COLOR_ROUTE = 15;
|
||||
// Colores para la entidad seleccionada (brillantes)
|
||||
constexpr Uint8 SEL_BOUND1 = 21; // BRIGHT_CYAN
|
||||
constexpr Uint8 SEL_BOUND2 = 25; // BRIGHT_YELLOW
|
||||
constexpr Uint8 SEL_ROUTE = 26; // BRIGHT_WHITE
|
||||
|
||||
// Colores para entidades no seleccionadas (apagados)
|
||||
constexpr Uint8 DIM_BOUND1 = 11; // CYAN
|
||||
constexpr Uint8 DIM_BOUND2 = 13; // YELLOW
|
||||
constexpr Uint8 DIM_ROUTE = 14; // WHITE (gris medio)
|
||||
|
||||
for (auto type : {EntityType::ENEMY, EntityType::PLATFORM}) {
|
||||
for (int i = 0; i < entityDataCount(type); ++i) {
|
||||
@@ -999,6 +1005,8 @@ void MapEditor::renderEntityBoundaries() {
|
||||
auto bd = entityBoundaries(type, i);
|
||||
constexpr float HALF = Tile::SIZE / 2.0F;
|
||||
|
||||
bool is_selected = selection_.is(type) && selection_.index == i;
|
||||
|
||||
// Posiciones base (pueden estar siendo arrastradas)
|
||||
float init_x = pos_x;
|
||||
float init_y = pos_y;
|
||||
@@ -1019,15 +1027,20 @@ void MapEditor::renderEntityBoundaries() {
|
||||
init_x = drag_.snap_x;
|
||||
init_y = drag_.snap_y;
|
||||
}
|
||||
is_selected = true; // Arrastrando = siempre iluminado
|
||||
}
|
||||
|
||||
Uint8 color_b1 = is_selected ? SEL_BOUND1 : DIM_BOUND1;
|
||||
Uint8 color_b2 = is_selected ? SEL_BOUND2 : DIM_BOUND2;
|
||||
Uint8 color_route = is_selected ? SEL_ROUTE : DIM_ROUTE;
|
||||
|
||||
// Dibujar líneas de ruta
|
||||
game_surface->drawLine(b1_x + HALF, b1_y + HALF, init_x + HALF, init_y + HALF, COLOR_ROUTE);
|
||||
game_surface->drawLine(init_x + HALF, init_y + HALF, b2_x + HALF, b2_y + HALF, COLOR_ROUTE);
|
||||
game_surface->drawLine(b1_x + HALF, b1_y + HALF, init_x + HALF, init_y + HALF, color_route);
|
||||
game_surface->drawLine(init_x + HALF, init_y + HALF, b2_x + HALF, b2_y + HALF, color_route);
|
||||
|
||||
// Marcadores en las boundaries
|
||||
renderBoundaryMarker(b1_x, b1_y, COLOR_BOUND1);
|
||||
renderBoundaryMarker(b2_x, b2_y, COLOR_BOUND2);
|
||||
renderBoundaryMarker(b1_x, b1_y, color_b1);
|
||||
renderBoundaryMarker(b2_x, b2_y, color_b2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user