- Messages
- 153
- Country

Hi all. After months of time off not messing with code I am diving back in to working on my aircraft. Not that I was ever good at it, but now I am very rusty and my brain is fried. My issue is with creating a 3 position spring switch( Up-Down) that returns to center. I have created something that works with templates but it uses the mouse wheel movement and timer return which I dont like the looks of its operation.
I am working with this code and its semi-successful. Issue #1- it doesn't start centered and issue #2 it springs back only from the Top to center not bottom to center also. I'm sure I'm missing something simple, but I've been staring at this for too long and my brain is spaghetti. Any help would be greatly appreciated.
I am working with this code and its semi-successful. Issue #1- it doesn't start centered and issue #2 it springs back only from the Top to center not bottom to center also. I'm sure I'm missing something simple, but I've been staring at this for too long and my brain is spaghetti. Any help would be greatly appreciated.
Code:
<Component ID="S2T_LL_PL_Switch" Node="S2T_LL_PL_Switch">
<UseTemplate Name="ASOBO_GT_Anim_Code">
<ANIM_NAME>S2T_LL_PL_Switch</ANIM_NAME>
<PART_ID>S2T_LL_PL_Switch</PART_ID>
<ANIM_LENGTH>100</ANIM_LENGTH>
<ANIM_CODE>
50 (L:s2t_Pulse_Landing_switch,enum) 50 *
</ANIM_CODE>
<ANIM_LAG>400</ANIM_LAG>
</UseTemplate>
<UseTemplate Name="ASOBO_GT_MouseRect">
<TOOLTIPID>Landing Lights</TOOLTIPID>
<MOUSEFLAGS>LeftSingle+LeftRelease</MOUSEFLAGS>
<UPARROW>UpArrow</UPARROW>
<DOWNARROW>DownArrow</DOWNARROW>
<CALLBACKCODE>
(M:Event) 'LeftSingle' scmp 0 ==
if{
(M:RelativeY) 0 >
if{
(L:s2t_Pulse_Landing_switch, number) ++ (>L:s2t_Pulse_Landing_switch, number)
(L:s2t_Pulse_Landing_switch, number) 2 > if{ 2 (>L:s2t_Pulse_Landing_switch, number) }
}
els{
(L:s2t_Pulse_Landing_switch, number) -- (>L:s2t_Pulse_Landing_switch, number)
(L:s2t_Pulse_Landing_switch, number) 0 < if{ 0 (>L:s2t_Pulse_Landing_switch, number) }
}
}
(M:Event) 'LeftRelease' scmp 0 ==
if{
(L:s2t_Pulse_Landing_switch, number) 1 > if{ 1 (>L:s2t_Pulse_Landing_switch, number)
}
</CALLBACKCODE>
</UseTemplate>
</Component>