Add support for cone and torus brushes in App.tsx and update ProjectSchedulePane.tsx

This commit is contained in:
2026-04-15 09:09:52 +02:00
parent 718dc75868
commit 0e0c8b4f41
2 changed files with 130 additions and 27 deletions

View File

@@ -6881,6 +6881,72 @@ export function App({ store, initialStatusMessage }: AppProps) {
return true;
}
if (creationPreview.target.kind === "cone-brush") {
const center =
creationPreview.center === null ? undefined : creationPreview.center;
store.executeCommand(
createCreateConeBrushCommand(
center === undefined
? {
sideCount: creationPreview.target.sideCount,
snapToGrid: whiteboxSnapEnabled,
gridSize: whiteboxSnapStep
}
: {
center,
sideCount: creationPreview.target.sideCount,
snapToGrid: whiteboxSnapEnabled,
gridSize: whiteboxSnapStep
}
)
);
completeCreation(
center === undefined
? whiteboxSnapEnabled
? `Created a whitebox cone on the ${whiteboxSnapStep}m grid.`
: "Created a whitebox cone."
: whiteboxSnapEnabled
? `Created a whitebox cone at snapped center ${formatVec3(center)}.`
: `Created a whitebox cone at ${formatVec3(center)}.`
);
return true;
}
if (creationPreview.target.kind === "torus-brush") {
const center =
creationPreview.center === null ? undefined : creationPreview.center;
store.executeCommand(
createCreateTorusBrushCommand(
center === undefined
? {
majorSegmentCount: creationPreview.target.majorSegmentCount,
tubeSegmentCount: creationPreview.target.tubeSegmentCount,
snapToGrid: whiteboxSnapEnabled,
gridSize: whiteboxSnapStep
}
: {
center,
majorSegmentCount: creationPreview.target.majorSegmentCount,
tubeSegmentCount: creationPreview.target.tubeSegmentCount,
snapToGrid: whiteboxSnapEnabled,
gridSize: whiteboxSnapStep
}
)
);
completeCreation(
center === undefined
? whiteboxSnapEnabled
? `Created a whitebox torus on the ${whiteboxSnapStep}m grid.`
: "Created a whitebox torus."
: whiteboxSnapEnabled
? `Created a whitebox torus at snapped center ${formatVec3(center)}.`
: `Created a whitebox torus at ${formatVec3(center)}.`
);
return true;
}
if (creationPreview.target.kind === "model-instance") {
const asset =
editorState.document.assets[creationPreview.target.assetId];
@@ -10740,22 +10806,41 @@ export function App({ store, initialStatusMessage }: AppProps) {
const addMenuItems: HierarchicalMenuItem[] = [
{
kind: "action",
label: "Whitebox Box",
testId: "add-menu-box",
onSelect: beginBoxCreation
},
{
kind: "action",
label: "Whitebox Wedge",
testId: "add-menu-wedge",
onSelect: beginWedgeCreation
},
{
kind: "action",
label: "Whitebox Cylinder",
testId: "add-menu-cylinder",
onSelect: beginCylinderCreation
kind: "group",
label: "Whitebox Primitives",
testId: "add-menu-whitebox-primitives",
children: [
{
kind: "action",
label: "Box",
testId: "add-menu-box",
onSelect: beginBoxCreation
},
{
kind: "action",
label: "Wedge",
testId: "add-menu-wedge",
onSelect: beginWedgeCreation
},
{
kind: "action",
label: "Cylinder",
testId: "add-menu-cylinder",
onSelect: beginCylinderCreation
},
{
kind: "action",
label: "Cone",
testId: "add-menu-cone",
onSelect: beginConeCreation
},
{
kind: "action",
label: "Torus",
testId: "add-menu-torus",
onSelect: beginTorusCreation
}
]
},
{
kind: "action",

View File

@@ -10,7 +10,6 @@ import {
HOURS_PER_DAY,
formatTimeOfDayHours
} from "../document/project-time-settings";
import type { ProjectDialogueLibrary } from "../dialogues/project-dialogues";
import { formatControlEffectValue, getControlTargetRefKey } from "../controls/control-surface";
import { ProjectSequencesPanel } from "./ProjectSequencesPanel";
import {
@@ -67,7 +66,15 @@ interface ProjectSequencerPaneProps {
}>;
scheduler: ProjectScheduler;
sequences: ProjectSequenceLibrary;
dialogues: ProjectDialogueLibrary;
npcTalkTargetOptions: Array<{
npcEntityId: string;
label: string;
defaultDialogueId: string | null;
dialogues: Array<{
dialogueId: string;
label: string;
}>;
}>;
selectedRoutineId: string | null;
selectedSequenceId: string | null;
onSelectRoutine(routineId: string | null): void;
@@ -91,7 +98,11 @@ interface ProjectSequencerPaneProps {
targetKey: string,
effectOptionId: ProjectScheduleEffectOptionId
): void;
onAddDialogueStep(sequenceId: string, dialogueId: string): void;
onAddNpcTalkEffect(
sequenceId: string,
npcEntityId: string,
dialogueId: string | null
): void;
onAddTeleportStep(sequenceId: string, targetEntityId: string): void;
onAddSceneTransitionStep(sequenceId: string, targetKey: string): void;
onAddVisibilityStep(sequenceId: string, targetKey: string): void;
@@ -141,10 +152,15 @@ interface ProjectSequencerPaneProps {
stepIndex: number,
loop: boolean
): void;
onSetDialogueStepDialogueId(
onSetNpcTalkStepNpcEntityId(
sequenceId: string,
stepIndex: number,
dialogueId: string
npcEntityId: string
): void;
onSetNpcTalkStepDialogueId(
sequenceId: string,
stepIndex: number,
dialogueId: string | null
): void;
onSetTeleportStepTarget(
sequenceId: string,
@@ -388,7 +404,7 @@ export function ProjectSequencerPane({
visibilityTargetOptions,
scheduler,
sequences,
dialogues,
npcTalkTargetOptions,
selectedRoutineId,
selectedSequenceId,
onSelectRoutine,
@@ -408,7 +424,7 @@ export function ProjectSequencerPane({
onSetRoutineSequenceId,
onSetSequenceTitle,
onAddControlEffect,
onAddDialogueStep,
onAddNpcTalkEffect,
onAddTeleportStep,
onAddSceneTransitionStep,
onAddVisibilityStep,
@@ -422,7 +438,8 @@ export function ProjectSequencerPane({
onSetControlStepPathId,
onSetControlStepPathSpeed,
onSetControlStepPathLoop,
onSetDialogueStepDialogueId,
onSetNpcTalkStepNpcEntityId,
onSetNpcTalkStepDialogueId,
onSetTeleportStepTarget,
onSetSceneTransitionStepTarget,
onSetVisibilityStepTarget,
@@ -661,8 +678,8 @@ export function ProjectSequencerPane({
<div className="schedule-pane__editor" style={{ width: "100%" }}>
<ProjectSequencesPanel
sequences={sequences}
dialogues={dialogues}
targetOptions={targetOptions}
npcTalkTargetOptions={npcTalkTargetOptions}
teleportTargetOptions={teleportTargetOptions}
sceneTransitionTargetOptions={sceneTransitionTargetOptions}
visibilityTargetOptions={visibilityTargetOptions}
@@ -678,7 +695,7 @@ export function ProjectSequencerPane({
onDeleteSequence={onDeleteSequence}
onSetSequenceTitle={onSetSequenceTitle}
onAddControlEffect={onAddControlEffect}
onAddDialogueStep={onAddDialogueStep}
onAddNpcTalkEffect={onAddNpcTalkEffect}
onAddTeleportStep={onAddTeleportStep}
onAddSceneTransitionStep={onAddSceneTransitionStep}
onAddVisibilityStep={onAddVisibilityStep}
@@ -692,7 +709,8 @@ export function ProjectSequencerPane({
onSetControlStepPathId={onSetControlStepPathId}
onSetControlStepPathSpeed={onSetControlStepPathSpeed}
onSetControlStepPathLoop={onSetControlStepPathLoop}
onSetDialogueStepDialogueId={onSetDialogueStepDialogueId}
onSetNpcTalkStepNpcEntityId={onSetNpcTalkStepNpcEntityId}
onSetNpcTalkStepDialogueId={onSetNpcTalkStepDialogueId}
onSetTeleportStepTarget={onSetTeleportStepTarget}
onSetSceneTransitionStepTarget={onSetSceneTransitionStepTarget}
onSetVisibilityStepTarget={onSetVisibilityStepTarget}