Skip to content

Commit

Permalink
Windows assetpack download script (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
HunterBarclay authored Jun 26, 2024
2 parents 878b910 + 6a51f33 commit 3f1aede
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 41 deletions.
2 changes: 1 addition & 1 deletion fission/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build:prod": "tsc && vite build --base=/fission/",
"assetpack": "run-script-os",
"assetpack:nix": "curl -o public/assetpack.zip https://synthesis.autodesk.com/Downloadables/assetpack.zip && unzip -o public/assetpack.zip -d public/",
"assetpack:win32": "echo todo"
"assetpack:win32": "curl -o public/assetpack.zip https://synthesis.autodesk.com/Downloadables/assetpack.zip && tar -xf public/assetpack.zip -C public/"
},
"dependencies": {
"@barclah/jolt-physics": "^0.19.3",
Expand Down
12 changes: 10 additions & 2 deletions fission/prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ const config = {
bracketSpacing: true,
bracketSameLine: false,
arrowParens: "avoid",
printWidth: 120
printWidth: 120,
overrides: [
{
files: "*.json",
options: {
tabWidth: 2,
},
},
],
}

export default config;
export default config
20 changes: 10 additions & 10 deletions fission/src/Synthesis.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Scene from '@/components/Scene.tsx';
import MirabufSceneObject from './mirabuf/MirabufSceneObject.ts';
import { LoadMirabufRemote } from './mirabuf/MirabufLoader.ts';
import { mirabuf } from './proto/mirabuf';
import MirabufParser, { ParseErrorSeverity } from './mirabuf/MirabufParser.ts';
import MirabufInstance from './mirabuf/MirabufInstance.ts';
import Scene from "@/components/Scene.tsx"
import MirabufSceneObject from "./mirabuf/MirabufSceneObject.ts"
import { LoadMirabufRemote } from "./mirabuf/MirabufLoader.ts"
import { mirabuf } from "./proto/mirabuf"
import MirabufParser, { ParseErrorSeverity } from "./mirabuf/MirabufParser.ts"
import MirabufInstance from "./mirabuf/MirabufInstance.ts"
import { AnimatePresence } from "framer-motion"
import { ReactElement, useEffect } from "react"
import { ModalControlProvider, useModalManager } from "@/ui/ModalContext"
Expand Down Expand Up @@ -49,10 +49,10 @@ import ScoringZonesPanel from "@/panels/configuring/scoring/ScoringZonesPanel"
import ZoneConfigPanel from "@/panels/configuring/scoring/ZoneConfigPanel"
import ScoreboardPanel from "@/panels/information/ScoreboardPanel"
import DriverStationPanel from "@/panels/simulation/DriverStationPanel"
import ManageAssembliesModal from '@/modals/spawning/ManageAssembliesModal.tsx';
import World from '@/systems/World.ts';
import { AddRobotsModal, AddFieldsModal, SpawningModal } from '@/modals/spawning/SpawningModals.tsx';
import ImportMirabufModal from '@/modals/mirabuf/ImportMirabufModal.tsx';
import ManageAssembliesModal from "@/modals/spawning/ManageAssembliesModal.tsx"
import World from "@/systems/World.ts"
import { AddRobotsModal, AddFieldsModal, SpawningModal } from "@/modals/spawning/SpawningModals.tsx"
import ImportMirabufModal from "@/modals/mirabuf/ImportMirabufModal.tsx"

const DEFAULT_MIRA_PATH = "/api/mira/Robots/Team 2471 (2018)_v7.mira"

Expand Down
2 changes: 1 addition & 1 deletion fission/src/mirabuf/MirabufParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class MirabufParser {
// Build undirected graph
const graph = new Graph()
graph.AddNode(rootNode ? rootNode.id : this._rigidNodes[0].id)
const jointInstances = (Object.values(assembly.data!.joints!.jointInstances!) as mirabuf.joint.JointInstance[])
const jointInstances = Object.values(assembly.data!.joints!.jointInstances!) as mirabuf.joint.JointInstance[]
jointInstances.forEach((x: mirabuf.joint.JointInstance) => {
const rA = this._partToNodeMap.get(x.parentPart)
const rB = this._partToNodeMap.get(x.childPart)
Expand Down
8 changes: 1 addition & 7 deletions fission/src/ui/ToastContext.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import React, {
createContext,
useState,
useContext,
useCallback,
ReactNode,
} from "react"
import React, { createContext, useState, useContext, useCallback, ReactNode } from "react"
import Toast from "@/components/Toast"
import { AnimatePresence, motion } from "framer-motion"

Expand Down
15 changes: 8 additions & 7 deletions fission/src/ui/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ const Dropdown: React.FC<DropdownProps> = ({ label, options, onSelect }) => {
<div className="relative w-full">
<Select
defaultValue={optionList[0]}
onChange={(_event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, value: string | unknown) =>
typeof value === "string" && onSelect && onSelect(value)
}
onChange={(
_event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null,
value: string | unknown
) => typeof value === "string" && onSelect && onSelect(value)}
>
{optionList.map(option => (
<Option value={option} key={option}>
Expand All @@ -54,10 +55,10 @@ const Dropdown: React.FC<DropdownProps> = ({ label, options, onSelect }) => {
)
}

const CustomButton = React.forwardRef(function CustomButton<TValue extends NonNullable<unknown>, Multiple extends boolean>(
props: SelectRootSlotProps<TValue, Multiple>,
ref: React.ForwardedRef<HTMLButtonElement>
) {
const CustomButton = React.forwardRef(function CustomButton<
TValue extends NonNullable<unknown>,
Multiple extends boolean,
>(props: SelectRootSlotProps<TValue, Multiple>, ref: React.ForwardedRef<HTMLButtonElement>) {
return (
<StyledButton type="button" {...props} ref={ref}>
{props.children}
Expand Down
2 changes: 1 addition & 1 deletion fission/src/ui/components/NumberInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import Label, { LabelSize } from "./Label"
import { Unstable_NumberInput as BaseNumberInput, } from "@mui/base/Unstable_NumberInput"
import { Unstable_NumberInput as BaseNumberInput } from "@mui/base/Unstable_NumberInput"

type InputProps = {
placeholder: string
Expand Down
14 changes: 7 additions & 7 deletions fission/src/ui/components/Scene.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import './Scene.css';
import { useEffect, useRef } from "react";
import Stats from 'stats.js';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import SceneObject from "@/systems/scene/SceneObject";
import World from '@/systems/World';
import "./Scene.css"
import { useEffect, useRef } from "react"
import Stats from "stats.js"
import { OrbitControls } from "three/addons/controls/OrbitControls.js"
import SceneObject from "@/systems/scene/SceneObject"
import World from "@/systems/World"

let stats: Stats | null

Expand Down Expand Up @@ -64,4 +64,4 @@ function Scene({ useStats }: SceneProps) {
)
}

export default Scene;
export default Scene
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { useModalControlContext } from "@/ui/ModalContext"
import {
ColorName,
Theme,
useTheme
} from "@/ui/ThemeContext"
import { ColorName, Theme, useTheme } from "@/ui/ThemeContext"
import Button from "@/components/Button"
import Dropdown from "@/components/Dropdown"
import Modal, { ModalPropsImpl } from "@/components/Modal"
Expand Down

0 comments on commit 3f1aede

Please sign in to comment.