Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified fission/src/assets/sound-files/DullClick.wav
Binary file not shown.
34 changes: 33 additions & 1 deletion fission/src/ui/components/StyledComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ import {
ToggleButtonGroup as MuiToggleButtonGroup,
Stack,
type ToggleButtonGroupProps,
Select as MuiSelect,
type SelectProps,
Accordion as MuiAccordion,
type AccordionProps,
AccordionSummary as MuiAccordionSummary,
type AccordionSummaryProps,
AccordionDetails as MuiAccordionDetails,
type AccordionDetailsProps,
type ToggleButtonProps,
Tooltip,
} from "@mui/material"
Expand Down Expand Up @@ -130,6 +138,30 @@ export const ToggleButtonGroup: React.FC<ToggleButtonGroupProps> = ({ children,
)
}

export const Select: React.FC<SelectProps> = ({ children, ...props }) => {
return (
<MuiSelect {...SoundPlayer.getInstance().dropdownSoundEffects()} {...props}>
{children}
</MuiSelect>
)
}

export const Accordion: React.FC<AccordionProps> = ({ children, ...props }) => {
return <MuiAccordion {...props}>{children}</MuiAccordion>
}

export const AccordionSummary: React.FC<AccordionSummaryProps> = ({ children, ...props }) => {
return (
<MuiAccordionSummary {...SoundPlayer.getInstance().dropdownSoundEffects()} {...props}>
{children}
</MuiAccordionSummary>
)
}

export const AccordionDetails: React.FC<AccordionDetailsProps> = ({ children, ...props }) => {
return <MuiAccordionDetails {...props}>{children}</MuiAccordionDetails>
}

export const PositiveButton: React.FC<ButtonProps> = ({ children, onClick, ...props }) => {
return (
<Button onClick={onClick} {...props} color="success">
Expand Down Expand Up @@ -257,4 +289,4 @@ export const LabelWithTooltip = (labelText: string, tooltipText: string) => {
}

// Export the raw MUI components for cases where sound effects are not wanted
export { MuiButton, MuiIconButton, MuiToggleButton, MuiToggleButtonGroup }
export { MuiButton, MuiIconButton, MuiToggleButton, MuiToggleButtonGroup, MuiSelect }
3 changes: 2 additions & 1 deletion fission/src/ui/modals/ViewModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FormControl, InputLabel, MenuItem, Select } from "@mui/material"
import { FormControl, InputLabel, MenuItem } from "@mui/material"
import { Select } from "@/ui/components/StyledComponents"
import type React from "react"
import { useEffect, useState } from "react"
import type { ModalImplProps } from "../components/Modal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FormControl, InputLabel, MenuItem, Select, TextField } from "@mui/material"
import { FormControl, InputLabel, MenuItem, TextField } from "@mui/material"
import { Select } from "@/ui/components/StyledComponents"
import { Stack } from "@mui/system"
import type React from "react"
import { useEffect, useMemo, useState } from "react"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FormControl, InputLabel, MenuItem, Select, TextField } from "@mui/material"
import { FormControl, InputLabel, MenuItem, TextField } from "@mui/material"
import { Select } from "@/ui/components/StyledComponents"
import type React from "react"
import { useEffect, useState } from "react"
import EncoderStimulus from "@/systems/simulation/stimulus/EncoderStimulus"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FormControl, InputLabel, MenuItem, Select } from "@mui/material"
import { FormControl, InputLabel, MenuItem } from "@mui/material"
import { Select } from "@/ui/components/StyledComponents"
import type React from "react"
import { useEffect, useState } from "react"
import WPILibBrain from "@/systems/simulation/wpilib_brain/WPILibBrain"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FormControl, InputLabel, MenuItem, Select } from "@mui/material"
import { FormControl, InputLabel, MenuItem } from "@mui/material"
import { Select } from "@/ui/components/StyledComponents"
import type MirabufSceneObject from "@/mirabuf/MirabufSceneObject"
import { DriveType } from "@/systems/simulation/behavior/Behavior.ts"
import type SynthesisBrain from "@/systems/simulation/synthesis_brain/SynthesisBrain"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Divider, MenuItem, Select, Stack } from "@mui/material"
import { Box, Divider, MenuItem, Stack } from "@mui/material"
import type React from "react"
import { useEffect, useState } from "react"
import InputSystem from "@/systems/input/InputSystem"
Expand All @@ -9,7 +9,7 @@ import type Input from "@/systems/input/inputs/Input"
import type { KeyCode } from "@/systems/input/KeyboardTypes"
import Checkbox from "@/ui/components/Checkbox"
import Label from "@/ui/components/Label"
import { Button, SynthesisIcons } from "@/ui/components/StyledComponents"
import { Button, SynthesisIcons, Select } from "@/ui/components/StyledComponents"

// Converts camelCase to Title Case for the inputs modal
const toTitleCase = (camelCase: string) => {
Expand Down Expand Up @@ -209,7 +209,7 @@ const EditInputInterface: React.FC<EditInputProps> = ({ input, useGamepad, useTo
value={gamepadAxes[input.gamepadAxisNumber + 1]}
onChange={e => {
setSelectedInput(input.inputName)
setChosenGamepadAxis(gamepadAxes.indexOf(e.target.value))
setChosenGamepadAxis(gamepadAxes.indexOf(e.target.value as string))
}}
>
{gamepadAxes.map(axis => (
Expand Down Expand Up @@ -277,7 +277,7 @@ const EditInputInterface: React.FC<EditInputProps> = ({ input, useGamepad, useTo
value={touchControlsAxes[input.touchControlAxis]}
onChange={e => {
setSelectedInput(input.inputName)
setChosenTouchControlsAxis(touchControlsAxes.indexOf(e.target.value))
setChosenTouchControlsAxis(touchControlsAxes.indexOf(e.target.value as string))
}}
>
{touchControlsAxes.map(axis => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
ListItemText,
MenuItem,
OutlinedInput,
Select,
Stack,
TextField,
} from "@mui/material"
import { Select } from "@/ui/components/StyledComponents"
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
import * as THREE from "three"
import { ConfigurationSavedEvent } from "@/events/ConfigurationSavedEvent"
Expand Down Expand Up @@ -308,7 +308,7 @@ const ZoneConfigInterface: React.FC<ZoneConfigProps> = ({ selectedField, selecte
}}
value={activeDuring}
input={<OutlinedInput label="Contact Type" />}
renderValue={selected => selected.join(", ")}
renderValue={selected => (selected as MatchModeType[]).join(", ")}
multiple
>
{MATCH_MODE_OPTIONS.map(opt => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Divider, FormControl, InputLabel, MenuItem, Select, Stack, Tooltip } from "@mui/material"
import { Box, Divider, FormControl, InputLabel, MenuItem, Stack, Tooltip } from "@mui/material"
import { type ReactElement, useCallback, useEffect, useReducer, useState } from "react"
import InputSchemeManager from "@/systems/input/InputSchemeManager"
import InputSystem from "@/systems/input/InputSystem"
Expand All @@ -7,7 +7,14 @@ import PreferencesSystem from "@/systems/preferences/PreferencesSystem"
import { DriveType } from "@/systems/simulation/behavior/Behavior"
import SynthesisBrain from "@/systems/simulation/synthesis_brain/SynthesisBrain"
import Label from "@/ui/components/Label"
import { Button, DeleteButton, EditButton, PositiveButton, SynthesisIcons } from "@/ui/components/StyledComponents"
import {
Button,
DeleteButton,
EditButton,
PositiveButton,
SynthesisIcons,
Select,
} from "@/ui/components/StyledComponents"
import { TouchControlsEvent, TouchControlsEventKeys } from "@/ui/components/TouchControls"
import { useStateContext } from "@/ui/helpers/StateProviderHelpers"

Expand Down
15 changes: 4 additions & 11 deletions fission/src/ui/panels/mirabuf/ImportMirabufPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import {
Accordion,
AccordionDetails,
AccordionSummary,
Box,
CircularProgress,
Stack,
Tab,
Tabs,
Tooltip,
} from "@mui/material"
import { Box, CircularProgress, Stack, Tab, Tabs, Tooltip } from "@mui/material"
import type React from "react"
import { type ReactNode, useCallback, useEffect, useLayoutEffect, useMemo, useState } from "react"
import { MdExpandMore } from "react-icons/md"
Expand Down Expand Up @@ -39,6 +29,9 @@ import {
PositiveIconButton,
RefreshButton,
SynthesisIcons,
Accordion,
AccordionDetails,
AccordionSummary,
} from "@/ui/components/StyledComponents"
import { useStateContext } from "@/ui/helpers/StateProviderHelpers"
import { CloseType, useUIContext } from "@/ui/helpers/UIProviderHelpers"
Expand Down
4 changes: 2 additions & 2 deletions fission/src/ui/panels/simulation/DriverStationPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { MenuItem, Select, Stack } from "@mui/material"
import { MenuItem, Stack } from "@mui/material"
import type React from "react"
import { useEffect, useState } from "react"
import type { PanelImplProps } from "@/ui/components/Panel"
import { Button } from "@/ui/components/StyledComponents"
import { Button, Select } from "@/ui/components/StyledComponents"
import { useUIContext } from "@/ui/helpers/UIProviderHelpers"

const DriverStationPanel: React.FC<PanelImplProps<void, void>> = ({ panel }) => {
Expand Down
Loading