Hello all. Been doing a little playing with dialog boxes recently, and I'm rapidly getting the hang of it. In particular, Razorwings' OFP Dialog Maker is an awesome tool. The problem I'm having is getting the dialog box to do anything based on differing inputs from a combo box. Say I created my dialog box from a script with this in it....
_ok = createDialog "Chooseaircraft"
?(!_ok): hint "Error"; exit
_index = lbAdd [102, "1st Aircraft"]
lbSetData [102, _index, "1st Aircraft"]
_index = lbAdd [102, "2nd Aircraft"]
lbSetData [102, _index, "2ndAircraft"]
_index = lbAdd [102, "3rd Aircraft"]
lbSetData [102, _index, "3rd Aircraft"]
lbSetCurSel [102, 0]
There are more lists than that, but they are all made in the same way. Now, I'm a little unsure about this whole "_index" nonsense. Is that labeling the data 0, 1 and 2, or what? Anyhow, I go on to define my dialog in the description.ext. Now, the relevant section regarding the list box is as follows......
class ChooseAircraft : RscCombo
{
x = 0.2
y = 0.14997
idc = 102
w = 0.3
h = 0.037
style = ST_LEFT
colorText[] = {0.2, 0.2, 0.2, 1};
colorBackground[] = {0.4, 0.4, 0.4, 1};
font = "CourierNewB64"
SizeEX = 0.025
colorSelect[] = {0.4, 0.4, 0.4, 1};
colorSelectBackGround[] = {0.2, 0.2, 0.2, 1};
RowHeight = 0.04
wholeHeight = 0.3
};
Thats all just position and colour stuff so far as I can tell, the important bit being the idc, which matches the idc in the script used to call the dialog. Finally, and herein lies the problem, I wan't to USE what the player has put as an output. Now, I tried something along those lines when clicking a button....
action = "if ((lbCurSel 102)==0) then hint ""Aircraft1"";"
Basically, all I need is to squeeze a number based output from the list, so when the button is pressed, dependant on the number, different things happen. I'm all cool on the actions, I just need to get the combo box to give me a number. Can anybody give me the command and syntax? Your help would be MUCH appreciated. Thanks a lot.