From a839530e60161333053b6c96877758c5fc68f7b9 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 4 Apr 2026 20:15:19 +0200 Subject: [PATCH] Add whitebox selection mode buttons and update outliner display logic --- src/app/App.tsx | 57 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index 962558bc..883c0bae 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -613,16 +613,6 @@ 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[], @@ -4806,6 +4796,21 @@ export function App({ store, initialStatusMessage }: AppProps) { +
+ {WHITEBOX_SELECTION_MODES.map((mode) => ( + + ))} +
+
- {selectedFace === null || selectedFaceId === null ? ( -
Select a face to edit its material and UV transform.
+ {whiteboxSelectionMode === "edge" ? ( + selectedEdgeId === null ? ( +
Select an edge in the viewport to inspect it. Edge transforms land in the next slice.
+ ) : ( +
+
Active Edge
+
{BOX_EDGE_LABELS[selectedEdgeId]}
+
Edge selection is visible in the viewport. Persistent edge transforms are still deferred.
+
+ ) + ) : whiteboxSelectionMode === "vertex" ? ( + selectedVertexId === null ? ( +
Select a vertex in the viewport to inspect it. Vertex transforms land in the next slice.
+ ) : ( +
+
Active Vertex
+
{BOX_VERTEX_LABELS[selectedVertexId]}
+
Vertex selection is visible in the viewport. Persistent vertex transforms are still deferred.
+
+ ) + ) : selectedFace === null || selectedFaceId === null ? ( +
+ {whiteboxSelectionMode === "object" + ? "Switch to Face mode or choose a face chip to edit materials and UVs." + : "Select a face to edit its material and UV transform."} +
) : ( <>
@@ -7140,6 +7170,9 @@ export function App({ store, initialStatusMessage }: AppProps) {
Status: {statusMessage}
+
+ Whitebox: {getWhiteboxSelectionModeLabel(whiteboxSelectionMode)} +
Document: {documentStatusLabel}