-
Notifications
You must be signed in to change notification settings - Fork 0
dpconfig widgets
Widgets define the graphical user interface for the config.
Each widget is an object and requires the type key describing the widget type.
A title or heading. Titles and headings have different sizes! Title is the larger one, a heading is smaller.
-
textstring: The heading text. Required.
Shows text. The text may be formatted in HTML, but not all HTML tags are allowed.
-
text[required - string]
Renders a cool picture.
-
file[required - string] - path to the image file (in the archive!)- for example
assets/my_pack_logo.pngorpack.png
- for example
-
width- scale the image to this width (integer or string) -
height- scale the image to this height (integer or string)
These widgets have inputs.
They all share the following options:
-
text[required] - the description (string) -
methodormethods- the method to insert input into (string or array of strings) -
slots- the slots to write input to (either single slot's name as string or list/array of slot names, without prefix)
The quintessential config option. Allows the user to modify a number. In the interface this is done using a spinbox.
-
value[required] - describes the value to accept as input {object}-
type[required] - either"int","percent"or"float"."percent"converts into a float on export, but is otherwise treated as an integer -
range[required] - a list describing the range of acceptable values, the minimum and maximum, in that order, both inclusive -
default[required] - the default value, default is the range minimum (integer/float) -
step- the step interval, the default depends on value type (integer/float) -
suffix- the suffix to add at the end of the number, purely visual; percentages use %, but this can be overwritten (string) -
decimals- float only, the number of decimals to show (integer)
-
A slider that allows the user to select a number from a range. Outputs either an integer or a float, depending on value type.
-
value[required] - describes the value to accept as input {object}-
type[required] - either"int"or"percent"."percent"converts into a float on export, but is otherwise treated as an integer -
range[required] - a list describing the range of acceptable values, the minimum and maximum, in that order, both inclusive -
default[required] - the default value, default is the range minimum (integer) -
step- the step interval, default is 1 (integer)
-
A button that the user can enable or disable. Only outputs true or false, but only if the user changed the state. If the state was unchanged, or changed back to default, there is no output from this widget.
-
value[required] - describes the value to accept as input {object}-
default[required] - the default state, either1or0
-