- Messages
- 4
- Country

Hi all
Quick question for the programming-gods... I would like to know if there is a simple way to create a 3-Way Spring-loaded toggle switch?
The switch I'd like to convert to a 'Return-to-Centre' switch, is a gauge test switch that is currently set-up as a left/right click rocker switch (switch operation simply spins all the fuel needles to show empty on Left click and full on right click), but I'd ideally like the switch to then return to centre automatically and my needles return to show their tanks normal quantities after the just one click.
I've tried in vain to marry up the above coding with the CallbackCode of P3D modeldef's G-Force rest (P:local time, seconds) 0.5 + (>L:G_reset) - but however I try to work this in I can't get it to work!
If this is possible, any help would be greatly appreciated. If not I'll stick with rocker...
Regards
Mike
Quick question for the programming-gods... I would like to know if there is a simple way to create a 3-Way Spring-loaded toggle switch?
The switch I'd like to convert to a 'Return-to-Centre' switch, is a gauge test switch that is currently set-up as a left/right click rocker switch (switch operation simply spins all the fuel needles to show empty on Left click and full on right click), but I'd ideally like the switch to then return to centre automatically and my needles return to show their tanks normal quantities after the just one click.
Code:
<PartInfo>
<Name>fuel_test_switch</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>50 (L:fuel_test_switch, bool) 50 * + </Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Fuel Gauge Test</TooltipText>
<MouseFlags>LeftSingle+RightSingle</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 == if{ (L:fuel_test_switch, bool) -- -1 max (>L:fuel_test_switch, bool) }
(M:Event) 'RightSingle' scmp 0 == if{ (L:fuel_test_switch, bool) ++ 1 min (>L:fuel_test_switch, bool) }
(L:fuel_test_switch, bool) -1 == if{ -310 (>L:tank_gauge_test, gallons) }
(L:fuel_test_switch, bool) 0 == if{ 0 (>L:tank_gauge_test, gallons) }
(L:fuel_test_switch, bool) 1 == if{ 310 (>L:tank_gauge_test, gallons) }
</CallbackCode>
</MouseRect>
</PartInfo>
I've tried in vain to marry up the above coding with the CallbackCode of P3D modeldef's G-Force rest (P:local time, seconds) 0.5 + (>L:G_reset) - but however I try to work this in I can't get it to work!
If this is possible, any help would be greatly appreciated. If not I'll stick with rocker...
Regards
Mike

