From 0082dd4b5227d49e41cd66bde1f2ae7d5d26182d Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 4 Apr 2026 20:12:45 +0200 Subject: [PATCH] Add functions to handle edge and vertex selection in App.tsx --- src/app/App.tsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/app/App.tsx b/src/app/App.tsx index f4b42cec..f35fe417 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -613,6 +613,16 @@ function getSelectedBrushLabel(selection: EditorSelection, brushes: BoxBrush[]): return getBrushLabelById(selectedBrushId, brushes); } +function getSelectedBrushEdgeLabel(selection: EditorSelection): string | null { + const selectedEdgeId = getSelectedBrushEdgeId(selection); + return selectedEdgeId === null ? null : BOX_EDGE_LABELS[selectedEdgeId]; +} + +function getSelectedBrushVertexLabel(selection: EditorSelection): string | null { + const selectedVertexId = getSelectedBrushVertexId(selection); + return selectedVertexId === null ? null : BOX_VERTEX_LABELS[selectedVertexId]; +} + function describeSelection( selection: EditorSelection, brushes: BoxBrush[], @@ -627,6 +637,10 @@ function describeSelection( return `${selection.ids.length} solid${selection.ids.length === 1 ? "" : "s"} selected (${getSelectedBrushLabel(selection, brushes)})`; case "brushFace": return `1 face selected (${BOX_FACE_LABELS[selection.faceId]} on ${getBrushLabelById(selection.brushId, brushes)})`; + case "brushEdge": + return `1 edge selected (${BOX_EDGE_LABELS[selection.edgeId]} on ${getBrushLabelById(selection.brushId, brushes)})`; + case "brushVertex": + return `1 vertex selected (${BOX_VERTEX_LABELS[selection.vertexId]} on ${getBrushLabelById(selection.brushId, brushes)})`; case "entities": return `${selection.ids.length} entity selected (${getEntityDisplayLabelById(selection.ids[0], entities, assets)})`; case "modelInstances": @@ -636,6 +650,19 @@ function describeSelection( } } +function getWhiteboxSelectionModeStatus(mode: WhiteboxSelectionMode): string { + switch (mode) { + case "object": + return "Whitebox selection mode set to Object. Whole-solid transforms are available."; + case "face": + return "Whitebox selection mode set to Face. Click a face to edit materials and UVs."; + case "edge": + return "Whitebox selection mode set to Edge. Edge transforms land in the next slice."; + case "vertex": + return "Whitebox selection mode set to Vertex. Vertex transforms land in the next slice."; + } +} + function getInteractionTriggerLabel(trigger: InteractionTriggerKind): string { switch (trigger) { case "enter":