HazJ 1288 Posted March 6, 2019 Inside. _lb ctrlAddEventHandler ["LBSelChanged", { params ["_control", "_selectedIndex"]; private _display = findDisplay 2001; _text = _display displayCtrl 5546; switch (_control lbText _selectedIndex) do { case "Spawn A Vehicle" : { _text ctrlSetStructuredText parseText "Some vehicle..."; }; case "Gun on Back" : { _text ctrlSetStructuredText parseText "..."; }; default { // default... _text ctrlSetStructuredText parseText "Test"; }; }; }]; 1 Share this post Link to post Share on other sites
sbondo1234 6 Posted March 6, 2019 47 minutes ago, HazJ said: Inside. _lb ctrlAddEventHandler ["LBSelChanged", { params ["_control", "_selectedIndex"]; private _display = findDisplay 2001; _text = _display displayCtrl 5546; switch (_control lbText _selectedIndex) do { case "Spawn A Vehicle" : { _text ctrlSetStructuredText parseText "Some vehicle..."; }; case "Gun on Back" : { _text ctrlSetStructuredText parseText "..."; }; default { // default... _text ctrlSetStructuredText parseText "Test"; }; }; }]; Sorry for late reply, was gone doing something but thanks for all the help! Works great! Going to work on making it look nicer now! Share this post Link to post Share on other sites
HazJ 1288 Posted March 7, 2019 No problem. You're welcome. Obviously go over the code to improve and understand things. If there is anything you don't understand, just ask. Share this post Link to post Share on other sites
sbondo1234 6 Posted March 7, 2019 2 minutes ago, HazJ said: No problem. You're welcome. Obviously go over the code to improve and understand things. If there is anything you don't understand, just ask. Sure will! I have kind of used switch/case statements before when making an earplugs script, so I kind of understand it but not much. Share this post Link to post Share on other sites