Skip to content

Commit

Permalink
feat: added setting for steering & rudder separation
Browse files Browse the repository at this point in the history
  • Loading branch information
Saschl committed Nov 19, 2021
1 parent 310488e commit 09466ec
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/instruments/src/EFB/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type ButtonType = {
setting: string,
}

type AdirsButton = {
type SimVarButton = {
simVarValue: number,
}

Expand Down Expand Up @@ -247,7 +247,10 @@ const SimOptionsPage = () => {

const [dynamicRegistration, setDynamicRegistration] = usePersistentProperty('DYNAMIC_REGISTRATION_DECAL', '0');

const adirsAlignTimeButtons: (ButtonType & AdirsButton)[] = [
const [realisticTiller, setRealisticTiller] = usePersistentProperty('REALISTIC_TILLER_ENABLED', '0');
const [, setRealisticTillerSimVar] = useSimVar('L:A32NX_REALISTIC_TILLER_ENABLED', 'Number', 0);

const adirsAlignTimeButtons: (ButtonType & SimVarButton)[] = [
{ name: 'Instant', setting: 'INSTANT', simVarValue: 1 },
{ name: 'Fast', setting: 'FAST', simVarValue: 2 },
{ name: 'Real', setting: 'REAL', simVarValue: 0 },
Expand All @@ -270,6 +273,11 @@ const SimOptionsPage = () => {
{ name: 'Enabled', setting: '1' },
];

const steeringSeparationButtons: (ButtonType & SimVarButton)[] = [
{ name: 'Disabled', setting: '0', simVarValue: 0 },
{ name: 'Enabled', setting: '1', simVarValue: 1 },
];

useEffect(() => {
setShowNavbar(!showThrottleSettings);
}, [showThrottleSettings]);
Expand Down Expand Up @@ -368,6 +376,23 @@ const SimOptionsPage = () => {
))}
</SelectGroup>
</div>
<div className="py-4 flex flex-row justify-between items-center">
<span className="text-lg text-gray-300 mr-1">Separate Tiller from Rudder Inputs</span>
<SelectGroup>
{steeringSeparationButtons.map((button) => (
<SelectItem
enabled
onSelect={() => {
setRealisticTiller(button.setting);
setRealisticTillerSimVar(button.simVarValue);
}}
selected={realisticTiller === button.setting}
>
{button.name}
</SelectItem>
))}
</SelectGroup>
</div>
</div>
<ControlSettings setShowSettings={setShowThrottleSettings} />
</>
Expand Down

0 comments on commit 09466ec

Please sign in to comment.