xScal Scaleform API 0.4.34

Plugin options

Options that loaded xScal plugins publish, for in-game settings menus.

xsGetPluginOptions

Options of every active plugin

__SFCodeObj.call("xsGetPluginOptions", [version:uint]):String

Arguments

NameTypeDescription
versionuintOptional. Result format version. 2 or higher lists choice and number options.

Returns String (JSON)

FieldTypeDescription
pluginsArray
plugins[].idString
plugins[].nameString
plugins[].optionsArray
plugins[].options[].idString
plugins[].options[].groupString
plugins[].options[].labelString
plugins[].options[].type"toggle" | "choice" | "number"Present only when the call passed version 2 or higher.
plugins[].options[].valueBoolean or Number
plugins[].options[].choicesArray of StringChoice options only.
plugins[].options[].minNumberNumber options only.
plugins[].options[].maxNumberNumber options only.
plugins[].options[].stepNumberNumber options only.
plugins[].options[].decimalsintNumber options only.

Without an argument, or with version 1, only toggle options are listed and options carry no type. With version 2 or higher, choice and number options are listed too and every option has type. Plugins without an options provider list an empty options array. Plugins that do not fit in the 40 KiB result are left out.

xsSetPluginOption

Change one plugin option

__SFCodeObj.call("xsSetPluginOption", pluginId:String, optionId:String, value:*):Boolean

Arguments

NameTypeDescription
pluginIdStringPlugin id from xsGetPluginOptions.
optionIdStringOption id.
value*Boolean for a toggle, Number for a choice index or number option. Must be finite.

Returns Boolean

Returns true when the plugin applied the value. value is a Boolean for toggles, or a number: the choice index or the number value. Plugins with a version 1 options provider take toggles only; a nonzero number turns the toggle on. Wrong argument count or types return no value.