OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: aurek on 02 Oct 2003, 21:13:00
-
Today I took a look at dialogs using Vektorboson's tutorial. And Ive run into a problem so I have a few questions.
a)What actions are valid for use with the CT_Button (action = "";)
b)More of a general scripting problem this, how do I create (if/then) statements in OFP scripting?
Basically what I want to do is:
If listbox "cars" is selected then .etc.
else if listbox "motorcycle" is selected then .etc.
I want this to happen after the button "buy" is pressed. Will I need to run a script for this, or is it doable within the dialog its self?
c) I want the text of a CT_Static to change depending on the currently selected list box item.
Ok I hope Ive made myself clear. Any help appreciated,
thanks :)
p.s If this was VB Id have it done twice by now :(
-
You can put anything you want into the action slot, actually its a general script command. You could use something like
[] exec "button_down.sqs"
or whatever. No need to fiddle with if statements ;)
c) Try ctrlSetText [], see OCR for more
-
In regards to B:
You need to associate a value with the list item.
lbSetValue [<Listbox Index number>,<integer>]
Then when the buy button is pressed, get the currently selected items value with:
lbValue [<idc>,lbCurSel (<idc>)]
-
Ill try that, thanks ;)