Home   Help Search Login Register  

Author Topic: Ok Some Dialog Questions  (Read 856 times)

0 Members and 1 Guest are viewing this topic.

aurek

  • Guest
Ok Some Dialog Questions
« 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 :(

Rubble_Maker

  • Guest
Re:Ok Some Dialog Questions
« Reply #1 on: 03 Oct 2003, 11:40:00 »
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

Offline CrashDome

  • Members
  • *
Re:Ok Some Dialog Questions
« Reply #2 on: 04 Oct 2003, 04:44:48 »
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>)]


aurek

  • Guest
Re:Ok Some Dialog Questions
« Reply #3 on: 04 Oct 2003, 14:39:50 »
Ill try  that, thanks ;)