Skip to content

Commit 9d9abb9

Browse files
committed
multiselect for connected planar faces
useful for selecting/scaling the outside of maps that had a skybox built around them
1 parent 858441b commit 9d9abb9

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/editor/Gui.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,17 @@ void Gui::draw3dContextMenus() {
434434
}
435435
tooltip(g, "Select every face in the map which has this texture.");
436436

437-
if (ImGui::MenuItem("Select connected planar faces of this texture", "", false, app->pickInfo.faces.size() == 1)) {
437+
if (ImGui::MenuItem("Select connected planar faces of this texture", "", false)) {
438438
Bsp* map = app->pickInfo.getMap();
439-
440-
set<int> newSelect = map->selectConnectedTexture(app->pickInfo.getModelIndex(), app->pickInfo.getFaceIndex());
439+
440+
set<int> newSelect;
441+
for (int i = 0; i < app->pickInfo.faces.size(); i++) {
442+
int faceIdx = app->pickInfo.faces[i];
443+
int modelIdx = map->get_model_from_face(faceIdx);
444+
set<int> selectPart = map->selectConnectedTexture(modelIdx, faceIdx);
445+
newSelect.insert(selectPart.begin(), selectPart.end());
446+
}
447+
441448
g_app->mapRenderer->highlightPickedFaces(false);
442449

443450
app->pickInfo.deselect();

0 commit comments

Comments
 (0)