Skip to content

Commit bec58b1

Browse files
committed
Merge branch 'dev' into alexey/273/arcade-to-swerve-turning
2 parents 561ad28 + 8d95ec7 commit bec58b1

4 files changed

Lines changed: 22 additions & 12 deletions

File tree

fission/src/mirabuf/MirabufLoader.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import InitialConfigPanel from "@/panels/configuring/initial-config/InitialConfi
88
import { PAUSE_REF_ASSEMBLY_SPAWNING } from "@/systems/physics/PhysicsTypes.ts"
99
import { createMirabuf } from "@/mirabuf/MirabufSceneObject.ts"
1010
import { getTargetControls } from "@/systems/scene/CameraControls.ts"
11+
import { detectAndTagWheels } from "@/systems/simulation/synthesis_brain/WheelDetector"
1112
import type { EncodedAssembly, Message } from "@/systems/multiplayer/types.ts"
1213
import { ProgressHandle } from "@/components/ProgressNotificationData.ts"
1314

@@ -271,6 +272,10 @@ class MirabufCachingService {
271272
return
272273
}
273274

275+
if (assembly.dynamic) {
276+
detectAndTagWheels(assembly)
277+
}
278+
274279
const info = await MirabufCachingService.storeAssemblyInCache(assembly, { miraType })
275280
if (!info) return
276281

fission/src/systems/simulation/synthesis_brain/WheelDetector.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ export function detectAndTagWheels(assembly: mirabuf.Assembly): void {
287287
const jointDefs = assembly.data?.joints?.jointDefinitions as Record<string, mirabuf.joint.IJoint> | undefined
288288
if (!jointDefs) return
289289

290+
const hasExistingWheels = Object.values(jointDefs).some(jDef => jDef.userData?.data?.["wheel"] === "true")
291+
if (hasExistingWheels) return
292+
290293
const candidates = extractCandidates(jointDefs)
291294
if (candidates.length < 2) return
292295

fission/src/ui/UIProvider.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { SnackbarKey, SnackbarMessage, VariantType } from "notistack"
33
import { useSnackbar } from "notistack"
44
import type React from "react"
55
import type { FunctionComponent, ReactNode } from "react"
6-
import { useCallback, useReducer, useState } from "react"
6+
import { Fragment, useCallback, useReducer, useState } from "react"
77
import { v4 as uuidv4 } from "uuid"
88
import type { ModalImplProps } from "./components/Modal"
99
import type { PanelImplProps } from "./components/Panel"
@@ -158,16 +158,18 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
158158
const addToast = useCallback(
159159
(variant: VariantType, ...contents: SnackbarMessage[]) => {
160160
enqueueSnackbar(
161-
contents.length <= 1
162-
? { ...contents }
163-
: {
164-
...contents.map(child => (
165-
<>
166-
{child}
167-
<br />
168-
</>
169-
)),
170-
},
161+
contents.length <= 1 ? (
162+
(contents[0] ?? "")
163+
) : (
164+
<span>
165+
{contents.map((content, index) => (
166+
<Fragment key={index}>
167+
{content}
168+
{index < contents.length - 1 && <br />}
169+
</Fragment>
170+
))}
171+
</span>
172+
),
171173
{ variant, action: snackbarAction }
172174
)
173175
},

fission/src/ui/panels/configuring/assembly-config/interfaces/cameras/CameraConfigInterface.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const CameraConfigInterface: React.FC<CameraConfigInterfaceProps> = ({ selectedR
101101
const gizmoComponent = useMemo(() => {
102102
if (!camera) {
103103
gizmoRef.current = undefined
104-
return <></>
104+
return null
105105
}
106106

107107
const postGizmoCreation = (gizmo: GizmoSceneObject) => {

0 commit comments

Comments
 (0)