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:
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)
|
||||
```
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user