faltava definir comandos
en color diferent el element seleccionat
This commit is contained in:
@@ -244,9 +244,16 @@ categories:
|
|||||||
completions:
|
completions:
|
||||||
ITEM: [ADD, DELETE, DUPLICATE]
|
ITEM: [ADD, DELETE, DUPLICATE]
|
||||||
|
|
||||||
|
- keyword: PLATFORM
|
||||||
|
handler: cmd_platform
|
||||||
|
description: "Add, delete or duplicate platform"
|
||||||
|
usage: "PLATFORM <ADD|DELETE|DUPLICATE>"
|
||||||
|
completions:
|
||||||
|
PLATFORM: [ADD, DELETE, DUPLICATE]
|
||||||
|
|
||||||
- keyword: SET
|
- keyword: SET
|
||||||
handler: cmd_set
|
handler: cmd_set
|
||||||
description: "Set property (enemy, item or room)"
|
description: "Set property (enemy, item, platform or room)"
|
||||||
usage: "SET <property> <value>"
|
usage: "SET <property> <value>"
|
||||||
dynamic_completions: true
|
dynamic_completions: true
|
||||||
completions:
|
completions:
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ enemies:
|
|||||||
boundaries:
|
boundaries:
|
||||||
position1: {x: 4, y: 7}
|
position1: {x: 4, y: 7}
|
||||||
position2: {x: 25, y: 7}
|
position2: {x: 25, y: 7}
|
||||||
color: 8
|
|
||||||
|
|
||||||
- animation: upv_student.yaml
|
- animation: upv_student.yaml
|
||||||
position: {x: 9, y: 18}
|
position: {x: 9, y: 18}
|
||||||
@@ -80,19 +79,8 @@ enemies:
|
|||||||
boundaries:
|
boundaries:
|
||||||
position1: {x: 3, y: 18}
|
position1: {x: 3, y: 18}
|
||||||
position2: {x: 23, y: 18}
|
position2: {x: 23, y: 18}
|
||||||
color: 10
|
|
||||||
flip: true
|
flip: true
|
||||||
|
|
||||||
# Plataformas móviles en esta habitación
|
|
||||||
platforms:
|
|
||||||
- animation: bin.yaml
|
|
||||||
position: {x: 5, y: 17}
|
|
||||||
velocity: {x: 25, y: 0}
|
|
||||||
boundaries:
|
|
||||||
position1: {x: 3, y: 17}
|
|
||||||
position2: {x: 20, y: 17}
|
|
||||||
frame: 0
|
|
||||||
|
|
||||||
# Objetos en esta habitación
|
# Objetos en esta habitación
|
||||||
items:
|
items:
|
||||||
- tileSetFile: items.gif
|
- tileSetFile: items.gif
|
||||||
@@ -100,3 +88,13 @@ items:
|
|||||||
position: {x: 4, y: 6}
|
position: {x: 4, y: 6}
|
||||||
counter: 1
|
counter: 1
|
||||||
|
|
||||||
|
# Plataformas móviles en esta habitación
|
||||||
|
platforms:
|
||||||
|
- animation: bin.yaml
|
||||||
|
position: {x: 2, y: 16}
|
||||||
|
velocity: {x: 25, y: 0}
|
||||||
|
boundaries:
|
||||||
|
position1: {x: 2, y: 16}
|
||||||
|
position2: {x: 20, y: 15}
|
||||||
|
frame: 0
|
||||||
|
|
||||||
|
|||||||
@@ -989,9 +989,15 @@ void MapEditor::renderEntityBoundaries() {
|
|||||||
auto game_surface = Screen::get()->getRendererSurface();
|
auto game_surface = Screen::get()->getRendererSurface();
|
||||||
if (!game_surface) { return; }
|
if (!game_surface) { return; }
|
||||||
|
|
||||||
const Uint8 COLOR_BOUND1 = 11;
|
// Colores para la entidad seleccionada (brillantes)
|
||||||
const Uint8 COLOR_BOUND2 = 13;
|
constexpr Uint8 SEL_BOUND1 = 21; // BRIGHT_CYAN
|
||||||
const Uint8 COLOR_ROUTE = 15;
|
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 (auto type : {EntityType::ENEMY, EntityType::PLATFORM}) {
|
||||||
for (int i = 0; i < entityDataCount(type); ++i) {
|
for (int i = 0; i < entityDataCount(type); ++i) {
|
||||||
@@ -999,6 +1005,8 @@ void MapEditor::renderEntityBoundaries() {
|
|||||||
auto bd = entityBoundaries(type, i);
|
auto bd = entityBoundaries(type, i);
|
||||||
constexpr float HALF = Tile::SIZE / 2.0F;
|
constexpr float HALF = Tile::SIZE / 2.0F;
|
||||||
|
|
||||||
|
bool is_selected = selection_.is(type) && selection_.index == i;
|
||||||
|
|
||||||
// Posiciones base (pueden estar siendo arrastradas)
|
// Posiciones base (pueden estar siendo arrastradas)
|
||||||
float init_x = pos_x;
|
float init_x = pos_x;
|
||||||
float init_y = pos_y;
|
float init_y = pos_y;
|
||||||
@@ -1019,15 +1027,20 @@ void MapEditor::renderEntityBoundaries() {
|
|||||||
init_x = drag_.snap_x;
|
init_x = drag_.snap_x;
|
||||||
init_y = drag_.snap_y;
|
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
|
// 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(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(init_x + HALF, init_y + HALF, b2_x + HALF, b2_y + HALF, color_route);
|
||||||
|
|
||||||
// Marcadores en las boundaries
|
// Marcadores en las boundaries
|
||||||
renderBoundaryMarker(b1_x, b1_y, COLOR_BOUND1);
|
renderBoundaryMarker(b1_x, b1_y, color_b1);
|
||||||
renderBoundaryMarker(b2_x, b2_y, COLOR_BOUND2);
|
renderBoundaryMarker(b2_x, b2_y, color_b2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user