Skip to content

Commit

Permalink
Move subsystem config to the combined configuration panel (#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonPacewic authored Aug 21, 2024
2 parents 1e72d60 + 7c0e4aa commit 0991fd5
Show file tree
Hide file tree
Showing 11 changed files with 294 additions and 321 deletions.
2 changes: 0 additions & 2 deletions fission/src/Synthesis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import ThemeEditorModal from "@/modals/configuring/theme-editor/ThemeEditorModal
import MatchModeModal from "@/modals/spawning/MatchModeModal"
import RobotSwitchPanel from "@/panels/RobotSwitchPanel"
import SpawnLocationsPanel from "@/panels/SpawnLocationPanel"
import ConfigureSubsystemsPanel from "@/ui/panels/configuring/ConfigureSubsystemsPanel.tsx"
import ScoreboardPanel from "@/panels/information/ScoreboardPanel"
import DriverStationPanel from "@/panels/simulation/DriverStationPanel"
import PokerPanel from "@/panels/PokerPanel.tsx"
Expand Down Expand Up @@ -236,7 +235,6 @@ const initialPanels: ReactElement[] = [
<WSViewPanel key="ws-view" panelId="ws-view" />,
<DebugPanel key="debug" panelId="debug" />,
<ConfigurePanel key="configure" panelId="configure" />,
<ConfigureSubsystemsPanel key="subsystem-config" panelId="subsystem-config" openLocation="right" sidePadding={8} />,
]

export default Synthesis
5 changes: 0 additions & 5 deletions fission/src/ui/components/MainHUD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,6 @@ const MainHUD: React.FC = () => {
icon={SynthesisIcons.MagnifyingGlass}
onClick={() => openModal("view")}
/> */}
<MainHUDButton
value={"Subsystems"}
icon={SynthesisIcons.Gear}
onClick={() => openPanel("subsystem-config")}
/>
<MainHUDButton
value={"Configure Assets"}
icon={SynthesisIcons.Wrench}
Expand Down
7 changes: 6 additions & 1 deletion fission/src/ui/components/SelectMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Label, { LabelSize } from "./Label"
import {
AddButtonInteractiveColor,
ButtonIcon,
CustomTooltip,
DeleteButton,
SectionDivider,
SectionLabel,
Expand Down Expand Up @@ -44,8 +45,10 @@ const CustomButton = styled(MUIButton)({
/** Extend this to make a type that contains custom data */
export class SelectMenuOption {
name: string
constructor(name: string) {
tooltipText?: string
constructor(name: string, tooltipText?: string) {
this.name = name
this.tooltipText = tooltipText
}
}

Expand Down Expand Up @@ -83,6 +86,7 @@ const OptionCard: React.FC<OptionCardProps> = ({ value, index, onSelected, onDel
{/* Indentation before the name */}
<Box width="8px" />
{/* Label for joint index and type (grey if child) */}

<SectionLabel
key={value.name + index}
size={LabelSize.Small}
Expand All @@ -102,6 +106,7 @@ const OptionCard: React.FC<OptionCardProps> = ({ value, index, onSelected, onDel
sx={{ borderColor: "#888888" }}
id={`select-button-${value.name}`}
/>
{value.tooltipText && CustomTooltip(value.tooltipText)}
{/** Delete button only if onDelete is defined */}
{onDelete && includeDelete && (
<>
Expand Down
1 change: 1 addition & 0 deletions fission/src/ui/components/StyledComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class SynthesisIcons {
public static EditLarge = (<IoPencil size={"1.25rem"} />)
public static LeftArrowLarge = (<FaArrowLeft size={"1.25rem"} />)
public static BugLarge = (<FaBug size={"1.25rem"} />)
public static XmarkLarge = (<FaXmark size={"1.25rem"} />)

public static OpenHudIcon = (
<FaAngleRight
Expand Down
3 changes: 2 additions & 1 deletion fission/src/ui/modals/configuring/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ const SettingsModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
}}
/>
<Checkbox
label="Subsystem Realistic Gravity"
label="Realistic Subsystem Gravity"
defaultState={PreferencesSystem.getGlobalPreference<boolean>("SubsystemGravity")}
onClick={checked => {
setSubsystemGravity(checked)
}}
tooltipText="Allows you to set a target torque or force for subsystems and joints. If not properly configured, joints may not be able to resist gravity or may not behave as intended."
/>
<Checkbox
label="Show Score Zones"
Expand Down
279 changes: 0 additions & 279 deletions fission/src/ui/panels/configuring/ConfigureSubsystemsPanel.tsx

This file was deleted.

Loading

0 comments on commit 0991fd5

Please sign in to comment.