Deano1973
Resource contributor
- Messages
- 384
- Country
Hi folks, currently melting what brain cells I have left in a crash-course in XML coding. This is probably child's play for many but I wanted to see if I've got my understanding of Lvars and how they work correct before I go meddling too much.
What I need to do = have an MFD screen for weapons in the VC, upon which the user can press a mouse rect for a particular weapons station. The screen icon for that weapon lights up, and the weapon also appears on the station on the external model and in the VC.
As I understand it, via much reading here and elsewhere, I can put an LVAR code in the modeldef.xml that will call the Lvar I create, plus another for the mouse rect, and then call that code in the MFD gauge XML.
Here's the code - if anybody passing through here sees any major cock ups, or knows I'm chasing rainbows with this entire idea, feel free to let me know and save me the agony
The LVar and mouse rect in modeldef.xml;
Would this type of method also work for switching screens in the same MFD, between things like radar screen, weapons screen and so on? It seems most folks use Lvars for that purpose, but I'm struggling to understand the numbering process.
What I need to do = have an MFD screen for weapons in the VC, upon which the user can press a mouse rect for a particular weapons station. The screen icon for that weapon lights up, and the weapon also appears on the station on the external model and in the VC.
As I understand it, via much reading here and elsewhere, I can put an LVAR code in the modeldef.xml that will call the Lvar I create, plus another for the mouse rect, and then call that code in the MFD gauge XML.
Here's the code - if anybody passing through here sees any major cock ups, or knows I'm chasing rainbows with this entire idea, feel free to let me know and save me the agony
The LVar and mouse rect in modeldef.xml;
Code:
<PartInfo>
<Name>Weapon Visible</Name>
<Visibility>
<Parameter>
<Code>
(L:Weapon1,bool)
</Code>
</Parameter>
</Visibility>
</PartInfo>
<PartInfo>
<Name>Weapon Invisible</Name>
<Visibility>
<Parameter>
<Code>
(L:Weapon1,bool) !
</Code>
</Parameter>
</Visibility>
</PartInfo>
<PartInfo>
<Name>Weapon1 Load</Name>
<MouseRect>
<Cursor>Hand</Cursor>
<CallbackCode>
(L:Weapon1,bool) ! (>L:Weapon1,bool)
</CallbackCode>
</MouseRect>
</PartInfo>
Would this type of method also work for switching screens in the same MFD, between things like radar screen, weapons screen and so on? It seems most folks use Lvars for that purpose, but I'm struggling to understand the numbering process.