The online racing simulator
Help with clickable buttons
(4 posts, started )
Help with clickable buttons
Hello,
I've added a button on an InSim I'm making in C#, but I have no clue how you make it actually do something? I've put down this for the button:

SendBtn(10, 4, 4, 45, 45, "^8Stream", ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK);

I'm guessing I need to reference this to a case, but how would I go about doing that?
When you click on a button, LFS sends a packet to your InSim app. In order to catch this packet you have to bind it:
InSim.Bind<IS_BTC>(BTC_Handler); // It's for "standard" clickable buttons.
InSim.Bind<IS_BTT>(BTT_Handler); // It's for the clickable buttons that popup a window where you can write text.

BTC_Handler and BTT_Handler are the methods (that you have to add in your code) that execute what is inside them each time the clickable button is clicked.

Each button that you create has an ID, and the same ID is also reported back in the IS_BTC,IS_BTT packets with other infos too (for example the UCID of the player who clicked the button), so you can handle them using those infos.
Thanks :-)
Everything is in the insim manual, very useful Smile

Help with clickable buttons
(4 posts, started )
FGED GREDG RDFGDR GSFDG