
* 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
135 lines
2.1 KiB
Markdown
135 lines
2.1 KiB
Markdown
# Table: globals
|
|
|
|
Table containing functions for manipulating gta script globals.
|
|
|
|
## Functions (9)
|
|
|
|
### `get_int(global)`
|
|
|
|
Retrieves an int global value.
|
|
|
|
- **Parameters:**
|
|
- `global` (integer): index of the global
|
|
|
|
- **Returns:**
|
|
- `integer`: value of the global
|
|
|
|
**Example Usage:**
|
|
```lua
|
|
integer = globals.get_int(global)
|
|
```
|
|
|
|
### `get_uint(global)`
|
|
|
|
Retrieves an uint global value.
|
|
|
|
- **Parameters:**
|
|
- `global` (integer): index of the global
|
|
|
|
- **Returns:**
|
|
- `integer`: value of the global
|
|
|
|
**Example Usage:**
|
|
```lua
|
|
integer = globals.get_uint(global)
|
|
```
|
|
|
|
### `get_float(global)`
|
|
|
|
Retrieves a float global value.
|
|
|
|
- **Parameters:**
|
|
- `global` (integer): index of the global
|
|
|
|
- **Returns:**
|
|
- `float`: value of the global
|
|
|
|
**Example Usage:**
|
|
```lua
|
|
float = globals.get_float(global)
|
|
```
|
|
|
|
### `get_string(global)`
|
|
|
|
Retrieves a string global value.
|
|
|
|
- **Parameters:**
|
|
- `global` (integer): index of the global
|
|
|
|
- **Returns:**
|
|
- `string`: value of the global
|
|
|
|
**Example Usage:**
|
|
```lua
|
|
string = globals.get_string(global)
|
|
```
|
|
|
|
### `set_int(global, val)`
|
|
|
|
Sets an int global value.
|
|
|
|
- **Parameters:**
|
|
- `global` (integer): index of the global
|
|
- `val` (integer): new value for the global
|
|
|
|
**Example Usage:**
|
|
```lua
|
|
globals.set_int(global, val)
|
|
```
|
|
|
|
### `set_uint(global, val)`
|
|
|
|
Sets an uint global value.
|
|
|
|
- **Parameters:**
|
|
- `global` (integer): index of the global
|
|
- `val` (integer): new value for the global
|
|
|
|
**Example Usage:**
|
|
```lua
|
|
globals.set_uint(global, val)
|
|
```
|
|
|
|
### `set_float(global, val)`
|
|
|
|
Sets a float global value.
|
|
|
|
- **Parameters:**
|
|
- `global` (integer): index of the global
|
|
- `val` (float): new value for the global
|
|
|
|
**Example Usage:**
|
|
```lua
|
|
globals.set_float(global, val)
|
|
```
|
|
|
|
### `set_string(global, str)`
|
|
|
|
Sets a string global value.
|
|
|
|
- **Parameters:**
|
|
- `global` (integer): index of the global
|
|
- `str` (string): new value for the global
|
|
|
|
**Example Usage:**
|
|
```lua
|
|
globals.set_string(global, str)
|
|
```
|
|
|
|
### `get_pointer(global)`
|
|
|
|
Retrieves a pointer global.
|
|
|
|
- **Parameters:**
|
|
- `global` (integer): index of the global
|
|
|
|
- **Returns:**
|
|
- `pointer`: value of the global
|
|
|
|
**Example Usage:**
|
|
```lua
|
|
pointer = globals.get_pointer(global)
|
|
```
|
|
|
|
|