Skip to content

Commit

Permalink
hierarchy - select all filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
nem0 committed Nov 19, 2024
1 parent 484b6cb commit 626f3ee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/editor/studio_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,22 @@ struct StudioAppImpl final : StudioApp {
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - ImGui::GetStyle().FramePadding.x);

if (filter.isActive()) {
bool select_all = false;
if (m_app.checkShortcut(m_app.getCommonActions().select_all)) {
select_all = true;
editor.selectEntities({}, false);
}

for (EntityPtr e = world->getFirstEntity(); e.isValid(); e = world->getNextEntity((EntityRef)e)) {
char buffer[1024];
getEntityListDisplayName(m_app, *world, Span(buffer), e);
if (!filter.pass(buffer)) continue;

ImGui::PushID(e.index);
const EntityRef e_ref = (EntityRef)e;
if (select_all) {
editor.selectEntities(Span(&e_ref, 1), true);
}
if (select_first) {
select_first = false;
editor.selectEntities(Span(&e_ref, 1), false);
Expand Down

0 comments on commit 626f3ee

Please sign in to comment.