mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-23 01:02:23 +08:00
feat(lua): much more complete imgui bindings, allow lua imgui callbacks from outside yimmenu classic tabs through gui.add_imgui(func)
but also inside yimmenu classic tabs through tab:add_imgui(func)
(#1736)
This commit is contained in:
6
docs/lua/classes/raw_imgui_callback.md
Normal file
6
docs/lua/classes/raw_imgui_callback.md
Normal file
@ -0,0 +1,6 @@
|
||||
# Class: raw_imgui_callback
|
||||
|
||||
## Inherit from 1 class: gui_element
|
||||
|
||||
Class for representing a raw imgui callback.
|
||||
|
@ -8,7 +8,7 @@ Class for gta script utils, the instance is usually given to you.
|
||||
|
||||
Yield execution.
|
||||
|
||||
**Exemple Usage:**
|
||||
**Example Usage:**
|
||||
```lua
|
||||
script_util:yield()
|
||||
```
|
||||
@ -20,7 +20,7 @@ Sleep for the given amount of time, time is in milliseconds.
|
||||
- **Parameters:**
|
||||
- `ms` (integer): The amount of time in milliseconds that we will sleep for.
|
||||
|
||||
**Exemple Usage:**
|
||||
**Example Usage:**
|
||||
```lua
|
||||
script_util:sleep(ms)
|
||||
```
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Class for representing a tab within the GUI.
|
||||
|
||||
## Functions (10)
|
||||
## Functions (11)
|
||||
|
||||
### `clear()`
|
||||
|
||||
@ -134,4 +134,30 @@ Add a ImGui::InputText.
|
||||
input_string = tab:add_input_string(name)
|
||||
```
|
||||
|
||||
### `add_imgui(imgui_rendering)`
|
||||
|
||||
Registers a function that will be called every rendering frame, you can call ImGui functions in it, please check the ImGui.md documentation file for more info.
|
||||
**Example Usage:**
|
||||
```lua
|
||||
tab:add_imgui(function()
|
||||
if ImGui.Begin("My Custom Window") then
|
||||
if ImGui.Button("Label") then
|
||||
script.run_in_fiber(function(script)
|
||||
-- call natives in there
|
||||
end)
|
||||
end
|
||||
|
||||
ImGui.End()
|
||||
end
|
||||
end)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `imgui_rendering` (function): Function that will be called every rendering frame, you can call ImGui functions in it, please check the ImGui.md documentation file for more info.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
tab:add_imgui(imgui_rendering)
|
||||
```
|
||||
|
||||
|
||||
|
@ -766,7 +766,7 @@ Arg Count: 0
|
||||
Arg Count: 0
|
||||
|
||||
### alwaysfullammo
|
||||
Refills your ammo every tick
|
||||
Refills your ammo every tick
|
||||
Arg Count: 0
|
||||
|
||||
### incrdamage
|
||||
|
1464
docs/lua/tables/ImGui.md
Normal file
1464
docs/lua/tables/ImGui.md
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
|
||||
Table containing functions for modifying the menu GUI.
|
||||
|
||||
## Functions (6)
|
||||
## Functions (7)
|
||||
|
||||
### `get_tab(tab_name)`
|
||||
|
||||
@ -79,4 +79,30 @@ gui.show_error(title, message)
|
||||
bool = gui.is_open()
|
||||
```
|
||||
|
||||
### `add_imgui(imgui_rendering)`
|
||||
|
||||
Registers a function that will be called every rendering frame, you can call ImGui functions in it, please check the ImGui.md documentation file for more info.
|
||||
**Example Usage:**
|
||||
```lua
|
||||
gui.add_imgui(function()
|
||||
if ImGui.Begin("My Custom Window") then
|
||||
if ImGui.Button("Label") then
|
||||
script.run_in_fiber(function(script)
|
||||
-- call natives in there
|
||||
end)
|
||||
end
|
||||
|
||||
ImGui.End()
|
||||
end
|
||||
end)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `imgui_rendering` (function): Function that will be called every rendering frame, you can call ImGui functions in it, please check the ImGui.md documentation file for more info.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
gui.add_imgui(imgui_rendering)
|
||||
```
|
||||
|
||||
|
||||
|
@ -75,3 +75,4 @@ end)
|
||||
script.run_in_fiber(func)
|
||||
```
|
||||
|
||||
|
||||
|
@ -13,11 +13,12 @@ end)
|
||||
|
||||
For a complete list of available gui functions, please refer to the tab class documentation and the gui table documentation.
|
||||
|
||||
## Tab Count: 42
|
||||
## Tab Count: 43
|
||||
|
||||
### `GUI_TAB_SELF`
|
||||
### `GUI_TAB_WEAPONS`
|
||||
### `GUI_TAB_TELEPORT`
|
||||
### `GUI_TAB_CUSTOM_TELEPORT`
|
||||
### `GUI_TAB_MOBILE`
|
||||
### `GUI_TAB_OUTFIT_EDITOR`
|
||||
### `GUI_TAB_OUTFIT_SLOTS`
|
||||
|
Reference in New Issue
Block a user