This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/docs/lua/tables/tunables.md
Quentin 89f57a9a4c
Lua: can make new tabs from lua scripts, doc generation for available tabs to use (#1593)
* lua api: add globals.get_uint and globals.set_uint

* lua doc: remove duplicate function check as we can overload so it doesn't make sense

* lua doc gen: add support for parsing the tabs enum

* gui: custom lua tabs don't have a `func` rendering function but can still have elements to draw

* lua doc: update generated doc

* chore: code style

* chore: minor spelling mistake

* chore: code style

* gui_service: add runtime removal of tabs

* refactor: make it so that it's less likely defining tabs and their translation key in a wrong way.

* lua api: ability to add custom tabs to the gui from lua
2023-07-05 00:30:57 +02:00

80 lines
1.5 KiB
Markdown

# Table: tunables
Table for manipulating gta tunables.
## Functions (6)
### `get_int(tunable_name)`
- **Parameters:**
- `tunable_name` (string): The name of the tunable.
- **Returns:**
- `integer`: The value of the given tunable.
**Example Usage:**
```lua
integer = tunables.get_int(tunable_name)
```
### `get_float(tunable_name)`
- **Parameters:**
- `tunable_name` (string): The name of the tunable.
- **Returns:**
- `float`: The value of the given tunable.
**Example Usage:**
```lua
float = tunables.get_float(tunable_name)
```
### `get_bool(tunable_name)`
- **Parameters:**
- `tunable_name` (string): The name of the tunable.
- **Returns:**
- `boolean`: The value of the given tunable.
**Example Usage:**
```lua
boolean = tunables.get_bool(tunable_name)
```
### `set_int(tunable_name, val)`
- **Parameters:**
- `tunable_name` (string): The name of the tunable.
- `val` (integer): The new value of the given tunable.
**Example Usage:**
```lua
tunables.set_int(tunable_name, val)
```
### `set_float(tunable_name, val)`
- **Parameters:**
- `tunable_name` (string): The name of the tunable.
- `val` (float): The new value of the given tunable.
**Example Usage:**
```lua
tunables.set_float(tunable_name, val)
```
### `set_bool(tunable_name, val)`
- **Parameters:**
- `tunable_name` (string): The name of the tunable.
- `val` (boolean): The new value of the given tunable.
**Example Usage:**
```lua
tunables.set_bool(tunable_name, val)
```