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:
Quentin
2023-07-17 14:55:42 +02:00
committed by GitHub
parent 5a76164d43
commit 14f4241bd8
18 changed files with 5294 additions and 11 deletions

1464
docs/lua/tables/ImGui.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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)
```

View File

@ -75,3 +75,4 @@ end)
script.run_in_fiber(func)
```