Skip to content

Commit 5d5999f

Browse files
authored
docs: Small fixes in lua-api
1 parent a179db3 commit 5d5999f

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

docs/docs/lua-api.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ The pipeline looks like this:
3838
**"State value"** -> **value_proc** -> **value_str_proc**
3939

4040
The script file runs in a **sandboxed environment**, that includes a few standard libs:
41-
**
4241
```
4342
math
4443
string
4544
table
4645
```
47-
**
4846

4947
With some functions from the `base` library:
50-
**
5148
```
5249
assert
5350
error
@@ -60,8 +57,7 @@ tostring
6057
type
6158
pcall
6259
xpcall
63-
```
64-
**
60+
```
6561

6662
Each script can contain the following callback functions:
6763

@@ -184,6 +180,23 @@ __OPTIONS = {
184180
| combo | integer, index of the `options`, begins from 0 |
185181
| hotkey | none |
186182

183+
### Functions
184+
#### getOptionValue(key_str [, default_value])
185+
Returns the option value.
186+
__Usage:__
187+
`local opt1 = getOptionValue("option_key")`
188+
189+
or with default value:
190+
191+
`local opt1 = getOptionValue("option_key", "Default String")`
192+
193+
#### setOptionValue(key_str, value)
194+
Allows to set a value for the option.
195+
__Usage:__
196+
`setOptionValue("option_key", "New String")`
197+
198+
**Note:** Only initial type of the value is allowed to set.
199+
187200
### Groups
188201
You can make a group of the options, simply add a name key to the table right before the options.
189202

@@ -214,19 +227,3 @@ __OPTIONS = {
214227
}
215228
```
216229
Maximum level of group depth is 2.
217-
218-
#### getOptionValue(key_str [, default_value])
219-
Returns the option value.
220-
__Usage:__
221-
`local opt1 = getOptionValue("option_key")`
222-
223-
or with default value:
224-
225-
`local opt1 = getOptionValue("option_key", "Default String")`
226-
227-
#### setOptionValue(key_str, value)
228-
Allows to set a value for the option.
229-
__Usage:__
230-
`setOptionValue("option_key", "New String")`
231-
232-
**Note:** Only initial type of the value is allowed to set.

0 commit comments

Comments
 (0)