Options
Module Definition
The module is inherited from ModuleBase. So base parameters can be found there.
Module name
The name of the module you use as the meta of the module definition is 'Options' or 'OptionModule' if _force_search
is set to true in the module definition.
XML Structure
<Options save_file loaded_callback auto_build_menu auto_load>
<Options save_file loaded_callback auto_build_menu auto_load>
<options name node_name title_id desc_id build_items>
<options name node_name title_id desc_id build_items>
<merge_data ...> ... </merge_data>
<merge_data ...> ... </merge_data>
Any additional parameters which should be included in the item/node definition
<option name type value_changed converter enabled_callback default_value disabled title_id desc_id hidden>
<option name type value_changed converter enabled_callback default_value disabled title_id desc_id hidden>
Every value type uses these parameters
<option type="multichoice" values_tbl save_value ...> ...
<option type="multichoice" values_tbl save_value ...> ...
<values> <value_node value/> ... </values>
<values> <value_node value/> ... </values>
This allows you to define the multichoice items in the xml. value_node automatically assigns the index depending on its location inside <values>
<option type="number" min max step show_value ...> ... </option>
<option type="number" min max step show_value ...> ... </option>
<option type="colour" alpha scale_factor step min max ...> ... </option>
<option type="colour" alpha scale_factor step min max ...> ... </option>
<option type="vector" scale_factor step min max ...> ... </option>
<option type="vector" scale_factor step min max ...> ... </option>
scale_factor
, step
, min
, max
Same as in the colour option.
<option type="table"/>
<option type="table"/>
The table option type is used to save tables into the options config, the menu will not create anything for this item, mostly this item is the same as the others just that default_value is a table like seen in here:
<option_group build_menu ...> ... </option_group>
<option_group build_menu ...> ... </option_group>
Same parameters as defined in the main options
docs. The option_group
can hold sub_menus in the form of option_groups or option_sets and sub options. The option_group
is used for grouping of similar options, this will create a sub menu in the parent node for the options.
<option_set not_pre_generated items_tbl populate_items ...>
<option_set not_pre_generated items_tbl populate_items ...>
The option set is used to create a collection of options which have similar parameters. This is used in PD:TH Hud to create the options for Heist Specific colour grading, as it generates the set of options based on the values from the tweak_data.
<items> </items>
<items> </items>
This can be used to define the items for the option set. See: 'items_tbl' definition above.
<item_parameters ...> ... </item_parameters>
<item_parameters ...> ... </item_parameters>
Item parameters as defined in the docs for the 'option' node.
Example
See: Mod Template
Functions
There are more functions but as they are mostly used in the class itself they are not defined here.
Last updated