- Messages
- 10,158
- Country

Hey guys,
I have some code I am trying to put into FSX Gmax code from FS9 XML 2D switch gauge code.
Here is what I am trying to do.
These are two switches in regular FS9 gauge code that operate selections.
What I need is to integrate 2 more strings into their commands for each of the two switches. In FSX, the VC animated buttons will be two components, while in the 2D switch format, they presently appear as one. Still though, as you can see above, the existing code is for two seperate click zones and two seperate commands, so no big deal there.
Here is what I must integrate;
Button A;
(L:LHC XM Radio Switch,number) ! (>L:LHC XM Radio Switch,number)
1 (>L:XMLSND7,enum)
Button B;
(L:LHC XM Radio Song Selector,number) ! (>L:LHC XM Radio Song Selector,number)
1 (>L:XMLSND7,enum)
Here is a 'try' at mixing and forming the code for the CallbackCode section;
1ST BUTTON:
<CallbackCode>(L:LHC XM Radio Switch,number) ! (>L:LHC XM Radio Switch,number)
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:Song Power,enum) 1 == if{ 0 (>L:Song Power,enum) 1 (>L:XMLStopSND,enum) } els{ 1 (>L:Song Power,enum) }
1 (>L:XMLSND7,enum)
</CallbackCode>
2ND BUTTON:
<CallbackCode>(L:LHC XM Radio Song Selector,number) ! (>L:LHC XM Radio Song Selector,number)
'LeftSingle' scmp 0 ==
if{ (L:Song Power,enum) 1 == if{ 0 (>L:Song Power,enum) 1 (>L:XMLStopSND,enum) } els{ 1 (>L:Song Power,enum) }
1 (>L:XMLSND7,enum)
</CallbackCode>
So far, I have been able to at least get the 'click sound' and animation to work on the first VC Gmax switch, but the second is not working. The first also will only click on the first try, but on turning it off, the click does not occur. The second switch does not function.
The code works brilliant and functions properly for 2D gauge switch code.
I have looked through various stacks in the FSX gauge code and wasnt able to find something similar.
Any idea's? Many thanks for any thoughts on this.
Bill
I have some code I am trying to put into FSX Gmax code from FS9 XML 2D switch gauge code.
Here is what I am trying to do.
These are two switches in regular FS9 gauge code that operate selections.
Code:
<Area Left="65" Right="115" Top="40" Bottom="120">
<Visible> 1 </Visible>
<Tooltip>Music Player Power</Tooltip>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle + RightSingle">
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:Song Power,enum) 1 == if{ 0 (>L:Song Power,enum) 1 (>L:XMLStopSND,enum) } els{ 1 (>L:Song Power,enum) }
</Click>
</Area>
// LH STEP SWITCH
<Area Name="STEP Switch Left" Left="61" Top="144" Width="96" Height="60">
<Tooltip>STEP Switch Left ( %((L:Song Index,enum))%!d of @NUM_SONGS)%</Tooltip>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle+Leave" Repeat="No">
(M:Event) 'LeftSingle' scmp 0 ==
if{ 1 (>L:STEPSWITCH_POS, enum) (L:Song Index,enum) 1 == if{ @NUM_SONGS (>L:Song Index,enum) } els{ (L:Song Index,enum) 1 - @NUM_SONGS min 1 max (>L:Song Index,enum) } 1 (>L:Toggle active,bool) }
(M:Event) 'Leave' scmp 0 == if{ 2 (>L:STEPSWITCH_POS, enum) }
</Click>
</Area>
What I need is to integrate 2 more strings into their commands for each of the two switches. In FSX, the VC animated buttons will be two components, while in the 2D switch format, they presently appear as one. Still though, as you can see above, the existing code is for two seperate click zones and two seperate commands, so no big deal there.
Here is what I must integrate;
Button A;
(L:LHC XM Radio Switch,number) ! (>L:LHC XM Radio Switch,number)
1 (>L:XMLSND7,enum)
Button B;
(L:LHC XM Radio Song Selector,number) ! (>L:LHC XM Radio Song Selector,number)
1 (>L:XMLSND7,enum)
Here is a 'try' at mixing and forming the code for the CallbackCode section;
1ST BUTTON:
<CallbackCode>(L:LHC XM Radio Switch,number) ! (>L:LHC XM Radio Switch,number)
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:Song Power,enum) 1 == if{ 0 (>L:Song Power,enum) 1 (>L:XMLStopSND,enum) } els{ 1 (>L:Song Power,enum) }
1 (>L:XMLSND7,enum)
</CallbackCode>
2ND BUTTON:
<CallbackCode>(L:LHC XM Radio Song Selector,number) ! (>L:LHC XM Radio Song Selector,number)
'LeftSingle' scmp 0 ==
if{ (L:Song Power,enum) 1 == if{ 0 (>L:Song Power,enum) 1 (>L:XMLStopSND,enum) } els{ 1 (>L:Song Power,enum) }
1 (>L:XMLSND7,enum)
</CallbackCode>
So far, I have been able to at least get the 'click sound' and animation to work on the first VC Gmax switch, but the second is not working. The first also will only click on the first try, but on turning it off, the click does not occur. The second switch does not function.
The code works brilliant and functions properly for 2D gauge switch code.
I have looked through various stacks in the FSX gauge code and wasnt able to find something similar.
Any idea's? Many thanks for any thoughts on this.
Bill