Partial entity inspector

This commit is contained in:
2024-01-07 13:49:13 +01:00
parent 5dbc5ba15e
commit 9c745d2857
9 changed files with 276 additions and 56 deletions

View File

@@ -64,6 +64,24 @@ void inputPrimaryAction(Game *game, InputState *input) {
input->state = INPUT_SELECTED_BUILDING;
}
selectedCount = ecs_query_entity_count(input->queries.selected);
if (IsKeyDown(KEY_LEFT_ALT) && IsKeyDown(KEY_LEFT_SHIFT)) {
ecs_iter_t it = ecs_query_iter(ECS, input->queries.selected);
while (ecs_iter_next(&it)) {
for (i32 i = 0; i < it.count; i++) {
ecs_entity_t entity = it.entities[i];
bool alreadyInspecting = false;
for (i32 j = 0; j < bzArraySize(game->debug.inspecting); j++) {
if (game->debug.inspecting[j] == entity) {
alreadyInspecting = true;
break;
}
}
if (!alreadyInspecting)
bzArrayPush(game->debug.inspecting, entity);
}
}
}
}
if (selectedCount == 0)