mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-04 00:23:27 +08:00
eecd20beaf
* feat(Lua): Make independent imgui independent. feat(Lua): Add a `pointer:set_address` binding. feat(Lua): Added `menu_event.Wndproc` event. fix(Lua): Fix `ImGui.SliderFloat3` binding. fix(Lua Docs): Partially fixed auto generated documentation. * fix(gui.cpp): include `lua_manager.hpp`. * fix(lua_manager.hpp): Added `draw_less_dependent_gui` function. * chore(Lua): Rename `add_independent_imgui` to `add_always_draw_imgui`. * docs(menu_event): Added docs for Wndporc event. * docs: Fixed a few more errors. * add reasoning and use native underlying format Co-authored-by: tupoy-ya <tupoy-ya@users.noreply.github.com> Co-authored-by: xiaoxiao921 <837334+xiaoxiao921@users.noreply.github.com>
119 lines
2.6 KiB
Markdown
119 lines
2.6 KiB
Markdown
# Table: menu_event
|
|
|
|
Table containing all possible events to which you can respond.
|
|
|
|
## Fields (9)
|
|
|
|
### `PlayerLeave`
|
|
|
|
Event that is triggered when a player leave the game session.
|
|
**Example Usage:**
|
|
```lua
|
|
event.register_handler(menu_event.PlayerLeave, function (player_name)
|
|
log.info(player_name)
|
|
end)
|
|
```
|
|
|
|
- Type: `integer`
|
|
|
|
### `PlayerJoin`
|
|
|
|
Event that is triggered when a player join the game session.
|
|
**Example Usage:**
|
|
```lua
|
|
event.register_handler(menu_event.PlayerJoin, function (player_name, player_id)
|
|
log.info(player_name)
|
|
log.info(player_id)
|
|
end)
|
|
```
|
|
|
|
- Type: `integer`
|
|
|
|
### `PlayerMgrInit`
|
|
|
|
Event that is triggered when the player manager initialize. Usually called when we are joining a session.
|
|
**Example Usage:**
|
|
```lua
|
|
event.register_handler(menu_event.PlayerMgrInit, function ()
|
|
log.info("Player manager inited, we just joined a session.")
|
|
end)
|
|
```
|
|
|
|
- Type: `integer`
|
|
|
|
### `PlayerMgrShutdown`
|
|
|
|
Event that is triggered when the player manager shutdown. Usually called when we are leaving a session.
|
|
**Example Usage:**
|
|
```lua
|
|
event.register_handler(menu_event.PlayerMgrShutdown, function ()
|
|
log.info("Player manager inited, we just left a session.")
|
|
end)
|
|
```
|
|
|
|
- Type: `integer`
|
|
|
|
### `ChatMessageReceived`
|
|
|
|
Event that is triggered when we receive a in-game chat message.
|
|
**Example Usage:**
|
|
```lua
|
|
event.register_handler(menu_event.ChatMessageReceived, function (player_id, chat_message)
|
|
log.info(player_id)
|
|
log.info(chat_message)
|
|
end)
|
|
```
|
|
|
|
- Type: `integer`
|
|
|
|
### `ScriptedGameEventReceived`
|
|
|
|
Event that is triggered when we receive a scripted game event.
|
|
**Example Usage:**
|
|
```lua
|
|
event.register_handler(menu_event.ScriptedGameEventReceived, function (player_id, script_event_args)
|
|
log.info(player_id)
|
|
log.info(script_event_args)
|
|
end)
|
|
```
|
|
|
|
- Type: `integer`
|
|
|
|
### `MenuUnloaded`
|
|
|
|
Event that is triggered when we unload YimMenu.
|
|
**Example Usage:**
|
|
```lua
|
|
event.register_handler(menu_event.MenuUnloaded, function ()
|
|
log.info("Menu unloaded.")
|
|
end)
|
|
```
|
|
|
|
- Type: `integer`
|
|
|
|
### `ScriptsReloaded`
|
|
|
|
Event that is triggered when we reload the Lua scripts.
|
|
**Example Usage:**
|
|
```lua
|
|
event.register_handler(menu_event.ScriptsReloaded, function ()
|
|
log.info("Scripts reloaded.")
|
|
end)
|
|
```
|
|
|
|
- Type: `integer`
|
|
|
|
### `Wndproc`
|
|
|
|
Event that is triggered when Wndproc is called
|
|
**Example Usage:**
|
|
```lua
|
|
event.register_handler(menu_event.Wndproc, function (hwnd, msg, wparam, lparam)
|
|
if msg == 132 then return end
|
|
log.debug("hwnd = " .. tostring(hwnd) .. ", msg = " .. tostring(msg) .. ", wparam = " .. tostring(wparam) .. ", lparam = " .. tostring(lparam))
|
|
end)
|
|
```
|
|
|
|
- Type: `integer`
|
|
|