New UI Callback Parameters
In 1.06, callbacks can take 2 new 'variable' parameters in addition to global:# and local:#.
The first new parameter type is
listboxrow:listboxname
This will insert the row # that is currently selected in the listbox indicated by listboxname
For example, if I had a callback that looked like:
OnLeftClick=UIObject_Misc_ExecuteServerScript("myguiscript",listboxrow:mylb)
On the same UIScene I have a listbox called 'mylb' where I have selected the 3rd row.
When the OnLeftClick callback above gets executed, the 1 parameter that gets sent to that script will be an integer with the value of 2. (The first row in the LB would send a value of 0).
The second new parameter type also deals with ListBoxes:
listboxtext:listboxname[.textfieldname]
This will insert the text contained by that row. If the listbox rows are buttons or text fields, then the textfieldname parameter above is not necessary. If instead they are complex UI Panes, then the textfieldname will be used to specify which object within the pane contains the text we want.
For example, if I had a callback that looked like:
OnLeftClick=UIObject_Misc_ExecuteServerScript("myguiscript",listboxtext:mylb.mytext)
In the same UIScene, I have a Listbox named 'mylb'. The rows of that lb are complex UIPanes that contain a text field in them called 'mytext'.
When that callback executes, the engine will look at 'mylb', find the currently selected row, then look for the object named 'mytext' within that row and insert the text within that object as a parameter to the script on the server.
Now obviously the real power of these new variable parameters will be when coupled with the ability for scripts to populate a gui listbox. That functionality isn't in yet, but is something else I intend to have in for 1.06.
There are other new 'variable' parameter syntaxes that will be coming along with 1.06 that I'll post about once I have actually implemented them.
10 Comments
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now