Jump to content

Recommended Posts

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";
		};
	};
}];

 

  • Thanks 1

Share this post


Link to post
Share on other sites
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

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
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×