feat(lua): add tunable overloads for getting / setting values through the already joaated tunable value. (#2417)

This commit is contained in:
Quentin
2023-11-14 20:21:03 +01:00
committed by GitHub
parent 9d7e5893c6
commit e56a6fd38f
3 changed files with 132 additions and 7 deletions

View File

@ -2,7 +2,7 @@
Table for manipulating gta tunables.
## Functions (6)
## Functions (12)
### `get_int(tunable_name)`
@ -43,6 +43,45 @@ float = tunables.get_float(tunable_name)
boolean = tunables.get_bool(tunable_name)
```
### `get_int(tunable_joaated_value)`
- **Parameters:**
- `tunable_joaated_value` (integer): The joaated value of the tunable.
- **Returns:**
- `integer`: The value of the given tunable.
**Example Usage:**
```lua
integer = tunables.get_int(tunable_joaated_value)
```
### `get_float(tunable_joaated_value)`
- **Parameters:**
- `tunable_joaated_value` (integer): The joaated value of the tunable.
- **Returns:**
- `float`: The value of the given tunable.
**Example Usage:**
```lua
float = tunables.get_float(tunable_joaated_value)
```
### `get_bool(tunable_joaated_value)`
- **Parameters:**
- `tunable_joaated_value` (integer): The joaated value of the tunable.
- **Returns:**
- `boolean`: The value of the given tunable.
**Example Usage:**
```lua
boolean = tunables.get_bool(tunable_joaated_value)
```
### `set_int(tunable_name, val)`
- **Parameters:**
@ -76,4 +115,37 @@ tunables.set_float(tunable_name, val)
tunables.set_bool(tunable_name, val)
```
### `set_int(tunable_joaated_value, val)`
- **Parameters:**
- `tunable_joaated_value` (integer): The joaated value of the tunable.
- `val` (integer): The new value of the given tunable.
**Example Usage:**
```lua
tunables.set_int(tunable_joaated_value, val)
```
### `set_float(tunable_joaated_value, val)`
- **Parameters:**
- `tunable_joaated_value` (integer): The joaated value of the tunable.
- `val` (float): The new value of the given tunable.
**Example Usage:**
```lua
tunables.set_float(tunable_joaated_value, val)
```
### `set_bool(tunable_joaated_value, val)`
- **Parameters:**
- `tunable_joaated_value` (integer): The joaated value of the tunable.
- `val` (boolean): The new value of the given tunable.
**Example Usage:**
```lua
tunables.set_bool(tunable_joaated_value, val)
```