-
May 19th, 2023, 09:19 #1
OptionsManager registerOption2 - parameters explanation
I need some explanation on these function parameters. I put the questions next to the parameters of the code.
Code:OptionsManager.registerOption2( "XYZ", --> This is the unique name of the option, right? true, --> "true" is equal for all, "false" every client can define it? "ABC", --> This should be the name of the group the option should be placed in, right? "DEF", --> This is the option label "fff", --> This is th option type, like "option_entry_cycler" { labels = "option1|option2", --> These are the labels on which the option cycles (if option_entry_cycler)? values = "123|456", --> These are the associated values? baselabel = "option3", --> Is this the default? Should it be one of the above? I find some example with a different option... baseval = "789", --> This depends on the answers above default = "ggg" }); --> Another default?
-
May 19th, 2023, 14:19 #2
like with other cyclers the default is not one of the options. the default is an option its just not listed in the options, its listed as the default.
you have a display value and a db value
-
May 19th, 2023, 15:07 #3
-
May 19th, 2023, 16:14 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 19,638
From the OptionsManager function in CoreRPG, the function is defined as:
registerOption2(sKey, bLocal, sGroupRes, sLabelRes, sOptionType, aCustom)
So, the values are:
- sKey = (string) Unique identifier to register/access this option
- bLocal = (boolean) Specify whether option is local (i.e. editable by each user) or campaign-wide (i.e. only editable by GM)
- sGroupRes = (string) Specify string resource to use for option group. All options with same option group name are grouped together in UI.
- sLabelRes = (string) Specify string resource to display in UI for this option.
- sOptionType = (string) Specify the window class to use for displaying the option. (Usually this is "option_entry_cycler".)
- aCustom = (table) Specify any data used to customize the window or specify other optional information.
aCustom is used by the window class defined by sOptionType in the original call. For "option_entry_cycler", the expected values are:
- default = (string) Default value of option. By default, empty option value is the default value.
- baselabel = (string) Specify string resource to denote label for empty option value.
- baseval = (string) Specify the empty option value.
- labels = (string) Pipe-delimited ("|") string resources to denote labels for non-empty option values.
- values = (string) Pipe-delimited ("|") strings to denote available non-empty option values.
This is one of the oldest global scripts, and one of the first ones to be used across multiple rulesets; so it's a little more complex than I would like, but it's not on the list to streamline at this point to avoid breaking older rulesets.
Regards,
JPGFG Wish List - https://fgapp.idea.informer.com/
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks